From 73df0409adb1ea30628a055843af5a95bc6c1582 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 20 May 2025 10:52:43 +0800 Subject: [PATCH] =?UTF-8?q?47042=20MES:=20PCN=E5=8F=91=E8=BF=90=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=EF=BC=9A=E5=8F=91=E8=BF=90=E5=8D=95=E6=98=8E=E7=BB=86?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=85=88=E6=A0=A1=E9=AA=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=BE=85=E5=BC=80=E7=A5=A8=E7=89=A9=E6=96=99=E4=B8=AD=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E9=9B=B6=E4=BB=B6=E5=85=B3=E7=B3=BB=E4=B8=BB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/mes/pcn/api/base/IMesCustomerPartService.java | 1 + .../serviceimpl/base/MesCustomerPartService.java | 19 +++++++++++++++++++ ...gCheckVolvoRackNoAndPartNoStrategyServiceImpl.java | 14 ++++++-------- .../MesShippingScanOrderStrategyServiceImpl.java | 14 ++++---------- .../MesShippingScanSnStrategyServiceImpl.java | 16 ++++------------ 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesCustomerPartService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesCustomerPartService.java index 5ec36b3..ace853d 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesCustomerPartService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesCustomerPartService.java @@ -19,4 +19,5 @@ public interface IMesCustomerPartService { @ApiOperation(value = "根据物料代码查询物料信息") MesCustomerPart getMesCustomerPart(String organizeCode,String partNo); + boolean isExistCustomerPart(String organizeCode,String partNo, String custPartNo); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesCustomerPartService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesCustomerPartService.java index f77d2fe..a520d95 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesCustomerPartService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesCustomerPartService.java @@ -6,6 +6,7 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerPart; +import cn.estsh.i3plus.pojo.mes.repository.MesCustPartInvoicedRepository; import cn.estsh.i3plus.pojo.mes.repository.MesCustomerPartRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -22,6 +23,9 @@ public class MesCustomerPartService implements IMesCustomerPartService { @Autowired private MesCustomerPartRepository customerPartRepository; + @Autowired + private MesCustPartInvoicedRepository partInvoicedRao; + @Override public MesCustomerPart getMesCustomerPartByPartNo(String erpPartNo, String custCode, String organizeCode) { @@ -42,4 +46,19 @@ public class MesCustomerPartService implements IMesCustomerPartService { DdlPreparedPack.getStringEqualPack(partNo, "erpPartNo", ddlPackBean); return customerPartRepository.getByProperty(ddlPackBean); } + + @Override + public boolean isExistCustomerPart(String organizeCode, String partNo, String custPartNo) { + DdlPackBean invoicedPackBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(partNo, "partNo", invoicedPackBean); + DdlPreparedPack.getStringEqualPack(custPartNo, "custPartNo", invoicedPackBean); + if (partInvoicedRao.isExitByHql(invoicedPackBean)) { + return true; + } + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(partNo, "erpPartNo", packBean); + DdlPreparedPack.getStringEqualPack(custPartNo, "custPartNo", packBean); + return customerPartRepository.isExitByHql(packBean); + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java index 6dc9118..0f54054 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.strategy; +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.*; import cn.estsh.i3plus.ext.mes.pcn.apiservice.aspect.MonitorLog; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.IMesShippingScanStrategyService; @@ -60,6 +61,9 @@ public class MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl implements private MesCustomerPartRepository mesCustomerPartRepository; @Autowired + private IMesCustomerPartService customerPartService; + + @Autowired private IMesConfigService mesConfigService; @Autowired @@ -135,10 +139,7 @@ public class MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl implements //校验客户零件信息是否存在 (默认需要验证, 值可能是[空/0/20]) if (StringUtils.isEmpty(shippingGroup.getScanMethodJudgment()) || !shippingGroup.getScanMethodJudgment().equals(MesExtEnumUtil.SHIPPING_GROUP_SCAN_METHOD_JUDGMENT.PART_NO.getValueStr())) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(detail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(detail.getCustPartNo(), "custPartNo", packBean); - if (!mesCustomerPartRepository.isExitByHql(packBean)) { + if (!customerPartService.isExistCustomerPart(model.getOrganizeCode(), detail.getPartNo(), detail.getCustPartNo())) { throw new ImppBusiException(String.format("零件号【%s】客户零件号【%s】关系不存在,请检查数据!", detail.getPartNo(), detail.getCustPartNo())); } } @@ -226,10 +227,7 @@ public class MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl implements List detailList = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getCustPartNo()) && StringUtils.isEmpty(k.getBarcode()) && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).collect(Collectors.toList()); MesShippingOrderManagementDetail mesShippingOrderManagementDetail = null; for (MesShippingOrderManagementDetail managementDetail : detailList) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(managementDetail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(managementDetail.getCustPartNo(), "custPartNo", packBean); - if (checkMesPartShippingGroupDetailRule(model, managementDetail) && mesCustomerPartRepository.isExitByHql(packBean)) { + if (checkMesPartShippingGroupDetailRule(model, managementDetail) && customerPartService.isExistCustomerPart(model.getOrganizeCode(), managementDetail.getPartNo(), managementDetail.getCustPartNo())) { mesShippingOrderManagementDetail = managementDetail; break; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanOrderStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanOrderStrategyServiceImpl.java index 56145e0..064eb6c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanOrderStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanOrderStrategyServiceImpl.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.strategy; +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.*; import cn.estsh.i3plus.ext.mes.pcn.apiservice.aspect.MonitorLog; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.IMesShippingScanStrategyService; @@ -16,7 +17,6 @@ import cn.estsh.i3plus.pojo.base.util.StringUtil; import cn.estsh.i3plus.pojo.mes.bean.*; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagementDetail; -import cn.estsh.i3plus.pojo.mes.repository.MesCustomerPartRepository; import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; import cn.estsh.i3plus.pojo.mes.repository.MesShippingOrderManagementDetailRepository; import cn.estsh.i3plus.pojo.mes.repository.MesShippingOrderManagementRepository; @@ -56,7 +56,7 @@ public class MesShippingScanOrderStrategyServiceImpl implements IMesShippingScan private IMesProduceSnExtService produceSnExtService; @Autowired - private MesCustomerPartRepository mesCustomerPartRepository; + private IMesCustomerPartService customerPartService; @Autowired private IMesConfigService mesConfigService; @@ -144,10 +144,7 @@ public class MesShippingScanOrderStrategyServiceImpl implements IMesShippingScan //校验客户零件信息是否存在 (默认需要验证, 值可能是[空/0/20]) if (StringUtils.isEmpty(shippingGroup.getScanMethodJudgment()) || !shippingGroup.getScanMethodJudgment().equals(MesExtEnumUtil.SHIPPING_GROUP_SCAN_METHOD_JUDGMENT.PART_NO.getValueStr())) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(detail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(detail.getCustPartNo(), "custPartNo", packBean); - if (!mesCustomerPartRepository.isExitByHql(packBean)) { + if (!customerPartService.isExistCustomerPart(model.getOrganizeCode(), detail.getPartNo(), detail.getCustPartNo())) { throw new ImppBusiException(String.format("零件号【%s】客户零件号【%s】关系不存在,请检查数据!", detail.getPartNo(), detail.getCustPartNo())); } } @@ -212,10 +209,7 @@ public class MesShippingScanOrderStrategyServiceImpl implements IMesShippingScan List detailList = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getCustPartNo()) && StringUtils.isEmpty(k.getBarcode()) && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).collect(Collectors.toList()); MesShippingOrderManagementDetail mesShippingOrderManagementDetail = null; for (MesShippingOrderManagementDetail managementDetail : detailList) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(managementDetail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(managementDetail.getCustPartNo(), "custPartNo", packBean); - if (checkMesPartShippingGroupDetailRule(model, managementDetail) && mesCustomerPartRepository.isExitByHql(packBean)) { + if (checkMesPartShippingGroupDetailRule(model, managementDetail) && customerPartService.isExistCustomerPart(model.getOrganizeCode(), managementDetail.getPartNo(), managementDetail.getCustPartNo())) { mesShippingOrderManagementDetail = managementDetail; break; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java index 43f084b..7c6a3cc 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.strategy; +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.*; import cn.estsh.i3plus.ext.mes.pcn.apiservice.aspect.MonitorLog; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.IMesShippingScanStrategyService; @@ -19,7 +20,6 @@ import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroupDetail; import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagementDetail; -import cn.estsh.i3plus.pojo.mes.repository.MesCustomerPartRepository; import cn.estsh.i3plus.pojo.mes.repository.MesProduceSnRepository; import cn.estsh.i3plus.pojo.mes.repository.MesShippingOrderManagementDetailRepository; import cn.estsh.i3plus.pojo.mes.repository.MesShippingOrderManagementRepository; @@ -60,7 +60,7 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr private IMesProduceSnExtService produceSnExtService; @Autowired - private MesCustomerPartRepository mesCustomerPartRepository; + private IMesCustomerPartService customerPartService; @Autowired private IMesConfigService mesConfigService; @@ -107,8 +107,6 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr } private void checkShippingDetails(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup, MesProduceSn produceSn, MesShippingOrderManagementDetail detail) { - - //校验发运单明细顺序 if (!Objects.isNull(shippingGroup) && !StringUtils.isEmpty(shippingGroup.getIsEnableShippingFailSafe()) && CommonEnumUtil.VALID == shippingGroup.getIsEnableShippingFailSafe()) { //45550 PDA-MES-PDA发运扫描排序方式修改 @@ -147,10 +145,7 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr //校验客户零件信息是否存在 (默认需要验证, 值可能是[空/0/20]) if (StringUtils.isEmpty(shippingGroup.getScanMethodJudgment()) || !shippingGroup.getScanMethodJudgment().equals(MesExtEnumUtil.SHIPPING_GROUP_SCAN_METHOD_JUDGMENT.PART_NO.getValueStr())) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(detail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(detail.getCustPartNo(), "custPartNo", packBean); - if (!mesCustomerPartRepository.isExitByHql(packBean)) { + if (!customerPartService.isExistCustomerPart(model.getOrganizeCode(), detail.getPartNo(), detail.getCustPartNo())) { throw new ImppBusiException(String.format("零件号【%s】客户零件号【%s】关系不存在,请检查数据!", detail.getPartNo(), detail.getCustPartNo())); } } @@ -241,10 +236,7 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr List detailList = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getCustPartNo()) && StringUtils.isEmpty(k.getBarcode()) && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).collect(Collectors.toList()); MesShippingOrderManagementDetail mesShippingOrderManagementDetail = null; for (MesShippingOrderManagementDetail managementDetail : detailList) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(model.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(managementDetail.getPartNo(), "erpPartNo", packBean); - DdlPreparedPack.getStringEqualPack(managementDetail.getCustPartNo(), "custPartNo", packBean); - if (checkMesPartShippingGroupDetailRule(model, managementDetail) && mesCustomerPartRepository.isExitByHql(packBean)) { + if (checkMesPartShippingGroupDetailRule(model, managementDetail) && customerPartService.isExistCustomerPart(model.getOrganizeCode(), managementDetail.getPartNo(), managementDetail.getCustPartNo())) { mesShippingOrderManagementDetail = managementDetail; break; }