问题清单问题修复

tags/yfai-pcn-ext-v1.0
jun 11 months ago
parent f5f4560de2
commit aa907b8fe5

@ -85,8 +85,10 @@ public class MesNcProcessingController {
// 数据校验
ValidatorBean.checkNotNull(model.getPartInspection(), "单据不能为空");
ValidatorBean.checkNotNull(model.getPartInspectionDetailList(), "单据明细不能为空");
if (model.getType() != 10 && model.getType() != 40) {
if (model.getType() == MesExtEnumUtil.NC_TYPE.REWORK.getValue()
|| model.getType() == MesExtEnumUtil.NC_TYPE.SCRAP.getValue()) {
ValidatorBean.checkNotNull(model.getPerson(), "责任人不能为空");
ValidatorBean.checkNotNull(model.getInventoryLocationCode(), "区域代码不能为空");
}
String description = MesExtEnumUtil.NC_TYPE.valueOfDescription(model.getType());

@ -32,10 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -203,9 +200,17 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
MesPartInspection partInspection;
//返工单返修完成,需可疑品移正常库
if (model.isTransferFlg()) {
String srcLocate = configService.getCfgValue(org, "UMLGO");
if(!Objects.isNull(model.getPartInspection())){
MesMove mesMove = getMesMove(model, org);
if(!Objects.isNull(mesMove)){
srcLocate = mesMove.getUmlgo();
}
}
//移库
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org);
MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org);
moveRepository.save(move);
}
@ -270,9 +275,17 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
produceSnRepository.save(produceSn);
}
//移库
String srcLocate;
MesMove mesMove = getMesMove(model, org);
if(!Objects.isNull(mesMove)){
srcLocate = mesMove.getUmlgo();
}else{
srcLocate= configService.getCfgValue(org, "UMLGO");
}
//移库
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org);
MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org);
moveRepository.save(move);
}
}
@ -285,7 +298,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
if (StringUtils.isEmpty(model.getPartInspection())) {
partInspection = createPartInspection(model, MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), org);
partInspectionRepository.save(partInspection);
model.setPartInspection(partInspectionRepository.save(partInspection));
List<String> defectTypeNoExitList = new ArrayList<>();
for (MesPartInspectionDetail detail : model.getPartInspectionDetailList()) {
@ -381,6 +394,14 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
}
}
private MesMove getMesMove(MesPartInspectionInputModel model, String org) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getNumEqualPack(model.getPartInspection().getId(),"partInspectionId",packBean);
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE.getValue(),"moveType",packBean);
MesMove mesMove = moveRepository.getByProperty(packBean);
return mesMove;
}
/**
* NC--
*
@ -590,6 +611,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
move.setZrsum(zrsum);
move.setPostDate(TimeTool.getToday());
move.setPostTime(TimeTool.getTimeShortWithColon());
move.setPartInspectionId(model.getPartInspection().getId());
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue());
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
return move;

@ -476,6 +476,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
move.setPostDate(TimeTool.getToday());
move.setPostTime(TimeTool.getTimeShortWithColon());
move.setMoveType(moveType.getValue());
move.setPartInspectionId(model.getPartInspection().getId());
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
return move;
}

Loading…
Cancel
Save