diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index d364dba..fd07b33 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -683,10 +683,10 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService * @return */ private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org, String workCenterCode) { + if (StringUtils.isEmpty(model.getUserInfo())) model.setUserInfo("系统"); GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); serialNoModel.setPartNo(model.getPart().getPartNo()); -// ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1); - ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, "系统", org, 1); + ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, model.getUserInfo(), org, 1); String zrsum = ""; if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) { zrsum = (rb.getResultList().get(0)).toString(); @@ -707,8 +707,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue()); move.setProductSn(model.getSn()); move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode)); -// ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName()); - ConvertBean.serviceModelInitialize(move, "系统"); + ConvertBean.serviceModelInitialize(move, model.getUserInfo()); return move; } @@ -894,7 +893,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService public void saveSusPartInspection(MesPartInspectionInputModel model, String org) { MesPartInspection partInspection = new MesPartInspection(); - BeanUtils.copyProperties(model, partInspection); + BeanUtils.copyProperties(model, partInspection, "id"); partInspection.setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()); partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue()); partInspection.setOrganizeCode(org); @@ -908,8 +907,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspection.setDefectTypeCode(defectType.getDefectTypeCode()); partInspection.setDefectTypeId(defectType.getId()); - - partInspectionRepository.save(partInspection); + ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo()); + partInspection = partInspectionRepository.insert(partInspection); log.info("生成的缺陷记录id ={}", partInspection); MesPartInspectionDetail detail = new MesPartInspectionDetail(); @@ -923,7 +922,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setDefectTypeName(defectType.getDefectTypeName()); detail.setId(null); detail.setOrganizeCode(org); - ConvertBean.serviceModelInitialize(detail, "系统"); + ConvertBean.serviceModelInitialize(detail, model.getUserInfo()); partInspectionDetailRepository.insert(detail); // String source = configService.getCfgValue(org, "LGORT"); @@ -945,7 +944,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } } MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org, model.getWorkCenterCode()); - moveRepository.save(move); + moveRepository.insert(move); } @ApiOperation(value = "客退品查询") diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java index 3b8585a..54b0c70 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java @@ -123,10 +123,12 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { @Override public void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List idList) { - + idList = CollectionUtils.isEmpty(idList) ? idList : idList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); + if (CollectionUtils.isEmpty(idList)) return; DdlPackBean packBean = new DdlPackBean(); DdlPreparedPack.getStringEqualPack(reqBean.getOrganizeCode(), MesPcnExtConstWords.ORGANIZE_CODE, packBean); - DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); + if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean); + else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); produceSnRepository.updateByProperties( new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.WORK_CELL_CODE, MesPcnExtConstWords.SN_STATUS}, new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), snStatus}, diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java index af34618..d49cf0c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java @@ -157,6 +157,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { model.setPart(mesPartSap); model.setPartInspectionDetailList(Arrays.asList(mesPartInspectionDetail)); if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) { + //TODO 有问题 需要修改条码质量状态 ncProcessingService.saveNc(model, reqBean.getOrganizeCode(), true); } else { MesPartInspectionInputModel inspectModel = new MesPartInspectionInputModel(); @@ -169,6 +170,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { inspectModel.setPartInspection(partInspection); inspectModel.setShiftCode(mesProduceSn.getShiftCode()); inspectModel.setProductVersion(productVersion); + inspectModel.setUserInfo(reqBean.getUserInfo()); inputDefectRecordService.saveSusPartInspection(inspectModel, reqBean.getOrganizeCode()); }