diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchDispatchService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchDispatchService.java index 5be46a7..0b3fc8f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchDispatchService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchDispatchService.java @@ -24,7 +24,7 @@ public class MesNumberRuleMatchDispatchService implements IMesNumberRuleMatchDis List resultList = new ArrayList<>(); - if (numberRuleList.get(0) instanceof MesProdRuleNosortCfg) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, o, "mesNumberRuleMatchRegularExpressionService", ((MesProdRuleNosortCfg) o).getInPartNoRule())); + if (numberRuleList.get(0) instanceof MesProdRuleNosortCfg) numberRuleList.forEach(o -> matchNumberRule(organizeCode, sn, resultList, o, "mesNumberRuleMatchRegularExpressionService",o, ((MesProdRuleNosortCfg) o).getInPartNoRule())); return resultList; @@ -34,7 +34,7 @@ public class MesNumberRuleMatchDispatchService implements IMesNumberRuleMatchDis if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(sn) || StringUtils.isEmpty(strategyClass) || null == o) return; - Boolean result = ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(strategyClass)).matchNumberRule(organizeCode, sn, o, params); + Boolean result = ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(strategyClass)).matchNumberRule(organizeCode, sn, params); if (result) resultList.add(o); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java index 1ae4b48..8f8c889 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java @@ -14,7 +14,7 @@ public class MesNumberRuleMatchRegularExpressionService implements IMesNumberRul @Override public Boolean matchNumberRule(String organizeCode, String sn, Object... params) { - String matchRule = (String) params[0]; + String matchRule = params[1].toString(); return true; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java index e8046fd..20ce11b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnScanStepService.java @@ -202,11 +202,12 @@ public class MesProductSnScanStepService extends BaseStepService { //扫描条码 剔除finishCode信息 List filterList1 = equipVariableCollectContextList.stream().filter(o -> (null != o && !o.getEquipVariableValue().equals(productionProcessContext.getFinishCode()))).map(MesEquipVariableCollectContext::getEquipVariableValue).collect(Collectors.toList()); //已验证条码 剔除finishCode信息 - List filterList2 = productionPsInContextList.stream().filter(o -> (null != o && !o.getProductSn().equals(productionProcessContext.getFinishCode()))).map(MesProductionPsInContext::getProductSn).collect(Collectors.toList()); + List filterList2 = CollectionUtils.isEmpty(productionPsInContextList) ? null : + productionPsInContextList.stream().filter(o -> (null != o && !o.getProductSn().equals(productionProcessContext.getFinishCode()))).map(MesProductionPsInContext::getProductSn).collect(Collectors.toList()); List filterList = new ArrayList<>(); - if (CollectionUtils.isEmpty(filterList1)) filterList.addAll(filterList1); - if (CollectionUtils.isEmpty(filterList2)) filterList.addAll(filterList2); + if (!CollectionUtils.isEmpty(filterList1)) filterList.addAll(filterList1); + if (!CollectionUtils.isEmpty(filterList2)) filterList.addAll(filterList2); //验证是否存在重复条码 if (!CollectionUtils.isEmpty(filterList) && filterList.size() != filterList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()).size()) return true;