From 75a464ed766bba8ada11d86184968d9373dac704 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Mon, 27 Oct 2025 14:50:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?demand:=20=20=20=20tms/app-=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E5=BD=95=E5=85=A5=E3=80=81=E8=BF=90=E5=8D=95=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=BD=95=E5=85=A5-=E8=BF=90=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C=EF=BC=8C=E4=BB=85=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=AD=97=E6=AF=8D+=E6=95=B0=E5=AD=97+=E2=80=9C-?= =?UTF-8?q?=E2=80=9D=E6=A8=AA=E6=9D=A0=E7=9A=84=E7=BB=84=E5=90=88=20commit?= =?UTF-8?q?ter:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EmisWaybillServiceImpl.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) 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 b3e10bfa8..daf0165c4 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 @@ -3163,6 +3163,34 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb } + /** + * 校验运单号格式 + * 只允许包含数字、字母、"-"横杠三种类型 + * 横杠只允许在中间,不能在两端,且不能连续有多个横杠 + * @param billCode 运单号 + * @throws EmisBizError 格式不符合要求时抛出异常 + */ + private void validateBillCodeFormat(String billCode) throws EmisBizError { + if (StringUtils.isEmpty(billCode)) { + throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号不能为空"); + } + + // 检查是否只包含数字、字母、横杠 + if (!billCode.matches("^[0-9a-zA-Z\\-]+$")) { + throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号只能包含数字、字母和横杠"); + } + + // 检查横杠是否在两端 + if (billCode.startsWith("-") || billCode.endsWith("-")) { + throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号横杠不能在两端"); + } + + // 检查是否有连续的横杠 + if (billCode.contains("--")) { + throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "运单号不能有连续的横杠"); + } + } + /** * 新开单 * @param emisWaybillSave @@ -3172,6 +3200,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb // 当寄件国家为0095或0855时,去除billCode和billCodeSub中的第一个T // modifyBillCode(emisWaybillSave); + // 校验运单号格式 + validateBillCodeFormat(emisWaybillSave.getBillCode()); + // 获取运单号,判断是不是子单已存在 boolean isExists = checkWaybillIsExists(emisWaybillSave.getBillCode()); if(isExists){ From 26b2a14a3812785d20d9bed552f31593372d529f Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Tue, 28 Oct 2025 09:57:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?demand:=20=20=20=20tms-=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86-=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=87=BA=E8=B4=A6=E7=A1=AE=E8=AE=A4-=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E5=87=BA=E8=B4=A6=E8=87=AA=E5=8A=A8=E8=BF=87=E6=BB=A4=E6=8E=89?= =?UTF-8?q?=E6=9C=89=E8=99=9A=E6=8B=9F=E4=BB=B6=E6=A0=87=E8=AF=86=E4=B8=94?= =?UTF-8?q?=E5=B7=B2=E7=BB=91=E5=AE=9A=E4=B8=BB=E5=8D=95=E7=9A=84=E8=BF=90?= =?UTF-8?q?=E5=8D=95=20committer:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/EmisSettleSubBillMapper.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emis-biz/src/main/resources/mapper/EmisSettleSubBillMapper.xml b/emis-biz/src/main/resources/mapper/EmisSettleSubBillMapper.xml index bca1246b9..a6d7b309b 100644 --- a/emis-biz/src/main/resources/mapper/EmisSettleSubBillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisSettleSubBillMapper.xml @@ -167,6 +167,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and not exists( select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(173,170,151) ) + + and not exists( + select 1 from emis_waybill ew where a.bill_code=ew.bill_code and ew.bl_virtual='1' and ew.master_bill_code is not null and ew.master_bill_code != '' + ) and a.send_site_code = #{params.sendSiteCode} @@ -323,6 +327,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and not exists( select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(173,170,151) ) + + and not exists( + select 1 from emis_waybill ew where a.bill_code=ew.bill_code and ew.bl_virtual='1' and ew.master_bill_code is not null and ew.master_bill_code != '' + ) and a.send_site_code = #{params.sendSiteCode}