|
|
|
@ -392,16 +392,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
MesPartInspection partInspection;
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
@ -442,6 +432,17 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
String srcLocateNo = null;
|
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
//已创建返修单
|
|
|
|
|
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()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkProduceSn(produceSn, model.getSn());
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
@ -484,16 +485,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
} 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());
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
|
|
|
|
@ -533,6 +525,18 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
|
|
|
|
|
//已创建返修单
|
|
|
|
|
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()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkProduceSn(produceSn, model.getSn());
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|