From d2d1d9828100576f86b166ea529f2b3e827ae473 Mon Sep 17 00:00:00 2001 From: jun Date: Thu, 19 Sep 2024 11:49:58 +0800 Subject: [PATCH] =?UTF-8?q?43072=20=E5=8A=A0=E6=96=99=E9=98=B2=E9=94=99=20?= =?UTF-8?q?=E6=96=99=E7=AE=B1=E8=87=AA=E5=8A=A8=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesRawPartChargingServiceImpl.java | 27 ++++++---------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java index 8b6fb49..e23434c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesRawPartChargingServiceImpl.java @@ -1,9 +1,11 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesNumberRuleMatchDispatchService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesRawPartChargingService; import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesRawPackageModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesRawPartChargingModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; @@ -12,6 +14,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.*; import cn.estsh.i3plus.pojo.mes.repository.*; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import cn.estsh.impp.framework.boot.util.ValidatorBean; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -99,7 +102,8 @@ public class MesRawPartChargingServiceImpl implements IMesRawPartChargingService //校验是否已扫描 List mesRawPartCharging = findMesRawPartCharging(mesRawPartChargingModel); if (!CollectionUtils.isEmpty(mesRawPartCharging)) { - MesPcnException.throwMesBusiException("料筒条码【%s】与原料条码【%s】已绑定", mesRawPartChargingModel.getPackageSn(), mesRawPartCharging.iterator().next().getSn()); + //已绑定,再次扫描料筒条码自动初始化 + doMesRawPartChargingInit(mesRawPartChargingModel); } if (Objects.isNull(MesExtEnumUtil.RAW_SCAN_TYPE.valueOfDescription(mesRawPartChargingModel.getMesRawPackagePart().getScanType()))) { MesPcnException.throwMesBusiException("料筒条码【%s】物料【%s】扫描类型信息不存在", mesRawPartChargingModel.getPackageSn(), mesRawPartChargingModel.getMesRawPackagePart().getPartNo()); @@ -219,25 +223,8 @@ public class MesRawPartChargingServiceImpl implements IMesRawPartChargingService } private void checkHomeRuleSn(MesRawPartChargingModel mesRawPartChargingModel) { - if (StringUtils.isEmpty(mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule())) { - MesPcnException.throwMesBusiException("非自制件,条码规则未维护", mesRawPartChargingModel.getMesRawPackagePart().getPartNo()); - } - if (!mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().contains("*")) { - if(!mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().equals(mesRawPartChargingModel.getSn())){ - MesPcnException.throwMesBusiException("原料条码【%s】校验条码规则【%s】失败", mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()); - } - } else if (mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().startsWith("*") && mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().endsWith("*")) { - if(!mesRawPartChargingModel.getSn().contains(mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().replace("*", ""))){ - MesPcnException.throwMesBusiException("原料条码【%s】校验条码规则【%s】失败", mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()); - } - } else if (mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().startsWith("*")) { - if(!mesRawPartChargingModel.getSn().endsWith(mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().replace("*", ""))){ - MesPcnException.throwMesBusiException("原料条码【%s】校验条码规则【%s】失败", mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()); - } - } else if (mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().endsWith("*")) { - if(!mesRawPartChargingModel.getSn().startsWith(mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule().replace("*", ""))){ - MesPcnException.throwMesBusiException("原料条码【%s】校验条码规则【%s】失败", mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()); - } + if(!(Boolean) ((IMesNumberRuleMatchDispatchService) SpringContextsUtil.getBean(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_20.getStrategyClass())).matchNumberRule(mesRawPartChargingModel.getOrganizeCode(), mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()).get(MesPcnExtConstWords.RESULT)){ + MesPcnException.throwMesBusiException("原料条码【%s】校验条码规则【%s】失败", mesRawPartChargingModel.getSn(), mesRawPartChargingModel.getMesRawPackagePart().getBarcodeRule()); } }