|
|
|
@ -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;
|
|
|
|
|