From 3b955236e609d7e53ae602f9b1a7c18934d44817 Mon Sep 17 00:00:00 2001 From: gsz Date: Tue, 8 Oct 2024 15:10:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?43302=20=E5=8A=A0=E6=96=99=E9=98=B2?= =?UTF-8?q?=E9=94=99=E6=89=AB=E7=A0=81=E6=B5=81=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesRawPartChargingServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java index e23434c..53f0bd9 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java @@ -128,10 +128,14 @@ public class MesRawPartChargingServiceImpl implements IMesRawPartChargingService if (!CollectionUtils.isEmpty(mesRawPartCharging)) { MesPcnException.throwMesBusiException("料筒条码【%s】与原料条码【%s】已绑定", mesRawPartChargingModel.getPackageSn(), mesRawPartCharging.iterator().next().getSn()); } - //保存生产控制加料 - MesRawPartCharging charging = insertRawPartCharging(mesRawPartChargingModel); - //保存日志 - saveLog(mesRawPartChargingModel, charging, MesExtEnumUtil.CHARGING_LOG_STATUS.FEEDING); + //保存生产控制加料 43302 加料防错扫码流程优化 + String[] split = mesRawPartChargingModel.getSn().split(","); + for (String sn : split) { + mesRawPartChargingModel.setSn(sn); + MesRawPartCharging charging = insertRawPartCharging(mesRawPartChargingModel); + //保存日志 + saveLog(mesRawPartChargingModel, charging, MesExtEnumUtil.CHARGING_LOG_STATUS.FEEDING); + } } From 7343c0e462c7d2cd730e856ee9e4184904bd2209 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Tue, 8 Oct 2024 18:25:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=8F=AF=E7=96=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesInputDefectRecordService.java | 20 +++++++++++++++++++- .../serviceimpl/busi/MesNcProcessingService.java | 11 ++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index 1ebd00d..d364dba 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -369,6 +369,14 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } if (Objects.isNull(srcLocateNo)) { srcLocateNo = configService.getCfgValue(org, "LGORT"); + + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean); + + MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + if (version != null) { + srcLocateNo = version.getShipInventoryPoint(); + } } if (model.getOptType() != 2) { //移库 @@ -425,7 +433,17 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService //移库 if (model.getOptType() != 2) { - MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); + String srcLocateNo = configService.getCfgValue(org, "LGORT"); + + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean); + + MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + if (version != null) { + srcLocateNo = version.getShipInventoryPoint(); + } + + MesMove move = createMove(model, srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); moveRepository.save(move); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java index 1ea2a41..a4b4fe8 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java @@ -370,8 +370,17 @@ public class MesNcProcessingService implements IMesNcProcessingService { partInspectionRepository.save(model.getPartInspection()); + String target = configService.getCfgValue(org, "LGORT"); + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); + DdlPreparedPack.getStringEqualPack(model.getPart().getPartNo(), "partNo", ddlPackBean); + + MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + if (version != null) { + target = version.getShipInventoryPoint(); + } + //移库 转正常、放行:8000移至2000 - MesMove move = createMove(model, sourceValue, configService.getCfgValue(org, "LGORT"), org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); + MesMove move = createMove(model, sourceValue, target, org, null == sn ? workCenterCode : sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); ConvertBean.serviceModelInitialize(move,model.getUserName()); moveRepository.save(move); From 893f30728400786785ced39dbf5c86ad37b4e550 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Tue, 8 Oct 2024 22:43:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B7=A5=E6=AD=A5=EF=BC=8C=20=E4=BF=AE=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/MesWorkOrderSaveStepService.java | 59 +++++++++++----------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java index 49c4584..b638607 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java @@ -138,8 +138,6 @@ public class MesWorkOrderSaveStepService extends BaseStepService { reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(workOrder), calcCompleteQty, prodResult); - entityManager.detach(workOrder); - //工单状态分 排序工单 和非排序工单; 现在必须是非排序工单 if (!MesExtEnumUtil.ORDER_STATUS.checkAllowStatus(workCenter.getCenterType(), workOrder.getWorkOrderStatus())) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("请检查工单信息,加工单[%s]信息工单状态[%s]!", entry.getKey(), MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus()))); @@ -147,17 +145,16 @@ public class MesWorkOrderSaveStepService extends BaseStepService { if (!workOrder.getWorkCenterCode().equals(reqBean.getWorkCenterCode())) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("请检查工单信息,加工单[%s]信息所属生产线[%s]与当前生产线[%s]不一致!", entry.getKey(), workOrder.getWorkCenterCode(), reqBean.getWorkCenterCode())); - List propertyNameList = new ArrayList<>(); + Map propertyMap = new HashMap<>(); + //修改完成数量 if (calcCompleteQty.compareTo(MesPcnExtConstWords.ZERO) > 0) { - workOrder.setCompleteQty(MathOperation.add(workOrder.getCompleteQty(), calcCompleteQty)); - propertyNameList.add("completeQty"); + propertyMap.put(MesPcnExtConstWords.COMPLATED_QTY, MathOperation.add(workOrder.getCompleteQty(), calcCompleteQty)); } //修改未完成数量 if (calcCompleteQty.compareTo(MesPcnExtConstWords.ZERO) > 0 && workOrder.getUnCompleteQty().compareTo(new Double(0)) > 0 && MathOperation.compareTo(MathOperation.sub(workOrder.getUnCompleteQty(), new Double(calcCompleteQty)), new Double(0)) >= 0) { - workOrder.setUnCompleteQty(MathOperation.sub(workOrder.getUnCompleteQty(), new Double(calcCompleteQty))); - propertyNameList.add("unCompleteQty"); + propertyMap.put("unCompleteQty", MathOperation.sub(workOrder.getUnCompleteQty(), new Double(calcCompleteQty))); } /** @@ -167,42 +164,44 @@ public class MesWorkOrderSaveStepService extends BaseStepService { * 上下文中 已经按照工单分组了,因为有一模多腔问题 */ - if (!StringUtils.isEmpty(prodResult)) { //可疑品 - boolean isSuspicious = MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue() == Integer.parseInt(prodResult); - if (isSuspicious && !productionPsOutContextList.isEmpty()){ - int suspiciousQty = productionPsOutContextList.size(); - workOrder.setSuspiciousPartQty(MathOperation.add(workOrder.getSuspiciousPartQty(), new Double(suspiciousQty))); - propertyNameList.add("suspiciousPartQty"); + if (Integer.valueOf(prodResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ + propertyMap.put("suspiciousPartQty", MathOperation.add(workOrder.getSuspiciousPartQty(), new Double(productionPsOutContextList.size()))); } //报废数量 - boolean isScrap = MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue() == Integer.parseInt(prodResult); - if (isScrap && !productionPsOutContextList.isEmpty()){ - int scrapQty = productionPsOutContextList.size(); - workOrder.setScrapPartQty(MathOperation.add(workOrder.getScrapPartQty(), new Double(scrapQty))); - propertyNameList.add("scrapPartQty"); + if (Integer.valueOf(prodResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ + propertyMap.put("scrapPartQty", MathOperation.add(workOrder.getScrapPartQty(), new Double(productionPsOutContextList.size()))); } } if (MathOperation.compareTo(workOrder.getCompleteQty(), workOrder.getQty()) >= 0 && workOrder.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue()) != 0) { - workOrder.setWorkOrderStatus(MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue()); - propertyNameList.add("workOrderStatus"); + propertyMap.put("workOrderStatus", MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue()); } else if (workOrder.getCompleteQty() > 0 && workOrder.getWorkOrderStatus() == MesExtEnumUtil.ORDER_STATUS.RELEASE.getValue()) { - workOrder.setWorkOrderStatus(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()); - propertyNameList.add("workOrderStatus"); + propertyMap.put("workOrderStatus", MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()); } - //如果数量都没有修改,不操作数据库 - if (!propertyNameList.isEmpty()) { - ConvertBean.serviceModelUpdate(workOrder, reqBean.getUserInfo()); - workOrder.setModifyDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new Date())); - workOrderExtService.update(workOrder); - log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:{}", - reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), - StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(workOrder)); + if (CollectionUtils.isEmpty(propertyMap)) continue; + + propertyMap.put(MesPcnExtConstWords.MODIFY_DATE_TIME, (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new Date())); + propertyMap.put(MesPcnExtConstWords.MODIFY_USER, reqBean.getUserInfo()); + String[] propertyName = new String[propertyMap.size()]; + Object[] propertyValue = new Object[propertyMap.size()]; + + Integer index = 0; + for (Map.Entry innerEntry : propertyMap.entrySet()) { + if (null == innerEntry) continue; + propertyName[index] = innerEntry.getKey(); + propertyValue[index] = innerEntry.getValue(); + index ++; } + + workOrderRepository.updateByProperties(new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{workOrder.getId(), reqBean.getOrganizeCode()}, propertyName, propertyValue); + + log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:{}", + reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), + StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(propertyMap)); } } From 23b774af3aca2a70bca5f30e020684b2edfdea4a Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 9 Oct 2024 10:55:50 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B7=A5=E6=AD=A5=20=E4=BF=AE=E6=94=B9=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java index b638607..52e7066 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveStepService.java @@ -149,7 +149,7 @@ public class MesWorkOrderSaveStepService extends BaseStepService { //修改完成数量 if (calcCompleteQty.compareTo(MesPcnExtConstWords.ZERO) > 0) { - propertyMap.put(MesPcnExtConstWords.COMPLATED_QTY, MathOperation.add(workOrder.getCompleteQty(), calcCompleteQty)); + propertyMap.put("completeQty", MathOperation.add(workOrder.getCompleteQty(), calcCompleteQty)); } //修改未完成数量 if (calcCompleteQty.compareTo(MesPcnExtConstWords.ZERO) > 0 && workOrder.getUnCompleteQty().compareTo(new Double(0)) > 0 && From 8930187f6f83499eb30ec0144e02d01718589634 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 9 Oct 2024 12:52:50 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesInputDefectRecordService.java | 17 ++++++++--------- .../serviceimpl/busi/MesProduceSnExtService.java | 6 ++++-- .../step/MesProductResultErrorHandleStepService.java | 2 ++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index d364dba..fd07b33 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -683,10 +683,10 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService * @return */ private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org, String workCenterCode) { + if (StringUtils.isEmpty(model.getUserInfo())) model.setUserInfo("系统"); GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); serialNoModel.setPartNo(model.getPart().getPartNo()); -// ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1); - ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, "系统", org, 1); + ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getUserInfo(), org, 1); String zrsum = ""; if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) { zrsum = (rb.getResultList().get(0)).toString(); @@ -707,8 +707,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue()); move.setProductSn(model.getSn()); move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode)); -// ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName()); - ConvertBean.serviceModelInitialize(move, "系统"); + ConvertBean.serviceModelInitialize(move, model.getUserInfo()); return move; } @@ -894,7 +893,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService public void saveSusPartInspection(MesPartInspectionInputModel model, String org) { MesPartInspection partInspection = new MesPartInspection(); - BeanUtils.copyProperties(model, partInspection); + BeanUtils.copyProperties(model, partInspection, "id"); partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()); partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue()); partInspection.setOrganizeCode(org); @@ -908,8 +907,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspection.setDefectTypeCode(defectType.getDefectTypeCode()); partInspection.setDefectTypeId(defectType.getId()); - - partInspectionRepository.save(partInspection); + ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo()); + partInspection = partInspectionRepository.insert(partInspection); log.info("生成的缺陷记录id ={}", partInspection); MesPartInspectionDetail detail = new MesPartInspectionDetail(); @@ -923,7 +922,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setDefectTypeName(defectType.getDefectTypeName()); detail.setId(null); detail.setOrganizeCode(org); - ConvertBean.serviceModelInitialize(detail, "系统"); + ConvertBean.serviceModelInitialize(detail, model.getUserInfo()); partInspectionDetailRepository.insert(detail); // String source = configService.getCfgValue(org, "LGORT"); @@ -945,7 +944,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } } MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org, model.getWorkCenterCode()); - moveRepository.save(move); + moveRepository.insert(move); } @ApiOperation(value = "客退品查询") diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java index 3b8585a..54b0c70 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java @@ -123,10 +123,12 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { @Override public void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List idList) { - + idList = CollectionUtils.isEmpty(idList) ? idList : idList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); + if (CollectionUtils.isEmpty(idList)) return; DdlPackBean packBean = new DdlPackBean(); DdlPreparedPack.getStringEqualPack(reqBean.getOrganizeCode(), MesPcnExtConstWords.ORGANIZE_CODE, packBean); - DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); + if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean); + else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); produceSnRepository.updateByProperties( new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.WORK_CELL_CODE, MesPcnExtConstWords.SN_STATUS}, new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), snStatus}, diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java index af34618..d49cf0c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java @@ -157,6 +157,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { model.setPart(mesPartSap); model.setPartInspectionDetailList(Arrays.asList(mesPartInspectionDetail)); if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) { + //TODO 有问题 需要修改条码质量状态 ncProcessingService.saveNc(model, reqBean.getOrganizeCode(), true); } else { MesPartInspectionInputModel inspectModel = new MesPartInspectionInputModel(); @@ -169,6 +170,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { inspectModel.setPartInspection(partInspection); inspectModel.setShiftCode(mesProduceSn.getShiftCode()); inspectModel.setProductVersion(productVersion); + inspectModel.setUserInfo(reqBean.getUserInfo()); inputDefectRecordService.saveSusPartInspection(inspectModel, reqBean.getOrganizeCode()); }