合并 dev-temp-xw-2412201000-44315 解决冲突

tags/yfai-pcn-ext-v2.5
王杰 5 months ago
commit 7892031fa8

@ -245,7 +245,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
} }
//零件检测详情为空,则代表本次校验为合格。 //零件检测详情为空,则代表本次校验为合格。
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) { if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
MesPartInspection partInspection; MesPartInspection partInspection = null;
//返工单返修完成,需可疑品移正常库 //返工单返修完成,需可疑品移正常库
if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
@ -274,7 +274,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
if (model.getOptType() != null && model.getOptType() == 2) { if (model.getOptType() != null && model.getOptType() == 2) {
partInspection.setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); partInspection.setRefundFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
} }
partInspectionRepository.save(partInspection); partInspection = partInspectionRepository.save(partInspection);
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
checkProduceSn(produceSn, model.getSn()); checkProduceSn(produceSn, model.getSn());
@ -294,7 +294,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
} else { } else {
//原单据不合格 现合格 //原单据不合格 现合格
if (model.getPartInspection().getInspectionStatus() == MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()) { if (model.getPartInspection().getInspectionStatus() == MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()) {
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue()); model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
@ -367,7 +366,25 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
} }
} }
} }
if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
//电子化检验
String target = configService.getCfgValue(org, "LGORT");
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(model.getPartNo(), "partNo", ddlPackBean);
MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean);
if (version != null) {
target = version.getReceiveInventoryPoint();
}
log.info("partInspection={}",partInspection);
if (partInspection != null) {
model.setPartInspection(partInspection);
}
MesMove move = createMove(model, getDestLocateNo(model, org), target, org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
moveRepository.save(move);
}
} else { } else {
//零件检测详情不为空,则代表本次校验为不合格。 //零件检测详情不为空,则代表本次校验为不合格。
@ -375,6 +392,17 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
MesPartInspection partInspection; MesPartInspection partInspection;
if (StringUtils.isEmpty(model.getPartInspection())) { if (StringUtils.isEmpty(model.getPartInspection())) {
//已创建返修单
DdlPackBean reworkPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(model.getSn(), "sn", reworkPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.REWORK_TASK_STATUS.FINISH.getValue(), "status", reworkPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, reworkPackBean);
int count = reworkTaskRepository.findByHqlWhereCount(reworkPackBean);
if (count > 0) {
throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn()));
}
partInspection = createPartInspection(model, MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), org); partInspection = createPartInspection(model, MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), org);
if (model.getOptType() != null && model.getOptType() == 2) { if (model.getOptType() != null && model.getOptType() == 2) {
@ -444,12 +472,29 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
} }
if (model.getOptType() != 2) { if (model.getOptType() != 2) {
//移库 //移库
MesMove move = createMove(model, srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); //移库
String destLocateNo = getDestLocateNo(model, org);
String dest = configService.getCfgValue(org, "UMLGO");
if (!StringUtils.isEmpty(destLocateNo) && Objects.equals(dest, destLocateNo)) {
return;
}
MesMove move = createMove(model, srcLocateNo, dest, org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
moveRepository.save(move); moveRepository.save(move);
} }
} else { } else {
//已创建返修单
DdlPackBean reworkPackBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(model.getSn(), "sn", reworkPackBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.REWORK_TASK_STATUS.FINISH.getValue(), "status", reworkPackBean);
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, reworkPackBean);
int count = reworkTaskRepository.findByHqlWhereCount(reworkPackBean);
if (count > 0) {
throw new ImppBusiException(String.format("【%s】该条码需要完成质检,再重新录入电子化检验", model.getSn()));
}
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()); model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue());
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName()); ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
if (model.getOptType() != null && model.getOptType() == 2) { if (model.getOptType() != null && model.getOptType() == 2) {
@ -516,8 +561,13 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
if (version != null) { if (version != null) {
srcLocateNo = version.getReceiveInventoryPoint(); srcLocateNo = version.getReceiveInventoryPoint();
} }
//移库
MesMove move = createMove(model, srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode()); String destLocateNo = getDestLocateNo(model, org);
String dest = configService.getCfgValue(org, "UMLGO");
if (!StringUtils.isEmpty(destLocateNo) && Objects.equals(dest, destLocateNo)) {
return;
}
MesMove move = createMove(model, srcLocateNo, dest, org, null == produceSn ? model.getWorkCenterCode() : produceSn.getWorkCenterCode());
moveRepository.save(move); moveRepository.save(move);
} }

Loading…
Cancel
Save