|
|
|
@ -98,7 +98,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
//检查物料
|
|
|
|
|
MesPart part;
|
|
|
|
|
//获取NC-零件检测-单据
|
|
|
|
|
MesPartInspection partInspection;
|
|
|
|
|
MesPartInspection partInspection = null;
|
|
|
|
|
Integer sourceType = null;
|
|
|
|
|
if (!StringUtils.isEmpty(inputModel.getSn())) {
|
|
|
|
|
// 数据校验
|
|
|
|
@ -125,7 +125,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
part = checkPartByPartNo(inputModel.getPartNo(), org);
|
|
|
|
|
|
|
|
|
|
//获取NC-零件检测-单据
|
|
|
|
|
partInspection = getPartInspectionByPartAndLot(inputModel, org);
|
|
|
|
|
if(!Objects.isNull(inputModel.getId())){
|
|
|
|
|
partInspection = getPartInspectionByPartAndLot(inputModel, org);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceType = MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.LOT.getValue();
|
|
|
|
|
}
|
|
|
|
@ -332,16 +334,21 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
|
|
|
|
|
partInspectionDetailRepository.saveAll(model.getPartInspectionDetailList());
|
|
|
|
|
|
|
|
|
|
String srcLocateNo = null;
|
|
|
|
|
//若是扫描条码 则判定条码可疑
|
|
|
|
|
if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
MesProduceSn produceSn = checkProduceSn(model.getSn(), org);
|
|
|
|
|
produceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue());
|
|
|
|
|
ConvertBean.serviceModelInitialize(produceSn, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
produceSnExtService.update(produceSn);
|
|
|
|
|
//查询条码所在库位
|
|
|
|
|
srcLocateNo = getDestLocateNo(model, org);
|
|
|
|
|
}
|
|
|
|
|
if (Objects.isNull(srcLocateNo)) {
|
|
|
|
|
srcLocateNo = configService.getCfgValue(org, "LGORT");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//移库
|
|
|
|
|
MesMove move = createMove(model, configService.getCfgValue(org, "LGORT"), configService.getCfgValue(org, "UMLGO"), org);
|
|
|
|
|
MesMove move = createMove(model,srcLocateNo, configService.getCfgValue(org, "UMLGO"), org);
|
|
|
|
|
moveRepository.save(move);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
@ -399,12 +406,19 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getDestLocateNo(MesPartInspectionInputModel model, String org) {
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(model.getSn(), "productSn", packBean);
|
|
|
|
|
DdlPreparedPack.getOrderBy(null, null, packBean);
|
|
|
|
|
MesMove mesMove = moveRepository.getByProperty(packBean);
|
|
|
|
|
return Objects.isNull(mesMove) ? null : mesMove.getUmlgo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
return moveRepository.getByProperty(packBean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -438,6 +452,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
private MesPartInspection getPartInspectionByPartAndLot(MesPartInspectionInputModel inputModel, String org) {
|
|
|
|
|
//根据扫描的条码查询条码是否存在
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(inputModel.getId(), "id", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getPartNo(), "partNo", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(inputModel.getLotNo(), "lotNo", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(inputModel.getQty().intValue(), "qty", packBean);
|
|
|
|
|