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);