From e1e2e966dd1e091e25ecc691c8c8b728e2645cdb Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Tue, 13 Jan 2026 10:18:10 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=20TMS=E7=B3=BB=E7=BB=9F=20-=20?= =?UTF-8?q?=E8=BF=90=E5=8D=95=E7=AE=A1=E7=90=86=20-=20=E8=BD=AC=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20-=20=E8=BD=AC=E4=BB=B6=E7=99=BB=E8=AE=B0?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A4=E6=96=AD=EF=BC=8C=E8=8B=A5=E8=BF=90?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=B7=B2=E7=99=BB=E8=AE=B0=20=E9=9D=A2?= =?UTF-8?q?=E5=8D=95=E5=88=A0=E9=99=A4=E3=80=81=E5=87=BA=E5=8F=A3=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E5=8D=95=E3=80=81=E8=BF=94=E8=B4=A7=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E4=BB=A5=E4=B8=8A=E4=B8=89=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BB=B6=E7=B1=BB=E5=9E=8B=E4=BB=BB=E6=84=8F=E4=B8=80?= =?UTF-8?q?=E7=A7=8D=E9=97=AE=E9=A2=98=E4=BB=B6=E7=B1=BB=E5=9E=8B=E9=83=BD?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E7=99=BB=E8=AE=B0=E8=BD=AC=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../emis/EmisWaybillTransferController.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillTransferController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillTransferController.java index 34353fc5e..a7f494880 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillTransferController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisWaybillTransferController.java @@ -46,7 +46,9 @@ import com.xdadan.erp.common.enums.BusinessType; import com.xdadan.erp.common.utils.poi.ExcelUtil; import com.xdadan.erp.emis.domain.EmisWaybillTransfer; +import com.xdadan.erp.emis.domain.EmisWaybillProblemInfo; import com.xdadan.erp.emis.service.IEmisWaybillTransferService; +import com.xdadan.erp.emis.service.IEmisWaybillProblemInfoService; /** * 运单转件表Controller @@ -67,6 +69,9 @@ public class EmisWaybillTransferController extends EmisBaseController @Autowired private EmisBaseService emisBaseService; + @Autowired + private IEmisWaybillProblemInfoService emisWaybillProblemInfoService; + /** @@ -151,6 +156,57 @@ public class EmisWaybillTransferController extends EmisBaseController return AjaxResult.error(" 运单号,转件单号,转件时间,目的城市,转件公司必填!"); } + // 校验运单的问题件类型:面单删除(151)、出口虚拟单(173)、返货虚拟单(170)不允许转件 + if(StringUtils.isNotEmpty(emisWaybillTransfer.getBillCode())){ + String billCode = emisWaybillTransfer.getBillCode(); + // 获取主单号 + String mainBillCode = emisBaseService.getMainBillCode(billCode); + + // 检查主单号的问题件(问题件通常关联到主单号) + EmisWaybillProblemInfo queryProblem = new EmisWaybillProblemInfo(); + queryProblem.setBillCode(mainBillCode); + List problemList = emisWaybillProblemInfoService.selectEmisWaybillProblemInfoList(queryProblem); + if(!CollectionUtils.isEmpty(problemList)){ + for(EmisWaybillProblemInfo problemInfo : problemList){ + Integer problemType = problemInfo.getProblemType(); + if(problemType != null && (problemType == 151 || problemType == 170 || problemType == 173)){ + String problemTypeName = ""; + if(problemType == 151){ + problemTypeName = "面单删除"; + } else if(problemType == 170){ + problemTypeName = "返货虚拟单"; + } else if(problemType == 173){ + problemTypeName = "出口虚拟单"; + } + return AjaxResult.error("运单已登记问题件类型为" + problemTypeName + ",不允许转件!"); + } + } + } + + // 如果传入的是子单号,也检查子单号的问题件 + if(!billCode.equals(mainBillCode)){ + EmisWaybillProblemInfo querySubProblem = new EmisWaybillProblemInfo(); + querySubProblem.setBillCode(billCode); + List subProblemList = emisWaybillProblemInfoService.selectEmisWaybillProblemInfoList(querySubProblem); + if(!CollectionUtils.isEmpty(subProblemList)){ + for(EmisWaybillProblemInfo problemInfo : subProblemList){ + Integer problemType = problemInfo.getProblemType(); + if(problemType != null && (problemType == 151 || problemType == 170 || problemType == 173)){ + String problemTypeName = ""; + if(problemType == 151){ + problemTypeName = "面单删除"; + } else if(problemType == 170){ + problemTypeName = "返货虚拟单"; + } else if(problemType == 173){ + problemTypeName = "出口虚拟单"; + } + return AjaxResult.error("运单已登记问题件类型为" + problemTypeName + ",不允许转件!"); + } + } + } + } + } + // 校验转单号格式:只允许英文和数字,长度6-32位 String transferBillCode = emisWaybillTransfer.getTransferBillCode(); if (StringUtils.isNotEmpty(transferBillCode)) {