|
|
|
@ -248,7 +248,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
MesPartInspection partInspection = null;
|
|
|
|
|
//返工单返修完成,需可疑品移正常库
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断首次合格还是 多次检验最终为合格品
|
|
|
|
|
//若返修单返修完成,则会生成一个新的检验单并合格
|
|
|
|
|
//若检验单为空,则生成新的单据并合格
|
|
|
|
@ -376,16 +375,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);
|
|
|
|
|
|
|
|
|
@ -426,6 +415,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());
|
|
|
|
@ -468,16 +468,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());
|
|
|
|
@ -517,6 +508,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());
|
|
|
|
|