|
|
|
@ -1086,12 +1086,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(defectTypeCodeStr, "defectTypeCode", packBean);
|
|
|
|
|
MesDefectType defectType = defectTypeRepository.getByProperty(packBean);
|
|
|
|
|
if (null == defectType) MesPcnException.throwBusiException(String.format("未配置[%s]对应的可疑品缺陷类型!", defectTypeCodeStr));
|
|
|
|
|
|
|
|
|
|
partInspection.setDefectTypeCode(defectType.getDefectTypeCode());
|
|
|
|
|
partInspection.setDefectTypeId(defectType.getId());
|
|
|
|
|
ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo());
|
|
|
|
|
partInspection = partInspectionRepository.insert(partInspection);
|
|
|
|
|
log.info("生成的缺陷记录id ={}", partInspection);
|
|
|
|
|
|
|
|
|
|
MesPartInspectionDetail detail = new MesPartInspectionDetail();
|
|
|
|
|
|
|
|
|
@ -1106,8 +1106,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
detail.setOrganizeCode(org);
|
|
|
|
|
ConvertBean.serviceModelInitialize(detail, model.getUserInfo());
|
|
|
|
|
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();
|
|
|
|
|
// 查询生产版本
|
|
|
|
@ -1132,7 +1136,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|