|
|
|
@ -24,7 +24,6 @@ import cn.estsh.i3plus.pojo.mes.bean.rework.MesReworkTaskDetail;
|
|
|
|
|
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.util.ResultBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -327,7 +326,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnRepository.save(sn);
|
|
|
|
|
|
|
|
|
|
//更新检验单
|
|
|
|
@ -336,7 +335,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
}
|
|
|
|
|
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
|
|
|
|
|
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.NORMAL.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
@ -350,7 +349,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
//生成返工单 根据责任方库区对应关系,选择哪个责任方,就移动到哪个库区(8000移至8002/8003);
|
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("NC_REWORK");
|
|
|
|
|
serialNoModel.setPartNo(part.getPartNo());
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1);
|
|
|
|
|
String rework = "";
|
|
|
|
|
if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) {
|
|
|
|
|
rework = (rb.getResultList().get(0)).toString();
|
|
|
|
@ -365,7 +364,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
reworkTask.setPartInspectionId(model.getPartInspection().getId());
|
|
|
|
|
reworkTask.setOrganizeCode(org);
|
|
|
|
|
reworkTask.setType(model.getPartInspection().getSourceType());
|
|
|
|
|
ConvertBean.serviceModelInitialize(reworkTask, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelInitialize(reworkTask, model.getPartInspection().getModifyUser());
|
|
|
|
|
reworkTaskRepository.save(reworkTask);
|
|
|
|
|
|
|
|
|
|
//生成返工单明细
|
|
|
|
@ -377,7 +376,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
taskDetail.setStatus(MesExtEnumUtil.REWORK_TASK_DETAIL_STATUS.REWORK_TASK_DETAIL_STATUS_10.getValue());
|
|
|
|
|
taskDetail.setPartInspectionDetailId(detail.getId());
|
|
|
|
|
taskDetail.setOrganizeCode(org);
|
|
|
|
|
ConvertBean.serviceModelInitialize(taskDetail, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelInitialize(taskDetail, model.getPartInspection().getModifyUser());
|
|
|
|
|
taskDetailList.add(taskDetail);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -397,14 +396,14 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnRepository.save(sn);
|
|
|
|
|
|
|
|
|
|
//更新检验单
|
|
|
|
|
model.getPartInspection().setDefectTypeId(person.getId());
|
|
|
|
|
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue());
|
|
|
|
|
model.getPartInspection().setRejectQty(model.getPartInspection().getQty());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
//移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003)
|
|
|
|
@ -417,7 +416,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnRepository.save(sn);
|
|
|
|
|
|
|
|
|
|
//更新检验单
|
|
|
|
@ -426,7 +425,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
}
|
|
|
|
|
model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
|
|
|
|
|
model.getPartInspection().setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.RELEASE.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -457,7 +456,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org,MesExtEnumUtil.MOVE_TYPE moveType) {
|
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1);
|
|
|
|
|
String zrsum = "";
|
|
|
|
|
if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) {
|
|
|
|
|
zrsum = (rb.getResultList().get(0)).toString();
|
|
|
|
@ -477,7 +476,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
move.setMoveType(moveType.getValue());
|
|
|
|
|
move.setPartInspectionId(model.getPartInspection().getId());
|
|
|
|
|
move.setProductSn(model.getSn());
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, model.getPartInspection().getModifyUser());
|
|
|
|
|
return move;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|