From 87c80f07a005af4f733fa4f97e60e42535469996 Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Tue, 15 Mar 2022 17:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8D=B7,=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E5=8D=95=E6=A0=A1=E9=AA=8C=E6=9C=BA=E5=8F=B0?= =?UTF-8?q?,=E5=BC=82=E5=B8=B8=E7=BB=93=E6=9D=9F=E5=8D=B7=20sxm=202022-3-1?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ScheduleController.java | 26 +++++ .../schedule/mapper/ScheduleMapper.java | 20 ++++ .../schedule/service/ScheduleService.java | 18 ++++ .../service/impl/ScheduleServiceImpl.java | 94 ++++++++++++------- .../mapper/schedule/ScheduleMapper.xml | 38 ++++++++ 5 files changed, 161 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java b/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java index e019928..202a6bb 100644 --- a/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java +++ b/src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java @@ -1363,4 +1363,30 @@ public class ScheduleController { .put("total", resultList.size()); } + /** + * @Author sxm + * @Description 删除卷 + * @Date 2022/3/15 16:20 + * @Param + * @return + **/ + @RequestMapping(value = "switchrollReverse") + public R switchrollReverse(@RequestBody SearchScheduleData inData){ + scheduleService.switchrollReverse(inData); + return R.ok("验证通过"); + } + + /** + * @Author sxm + * @Description 报工校验 + * @Date 2022/3/15 16:20 + * @Param + * @return + **/ + @RequestMapping(value = "reportCheck") + public R reportCheck(@RequestBody SearchScheduleData inData){ + scheduleService.reportCheck(inData); + return R.ok("验证通过"); + } + } diff --git a/src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java b/src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java index d0a6b73..b5199d4 100644 --- a/src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java +++ b/src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java @@ -3,6 +3,7 @@ package com.gaotao.modules.schedule.mapper; import com.gaotao.modules.schedule.data.*; import com.gaotao.modules.shopOrder.entity.OperatorData; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -440,4 +441,23 @@ public interface ScheduleMapper { * @return **/ List getReworkSfdcRollByCon(SearchScheduleData inData); + + /** + * @Author sxm + * @Description 检查是否正在报工 + * @Date 2022/3/15 17:10 + * @Param + * @return + **/ + int reportCheck(SearchScheduleData inData); + + /** + * @Author sxm + * @Description 判断权限 + * @Date 2022/3/15 17:28 + * @Param + * @return + **/ + String getUserSpecialSecurity(@Param("username") String username,@Param("sNo") String sNo); + } diff --git a/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java b/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java index fa76db9..7dfb970 100644 --- a/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java +++ b/src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java @@ -781,4 +781,22 @@ public interface ScheduleService { **/ List getReworkSfdcRollByCon(SearchScheduleData inData); + /** + * @Author sxm + * @Description 删除卷操作 + * @Date 2022/3/15 16:23 + * @Param + * @return + **/ + void switchrollReverse(SearchScheduleData inData); + + /** + * @Author sxm + * @Description 检查是否又正在报工 + * @Date 2022/3/15 17:09 + * @Param + * @return + **/ + void reportCheck(SearchScheduleData inData); + } \ No newline at end of file diff --git a/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java b/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java index 3e8fd42..7d9eba0 100644 --- a/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java +++ b/src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java @@ -137,7 +137,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcTimeByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcTimeByCon(inData); @@ -152,7 +152,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcToolByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcToolByCon(inData); @@ -166,7 +166,7 @@ public class ScheduleServiceImpl implements ScheduleService { inData.setReferenceCustomerId(referenceCustomerId); //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getOrderBomByCon(inData); @@ -176,7 +176,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcMaterialByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcMaterialByCon(inData); @@ -186,7 +186,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcRollOpsByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcRollOpsByCon(inData); @@ -196,7 +196,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcDefectByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcDefectByCon(inData); @@ -206,7 +206,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcRollByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcRollByCon(inData); @@ -216,7 +216,7 @@ public class ScheduleServiceImpl implements ScheduleService { public List getSfdcDataByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getSfdcDataByCon(inData); @@ -1968,27 +1968,27 @@ public class ScheduleServiceImpl implements ScheduleService { String msg = String.valueOf(resultMap.get("resultMsg")); throw new RRException(msg); } - if("Y".equals(pageData.getCreateNewRollFlag())){ + if ("Y".equals(pageData.getCreateNewRollFlag())) { //调用存储过程校验每一个卷的数量 - this.finishRollProcessSFDCNewRoll(site, orderNo, itemNo, rollNo, seqNo,pageData.getNewCreateRollQty(),pageData.getOperatorId() ); + this.finishRollProcessSFDCNewRoll(site, orderNo, itemNo, rollNo, seqNo, pageData.getNewCreateRollQty(), pageData.getOperatorId()); } return resultMap; } return null; } - public void finishRollProcessSFDCNewRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo,Double newRollQty,String operatorId){ + public void finishRollProcessSFDCNewRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, Double newRollQty, String operatorId) { - List params = new ArrayList<>(); - params.add(site); - params.add(orderNo); - params.add(itemNo); - params.add(seqNo); - params.add(rollNo); - params.add(newRollQty); - params.add(operatorId); - //执行存储过程 - procedureMapper.getProcedureData("finishRollProcessSFDCNewRoll", params); + List params = new ArrayList<>(); + params.add(site); + params.add(orderNo); + params.add(itemNo); + params.add(seqNo); + params.add(rollNo); + params.add(newRollQty); + params.add(operatorId); + //执行存储过程 + procedureMapper.getProcedureData("finishRollProcessSFDCNewRoll", params); } @@ -2048,7 +2048,7 @@ public class ScheduleServiceImpl implements ScheduleService { * @DateTime 2022/1/25 13:55 * @Param [site, orderNo, itemNo, seqNo, rollNo] // todo 添加是否创建新卷参数 sxm 2022 -3-15 **/ - public Map checkFinishRollWithSfdcRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo,String createNewRollFlag) { + public Map checkFinishRollWithSfdcRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String createNewRollFlag) { List params = new ArrayList<>(); params.add(site); params.add(orderNo); @@ -2136,12 +2136,12 @@ public class ScheduleServiceImpl implements ScheduleService { //4.调用存储过程 处理SfdcMaterialHist的信息 --非主材 this.finishRollProcessSfdcMaterialHistWithNotKeyRm(site, orderNo, itemNo, seqNo, rollNo, operatorId, reportedTime); //5.调用存储过程 处理SfdcRoll和SfdcRoollOps todo sxm 2022 -3 -15 添加参数 是否创建新卷 - this.finishRollProcessSfdcRollAndOps(site, orderNo, itemNo, seqNo, rollNo, totalApprovedQty, sfdcApprovedQty, defectedQty, operatorName, reportedTime,pageData.getCreateNewRollFlag()); + this.finishRollProcessSfdcRollAndOps(site, orderNo, itemNo, seqNo, rollNo, totalApprovedQty, sfdcApprovedQty, defectedQty, operatorName, reportedTime, pageData.getCreateNewRollFlag()); //6.调用存储过程 处理Sfdc和派工单 this.finishRollProcessSfdcAndSchedule(site, orderNo, itemNo, seqNo, rollNo, sfdcReportedQty, sfdcApprovedQty, sfdcSetupTime, sfdcProdTime, sfdcDownTime, eventTime, tillTime, remark, sfdcSetupDownTime, sfdcProdSetupTime, defectedQty, sfdcManufactureTime, operatorId, reportedTime); - //7.调用存储过程 处理异常信息 + //7.正常结束卷还是 异常下机 if ("Y".equalsIgnoreCase(exceptionFlag)) { this.finishRollProcessException(site, orderNo, itemNo, seqNo, rollNo, exceptionReason, username); } @@ -2210,7 +2210,7 @@ public class ScheduleServiceImpl implements ScheduleService { * @Param [site, orderNo, itemNo, seqNo, rollNo, totalApprovedQty, sfdcApproveQty, defectedQty] **/ public void finishRollProcessSfdcRollAndOps(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, - Float totalApprovedQty, Float sfdcApproveQty, Float defectedQty, String username, String reportedTime,String createNewRollFlag) { + Float totalApprovedQty, Float sfdcApproveQty, Float defectedQty, String username, String reportedTime, String createNewRollFlag) { List params = new ArrayList<>(); params.add(site); params.add(orderNo); @@ -3295,7 +3295,7 @@ public class ScheduleServiceImpl implements ScheduleService { } //2.调用存储过程 校验是否可以下机卷 - Map checkMap2 = this.checkFinishRollWithSfdcRoll(site, orderNo, itemNo, seqNo, rollNo,pageData.getCreateNewRollFlag()); + Map checkMap2 = this.checkFinishRollWithSfdcRoll(site, orderNo, itemNo, seqNo, rollNo, pageData.getCreateNewRollFlag()); //判断是否检验成功 String code2 = String.valueOf(checkMap2.get("resultCode")); if ("400".equalsIgnoreCase(code2)) { @@ -3628,8 +3628,8 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(inData.getsFQCSlitFlag()); // 调用存储过程 Map checkMap = workbenchCreateslittingrollFqcCheck("workbench_createslittingroll_fqc_check", params); - if(checkMap == null){ - throw new RRException("存储过程未返回信息",400); + if (checkMap == null) { + throw new RRException("存储过程未返回信息", 400); } //判断结果是否成功 @@ -3677,7 +3677,7 @@ public class ScheduleServiceImpl implements ScheduleService { private Map workbenchCreateslittingrollFqcCheck(String procedureName, List params) { //调用存储过程 List> resultList = procedureMapper.getProcedureData(procedureName, params); - if(CollectionUtils.isEmpty(resultList)){ + if (CollectionUtils.isEmpty(resultList)) { return null; } //处理返回的结果 @@ -3799,7 +3799,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(dto.getSite()); params.add(dto.getResourceId()); params.add(dto.getCurrentDateTime()); - return workbenchCreateslittingrollFqcCheck("get_ScheduleDate_Shift",params); + return workbenchCreateslittingrollFqcCheck("get_ScheduleDate_Shift", params); } @Override @@ -3820,11 +3820,11 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(rollData.getCurrentDatetime()); params.add(" "); Map map = workbenchCreateslittingrollFqcCheck("workbench_postinspection", params); - if(map == null){ - throw new RRException("存储过程未返回信息",400); + if (map == null) { + throw new RRException("存储过程未返回信息", 400); } - if ("400".equals(map.get("resultCode"))){ - throw new RRException(map.get("resultMsg").toString(),400); + if ("400".equals(map.get("resultCode"))) { + throw new RRException(map.get("resultMsg").toString(), 400); } } } @@ -3833,9 +3833,33 @@ public class ScheduleServiceImpl implements ScheduleService { public List getReworkSfdcRollByCon(SearchScheduleData inData) { //判断是否查询当前卷的 boolean currentRollFlag = inData.isCurrentRollFlag(); - if(!currentRollFlag){ + if (!currentRollFlag) { inData.setRollNo(null); } return scheduleMapper.getReworkSfdcRollByCon(inData); } + + @Override + public void switchrollReverse(SearchScheduleData inData) { + List params = new ArrayList<>(); + params.add(inData.getSite()); + params.add(inData.getOrderNo()); + params.add(inData.getItemNo()); + params.add(inData.getSeqNo()); + params.add(inData.getRollNo()); + workbenchCreateslittingrollFqcCheck("switchroll_reverse", params); + } + + @Override + public void reportCheck(SearchScheduleData inData) { + int i = scheduleMapper.reportCheck(inData); + if (i > 0) { + String flag = scheduleMapper.getUserSpecialSecurity(inData.getUsername(), "236"); + if ("Y".equals(flag)) { + throw new RRException("该机台尚有未结束的其他派工单,确实要继续对该派工单进行报工吗?", 400); + } else { + throw new RRException(" 该机台尚有未结束的其他派工单,不能对其他的派工单进行报工!", 300); + } + } + } } \ No newline at end of file diff --git a/src/main/resources/mapper/schedule/ScheduleMapper.xml b/src/main/resources/mapper/schedule/ScheduleMapper.xml index cc76716..290953f 100644 --- a/src/main/resources/mapper/schedule/ScheduleMapper.xml +++ b/src/main/resources/mapper/schedule/ScheduleMapper.xml @@ -1053,6 +1053,44 @@ and T.Remark='直接送检' ORDER BY sfr.RollNo + +