|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNcProcessingService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
|
|
|
|
@ -50,6 +51,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProdOrgExtService prodOrgExtService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesDefectRecordRepository defectRecordRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -321,8 +325,9 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
* @param person
|
|
|
|
|
* @param org
|
|
|
|
|
*/
|
|
|
|
|
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean
|
|
|
|
|
isOrder) {
|
|
|
|
|
private void saveDate(MesNcProcessingInputModel model, MesPartSap part, Integer type, MesDefectType person, String org,String areaCode, boolean isOrder) {
|
|
|
|
|
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
|
|
String source = configService.getCfgValue(org, "LGORT");
|
|
|
|
|
if (!StringUtils.isEmpty(model.getProductVersion())) {
|
|
|
|
@ -340,7 +345,6 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
if (type == MesExtEnumUtil.NC_TYPE.NORMAL.getValue()) {
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnExtService.update(sn);
|
|
|
|
@ -356,7 +360,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org,MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.REWORK.getValue()) {
|
|
|
|
@ -406,13 +410,12 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
model.getPartInspection().setReworkTaskId(reworkTask.getId());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org,MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.SCRAP.getValue()) {
|
|
|
|
|
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnExtService.update(sn);
|
|
|
|
@ -429,11 +432,11 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
partInspectionRepository.save(model.getPartInspection());
|
|
|
|
|
if (isOrder) {
|
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org,MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "SCRAP"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
} else {
|
|
|
|
|
//移库 转报废 根据责任方库区对应关系的主数据,选择哪个责任方,就移动到哪个库区(8000移至8002/8003)
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE);
|
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "SCRAP"), org);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
}
|
|
|
|
@ -441,7 +444,6 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
} else if (type == MesExtEnumUtil.NC_TYPE.RELEASE.getValue()) {
|
|
|
|
|
|
|
|
|
|
//更新条码质量状态
|
|
|
|
|
MesProduceSn sn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
sn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(sn, model.getPartInspection().getModifyUser());
|
|
|
|
|
produceSnExtService.update(sn);
|
|
|
|
@ -458,7 +460,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
|
|
|
|
|
//移库 转正常、放行:8000移至2000
|
|
|
|
|
// MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), areaCode, org);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org,MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "UMLGO"), configService.getCfgValue(org, "LGORT"), org, sn.getWorkCenterCode(), MesExtEnumUtil.MOVE_TYPE.NORMAL_MOVE);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -480,7 +482,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
return produceSn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org,MesExtEnumUtil.MOVE_TYPE moveType) {
|
|
|
|
|
private MesMove createMove(MesNcProcessingInputModel model, String source, String target, String org, String workCenterCode, MesExtEnumUtil.MOVE_TYPE moveType) {
|
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getPartInspection().getModifyUser(), org, 1);
|
|
|
|
@ -503,6 +505,7 @@ public class MesNcProcessingService implements IMesNcProcessingService {
|
|
|
|
|
move.setMoveType(moveType.getValue());
|
|
|
|
|
move.setPartInspectionId(model.getPartInspection().getId());
|
|
|
|
|
move.setProductSn(model.getSn());
|
|
|
|
|
move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode));
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, model.getPartInspection().getModifyUser());
|
|
|
|
|
return move;
|
|
|
|
|
}
|
|
|
|
|