|
|
@ -1,5 +1,6 @@
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
|
|
|
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.IMesConfigService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesInputDefectRecordService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesInputDefectRecordService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnExtService;
|
|
|
@ -52,6 +53,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
private MesProduceSnRepository produceSnRepository;
|
|
|
|
private MesProduceSnRepository produceSnRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesProdOrgExtService prodOrgExtService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private MesPartRepository partRepository;
|
|
|
|
private MesPartRepository partRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -202,6 +206,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void savePartInspection(MesPartInspectionInputModel model, String org) {
|
|
|
|
public void savePartInspection(MesPartInspectionInputModel model, String org) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
|
|
|
|
//零件检测详情为空,则代表本次校验为合格。
|
|
|
|
//零件检测详情为空,则代表本次校验为合格。
|
|
|
|
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
|
|
|
|
if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) {
|
|
|
@ -210,7 +215,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
|
|
if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
if (model.isTransferFlg() && model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
//移库
|
|
|
|
//移库
|
|
|
|
MesMove move = createMove(model,getDestLocateNo(model, org),configService.getCfgValue(org, "LGORT"), org);
|
|
|
|
MesMove move = createMove(model,getDestLocateNo(model, org),configService.getCfgValue(org, "LGORT"), org, produceSn.getWorkCenterCode());
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -223,7 +228,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
partInspectionRepository.save(partInspection);
|
|
|
|
partInspectionRepository.save(partInspection);
|
|
|
|
|
|
|
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
@ -270,7 +275,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
|
|
|
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
@ -285,7 +289,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//移库
|
|
|
|
//移库
|
|
|
|
MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org);
|
|
|
|
MesMove move = createMove(model,srcLocate,configService.getCfgValue(org, "LGORT"), org, produceSn.getWorkCenterCode());
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -330,7 +334,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
String srcLocateNo = null;
|
|
|
|
String srcLocateNo = null;
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
@ -341,7 +344,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
srcLocateNo = configService.getCfgValue(org, "LGORT");
|
|
|
|
srcLocateNo = configService.getCfgValue(org, "LGORT");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//移库
|
|
|
|
//移库
|
|
|
|
MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org);
|
|
|
|
MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org, produceSn.getWorkCenterCode());
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -380,7 +383,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
@ -390,7 +392,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
|
|
|
|
|
|
|
|
//移库
|
|
|
|
//移库
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org);
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org, produceSn.getWorkCenterCode());
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -604,7 +606,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
* @param org
|
|
|
|
* @param org
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org) {
|
|
|
|
private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org, String workCenterCode) {
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM");
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
serialNoModel.setPartNo(model.getPart().getPartNo());
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
|
|
|
|
ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1);
|
|
|
@ -627,6 +629,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
move.setPartInspectionId(Objects.isNull(model.getPartInspection()) ? 0 : model.getPartInspection().getId());
|
|
|
|
move.setPartInspectionId(Objects.isNull(model.getPartInspection()) ? 0 : model.getPartInspection().getId());
|
|
|
|
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue());
|
|
|
|
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue());
|
|
|
|
move.setProductSn(model.getSn());
|
|
|
|
move.setProductSn(model.getSn());
|
|
|
|
|
|
|
|
move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode));
|
|
|
|
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName());
|
|
|
|
return move;
|
|
|
|
return move;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -816,7 +819,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void saveSusPartInspection(MesPartInspectionInputModel model, String org) {
|
|
|
|
public void saveSusPartInspection(MesPartInspectionInputModel model, String org) {
|
|
|
|
//
|
|
|
|
|
|
|
|
MesPartInspection partInspection = new MesPartInspection();
|
|
|
|
MesPartInspection partInspection = new MesPartInspection();
|
|
|
|
BeanUtils.copyProperties(model, partInspection);
|
|
|
|
BeanUtils.copyProperties(model, partInspection);
|
|
|
|
partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
|
|
|
|
partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.QUALIFIED.getValue());
|
|
|
@ -842,7 +845,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
source = version.getShipInventoryPoint();
|
|
|
|
source = version.getShipInventoryPoint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org);
|
|
|
|
MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org, model.getWorkCenterCode());
|
|
|
|
moveRepository.save(move);
|
|
|
|
moveRepository.save(move);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|