From e146948aa2645f5dfdbefcf31f3f5de1319ef64d Mon Sep 17 00:00:00 2001 From: Rui_Li <877258667@qq.com> Date: Thu, 27 Jan 2022 17:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E6=9D=9F=E5=8D=B7=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20BUG=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ScheduleServiceImpl.java | 437 +++++++++--------- 1 file changed, 229 insertions(+), 208 deletions(-) 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 c2d3818..0f88319 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 @@ -37,10 +37,10 @@ public class ScheduleServiceImpl implements ScheduleService { //获取当前加工中心机台的数据 List resourceList = scheduleMapper.getResourceLIst(inData); //判断是否存在当前的加工中心机台数据 - if(resourceList.size() == 0){ + if (resourceList.size() == 0) { //throw new RuntimeException(""); return new ArrayList(); - }else { + } else { //设置查询的条件 inData.setCalendarId(resourceList.get(0).getCalendarId()); } @@ -61,13 +61,13 @@ public class ScheduleServiceImpl implements ScheduleService { public List getProduceScheduleData(SearchScheduleData inData) { //判断是否查询 boolean searchFlag = inData.isSearchFlag(); - if(!searchFlag){ + if (!searchFlag) { return new ArrayList(); } //把查询时间结束参数添加一天 Date planStartTime2 = inData.getPlanStartTime2(); //判断是否是null - if(planStartTime2 != null){ + if (planStartTime2 != null) { planStartTime2 = DateUtils.addDateDays(planStartTime2, 1); //重置参数 inData.setPlanStartTime2(planStartTime2); @@ -94,8 +94,8 @@ public class ScheduleServiceImpl implements ScheduleService { public SfdcRollOpsData getCurrentRollOpsBySeqNo(BaseRollData inData) { SfdcRollOpsData result = scheduleMapper.getCurrentRollOpsBySeqNo(inData); //判断是否查询到结果 - if(null == result){ - return new SfdcRollOpsData(); + if (null == result) { + throw new RRException("不存在上机卷!"); } return result; } @@ -153,7 +153,7 @@ public class ScheduleServiceImpl implements ScheduleService { public Float getSfdcRollReportedQty(SearchScheduleData inData) { Float reportedQty = scheduleMapper.getSfdcRollReportedQty(inData); //判断null - if(reportedQty == null){ + if (reportedQty == null) { reportedQty = 0f; } return reportedQty; @@ -163,7 +163,7 @@ public class ScheduleServiceImpl implements ScheduleService { public Integer countSfdcRollByRollNo(SearchScheduleData inData) { Integer countNums = scheduleMapper.countSfdcRollByRollNo(inData); //判断null - if(countNums == null){ + if (countNums == null) { countNums = 0; } return countNums; @@ -173,7 +173,7 @@ public class ScheduleServiceImpl implements ScheduleService { public Float getSfdcDefectDefectedQty(SearchScheduleData inData) { Float defectedQty = scheduleMapper.getSfdcDefectDefectedQty(inData); //判断null - if(defectedQty == null){ + if (defectedQty == null) { defectedQty = 0f; } return defectedQty; @@ -186,20 +186,20 @@ public class ScheduleServiceImpl implements ScheduleService { //查询数据 List> resultList = scheduleMapper.countSfdcTimeQty(inData); //判断是否查询到结果数据 - if(resultList.size() > 0){ + if (resultList.size() > 0) { result = resultList.get(0); //处理时间的数据 //处理调机 String strTotalSetupTime = String.valueOf(result.get("totalSetupTime")); //判断null - if(strTotalSetupTime == null || "null".equalsIgnoreCase(strTotalSetupTime)){ + if (strTotalSetupTime == null || "null".equalsIgnoreCase(strTotalSetupTime)) { strTotalSetupTime = "0"; } Float totalSetupTime = Float.parseFloat(strTotalSetupTime); String strTotalDowntimeTimeSetup = String.valueOf(result.get("totalDowntimeTimeSetup")); //判断null - if(strTotalDowntimeTimeSetup == null || "null".equalsIgnoreCase(strTotalDowntimeTimeSetup)){ + if (strTotalDowntimeTimeSetup == null || "null".equalsIgnoreCase(strTotalDowntimeTimeSetup)) { strTotalDowntimeTimeSetup = "0"; } Float totalDowntimeTimeSetup = Float.parseFloat(strTotalDowntimeTimeSetup); @@ -210,14 +210,14 @@ public class ScheduleServiceImpl implements ScheduleService { //处理生产的时间 String strTotalProdTime = String.valueOf(result.get("totalProdTime")); //判断null - if(strTotalProdTime == null || "null".equalsIgnoreCase(strTotalProdTime)){ + if (strTotalProdTime == null || "null".equalsIgnoreCase(strTotalProdTime)) { strTotalProdTime = "0"; } Float totalProdTime = Float.parseFloat(strTotalProdTime); String strTotalDowntimeTimeProd = String.valueOf(result.get("totalDowntimeTimeProd")); //判断null - if(strTotalDowntimeTimeProd == null || "null".equalsIgnoreCase(strTotalDowntimeTimeProd)){ + if (strTotalDowntimeTimeProd == null || "null".equalsIgnoreCase(strTotalDowntimeTimeProd)) { strTotalDowntimeTimeProd = "0"; } Float totalDowntimeTimeProd = Float.parseFloat(strTotalDowntimeTimeProd); @@ -225,7 +225,7 @@ public class ScheduleServiceImpl implements ScheduleService { Float totalPureProdTime = totalProdTime - totalDowntimeTimeProd; //净的制造时间 - Float totalManufactureTime = totalSetupTime + totalProdTime; + Float totalManufactureTime = totalSetupTime + totalProdTime; Float totalManufactureDowntimeTime = totalDowntimeTimeSetup + totalDowntimeTimeProd; Float totalPureManufactureTime = totalPureSetupTime + totalPureProdTime; //设置返回的参数 @@ -239,7 +239,7 @@ public class ScheduleServiceImpl implements ScheduleService { result.put("totalManufactureDowntimeTime", totalManufactureDowntimeTime); result.put("totalPureManufactureTime", totalPureManufactureTime); result.put("code", "200"); - }else{ + } else { result.put("code", "500"); } return result; @@ -252,17 +252,17 @@ public class ScheduleServiceImpl implements ScheduleService { //查询数据 List> resultList = scheduleMapper.getSfdcTimeMaxAndMinTime(inData); //判断是否查询到结果数据 - if(resultList.size() > 0){ + if (resultList.size() > 0) { result = resultList.get(0); //判断时间 String sl = String.valueOf(result.get("sl")); //判断null - if(sl == null || "null".equalsIgnoreCase(sl)){ + if (sl == null || "null".equalsIgnoreCase(sl)) { sl = "0"; } Integer countNums = Integer.parseInt(sl); //设置时间 - if(countNums == 0){ + if (countNums == 0) { //格式化当前的时间 String evenTime = DateUtil.getStringDate(new Date(), "yyyy-MM-dd HH:mm:ss"); String tillTime = DateUtil.getStringDate(new Date(), "yyyy-MM-dd HH:mm:ss"); @@ -270,7 +270,7 @@ public class ScheduleServiceImpl implements ScheduleService { result.put("tillTime", tillTime); } result.put("code", "200"); - }else{ + } else { result.put("code", "500"); } return result; @@ -283,10 +283,10 @@ public class ScheduleServiceImpl implements ScheduleService { //查询数据 List> resultList = scheduleMapper.getSfdcRollOpsReportedQty(inData); //判断是否查询到结果数据 - if(resultList.size() > 0){ + if (resultList.size() > 0) { result = resultList.get(0); result.put("code", "200"); - }else{ + } else { result.put("code", "500"); } return result; @@ -299,19 +299,19 @@ public class ScheduleServiceImpl implements ScheduleService { //查询是否存在下机卷信息 Integer countNums = scheduleMapper.countSfdcRollByRollNo(inData); //判断如果存在下机卷 - if(countNums != null && countNums > 0){ + if (countNums != null && countNums > 0) { //统计非虚拟卷的下机数量 inData.setSwitchKey("V"); Float approvedQty = scheduleMapper.getSfdcRollReportedQty(inData); //判断null - if(null == approvedQty){ + if (null == approvedQty) { approvedQty = 0f; } //统计非合并的下机数量 inData.setSwitchKey("VC"); Float otherQty = scheduleMapper.getSfdcRollReportedQty(inData); //判断null - if(null == otherQty){ + if (null == otherQty) { otherQty = 0f; } //其他卷的数量 @@ -321,35 +321,35 @@ public class ScheduleServiceImpl implements ScheduleService { inData.setSwitchKey(null); Float defectedQty = scheduleMapper.getSfdcDefectDefectedQty(inData); //判断null - if(null == defectedQty){ + if (null == defectedQty) { defectedQty = 0f; } Float totalQty = approvedQty + defectedQty; //设置参数 result.put("approvedQty", approvedQty); result.put("defectedQty", defectedQty); - result.put("otherRollQty", otherRollQty ); + result.put("otherRollQty", otherRollQty); result.put("totalQty", totalQty); result.put("reportedFlag", "Y"); - }else{ + } else { //查询良品和不良的数量 List> resultList = scheduleMapper.getSfdcRollOpsReportedQty(inData); //判断是否查询到结果数据 - if(resultList.size() > 0){ + if (resultList.size() > 0) { result = resultList.get(0); - }else{ + } else { result.put("code", "500"); } //设置参数 String strApprovedQty = String.valueOf(result.get("approvedQty")); //判断null - if(strApprovedQty == null || "null".equalsIgnoreCase(strApprovedQty)){ + if (strApprovedQty == null || "null".equalsIgnoreCase(strApprovedQty)) { strApprovedQty = "0"; } Float approvedQty = Float.parseFloat(strApprovedQty); String strDefectedQty = String.valueOf(result.get("defectedQty")); //判断null - if(strDefectedQty == null || "null".equalsIgnoreCase(strDefectedQty)){ + if (strDefectedQty == null || "null".equalsIgnoreCase(strDefectedQty)) { strDefectedQty = "0"; } Float defectedQty = Float.parseFloat(strDefectedQty); @@ -371,27 +371,27 @@ public class ScheduleServiceImpl implements ScheduleService { //查询数据 List> resultList = scheduleMapper.getScheduleShiftData(inData); //判断是否查询到结果数据 - if(resultList.size() > 0){ + if (resultList.size() > 0) { //循环处理数据 - for (int i = 0; i < resultList.size(); i++){ + for (int i = 0; i < resultList.size(); i++) { Map tempMap = resultList.get(i); Float curTime = Float.parseFloat(String.valueOf(tempMap.get("curTime"))); - Float startTime = Float.parseFloat(String.valueOf(tempMap.get("startTime"))); - Float endTime = Float.parseFloat(String.valueOf(tempMap.get("endTime"))); + Float startTime = Float.parseFloat(String.valueOf(tempMap.get("startTime"))); + Float endTime = Float.parseFloat(String.valueOf(tempMap.get("endTime"))); //区分各类情况 - if (curTime < startTime){ + if (curTime < startTime) { result.put("code", "500"); result.put("shiftDesc", "无班次"); break; - }else if (curTime >= startTime && curTime <= endTime){ + } else if (curTime >= startTime && curTime <= endTime) { result = resultList.get(i); break; - }else{ + } else { result = resultList.get(i); } } result.put("code", "200"); - }else{ + } else { result.put("code", "500"); result.put("shiftDesc", "无班次"); } @@ -405,18 +405,18 @@ public class ScheduleServiceImpl implements ScheduleService { //查询数据 List> resultList = scheduleMapper.getSfdcTimeData(inData); //判断是否查询到结果数据 - if(resultList.size() > 0 && resultList.get(0) != null){ + if (resultList.size() > 0 && resultList.get(0) != null) { result = resultList.get(0); String strReportedSetupTime = String.valueOf(result.get("reportedSetupTime")); //判断null - if(strReportedSetupTime == null || "null".equalsIgnoreCase(strReportedSetupTime)){ + if (strReportedSetupTime == null || "null".equalsIgnoreCase(strReportedSetupTime)) { strReportedSetupTime = "0"; } Float reportedSetupTime = Float.parseFloat(strReportedSetupTime); String strReportedManfTime = String.valueOf(result.get("reportedManfTime")); //判断null - if(strReportedManfTime == null || "null".equalsIgnoreCase(strReportedManfTime)){ + if (strReportedManfTime == null || "null".equalsIgnoreCase(strReportedManfTime)) { strReportedManfTime = "0"; } Float reportedManfTime = Float.parseFloat(strReportedManfTime); @@ -441,7 +441,7 @@ public class ScheduleServiceImpl implements ScheduleService { //sfdc的停机时间 String strDowntime = String.valueOf(result.get("downtime")); //判断null - if(strDowntime == null || "null".equalsIgnoreCase(strDowntime)){ + if (strDowntime == null || "null".equalsIgnoreCase(strDowntime)) { strDowntime = "0"; } Float downtime = Float.parseFloat(strDowntime); @@ -451,7 +451,7 @@ public class ScheduleServiceImpl implements ScheduleService { //调机停机时间 String strReportedSetupDowntime = String.valueOf(result.get("reportedSetupDowntime")); //判断null - if(strReportedSetupDowntime == null || "null".equalsIgnoreCase(strReportedSetupDowntime)){ + if (strReportedSetupDowntime == null || "null".equalsIgnoreCase(strReportedSetupDowntime)) { strReportedSetupDowntime = "0"; } Float reportedSetupDowntime = Float.parseFloat(strReportedSetupDowntime); @@ -461,7 +461,7 @@ public class ScheduleServiceImpl implements ScheduleService { //sfdc生产停机时间 String strReportedManfDowntime = String.valueOf(result.get("reportedManfDowntime")); //判断null - if(strReportedManfDowntime == null || "null".equalsIgnoreCase(strReportedManfDowntime)){ + if (strReportedManfDowntime == null || "null".equalsIgnoreCase(strReportedManfDowntime)) { strReportedManfDowntime = "0"; } Float reportedManfDowntime = Float.parseFloat(strReportedManfDowntime); @@ -476,7 +476,7 @@ public class ScheduleServiceImpl implements ScheduleService { result.put("sfdcSetupDownTime", sfdcSetupDownTime); result.put("sfdcProdSetupTime", sfdcProdSetupTime); result.put("resultCode", "200"); - }else{ + } else { result.put("resultCode", "500"); result.put("sfdcProdTime", 0); result.put("sfdcSetupTime", 0); @@ -493,9 +493,9 @@ public class ScheduleServiceImpl implements ScheduleService { //按照条件查询当前的数据 List resultList = scheduleMapper.getSfdcDataByCon(inData); //判断是否查询到结果 - if(resultList.size() > 0 && resultList.get(0) != null){ + if (resultList.size() > 0 && resultList.get(0) != null) { return resultList.get(0); - }else{ + } else { return new SfdcData(); } } @@ -537,18 +537,18 @@ public class ScheduleServiceImpl implements ScheduleService { Map functionMap = this.refreshWorkPlatformButtons(inData); String functionFlag = String.valueOf(functionMap.get(functionName)); //是否可用 - if("N".equalsIgnoreCase(functionFlag)){ + if ("N".equalsIgnoreCase(functionFlag)) { resultMap.put("code", 400); resultMap.put("msg", "当前功能不可用,请刷新页面后再试!"); return resultMap; } //区分不同的类型 - if ("createNewRollFlag".equalsIgnoreCase(functionName)){ + if ("createNewRollFlag".equalsIgnoreCase(functionName)) { //检查派工单是否关闭 inData.setClosedFlag("N"); Integer countNums = scheduleMapper.checkScheduleStatus(inData); - if (null == countNums || countNums == 0){ + if (null == countNums || countNums == 0) { resultMap.put("code", 400); resultMap.put("msg", "该派工单上不存在或者已经被关闭,不能创建新卷!"); return resultMap; @@ -560,23 +560,23 @@ public class ScheduleServiceImpl implements ScheduleService { SfdcRollOpsData sfdcRollOps = scheduleMapper.getCurrentRollOpsBySeqNo(queryRoll); //判断是否存在上机卷 - if(null != sfdcRollOps){ + if (null != sfdcRollOps) { resultMap.put("code", 400); - resultMap.put("msg", "该工序,有卷号("+sfdcRollOps.getRollNo()+")尚未完成,不能再次创建新卷号!"); + resultMap.put("msg", "该工序,有卷号(" + sfdcRollOps.getRollNo() + ")尚未完成,不能再次创建新卷号!"); return resultMap; } - }else if ("switchRollFlag".equalsIgnoreCase(functionName)){ + } else if ("switchRollFlag".equalsIgnoreCase(functionName)) { //不需要再做校验 - }else if("separateRollFlag".equalsIgnoreCase(functionName)){ + } else if ("separateRollFlag".equalsIgnoreCase(functionName)) { //查询当前的上机卷 List sfdcRollOps = scheduleMapper.getSfdcRollOpsByCon(inData); SfdcRollOpsData sfdcRollOp = sfdcRollOps.get(0); String finishedFlag = sfdcRollOp.getFinishedFlag(); String pauseFlag = sfdcRollOp.getPauseFlag(); - if ("Y".equalsIgnoreCase(finishedFlag) || "Y".equalsIgnoreCase(pauseFlag)){ + if ("Y".equalsIgnoreCase(finishedFlag) || "Y".equalsIgnoreCase(pauseFlag)) { resultMap.put("code", 400); - resultMap.put("msg", " 该卷号("+sfdcRollOp.getRollNo()+")在该工序已经生产结束或者暂停生产!"); + resultMap.put("msg", " 该卷号(" + sfdcRollOp.getRollNo() + ")在该工序已经生产结束或者暂停生产!"); return resultMap; } //判断是否存在上机卷 @@ -585,34 +585,34 @@ public class ScheduleServiceImpl implements ScheduleService { inData.setSeqNo(null); List sfdcRolls = scheduleMapper.getSfdcRollByCon(inData); //判断是否存在当前的卷号 - if(sfdcRolls.size() == 0){ + if (sfdcRolls.size() == 0) { resultMap.put("code", 400); - resultMap.put("msg", " 该卷号("+inData.getRollNo()+")不存在!"); + resultMap.put("msg", " 该卷号(" + inData.getRollNo() + ")不存在!"); return resultMap; } //如果存在 SfdcRollData sfdcRoll = sfdcRolls.get(0); Integer currentOpsItemNo = sfdcRoll.getCurrentOpsItemNo(); - if(currentOpsItemNo == itemNo){ + if (currentOpsItemNo == itemNo) { resultMap.put("code", 400); - resultMap.put("msg", " 该卷号("+inData.getRollNo()+")是当前工序创建的,因此不存在'新卷下机'!"); + resultMap.put("msg", " 该卷号(" + inData.getRollNo() + ")是当前工序创建的,因此不存在'新卷下机'!"); return resultMap; } //是否超过10% 需要再等等 - }else if ("finishRollFlag".equalsIgnoreCase(functionName)){ + } else if ("finishRollFlag".equalsIgnoreCase(functionName)) { //存在上机卷就可以结束 - }else if ("tuningFlag".equalsIgnoreCase(functionName)){ + } else if ("tuningFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 - }else if ("produceFlag".equalsIgnoreCase(functionName)){ + } else if ("produceFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 - }else if ("defectFlag".equalsIgnoreCase(functionName)){ + } else if ("defectFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 - }else if ("toolFlag".equalsIgnoreCase(functionName)){ + } else if ("toolFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 - }else if ("materialFlag".equalsIgnoreCase(functionName)){ + } else if ("materialFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 - }else if ("downTimeFlag".equalsIgnoreCase(functionName)){ + } else if ("downTimeFlag".equalsIgnoreCase(functionName)) { //存储过程已经验证过条件 } //如果上面的验证通过 @@ -636,10 +636,10 @@ public class ScheduleServiceImpl implements ScheduleService { //判断null String strRollId = ""; String strNormalRollId = ""; - if(tempMap != null){ + if (tempMap != null) { strRollId = String.valueOf(tempMap.get("rollId")); strNormalRollId = String.valueOf(tempMap.get("normalRollId")); - }else{ + } else { strRollId = "1"; strNormalRollId = "0"; } @@ -668,10 +668,10 @@ public class ScheduleServiceImpl implements ScheduleService { sfdcRollData.setRollQty(0f); sfdcRollData.setFirstLevelRollNo(currentRollNo); //判断是否是最后一道工序 - if (nextItemNo == 0){ + if (nextItemNo == 0) { sfdcRollData.setFgRollFlag("Y"); sfdcRollData.setCqcNeedInspectFlag("Y"); - }else { + } else { sfdcRollData.setFgRollFlag("N"); sfdcRollData.setCqcNeedInspectFlag("N"); } @@ -685,7 +685,7 @@ public class ScheduleServiceImpl implements ScheduleService { scheduleMapper.insertSfdcRolls(sfdcRollData); //插入sfdcRollOps的数据 - SfdcRollOpsData sfdcRollOpsData = new SfdcRollOpsData(username, new Date(), "N", "N", 0f, 0f, "N"); + SfdcRollOpsData sfdcRollOpsData = new SfdcRollOpsData(username, new Date(), "N", "N", 0f, 0f, "N"); //设置继承的参数 sfdcRollOpsData.setSite(site); sfdcRollOpsData.setOrderNo(orderNo); @@ -724,20 +724,21 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 获取sfdcRoll的卷号 - * @author LR - * @date 2021/12/13 15:52 + * * @param site * @param orderNo * @param itemNo * @return java.lang.String + * @author LR + * @date 2021/12/13 15:52 **/ - public String getSfdcRollSerialNo(String site, String orderNo, int itemNo){ + public String getSfdcRollSerialNo(String site, String orderNo, int itemNo) { List params = new ArrayList<>(); params.add(site); params.add(orderNo); params.add(itemNo); //执行存储过程获取结果 - List> resultList = procedureMapper.getProcedureData("getSfdcRollSerialNo",params); + List> resultList = procedureMapper.getProcedureData("getSfdcRollSerialNo", params); //处理结果集 Map resultMap = resultList.get(0); String rollNo = String.valueOf(resultMap.get("rollNo")); @@ -746,20 +747,21 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 获取派工单的后道工序 - * @author LR - * @date 2021/12/13 16:46 + * * @param site * @param orderNo * @param itemNo * @return java.lang.Integer + * @author LR + * @date 2021/12/13 16:46 **/ - public Integer getScheduleNextItemNo(String site, String orderNo, int itemNo){ + public Integer getScheduleNextItemNo(String site, String orderNo, int itemNo) { List params = new ArrayList<>(); params.add(site); params.add(orderNo); params.add(itemNo); //执行存储过程获取结果 - List> resultList = procedureMapper.getProcedureData("getScheduleNextItemNo",params); + List> resultList = procedureMapper.getProcedureData("getScheduleNextItemNo", params); //处理结果集 Map resultMap = resultList.get(0); String strItemNo = String.valueOf(resultMap.get("nextItemNo")); @@ -787,9 +789,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 校验是否可以开始调机 + * + * @return void * @author LR * @date 2021/12/27 15:15 - * @return void **/ public void checkStartTuning(String site, String orderNo, Integer itemNo, String seqNo, String rollNo) { List params = new ArrayList<>(); @@ -804,17 +807,18 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = resultList.get(0); String code = String.valueOf(resultMap.get("resultCode")); //判断是否存在异常 - if (!"200".equalsIgnoreCase(code)){ + if (!"200".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } } /** * TODO 开始调机的操作 + * + * @return void * @author LR * @date 2021/12/27 15:21 - * @return void **/ public void startTuning(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String username, String currentTime) { List params = new ArrayList<>(); @@ -830,7 +834,6 @@ public class ScheduleServiceImpl implements ScheduleService { } - @Override public Map checkDownTimeCode(SearchScheduleData inData) { //公共参数 @@ -843,9 +846,9 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = this.checkDownTimeCode(site, orderNo, itemNo, seqNo, rollNo, downTimeCode); //判断是否检验成功 String code = String.valueOf(resultMap.get("resultCode")); - if (!"200".equalsIgnoreCase(code)){ + if (!"200".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } @@ -863,7 +866,7 @@ public class ScheduleServiceImpl implements ScheduleService { String username = inData.getOperatorId(); String reportDate = inData.getReportDate(); String reportTime = inData.getReportTime(); - String operateTime = reportDate+ " "+reportTime.substring(0, 5); + String operateTime = reportDate + " " + reportTime.substring(0, 5); Float totalTime = inData.getTotalTime(); //首先调用校验的方法 this.checkDownTimeCode(inData); @@ -874,9 +877,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 调用存储过程返回停机代码的结果 + * + * @return java.util.Map * @author LR * @date 2021/12/27 11:55 - * @return java.util.Map **/ public Map checkDownTimeCode(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String downTimeCode) { List params = new ArrayList<>(); @@ -887,14 +891,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(rollNo); params.add(downTimeCode); List> resultList = procedureMapper.getProcedureData("checkDownTimeCode", params); - return resultList.get(0); + return resultList.get(0); } /** * TODO 调用存储过程创建停机的记录 + * + * @return void * @author LR * @date 2021/12/27 17:26 - * @return void **/ public void reportDownTime(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String downTimeCode, String username, String operateTime, Float totalTime) { List params = new ArrayList<>(); @@ -927,18 +932,19 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = this.checkDefectCode(site, orderNo, itemNo, seqNo, rollNo, defectCode); //判断是否检验成功 String code = String.valueOf(resultMap.get("resultCode")); - if (!"200".equalsIgnoreCase(code)){ + if (!"200".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } /** * TODO 校验不良代码 + * + * @return java.util.Map * @author LR * @date 2021/12/28 14:40 - * @return java.util.Map **/ public Map checkDefectCode(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String defectCode) { List params = new ArrayList<>(); @@ -949,7 +955,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(rollNo); params.add(defectCode); List> resultList = procedureMapper.getProcedureData("checkDefectCode", params); - return resultList.get(0); + return resultList.get(0); } @Override @@ -975,9 +981,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 执行报告不良代码的存储过程 + * + * @return void * @author LR * @date 2021/12/28 16:56 - * @return void **/ public void reportDefectCode(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String defectCode, Float defectQty, String username, String reportDate) { @@ -1009,26 +1016,27 @@ public class ScheduleServiceImpl implements ScheduleService { Map checkMap = this.checkProcessToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, currentTime); //判断是否检验成功 String checkFlag = String.valueOf(checkMap.get("resultCode")); - if (!"Y".equalsIgnoreCase(checkFlag)){ - throw new RRException("当前卷号不在调试过程中,不允许上/更换工具!"); + if (!"Y".equalsIgnoreCase(checkFlag)) { + throw new RRException("当前卷号不在调试过程中,不允许上/更换工具!"); } //调用存储过程判断是否可以上工具 Map resultMap = this.checkToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, toolInstanceId); //判断是否检验成功 String code = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(code)){ + if ("400".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } /** * TODO 检查是否处于上工具的时机 + * + * @return java.util.Map * @author LR * @date 2021/12/28 18:54 - * @return java.util.Map **/ public Map checkProcessToolInstanceId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String currentTime) { List params = new ArrayList<>(); @@ -1039,14 +1047,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(rollNo); params.add(currentTime); List> resultList = procedureMapper.getProcedureData("checkProcessToolInstanceId", params); - return resultList.get(0); + return resultList.get(0); } /** * TODO 检查工具实例的编码 + * + * @return java.util.Map * @author LR * @date 2021/12/28 18:44 - * @return java.util.Map **/ public Map checkToolInstanceId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String toolInstanceId) { List params = new ArrayList<>(); @@ -1057,7 +1066,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(rollNo); params.add(toolInstanceId); List> resultList = procedureMapper.getProcedureData("checkToolInstanceId", params); - return resultList.get(0); + return resultList.get(0); } @Override @@ -1082,9 +1091,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 调用存储过程生成工具的记录的数据 + * + * @return void * @author LR * @date 2021/12/29 18:37 - * @return void **/ public void addToolInstanceId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String toolInstanceId, String username, String currentTime) { @@ -1105,15 +1115,15 @@ public class ScheduleServiceImpl implements ScheduleService { //首先查询当前的材料卷号数据 CRollInfoOutData cRollInfo = scheduleMapper.getCRollInfoByRollNo(inData); //判断是否存在 - if(null == cRollInfo){ + if (null == cRollInfo) { throw new RRException("查无此卷!"); } inData.setRmPartNo(cRollInfo.getPartNo()); //查询bom行数据 List> resultList = scheduleMapper.getBomItemNosByPartNo(inData); //判断是否存在 - if(resultList.size() == 0){ - throw new RRException("工单:"+inData.getOrderNo()+"没有物料:"+cRollInfo.getPartNo()+"的BOM信息!"); + if (resultList.size() == 0) { + throw new RRException("工单:" + inData.getOrderNo() + "没有物料:" + cRollInfo.getPartNo() + "的BOM信息!"); } return resultList; } @@ -1130,21 +1140,21 @@ public class ScheduleServiceImpl implements ScheduleService { Integer bomItemNo = inData.getBomItemNo(); Integer histSeqNo = inData.getHistSeqNo(); String currentTime = DateUtil.getStringDate(new Date(), "yyyy-MM-dd HH:mm:ss"); - if (histSeqNo >= 0){ - throw new RRException("请选择接换料功能!"); + if (histSeqNo >= 0) { + throw new RRException("请选择接换料功能!"); } //检查是否是上材料的时机 String resultCode = this.checkProcessMaterialRoll(site, orderNo, itemNo, seqNo, rollNo, currentTime); - if ("N".equalsIgnoreCase(resultCode)){ + if ("N".equalsIgnoreCase(resultCode)) { throw new RRException("当前卷号不在调试过程中/不处于停机状态(停机原因是更换材料),不允许上/更换材料!"); } //执行检查材料卷上机的功能 - Map resultMap = this.checkFeedingMaterialRoll(site, orderNo, itemNo, seqNo, rollNo, rmRollNo, bomItemNo); + Map resultMap = this.checkFeedingMaterialRoll(site, orderNo, itemNo, seqNo, rollNo, rmRollNo, bomItemNo); //判断是否继续 String code = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(code)){ + if ("400".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); throw new RRException(msg); } @@ -1152,11 +1162,11 @@ public class ScheduleServiceImpl implements ScheduleService { } /** + * @return java.lang.String * @Author LR * @Description 判断是否处于调机或者停机--上/换材料 - * @DateTime 2021/12/21 18:32 + * @DateTime 2021/12/21 18:32 * @Param [site, orderNo, itemNo, seqNo, rollNo, currentTime] - * @return java.lang.String **/ public String checkProcessMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String currentTime) { List params = new ArrayList<>(); @@ -1176,9 +1186,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 调用检查的是否可以上料的存储过程 + * + * @return java.util.Map * @author LR * @date 2021/12/22 13:49 - * @return java.util.Map **/ public Map checkFeedingMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String rmRollNo, Integer bomItemNo) { List params = new ArrayList<>(); @@ -1218,9 +1229,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 调用存储过程执行上机的过程 + * + * @return void * @author LR * @date 2021/12/30 14:03 - * @return void **/ public void feedingMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String rmRollNo, Integer bomItemNo, String username, String currentTime) { List params = new ArrayList<>(); @@ -1234,7 +1246,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(currentTime); //执行存储过程 - procedureMapper.execProduceData("feedingMaterialRoll", params); + procedureMapper.execProduceData("feedingMaterialRoll", params); } @Override @@ -1250,7 +1262,7 @@ public class ScheduleServiceImpl implements ScheduleService { Map materialMap = this.checkCompleteMaterialRoll(site, orderNo, itemNo, seqNo, rollNo); //判断是否可以 String materialCode = String.valueOf(materialMap.get("resultCode")); - if (!"200".equalsIgnoreCase(materialCode)){ + if (!"200".equalsIgnoreCase(materialCode)) { String materialMsg = String.valueOf(materialMap.get("resultMsg")); throw new RRException(materialMsg); } @@ -1259,7 +1271,7 @@ public class ScheduleServiceImpl implements ScheduleService { Map toolMap = this.checkCompleteToolId(site, orderNo, itemNo, seqNo, rollNo); //判断是否可以 String toolCode = String.valueOf(materialMap.get("resultCode")); - if (!"200".equalsIgnoreCase(toolCode)){ + if (!"200".equalsIgnoreCase(toolCode)) { String toolMsg = String.valueOf(toolMap.get("resultMsg")); throw new RRException(toolMsg); } @@ -1268,7 +1280,7 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = this.checkStartProduce(site, orderNo, itemNo, seqNo, rollNo); //判断是否是异常 String resultCode = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(resultCode)){ + if ("400".equalsIgnoreCase(resultCode)) { String resultMsg = String.valueOf(resultMap.get("resultMsg")); throw new RRException(resultMsg); } @@ -1277,9 +1289,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 检查材料是否可以开始生产 + * + * @return java.util.Map * @author LR * @date 2021/12/31 11:28 - * @return java.util.Map **/ public Map checkCompleteMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo) { List params = new ArrayList<>(); @@ -1296,9 +1309,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 检查工具是否可以开始生产 + * + * @return java.util.Map * @author LR * @date 2021/12/31 11:30 - * @return java.util.Map **/ public Map checkCompleteToolId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo) { List params = new ArrayList<>(); @@ -1315,9 +1329,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO是否可以开始生产 + * + * @return java.util.Map * @author LR * @date 2021/12/31 13:18 - * @return java.util.Map **/ public Map checkStartProduce(String site, String orderNo, Integer itemNo, String seqNo, String rollNo) { List params = new ArrayList<>(); @@ -1343,7 +1358,7 @@ public class ScheduleServiceImpl implements ScheduleService { String username = inData.getOperatorId(); String reportDate = inData.getReportDate(); String reportTime = inData.getReportTime(); - String operateTime = reportDate+ " "+reportTime.substring(0, 5); + String operateTime = reportDate + " " + reportTime.substring(0, 5); //首先调用方法检测是否可以开始生产 this.checkStartProduce(inData); @@ -1353,9 +1368,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 调用存储过程执行开始生产 + * + * @return void * @author LR * @date 2022/1/6 17:29 - * @return void **/ public void startProduce(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String username, String operateTime) { List params = new ArrayList<>(); @@ -1388,18 +1404,18 @@ public class ScheduleServiceImpl implements ScheduleService { String reportTime = pageData.getReportTime(); String currentTime = reportDate + " " + reportTime; //先循环验证参数是否符合规则 - for (int i = 0; i < sfdcMaterialList.size(); i++){ + for (int i = 0; i < sfdcMaterialList.size(); i++) { SfdcMaterialData sfdcMaterialData = sfdcMaterialList.get(0); Float transQty = sfdcMaterialData.getTransQty(); Float netIssueQty = sfdcMaterialData.getNetIssueQty(); //判断是否符合规则 - if (netIssueQty == null){ + if (netIssueQty == null) { throw new RRException("材料上本卷耗用数量不能为空!"); } - if (netIssueQty <= 0){ + if (netIssueQty <= 0) { throw new RRException("材料上本卷耗用数量必须大于0!"); } - if (netIssueQty > transQty){ + if (netIssueQty > transQty) { throw new RRException("材料上本卷耗用数量大于发料数量!"); } } @@ -1408,7 +1424,7 @@ public class ScheduleServiceImpl implements ScheduleService { Map tuningMap = this.checkEndTuning(site, orderNo, itemNo, seqNo, rollNo, currentTime); //判断是否继续 String tuningCode = String.valueOf(tuningMap.get("resultCode")); - if(!"200".equalsIgnoreCase(tuningCode)){ + if (!"200".equalsIgnoreCase(tuningCode)) { String tuningMsg = String.valueOf(tuningMap.get("resultMsg")); throw new RRException(tuningMsg); } @@ -1417,13 +1433,13 @@ public class ScheduleServiceImpl implements ScheduleService { Map produceMap = this.checkStartProduce(site, orderNo, itemNo, seqNo, rollNo); //判断是否继续 String produceCode = String.valueOf(produceMap.get("resultCode")); - if("400".equalsIgnoreCase(produceCode)){ + if ("400".equalsIgnoreCase(produceCode)) { String produceMsg = String.valueOf(produceMap.get("resultMsg")); throw new RRException(produceMsg); } //验证通过循环执行结束调机操作 - for (int i = 0; i < sfdcMaterialList.size(); i++){ + for (int i = 0; i < sfdcMaterialList.size(); i++) { SfdcMaterialData sfdcMaterialData = sfdcMaterialList.get(0); String rmRollNo = sfdcMaterialData.getRmRollNo(); String rmPartNo = sfdcMaterialData.getPartNo(); @@ -1443,9 +1459,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 添加注释 + * + * @return java.util.Map * @author LR * @date 2022/1/13 11:15 - * @return java.util.Map **/ public Map checkEndTuning(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String currentTime) { List params = new ArrayList<>(); @@ -1463,9 +1480,10 @@ public class ScheduleServiceImpl implements ScheduleService { /** * TODO 执行结束调机的操作(针对单个材料的主材) + * + * @return void * @author LR * @date 2022/1/13 11:33 - * @return void **/ public void endTuning(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String rmRollNo, String rmPartNo, int histSeqNo, Float transQty, Float netIssueQty, String keyRMFlag, String sapBomItemNo, String startFromRollNo, String username, String currentTime) { @@ -1493,7 +1511,7 @@ public class ScheduleServiceImpl implements ScheduleService { public Float countToolUsedQty(SearchScheduleData inData) { Float usedQty = scheduleMapper.countToolUsedQty(inData); //null判断 - if(null == usedQty){ + if (null == usedQty) { usedQty = 0f; } return usedQty; @@ -1518,26 +1536,27 @@ public class ScheduleServiceImpl implements ScheduleService { Map checkMap = this.checkProcessToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, currentTime); //判断是否检验成功 String checkFlag = String.valueOf(checkMap.get("resultCode")); - if (!"Y".equalsIgnoreCase(checkFlag)){ - throw new RRException("当前卷号不在调试过程中,不允许上/更换工具!"); + if (!"Y".equalsIgnoreCase(checkFlag)) { + throw new RRException("当前卷号不在调试过程中,不允许上/更换工具!"); } //调用是否可以切换刀具的存储过程 Map resultMap = this.checkConnectToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, oriToolInstanceId, toolInstanceId, histSeqNo); //判断是否检验成功 String code = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(code)){ + if ("400".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } /** * TODO 是否可以切换刀具的存储过程 + * + * @return java.util.Map * @author LR * @date 2022/1/19 10:46 - * @return java.util.Map **/ public Map checkConnectToolInstanceId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String oriToolInstanceId, String toolInstanceId, Integer histSeqNo) { @@ -1578,15 +1597,16 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = this.checkConnectToolInstanceId(inData); //然后执行存储过程换刀 - this.connectToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, oriToolInstanceId, toolInstanceId, histSeqNo, consumeQty, downTimeQty, username, currentTime); + this.connectToolInstanceId(site, orderNo, itemNo, seqNo, rollNo, oriToolInstanceId, toolInstanceId, histSeqNo, consumeQty, downTimeQty, username, currentTime); } /** * TODO 存储过程换刀 + * + * @return void * @author LR * @date 2022/1/19 15:14 - * @return void **/ public void connectToolInstanceId(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String oriToolInstanceId, String toolInstanceId, Integer histSeqNo, Float consumeQty, Float downTimeQty, String username, String currentTime) { @@ -1621,13 +1641,13 @@ public class ScheduleServiceImpl implements ScheduleService { String reportDate = inData.getReportDate(); String reportTime = inData.getReportTime(); String currentTime = reportDate + " " + reportTime; - if (histSeqNo <= -1){ + if (histSeqNo <= -1) { throw new RRException("请选择上料功能!"); } //检查是否是上材料的时机 String resultCode = this.checkProcessMaterialRoll(site, orderNo, itemNo, seqNo, rollNo, currentTime); - if ("N".equalsIgnoreCase(resultCode)){ + if ("N".equalsIgnoreCase(resultCode)) { throw new RRException("当前卷号不在调试过程中/不处于停机状态(停机原因是更换材料),不允许上/更换材料!"); } @@ -1636,18 +1656,19 @@ public class ScheduleServiceImpl implements ScheduleService { Map resultMap = this.checkConnectMaterialRoll(site, orderNo, itemNo, seqNo, rollNo, rmRollNo, bomItemNo, histSeqNo); //判断是否检验成功 String code = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(code)){ + if ("400".equalsIgnoreCase(code)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } /** * TODO 调用存储过程判断是否可以接换料功能 + * + * @return java.util.Map * @author LR * @date 2021/12/22 15:39 - * @return java.util.Map **/ public Map checkConnectMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String rmRollNo, Integer bomItemNo, Integer histSeqNo) { List params = new ArrayList<>(); @@ -1690,11 +1711,11 @@ public class ScheduleServiceImpl implements ScheduleService { } /** + * @return void * @Author LR * @Description 调用存储过程换料功能 - * @DateTime 2022/1/20 11:47 + * @DateTime 2022/1/20 11:47 * @Param [site, orderNo, itemNo, seqNo, rollNo, rmRollNo, bomItemNo, histSeqNo, downTimeQty, username, currentTime] - * @return void **/ public void connectMaterialRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String rmRollNo, Integer bomItemNo, Integer histSeqNo, Float downTimeQty, String username, String currentTime) { @@ -1711,7 +1732,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(currentTime); //执行存储过程 - procedureMapper.execProduceData( "connectMaterialRoll", params); + procedureMapper.execProduceData("connectMaterialRoll", params); } @@ -1739,7 +1760,7 @@ public class ScheduleServiceImpl implements ScheduleService { //判断报工的数量是否为正整数 Double remainderQty = approvedQty % 1.0; - if(remainderQty > 0){ + if (remainderQty > 0) { throw new RRException("总良品数量不允许输入小数!"); } @@ -1747,7 +1768,7 @@ public class ScheduleServiceImpl implements ScheduleService { Map materialMap = this.checkCompleteMaterialRoll(site, orderNo, itemNo, seqNo, rollNo); //判断是否可以 String materialCode = String.valueOf(materialMap.get("resultCode")); - if (!"200".equalsIgnoreCase(materialCode)){ + if (!"200".equalsIgnoreCase(materialCode)) { String materialMsg = String.valueOf(materialMap.get("resultMsg")); throw new RRException(materialMsg); } @@ -1756,66 +1777,66 @@ public class ScheduleServiceImpl implements ScheduleService { Map toolMap = this.checkCompleteToolId(site, orderNo, itemNo, seqNo, rollNo); //判断是否可以 String toolCode = String.valueOf(materialMap.get("resultCode")); - if (!"200".equalsIgnoreCase(toolCode)){ + if (!"200".equalsIgnoreCase(toolCode)) { String toolMsg = String.valueOf(toolMap.get("resultMsg")); throw new RRException(toolMsg); } //判断是否有主材上机 - if (sfdcMaterialList.size() == 0){ - throw new RRException("为扫描主材不可结束卷!"); + if (sfdcMaterialList.size() == 0) { + throw new RRException("为扫描主材不可结束卷!"); } //1.调用存储过程 校验工单 派工单 上机卷 信息是否符合条件 - Map checkMap1 = this.checkFinishRollWithScheduleOpsShift(site, orderNo, itemNo, seqNo, rollNo, scheduledDate, shiftDesc); + Map checkMap1 = this.checkFinishRollWithScheduleOpsShift(site, orderNo, itemNo, seqNo, rollNo, scheduledDate, shiftDesc); //判断是否检验成功 String code1 = String.valueOf(checkMap1.get("resultCode")); - if ("400".equalsIgnoreCase(code1)){ + if ("400".equalsIgnoreCase(code1)) { String msg = String.valueOf(checkMap1.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } //2.调用存储过程 校验是否可以下机卷 Map checkMap2 = this.checkFinishRollWithSfdcRoll(site, orderNo, itemNo, seqNo, rollNo); //判断是否检验成功 String code2 = String.valueOf(checkMap2.get("resultCode")); - if ("400".equalsIgnoreCase(code2)){ + if ("400".equalsIgnoreCase(code2)) { String msg = String.valueOf(checkMap2.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } //3.调用存储过程 校验不同工序间数量大小 Map checkMap3 = this.checkFinishRollWithSoRoutingQty(site, orderNo, itemNo, editReportQty); //判断是否检验成功 String code3 = String.valueOf(checkMap3.get("resultCode")); - if ("400".equalsIgnoreCase(code3)){ + if ("400".equalsIgnoreCase(code3)) { String msg = String.valueOf(checkMap3.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } //4.调用存储过程 上机的主材依次校验 //先循环验证参数是否符合规则 - for (int i = 0; i < sfdcMaterialList.size(); i++){ + for (int i = 0; i < sfdcMaterialList.size(); i++) { SfdcMaterialData sfdcMaterialData = sfdcMaterialList.get(0); Float transQty = sfdcMaterialData.getTransQty(); Float netIssueQty = sfdcMaterialData.getNetIssueQty(); Integer histSeqNo = sfdcMaterialData.getHistSeqNo(); //判断是否符合规则 - if (netIssueQty == null){ + if (netIssueQty == null) { throw new RRException("材料上本卷耗用数量不能为空!"); } - if (netIssueQty <= 0){ + if (netIssueQty <= 0) { throw new RRException("材料上本卷耗用数量必须大于0!"); } - if (netIssueQty > transQty){ + if (netIssueQty > transQty) { throw new RRException("材料上本卷耗用数量大于发料数量!"); } //调用存储过程校验每一个卷的数量 Map resultMap = this.checkFinishRollWithSfdcMaterialHist(site, orderNo, itemNo, rollNo, seqNo, editTotalReportQty, otherRollQty, editNewRollQty, netIssueQty, histSeqNo, username); //区分是否抛出异常的信息 String resultCode = String.valueOf(resultMap.get("resultCode")); - if ("400".equalsIgnoreCase(resultCode)){ + if ("400".equalsIgnoreCase(resultCode)) { String msg = String.valueOf(resultMap.get("resultMsg")); - throw new RRException(msg); + throw new RRException(msg); } return resultMap; } @@ -1823,11 +1844,11 @@ public class ScheduleServiceImpl implements ScheduleService { } /** + * @return java.util.Map * @Author LR * @Description 存储过程校验 单个材料的校验数据 - * @DateTime 2022/1/25 15:05 + * @DateTime 2022/1/25 15:05 * @Param [site, orderNo, itemNo, rollNo, seqNo, editTotalReportQty, otherRollQty, editNewRollQty, netIssueQty, histSeqNo] - * @return java.util.Map **/ public Map checkFinishRollWithSfdcMaterialHist(String site, String orderNo, Integer itemNo, String rollNo, String seqNo, Float editTotalReportQty, Float otherRollQty, Float editNewRollQty, Float netIssueQty, Integer histSeqNo, String username) { @@ -1844,17 +1865,17 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(histSeqNo); params.add(username); //执行存储过程 - List> resultList = procedureMapper.getProcedureData( "checkFinishRollWithSfdcMaterialHist", params); + List> resultList = procedureMapper.getProcedureData("checkFinishRollWithSfdcMaterialHist", params); //返回执行的结果 return resultList.get(0); } /** + * @return java.util.Map * @Author LR * @Description 调用存储过程 校验工单 派工单 上机卷 信息是否符合条件 - * @DateTime 2022/1/25 13:44 + * @DateTime 2022/1/25 13:44 * @Param [site, orderNo, itemNo, seqNo, rollNo] - * @return java.util.Map **/ public Map checkFinishRollWithScheduleOpsShift(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String scheduledDate, String shiftDesc) { List params = new ArrayList<>(); @@ -1866,17 +1887,17 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(scheduledDate); params.add(shiftDesc); //执行存储过程 - List> resultList = procedureMapper.getProcedureData( "checkFinishRollWithScheduleOpsShift", params); + List> resultList = procedureMapper.getProcedureData("checkFinishRollWithScheduleOpsShift", params); //返回执行的结果 return resultList.get(0); } /** + * @return java.util.Map * @Author LR * @Description - * @DateTime 2022/1/25 13:55 + * @DateTime 2022/1/25 13:55 * @Param [site, orderNo, itemNo, seqNo, rollNo] - * @return java.util.Map **/ public Map checkFinishRollWithSfdcRoll(String site, String orderNo, Integer itemNo, String seqNo, String rollNo) { List params = new ArrayList<>(); @@ -1886,17 +1907,17 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(seqNo); params.add(rollNo); //执行存储过程 - List> resultList = procedureMapper.getProcedureData( "checkFinishRollWithSfdcRoll", params); + List> resultList = procedureMapper.getProcedureData("checkFinishRollWithSfdcRoll", params); //返回执行的结果 return resultList.get(0); } /** + * @return java.util.Map * @Author LR * @Description 调用存储过程 校验不同工序间数量大小 - * @DateTime 2022/1/25 14:13 + * @DateTime 2022/1/25 14:13 * @Param [site, orderNo, itemNo, editReportQty] - * @return java.util.Map **/ public Map checkFinishRollWithSoRoutingQty(String site, String orderNo, Integer itemNo, Float editReportQty) { List params = new ArrayList<>(); @@ -1905,7 +1926,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(itemNo); params.add(editReportQty); //执行存储过程 - List> resultList = procedureMapper.getProcedureData( "checkFinishRollWithSoRoutingQty", params); + List> resultList = procedureMapper.getProcedureData("checkFinishRollWithSoRoutingQty", params); //返回执行的结果 return resultList.get(0); } @@ -1939,7 +1960,7 @@ public class ScheduleServiceImpl implements ScheduleService { String eventTime = pageData.getEventTime();//开工时间 String tillTime = pageData.getTillTime();//完工时间 String remark = pageData.getRemark();//备注 - Float sfdcSetupDownTime = pageData.getSfdcSetupDownTime();//调机停机 + Float sfdcSetupDownTime = pageData.getSfdcSetupDownTime();//调机停机 Float sfdcProdSetupTime = pageData.getSfdcProdSetupTime();//生产调机 Float sfdcManufactureTime = pageData.getSfdcManufactureTime();//制造时间 String exceptionFlag = pageData.getExceptionFlag(); @@ -1953,7 +1974,7 @@ public class ScheduleServiceImpl implements ScheduleService { this.finishRollProcessSfdcToolHist(site, orderNo, itemNo, seqNo, rollNo, editTotalReportQty, username, reportedTime); //3.调用存储过程 处理SfdcMaterialHist的信息 --主材 //循环for循环处理 - for (int i = 0; i < sfdcMaterialList.size(); i++){ + for (int i = 0; i < sfdcMaterialList.size(); i++) { SfdcMaterialData sfdcMaterialData = sfdcMaterialList.get(0); Float netIssueQty = sfdcMaterialData.getNetIssueQty(); Integer histSeqNo = sfdcMaterialData.getHistSeqNo(); @@ -1968,17 +1989,17 @@ public class ScheduleServiceImpl implements ScheduleService { sfdcSetupTime, sfdcProdTime, sfdcDownTime, eventTime, tillTime, remark, sfdcSetupDownTime, sfdcProdSetupTime, defectedQty, sfdcManufactureTime, username); //7.调用存储过程 处理异常信息 - if("Y".equalsIgnoreCase(exceptionFlag)){ + if ("Y".equalsIgnoreCase(exceptionFlag)) { this.finishRollProcessException(site, orderNo, itemNo, seqNo, rollNo, exceptionReason, username); } } /** + * @return void * @Author LR * @Description 调用存储过程 处理异常信息 - * @DateTime 2022/1/26 14:00 + * @DateTime 2022/1/26 14:00 * @Param [site, orderNo, itemNo, seqNo, rollNo, exceptionReason] - * @return void **/ public void finishRollProcessException(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String exceptionReason, String username) { List params = new ArrayList<>(); @@ -1990,18 +2011,18 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(exceptionReason); params.add(username); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessException", params); + procedureMapper.execProduceData("finishRollProcessException", params); } /** + * @return void * @Author LR * @Description 处理Sfdc和派工单 - * @DateTime 2022/1/25 17:50 - * @return void + * @DateTime 2022/1/25 17:50 **/ public void finishRollProcessSfdcAndSchedule(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, Float sfdcReportedQty, Float sfdcApproveQty, Float sfdcSetupTime, Float sfdcProdTime, Float sfdcDownTime, String eventTime, String tillTime, String remark, - Float sfdcSetupDownTime, Float sfdcProdSetupTime, Float defectedQty, Float sfdcManufactureTime, String username) { + Float sfdcSetupDownTime, Float sfdcProdSetupTime, Float defectedQty, Float sfdcManufactureTime, String username) { List params = new ArrayList<>(); params.add(site); params.add(orderNo); @@ -2024,15 +2045,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(sfdcManufactureTime); params.add(username); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcAndSchedule", params); + procedureMapper.execProduceData("finishRollProcessSfdcAndSchedule", params); } /** + * @return void * @Author LR * @Description 调用存储过程 处理SfdcRoll和SfdcRoollOps - * @DateTime 2022/1/25 16:53 + * @DateTime 2022/1/25 16:53 * @Param [site, orderNo, itemNo, seqNo, rollNo, totalApprovedQty, sfdcApproveQty, defectedQty] - * @return void **/ public void finishRollProcessSfdcRollAndOps(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, Float totalApprovedQty, Float sfdcApproveQty, Float defectedQty, String username, String reportedTime) { @@ -2048,15 +2069,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(reportedTime); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcRollAndOps", params); + procedureMapper.execProduceData("finishRollProcessSfdcRollAndOps", params); } /** + * @return void * @Author LR * @Description 调用存储过程 处理SfdcMaterialHist的信息 --非主材 - * @DateTime 2022/1/25 15:39 + * @DateTime 2022/1/25 15:39 * @Param [site, orderNo, itemNo, seqNo, rollNo, username, reportedTime] - * @return void **/ public void finishRollProcessSfdcMaterialHistWithNotKeyRm(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String username, String reportedTime) { List params = new ArrayList<>(); @@ -2068,15 +2089,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(reportedTime); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcMaterialHistWithNotKeyRm", params); + procedureMapper.execProduceData("finishRollProcessSfdcMaterialHistWithNotKeyRm", params); } /** + * @return void * @Author LR * @Description 处理SfdcMaterialHist的信息 --主材 一次处理一个 - * @DateTime 2022/1/25 15:36 + * @DateTime 2022/1/25 15:36 * @Param [site, orderNo, itemNo, seqNo, rollNo, netIssueQty, histSeqNo, username, reportedTime] - * @return void **/ public void finishRollProcessSfdcMaterialHistWithKeyRm(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, Float netIssueQty, Integer histSeqNo, String username, String reportedTime) { List params = new ArrayList<>(); @@ -2090,15 +2111,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(reportedTime); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcMaterialHistWithKeyRm", params); + procedureMapper.execProduceData("finishRollProcessSfdcMaterialHistWithKeyRm", params); } /** + * @return void * @Author LR * @Description 调用存储过程 处理SfdcToolHist的信息 - * @DateTime 2022/1/25 15:31 + * @DateTime 2022/1/25 15:31 * @Param [site, orderNo, itemNo, seqNo, rollNo, editTotalReportQty, username, reportedTime] - * @return void **/ public void finishRollProcessSfdcToolHist(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, Float editTotalReportQty, String username, String reportedTime) { List params = new ArrayList<>(); @@ -2111,15 +2132,15 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(reportedTime); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcToolHist", params); + procedureMapper.execProduceData("finishRollProcessSfdcToolHist", params); } /** + * @return void * @Author LR * @Description 调用存储过程 处理sfdcTime的信息 - * @DateTime 2022/1/25 15:24 + * @DateTime 2022/1/25 15:24 * @Param [site, orderNo, itemNo, seqNo, rollNo, username, reportedTime] - * @return void **/ public void finishRollProcessSfdcTimeHist(String site, String orderNo, Integer itemNo, String seqNo, String rollNo, String username, String reportedTime) { List params = new ArrayList<>(); @@ -2131,7 +2152,7 @@ public class ScheduleServiceImpl implements ScheduleService { params.add(username); params.add(reportedTime); //执行存储过程 - procedureMapper.execProduceData( "finishRollProcessSfdcTimeHist", params); + procedureMapper.execProduceData("finishRollProcessSfdcTimeHist", params); } } \ No newline at end of file