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 4119470..e65b1ca 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 @@ -1241,7 +1241,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue()); partInspection.setOrganizeCode(org); - String defectTypeCodeStr = configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE") == null ? "QX130" :configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE"); + MesConfig mesConfig = configService.getMesConfigNoError(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE"); + String defectTypeCodeStr = (null != mesConfig && !StringUtils.isEmpty(mesConfig.getCfgValue())) ? mesConfig.getCfgValue() : "QX130"; //根据页面上选择的位置 查询位置,若不存在则提示 位置不存在,请检查数据 DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java index d4919d7..d5629cb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java @@ -646,6 +646,10 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService if (StringUtils.isEmpty(orderManagement)) { throw new ImppBusiException(String.format("【%s】此发运单不存在,请检查数据!", model.getShippingCode())); } + if (orderManagement.getStatus().compareTo(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()) >= 0) { + throw new ImppBusiException(String.format("【%s】此发运单当前状态【%s】,请检查数据!", + model.getShippingCode(), MesExtEnumUtil.SHIPPING_ORDER_STATUS.valueOfDescription(orderManagement.getStatus()))); + } return orderManagement; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/CqLjSortShippingPrintStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/CqLjSortShippingPrintStrategyService.java index 74a7b66..675ce42 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/CqLjSortShippingPrintStrategyService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/CqLjSortShippingPrintStrategyService.java @@ -65,6 +65,7 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt //遍历处理每个发运单主表 for (MesShippingOrderManagement shippingOrderManagement : shippingOrderManagementList) { + log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), Thread.currentThread().getName()); //一张实体发运单包含三部分信息(顶部的通用数据、中部的第一份表格数据,底部的第二份表格数据) //取出当前发运单的明细信息 List details = null == detailByPidMap ? null : detailByPidMap.get(shippingOrderManagement.getId()); @@ -82,6 +83,7 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt detailList.stream().min(Comparator.comparing(MesShippingOrderManagementDetail::getLogicSeq)); min.ifPresent(mesShippingOrderManagementDetail -> logicSeqAndAssyCodeMap.put(mesShippingOrderManagementDetail.getLogicSeq(), assyCode)); } + log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- assyCodeList:{} --- logicSeqAndAssyCodeMap:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), assyCodeList.toString(), JSONObject.toJSONString(logicSeqAndAssyCodeMap), Thread.currentThread().getName()); List collect = logicSeqAndAssyCodeMap.keySet().stream().sorted().collect(Collectors.toList()); List newAssyCodeList = new ArrayList<>(); for (Long logicSeq : collect) { @@ -92,10 +94,13 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt .filter(i -> i % 2 == 0) .mapToObj(i -> newAssyCodeList.subList(i, Math.min(i + 2, newAssyCodeList.size()))) .collect(Collectors.toList()); - for (List list : physicalOrderList) { - //生成一张实体发运单 - log.info("工厂{}排序发运打印 --- 生成一张实体发运单:{} --- {}", bean.getOrganizeCode(), list.toString(), Thread.currentThread().getName()); - mainDataList.add(createPhysicalOrder(shippingOrderManagement, list, detailByAssyCodeMap, details)); + if (!CollectionUtils.isEmpty(physicalOrderList)) { + log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- physicalOrderList:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), JSONObject.toJSONString(physicalOrderList), Thread.currentThread().getName()); + for (List list : physicalOrderList) { + //生成一张实体发运单 + log.info("工厂{}排序发运打印 --- 生成一张实体发运单:{} --- {}", bean.getOrganizeCode(), list.toString(), Thread.currentThread().getName()); + mainDataList.add(createPhysicalOrder(shippingOrderManagement, list, detailByAssyCodeMap, details)); + } } } shippingOrderManagement.setPrintCount(StringUtil.isEmpty(shippingOrderManagement.getPrintCount())? 1 : shippingOrderManagement.getPrintCount()+1); @@ -123,7 +128,8 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt //中部表结构赋值 model.setDetailModelsOne(createDetailList(assyCodeList.get(0), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo())); //底部表结构赋值 - model.setDetailModelsTwo(createDetailList(assyCodeList.get(1), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo())); + if (assyCodeList.size() > 1) model.setDetailModelsTwo(createDetailList(assyCodeList.get(1), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo())); + else model.setDetailModelsTwo(new ArrayList<>()); log.info("工厂{}排序发运打印 --- MesShippingOrderManagementModelForLiJia:{} --- {}", shippingOrderManagement.getOrganizeCode(), JSONObject.toJSONString(model), Thread.currentThread().getName()); return model; } 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 c6464d1..e680124 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 @@ -115,7 +115,8 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { String defectTypeCode = MesEnumUtil.DEFECT_TYPE_CODE.DETERMIND.getValue(); productionPsOutContextList.forEach(mesProduceSn -> { String productVersion = null; - List mesProductionPartContextList = productionPartContextList.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList()); + List mesProductionPartContextList = CollectionUtils.isEmpty(productionPartContextList) ? null : + productionPartContextList.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(mesProductionPartContextList)) { productVersion = mesProductionPartContextList.get(0).getProductVersion(); } @@ -186,7 +187,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { inspectModel.setShiftCode(mesProduceSn.getShiftCode()); inspectModel.setProductVersion(productVersion); inspectModel.setUserInfo(reqBean.getUserInfo()); - + inspectModel.setSourceType(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()); inputDefectRecordService.saveSusPartInspection(inspectModel, reqBean.getOrganizeCode()); } });