diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java index abb24a5..2c09905 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java @@ -303,7 +303,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { MesPartInspection mesPartInspection = null; if (!StringUtils.isEmpty(mesReworkTask.getId())){ DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesReworkTask.getOrganizeCode()); - DdlPreparedPack.getNumEqualPack(mesReworkTask.getPartInspectionId(), "id", packBean); + DdlPreparedPack.getNumEqualPack(mesReworkTask.getId(), "reworkTaskId", packBean); mesPartInspection = mesPartInspectionRepository.getByProperty(packBean); if (!Objects.isNull(mesPartInspection)){ if(!CollectionUtils.isEmpty(requestModel.getAssemblyModelList())){ 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 1e5c81e..5b6a4fa 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 @@ -712,6 +712,8 @@ public class MesNcProcessingService implements IMesNcProcessingService { String refundSource = configService.getCfgValue(org, "REFUND"); List personList = new ArrayList<>(); + + MesPartInspection mesPartInspection = model.getPartInspection(); for (MesNcPersonModel mesNcPersonModel : model.getPersonModelList()) { Integer type = mesNcPersonModel.getNcStatus(); @@ -727,7 +729,17 @@ public class MesNcProcessingService implements IMesNcProcessingService { model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } - partInspectionRepository.save(model.getPartInspection()); + //partInspectionRepository.save(model.getPartInspection()); + + MesPartInspectionPerson mesPartInspectionPerson = new MesPartInspectionPerson(); + mesPartInspectionPerson.setQty(Double.valueOf(mesNcPersonModel.getQty())); + mesPartInspectionPerson.setNcStatus(mesNcPersonModel.getNcStatus()); + mesPartInspectionPerson.setSn(model.getPartInspection().getSn()); + mesPartInspectionPerson.setOrganizeCode(model.getOrganizeCode()); + mesPartInspectionPerson.setPid(model.getPartInspection().getId()); + ConvertBean.serviceModelInitialize(mesPartInspectionPerson, model.getUserName()); + personList.add(mesPartInspectionPerson); + String target = configService.getCfgValue(org, "LGORT"); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org); @@ -757,6 +769,8 @@ public class MesNcProcessingService implements IMesNcProcessingService { mesPartInspectionPerson.setQty(Double.valueOf(mesNcPersonModel.getQty())); mesPartInspectionPerson.setNcStatus(mesNcPersonModel.getNcStatus()); mesPartInspectionPerson.setSn(model.getPartInspection().getSn()); + mesPartInspectionPerson.setOrganizeCode(model.getOrganizeCode()); + mesPartInspectionPerson.setPid(model.getPartInspection().getId()); DdlPackBean partyPackBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(mesNcPersonModel.getOnlyPerson(), "responsibleParty", partyPackBean); @@ -767,7 +781,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { personList.add(mesPartInspectionPerson); MesReworkTask reworkTask = new MesReworkTask(); - reworkTask.setQty(model.getPartInspection().getQty()); + reworkTask.setQty(mesNcPersonModel.getQty()); reworkTask.setSn(model.getPartInspection().getSn()); reworkTask.setReworkOrder(rework); reworkTask.setStatus(MesExtEnumUtil.REWORK_TASK_STATUS.CREATE.getValue()); @@ -808,7 +822,7 @@ public class MesNcProcessingService implements IMesNcProcessingService { sourceValue = refundSource; model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } - partInspectionRepository.save(model.getPartInspection()); + //partInspectionRepository.save(model.getPartInspection()); MesMove move = createMove(model, sourceValue, mesNcPersonModel.getInventoryLocationCode(), org,workCenterCode, MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE); ConvertBean.serviceModelInitialize(move, model.getUserName()); @@ -826,12 +840,14 @@ public class MesNcProcessingService implements IMesNcProcessingService { model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } - partInspectionRepository.save(model.getPartInspection()); + //partInspectionRepository.save(model.getPartInspection()); MesPartInspectionPerson mesPartInspectionPerson = new MesPartInspectionPerson(); mesPartInspectionPerson.setQty(Double.valueOf(mesNcPersonModel.getQty())); mesPartInspectionPerson.setNcStatus(mesNcPersonModel.getNcStatus()); mesPartInspectionPerson.setSn(model.getPartInspection().getSn()); + mesPartInspectionPerson.setOrganizeCode(model.getOrganizeCode()); + mesPartInspectionPerson.setPid(model.getPartInspection().getId()); DdlPackBean partyPackBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(mesNcPersonModel.getOnlyPerson(), "responsibleParty", partyPackBean); @@ -863,7 +879,19 @@ public class MesNcProcessingService implements IMesNcProcessingService { sourceValue = refundSource; model.getPartInspection().setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); } - partInspectionRepository.save(model.getPartInspection()); + //partInspectionRepository.save(model.getPartInspection()); + + + MesPartInspectionPerson mesPartInspectionPerson = new MesPartInspectionPerson(); + mesPartInspectionPerson.setQty(Double.valueOf(mesNcPersonModel.getQty())); + mesPartInspectionPerson.setNcStatus(mesNcPersonModel.getNcStatus()); + mesPartInspectionPerson.setSn(model.getPartInspection().getSn()); + mesPartInspectionPerson.setOrganizeCode(model.getOrganizeCode()); + mesPartInspectionPerson.setPid(model.getPartInspection().getId()); + + ConvertBean.serviceModelInitialize(mesPartInspectionPerson, model.getUserName()); + personList.add(mesPartInspectionPerson); + String target = configService.getCfgValue(org, "LGORT"); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); @@ -880,6 +908,9 @@ public class MesNcProcessingService implements IMesNcProcessingService { } } + mesPartInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SUCCESS.getValue()); + ConvertBean.serviceModelUpdate(mesPartInspection, model.getUserName()); + partInspectionRepository.save(mesPartInspection); mesPartInspectionPersonRepository.saveAll(personList); }