From 13d721d936198e7cb4c2ba35d0119556e6884ae7 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 3 Jul 2024 11:30:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF=E9=98=B2?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/step/MesProdCraftRouteCheckStepService.java | 5 ++++- .../apiservice/serviceimpl/step/MesWorkOrderScanStepService.java | 2 +- .../i3plus/ext/mes/pcn/pojo/context/MesProductionPartContext.java | 3 ++- .../i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java | 3 ++- .../cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java | 6 ++++++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProdCraftRouteCheckStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProdCraftRouteCheckStepService.java index 2277300..47856b8 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProdCraftRouteCheckStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProdCraftRouteCheckStepService.java @@ -88,9 +88,12 @@ public class MesProdCraftRouteCheckStepService extends BaseStepService { Map> craftRouteDataMap = new HashMap<>(); partNoList.forEach(o -> doHandleProdCraftData(reqBean, workCenter, o, craftRouteDataMap)); - if (CollectionUtils.isEmpty(craftRouteDataMap) || craftRouteDataMap.size() != partNoList.size()) + if (CollectionUtils.isEmpty(craftRouteDataMap) || craftRouteDataMap.size() != partNoList.size()) { + //剔除未验证的进料主条码后保存数据 + productionDispatchContextStepService.saveProductionPsInContext(reqBean, productionPsInContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getPartNo()) && o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0)).collect(Collectors.toList())); return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("零件编码%s未匹配到产品工艺路线!", CollectionUtils.isEmpty(craftRouteDataMap) ? partNoList.toString() : partNoList.stream().filter(o -> (!StringUtils.isEmpty(o) && !craftRouteDataMap.containsKey(o))).collect(Collectors.toList()).toString())); + } //前道工艺防错验证处理 doHandleProdCraftRouteCheck(reqBean, resultBean, stepResult, productionProcessContext, workCenter, productionPsInContextList, craftRouteDataMap); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java index 00527cd..560447b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java @@ -119,7 +119,7 @@ public class MesWorkOrderScanStepService extends BaseStepService { chooseList.stream().filter(o -> !StringUtils.isEmpty(o)).forEach(o -> equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), o, TimeTool.getNowTime(true), Integer.valueOf(cellMessageSorce)))); //发送工步内容 - String scanInfo = chooseCavityOrder.stream().filter(o -> (null != o && !o.getKey().equals(MesPcnExtConstWords.CELL_MESSAGE_SOURCE))).map(o -> o.getName() + "[" + o.getValue() + "]").collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON)); + String scanInfo = chooseCavityOrder.stream().filter(o -> (null != o && !o.getKey().equals(MesPcnExtConstWords.CELL_MESSAGE_SOURCE))).map(o -> o.getName() + MesPcnExtConstWords.SQUARE_BRACKETS_L + o.getValue() + MesPcnExtConstWords.SQUARE_BRACKETS_R).collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON)); productionCustomContextStepService.doSendStepContextMessage(reqBean, scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.getByValue(Integer.valueOf(cellMessageSorce))); stepResult.msg(String.format("当前%s%s!", MesExtEnumUtil.CELL_MESSAGE_SOURCE.valueOfDescription(Integer.valueOf(cellMessageSorce)), scanInfo)); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPartContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPartContext.java index 01703e7..1ef8ef7 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPartContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPartContext.java @@ -9,6 +9,7 @@ import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import io.swagger.annotations.ApiParam; import lombok.Data; import org.springframework.beans.BeanUtils; +import org.springframework.util.StringUtils; import java.io.Serializable; @@ -124,7 +125,7 @@ public class MesProductionPartContext implements Serializable { } public MesProductionPartContext isCheck(MesWorkCell workCell) { - this.isCheckSeq = workCell.getIsCheckSeq(); + if(!StringUtils.isEmpty(workCell.getIsCheckSeq()) && workCell.getIsCheckSeq().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) this.isCheckSeq = workCell.getIsCheckSeq(); return this; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java index d7ffb9b..3fcb6f7 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java @@ -7,6 +7,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; import io.swagger.annotations.ApiParam; import lombok.Data; import org.springframework.beans.BeanUtils; +import org.springframework.util.StringUtils; import java.io.Serializable; @@ -90,7 +91,7 @@ public class MesProductionPsInContext implements Serializable { } public MesProductionPsInContext isCheck(MesWorkCell workCell) { - this.isCheckCraft = workCell.getIsCheckCraft(); + if(!StringUtils.isEmpty(workCell.getIsCheckCraft()) && workCell.getIsCheckCraft().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) this.isCheckCraft = workCell.getIsCheckCraft(); return this; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java index 8b13b42..c487998 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java @@ -246,6 +246,12 @@ public class MesPcnExtConstWords { public static final String COLON = ":"; // % public static final String PERCENT = "%"; + // [ + public static final String SQUARE_BRACKETS_L = "["; + // ] + public static final String SQUARE_BRACKETS_R = "]"; + + //过程条码默认生成规则 public static final String DEFAULT_SERIAL_NUMBER_RULE = "DEFAULT_SERIAL_NUMBER_RULE";