From 07ea4571f273cab8f5cc994da00527de7facec5a Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Wed, 28 Jan 2026 09:29:43 +0800
Subject: [PATCH 1/2] =?UTF-8?q?demand:=20=20=20TMS=E7=B3=BB=E7=BB=9F=20-?=
=?UTF-8?q?=20=E6=88=90=E6=9C=AC=E7=AE=A1=E7=90=86=20-=20=E8=BF=90?=
=?UTF-8?q?=E5=8D=95=E5=88=A9=E6=B6=A6=E7=BB=9F=E8=AE=A1=20=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E6=8C=89=E9=92=AE=E2=80=9C=E6=89=B9=E9=87=8F=E9=87=8D?=
=?UTF-8?q?=E7=AE=97=E2=80=9D=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../erp/web/emis/EmisCommonController.java | 37 +++++++++++++++++++
.../resources/mapper/EmisWaybillMapper.xml | 4 +-
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java
index f193080a3..ade656057 100644
--- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java
+++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCommonController.java
@@ -45,6 +45,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -53,6 +54,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
+import java.time.LocalDateTime;
+import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.*;
@@ -1515,6 +1519,39 @@ public class EmisCommonController extends EmisBaseController
}
+ /**
+ * 触发按月份计算运单成本
+ * @return
+ */
+ @GetMapping(value = "/reCalcCostFeeByBillMonth")
+ @Async
+ public AjaxResult reCalcCostFeeByBillMonth(String billMonth)
+ {
+ if(StringUtils.isEmpty(billMonth)){
+ return AjaxResult.error("月份不能为空");
+ }
+
+ String lockKey="reCalcCostFeeByBillMonth";
+ log.info("reCalcCostFeeByBillMonth start");
+
+ // 加锁查询
+ redissonService.lock(lockKey,300);
+ try{
+ EmisWaybill emisWaybill = new EmisWaybill();
+ emisWaybill.getParams().put("billMonth",billMonth.replaceAll("-",""));
+ emisWaybill.getParams().put("blAllScan","1");
+ emisTmsCostFeeService.redoCalcCostFeeWaitWaybill(emisWaybill);
+ }catch(Exception ex){
+ ex.printStackTrace();
+ log.error("reCalcCostFeeByBillMonth exception:"+ex.getMessage());
+ return AjaxResult.error("计算异常:"+ex.getMessage());
+ }
+ log.info("reCalcCostFeeByBillMonth end");
+
+ redissonService.unlock(lockKey);
+ return AjaxResult.success("计算成功");
+ }
+
/**
* 导出进仓单-对接外部
*
diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
index 8f4dab8cd..d154230cb 100644
--- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
+++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml
@@ -3586,13 +3586,15 @@
a.del_flag = '0'
AND a.order_status != '0'
AND a.order_status != '2'
- AND a.bl_calc_cost = '0'
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(151)
)
and DATE_FORMAT(a.send_date,'%Y%m')= #{params.billMonth}
+
+ and a.bl_calc_cost= '0'
+
ORDER BY a.send_date DESC
From 1c19bf8995826255a0357736f32e2cb723440ecb Mon Sep 17 00:00:00 2001
From: aike <17730485278@139.com>
Date: Wed, 28 Jan 2026 11:46:55 +0800
Subject: [PATCH 2/2] =?UTF-8?q?demand:=20=20=20TMS=E7=B3=BB=E7=BB=9F=20-?=
=?UTF-8?q?=20=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86=20-=20=E4=BA=A7?=
=?UTF-8?q?=E5=93=81=E7=B1=BB=E5=9E=8B=E7=AE=A1=E7=90=86=20-=20=E6=9F=AC?=
=?UTF-8?q?=E5=9F=94=E5=AF=A8=E7=A9=BA=E8=BF=90=E6=96=B0=E5=A2=9E=E4=BA=A7?=
=?UTF-8?q?=E5=93=81=E7=B1=BB=E5=9E=8B=E6=8A=A5=E9=94=99bug=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../erp/emis/service/impl/EmisTransProductServiceImpl.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTransProductServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTransProductServiceImpl.java
index 75d9ab82e..ea2ae97dd 100644
--- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTransProductServiceImpl.java
+++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTransProductServiceImpl.java
@@ -69,6 +69,7 @@ public class EmisTransProductServiceImpl implements IEmisTransProductService
// 获取线路编号
QueryWrapper queryWrapper=new QueryWrapper<>();
queryWrapper.likeRight("prod_code",emisTransProduct.getTransLineCode()+"-");
+ queryWrapper.eq("trans_line_code", emisTransProduct.getTransLineCode());
queryWrapper.select("prod_code");
queryWrapper.orderByDesc("prod_code");
queryWrapper.last("LIMIT 1");