From 51a461e8a21e6c72e0bb578409fec5bf3faba37d Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Wed, 28 Jan 2026 14:40:34 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=20=20=E5=BD=93=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=AD=9F=E5=8A=A0=E6=8B=89=E8=BF=9B=E5=8F=A3=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=BF=90=E5=8D=95=E5=8F=B7=E8=A6=81=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8E=BB=E9=99=A4T=EF=BC=8CTMS=E3=80=81APP=E3=80=81OM?= =?UTF-8?q?S=E3=80=81=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EmisWaybillServiceImpl.java | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java index 31b41ab46..48de1dd5e 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillServiceImpl.java @@ -3316,18 +3316,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb } } - // 如果是孟加拉单子,把运单号变为 12位 - if("0880".equals(emisWaybillSave.getReceiveCountry()) || "0880".equals(emisWaybillSave.getSendCountry())){ - if(emisWaybillSave.getBillCode().length()==14 && emisWaybillSave.getBillCode().startsWith("T7080")){ - String str =emisWaybillSave.getBillCode(); - String prefix=str.substring(0,6); - String other = str.substring(8); - - String billCode=prefix+other; + // - 收件国家为 孟加拉:把运单号变为 12 位 + // - 发件国家为 孟加拉:运单号 去除前缀 'T' + String billCodeRaw = emisWaybillSave.getBillCode(); + if (billCodeRaw != null && billCodeRaw.length() == 14 && billCodeRaw.startsWith("T7080")) { + if ("0880".equals(emisWaybillSave.getReceiveCountry())) { + String prefix = billCodeRaw.substring(0, 6); + String other = billCodeRaw.substring(8); + String billCode = prefix + other; emisWaybillSave.setBillCode(billCode); - + } else if ("0880".equals(emisWaybillSave.getSendCountry())) { + emisWaybillSave.setBillCode(billCodeRaw.substring(1)); } - } // 设定为业务开单 @@ -3578,18 +3578,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb // 设定为客户下单,下单时间为当前时间 this.resetOmsWaybillData(emisWaybillSave); - // 如果是孟加拉单子,把运单号变为 12位 - if("0880".equals(emisWaybillSave.getReceiveCountry()) || "0880".equals(emisWaybillSave.getSendCountry())){ - if(emisWaybillSave.getBillCode().length()==14 && emisWaybillSave.getBillCode().startsWith("T7080")){ - String str =emisWaybillSave.getBillCode(); - String prefix=str.substring(0,6); - String other = str.substring(8); - - String billCode=prefix+other; + // - 收件国家为 孟加拉:把运单号变为 12 位 + // - 发件国家为 孟加拉:运单号 去除前缀 'T' + String billCodeRaw = emisWaybillSave.getBillCode(); + if (billCodeRaw != null && billCodeRaw.length() == 14 && billCodeRaw.startsWith("T7080")) { + if ("0880".equals(emisWaybillSave.getReceiveCountry())) { + String prefix = billCodeRaw.substring(0, 6); + String other = billCodeRaw.substring(8); + String billCode = prefix + other; emisWaybillSave.setBillCode(billCode); - + } else if ("0880".equals(emisWaybillSave.getSendCountry())) { + emisWaybillSave.setBillCode(billCodeRaw.substring(1)); } - } // 公共计算部分 @@ -3770,18 +3770,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb */ private void addNewWaybillByApi(EmisWaybill emisWaybillSave) throws EmisBizError { - // 如果是孟加拉单子,把运单号变为 12位 - if("0880".equals(emisWaybillSave.getReceiveCountry()) || "0880".equals(emisWaybillSave.getSendCountry())){ - if(emisWaybillSave.getBillCode().length()==14 && emisWaybillSave.getBillCode().startsWith("T7080")){ - String str =emisWaybillSave.getBillCode(); - String prefix=str.substring(0,6); - String other = str.substring(8); - - String billCode=prefix+other; + // - 收件国家为 孟加拉:把运单号变为 12 位 + // - 发件国家为 孟加拉:运单号 去除前缀 'T' + String billCodeRaw = emisWaybillSave.getBillCode(); + if (billCodeRaw != null && billCodeRaw.length() == 14 && billCodeRaw.startsWith("T7080")) { + if ("0880".equals(emisWaybillSave.getReceiveCountry())) { + String prefix = billCodeRaw.substring(0, 6); + String other = billCodeRaw.substring(8); + String billCode = prefix + other; emisWaybillSave.setBillCode(billCode); - + } else if ("0880".equals(emisWaybillSave.getSendCountry())) { + emisWaybillSave.setBillCode(billCodeRaw.substring(1)); } - } // api 开单 @@ -5481,18 +5481,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb */ private void addNewWaybillByExternal(EmisWaybill emisWaybillSave) throws EmisBizError { - // 如果是孟加拉单子,把运单号变为 12位 - if("0880".equals(emisWaybillSave.getReceiveCountry()) || "0880".equals(emisWaybillSave.getSendCountry())){ - if(emisWaybillSave.getBillCode().length()==14 && emisWaybillSave.getBillCode().startsWith("T7080")){ - String str =emisWaybillSave.getBillCode(); - String prefix=str.substring(0,6); - String other = str.substring(8); - - String billCode=prefix+other; + // - 收件国家为 孟加拉:把运单号变为 12 位 + // - 发件国家为 孟加拉:运单号 去除前缀 'T' + String billCodeRaw = emisWaybillSave.getBillCode(); + if (billCodeRaw != null && billCodeRaw.length() == 14 && billCodeRaw.startsWith("T7080")) { + if ("0880".equals(emisWaybillSave.getReceiveCountry())) { + String prefix = billCodeRaw.substring(0, 6); + String other = billCodeRaw.substring(8); + String billCode = prefix + other; emisWaybillSave.setBillCode(billCode); - + } else if ("0880".equals(emisWaybillSave.getSendCountry())) { + emisWaybillSave.setBillCode(billCodeRaw.substring(1)); } - } // 设定为客户下单,下单时间为当前时间