|
|
|
@ -19,6 +19,7 @@ import cn.estsh.i3plus.pojo.mes.bean.rework.MesReworkTask;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
@ -211,7 +212,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnRepository.save(produceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -221,7 +222,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
//原单据不合格 现合格
|
|
|
|
|
if (model.getPartInspection().getInspectionStatus() == MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()) {
|
|
|
|
|
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), "LML");
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
//查询当前单据明细
|
|
|
|
@ -231,7 +232,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
k.setId(null);
|
|
|
|
|
k.setOrganizeCode(org);
|
|
|
|
|
k.setPid(model.getPartInspection().getId());
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
});
|
|
|
|
|
partInspectionDetailRepository.saveAll(resultDetailList);
|
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
@ -239,7 +240,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnRepository.save(produceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -262,7 +263,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
model.getPartInspectionDetailList().forEach(k -> {
|
|
|
|
|
k.setOrganizeCode(org);
|
|
|
|
|
k.setPid(partInspection.getId());
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
@ -270,7 +271,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnRepository.save(produceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -281,7 +282,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), "LML");
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
//查询当前单据明细
|
|
|
|
@ -291,13 +292,13 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
k.setId(null);
|
|
|
|
|
k.setOrganizeCode(org);
|
|
|
|
|
k.setPid(model.getPartInspection().getId());
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(k, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnRepository.save(produceSn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -372,7 +373,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
List<MesPartInspectionDetail> resultDetailList = partInspectionDetailRepository.findByHqlWhere(packBean);
|
|
|
|
|
resultDetailList.forEach(k -> {
|
|
|
|
|
k.setIsDeleted(MesCommonConstant.TRUE_INTEGER);
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), "LML");
|
|
|
|
|
ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return resultDetailList;
|
|
|
|
@ -489,7 +490,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
partInspection.setQty(model.getQty());
|
|
|
|
|
partInspection.setWorkCenterCode(model.getWorkCenterCode());
|
|
|
|
|
partInspection.setSourceType(model.getSourceType());
|
|
|
|
|
ConvertBean.serviceModelInitialize(partInspection, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(partInspection, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
return partInspection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -505,7 +506,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org) {
|
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, "LML", org, 1);
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
|
|
|
|
|
String zrsum = "";
|
|
|
|
|
if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) {
|
|
|
|
|
zrsum = (rb.getResultList().get(0)).toString();
|
|
|
|
@ -522,7 +523,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
move.setZrsum(zrsum);
|
|
|
|
|
move.setPostDate(TimeTool.getToday());
|
|
|
|
|
move.setPostTime(TimeTool.getTimeShortWithColon());
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, "LML");
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
return move;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|