From 7680553d4eee6fdd8cc7e24812db98e44f094b3b Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 19 May 2025 18:22:55 +0800 Subject: [PATCH] =?UTF-8?q?46987=20MES&PCN-=E8=A3=85=E7=AE=B1=E9=98=B2?= =?UTF-8?q?=E9=94=99=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=BC=80=E5=85=B3=20=E2=80=9C=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E7=A0=81=E4=B8=AD=E6=98=AF=E5=90=A6=E4=B8=BA=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=8F=B7=E2=80=9D=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=85=B3=E9=97=AD=EF=BC=8C=E4=B8=BA=E6=98=AF?= =?UTF-8?q?=E5=88=99=E5=8C=85=E8=A3=85=E6=9D=A1=E7=A0=81=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=8F=B7=E4=B8=BA=E5=AE=A2=E6=88=B7=E9=9B=B6?= =?UTF-8?q?=E4=BB=B6=E5=8F=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busi/MesBoxingErrorProofingService.java | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java index 493ad00..dbea1d4 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java @@ -81,6 +81,10 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer @Autowired private MesCustomerPartRepository mesCustomerPartRDao; + @Autowired + private MesCustPartInvoicedRepository partInvoicedRao; + + @Override public ListPager queryMesPackageDetailByPager(MesPackage mesPackage, Pager pager) { @@ -641,15 +645,22 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer } String partNo = split[packingDefine.getPartNoIndex() - 1]; if (Objects.equals(packingDefine.getPackBarcodeCustPartNo(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue())) { - DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, packBean); - MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(packBean); - if (mesCustomerPart == null) { - MesPcnException.throwMesBusiException("客户零件号[%s]信息不存在,请检查数据!", partNo); + DdlPackBean invoicePackBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, invoicePackBean); + MesCustPartInvoiced invoiced = partInvoicedRao.getByProperty(invoicePackBean); + if (invoiced != null && !StringUtils.isEmpty(invoiced.getPartNo())) { + partNo = invoiced.getPartNo(); + } else { + DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesPackageDetail.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.CUST_PART_NO, packBean); + MesCustomerPart mesCustomerPart = mesCustomerPartRDao.getByProperty(packBean); + if (mesCustomerPart == null) { + MesPcnException.throwMesBusiException("客户零件号[%s]信息不存在,请检查数据!", partNo); + } + partNo = mesCustomerPart.getErpPartNo(); } - partNo = mesCustomerPart.getErpPartNo(); if (StringUtils.isEmpty(partNo)) { - MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", mesCustomerPart.getCustPartNo()); + MesPcnException.throwMesBusiException("客户零件号[%s]未绑定物料号数据,请检查数据!", split[packingDefine.getPartNoIndex() - 1]); } } return getPart(mesPackageDetail.getOrganizeCode(), partNo);