From 529efb5ea0e4f6eaf8a09030007c4a2f80afb076 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Sat, 19 Apr 2025 13:42:07 +0800 Subject: [PATCH] =?UTF-8?q?45858=20MES=EF=BC=9A=E7=94=B5=E5=AD=90=E5=8C=96?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=88=9D=E5=88=A4=E5=92=8C=E7=BB=88=E5=88=A4?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/MesNcProcessingService.java | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) 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 064907f..b219e37 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 @@ -751,7 +751,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { } //移库 转正常、放行:8000移至2000 - MesMove move = createMove(model, sourceValue, target, org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); + MesMove move = createLotMove(model,mesNcPersonModel.getQty(), sourceValue, target, org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); ConvertBean.serviceModelInitialize(move, model.getUserName()); moveRepository.save(move); } @@ -824,7 +824,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { } //partInspectionRepository.save(model.getPartInspection()); - MesMove move = createMove(model, sourceValue, mesNcPersonModel.getInventoryLocationCode(), org,workCenterCode, MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE); + MesMove move = createLotMove(model,mesNcPersonModel.getQty(), sourceValue, mesNcPersonModel.getInventoryLocationCode(), org,workCenterCode, MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE); ConvertBean.serviceModelInitialize(move, model.getUserName()); moveRepository.save(move); @@ -864,7 +864,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { sourceValue = refundSource; } //移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003) - MesMove move = createMove(model, sourceValue, mesNcPersonModel.getInventoryLocationCode(), org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); + MesMove move = createLotMove(model,mesNcPersonModel.getQty(), sourceValue, mesNcPersonModel.getInventoryLocationCode(), org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE); ConvertBean.serviceModelInitialize(move,model.getUserName()); moveRepository.save(move); } else if (type == MesExtEnumUtil.PART_INSPECTION_NC_STATUS.RELEASE.getValue()) { @@ -904,7 +904,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { target = version.getReceiveInventoryPoint(); } //移库 转正常、放行:8000移至2000 - MesMove move = createMove(model, sourceValue, target, org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); + MesMove move = createLotMove(model,mesNcPersonModel.getQty(), sourceValue, target, org, workCenterCode, MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE); ConvertBean.serviceModelInitialize(move, model.getUserName()); moveRepository.save(move); @@ -1009,6 +1009,33 @@ public class MesNcProcessingService implements IMesNcProcessingService { return move; } + private MesMove createLotMove(MesNcProcessingInputModel model,double qty, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType) { + GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); + serialNoModel.setPartNo(model.getPart().getPartNo()); + ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1); + String zrsum = ""; + if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) { + zrsum = (rb.getResultList().get(0)).toString(); + } + + MesMove move = new MesMove(); + move.setMatnr(model.getPart().getPartNo()); + move.setOrganizeCode(org); + move.setFactoryCode(org); + move.setLgort(source); + move.setUmlgo(target); + move.setMenge(qty); + move.setMeins(model.getPart().getUnit()); + move.setZrsum(zrsum); + move.setPostDate(TimeTool.getToday()); + move.setPostTime(TimeTool.getTimeShortWithColon()); + move.setMoveType(moveType.getValue()); + move.setPartInspectionId(model.getPartInspection().getId()); + move.setProductSn(model.getSn()); + move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode)); + return move; + } + private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType, String partNo) { GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); serialNoModel.setPartNo(partNo);