Merge branch 'uat-temp-wj-2412300000-44631' into test

tags/yfai-pcn-ext-v2.75
王杰 4 months ago
commit 8566676e9e

@ -1086,12 +1086,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
DdlPreparedPack.getStringEqualPack(defectTypeCodeStr, "defectTypeCode", packBean); DdlPreparedPack.getStringEqualPack(defectTypeCodeStr, "defectTypeCode", packBean);
MesDefectType defectType = defectTypeRepository.getByProperty(packBean); MesDefectType defectType = defectTypeRepository.getByProperty(packBean);
if (null == defectType) MesPcnException.throwBusiException(String.format("未配置[%s]对应的可疑品缺陷类型!", defectTypeCodeStr));
partInspection.setDefectTypeCode(defectType.getDefectTypeCode()); partInspection.setDefectTypeCode(defectType.getDefectTypeCode());
partInspection.setDefectTypeId(defectType.getId()); partInspection.setDefectTypeId(defectType.getId());
ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo()); ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo());
partInspection = partInspectionRepository.insert(partInspection); partInspection = partInspectionRepository.insert(partInspection);
log.info("生成的缺陷记录id ={}", partInspection);
MesPartInspectionDetail detail = new MesPartInspectionDetail(); MesPartInspectionDetail detail = new MesPartInspectionDetail();
@ -1106,8 +1106,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
detail.setOrganizeCode(org); detail.setOrganizeCode(org);
ConvertBean.serviceModelInitialize(detail, model.getUserInfo()); ConvertBean.serviceModelInitialize(detail, model.getUserInfo());
partInspectionDetailRepository.insert(detail); partInspectionDetailRepository.insert(detail);
// //查询来源/目标库位
String source = configService.getCfgValue(org, "LGORT"); MesConfig sourceCfg = configService.getMesConfigNoError(org, "LGORT");
MesConfig targetCfg = configService.getMesConfigNoError(org, "UMLGO");
String source = (null != sourceCfg && !StringUtils.isEmpty(sourceCfg.getCfgValue())) ? sourceCfg.getCfgValue() : null;
String target = (null != targetCfg && !StringUtils.isEmpty(targetCfg.getCfgValue())) ? targetCfg.getCfgValue() : null;
if (StringUtils.isEmpty(target)) MesPcnException.throwBusiException(String.format("系统配置缺失目标库位配置[%s]!", "UMLGO"));
//移库 //移库
String partNo = model.getPartNo(); String partNo = model.getPartNo();
// 查询生产版本 // 查询生产版本
@ -1132,7 +1136,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
if (null != workCenter && !StringUtils.isEmpty(workCenter.getRawLocate())) source = workCenter.getRawLocate(); if (null != workCenter && !StringUtils.isEmpty(workCenter.getRawLocate())) source = workCenter.getRawLocate();
} }
MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org, model.getWorkCenterCode()); if (StringUtils.isEmpty(source)) MesPcnException.throwBusiException("未找到来源库位!");
MesMove move = createMove(model, source, target, org, model.getWorkCenterCode());
moveRepository.insert(move); moveRepository.insert(move);
} }

Loading…
Cancel
Save