From 3b74434320d0fb664dd2f508a43c1a6838add2c8 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Sun, 28 Sep 2025 16:21:20 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=20TMS=E7=B3=BB=E7=BB=9F=20-=20?= =?UTF-8?q?=E8=BF=90=E8=BE=93=E7=AE=A1=E7=90=86=20-=20=E6=BC=8F=E7=BB=84?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E7=BB=9F=E8=AE=A1=20-=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=BC=8F=E7=BB=84=E6=89=B9=E6=AC=A1=E7=BB=9F=E8=AE=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E5=AF=BC=E5=87=BA=E6=BC=8F=E7=BB=84=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E6=95=B0=E6=8D=AE=E3=80=81=E5=AF=BC=E5=87=BA=E6=BC=8F?= =?UTF-8?q?=E7=BB=84=E6=89=B9=E6=AC=A1=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E6=94=AF=E6=8C=81=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?/=E5=AF=BC=E5=87=BA=20=20=20TMS=E7=B3=BB=E7=BB=9F=20-=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B4=A6=E5=8D=95=E7=AE=A1=E7=90=86=20-=20?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=94=B6=E6=AC=BE=E9=92=88=E5=AF=B9=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E8=B4=A6=E5=8D=95=E4=B8=8D=E5=90=8C=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=94=B6=E6=AC=BE=E7=89=B9=E6=AE=8A=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit committer: heyu --- .../EmisTmsSiteBatchMissStatistics.java | 14 ++++-- ...TmsSiteBatchMissStatisticsServiceImpl.java | 35 -------------- .../EmisTmsSiteBatchMissStatisticsMapper.xml | 48 +++++++++---------- 3 files changed, 33 insertions(+), 64 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisTmsSiteBatchMissStatistics.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisTmsSiteBatchMissStatistics.java index 127d153aa..4c2217fc3 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisTmsSiteBatchMissStatistics.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/EmisTmsSiteBatchMissStatistics.java @@ -1,11 +1,11 @@ package com.xdadan.erp.emis.domain; import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; import com.xdadan.erp.common.core.domain.BaseEntity; import lombok.Data; import java.util.Date; -import java.util.List; /** * 漏组批次统计查询结果DTO @@ -29,9 +29,13 @@ public class EmisTmsSiteBatchMissStatistics extends BaseEntity { /** 票数 */ private Integer ticketCount; - /** 多个寄件月份,逗号分隔,例如:2025-06,2025-07 */ - private String billMonths; + /** 开始时间(含) */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; - /** 解析后的月份列表(yyyy-MM) */ - private List billMonthList; + /** 结束时间(含) */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; } diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissStatisticsServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissStatisticsServiceImpl.java index 7c05a9e4a..36236454e 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissStatisticsServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisTmsSiteBatchMissStatisticsServiceImpl.java @@ -46,7 +46,6 @@ public class EmisTmsSiteBatchMissStatisticsServiceImpl implements IEmisTmsSiteBa @Override public List selectStatisticsList( EmisTmsSiteBatchMissStatistics emisTmsSiteBatchMissStatistics) { - normalizeBillMonths(emisTmsSiteBatchMissStatistics); log.info("查询漏组批次统计列表,startSiteCode: {}, billMonth: {}", emisTmsSiteBatchMissStatistics.getStartSiteCode(), emisTmsSiteBatchMissStatistics.getBillMonth()); @@ -62,7 +61,6 @@ public class EmisTmsSiteBatchMissStatisticsServiceImpl implements IEmisTmsSiteBa @Override public void exportStatisticsData(HttpServletResponse response, EmisTmsSiteBatchMissStatistics emisTmsSiteBatchMissStatistics) { - normalizeBillMonths(emisTmsSiteBatchMissStatistics); try { // 设置响应头 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); @@ -242,7 +240,6 @@ public class EmisTmsSiteBatchMissStatisticsServiceImpl implements IEmisTmsSiteBa @Override public void exportDetailDataByMonthStream(HttpServletResponse response, EmisTmsSiteBatchMissStatistics emisTmsSiteBatchMissStatistics) { - normalizeBillMonths(emisTmsSiteBatchMissStatistics); long startTime = System.currentTimeMillis(); try { // 设置响应头 @@ -449,36 +446,4 @@ public class EmisTmsSiteBatchMissStatisticsServiceImpl implements IEmisTmsSiteBa } } - /** - * 归一化 billMonths 到 billMonthList,支持逗号分隔的多月份(yyyy-MM)。 - */ - private void normalizeBillMonths(EmisTmsSiteBatchMissStatistics query) { - if (query == null) { - return; - } - if (query.getBillMonthList() != null && !query.getBillMonthList().isEmpty()) { - return; - } - List result = new ArrayList<>(); - String months = query.getBillMonths(); - if (months != null && months.trim().length() > 0) { - String[] parts = months.split(","); - for (String p : parts) { - if (p != null) { - String v = p.trim(); - if (v.length() > 0) { - result.add(v); - } - } - } - } - if (result.isEmpty() && query.getBillMonth() != null) { - synchronized (MONTH_FORMAT) { - result.add(MONTH_FORMAT.format(query.getBillMonth())); - } - } - if (!result.isEmpty()) { - query.setBillMonthList(result); - } - } } diff --git a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMissStatisticsMapper.xml b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMissStatisticsMapper.xml index b5686b998..309172a60 100644 --- a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMissStatisticsMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMissStatisticsMapper.xml @@ -24,13 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bm.start_site_code = #{startSiteCode} - - AND DATE_FORMAT(w.send_date, '%Y-%m') IN - - #{bm} - + + AND w.send_date = ]]> #{startTime} - + + AND w.send_date #{endTime} + + AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m') @@ -76,13 +76,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND m.start_site_code = #{startSiteCode} - - AND DATE_FORMAT(w.send_date, '%Y-%m') IN - - #{bm} - + + AND w.send_date = ]]> #{startTime} - + + AND w.send_date #{endTime} + + AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m') @@ -128,13 +128,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND m.start_site_code = #{query.startSiteCode} - - AND DATE_FORMAT(w.send_date, '%Y-%m') IN - - #{bm} - + + AND w.send_date = ]]> #{query.startTime} - + + AND w.send_date #{query.endTime} + + AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{query.billMonth}, '%Y-%m') @@ -152,13 +152,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND m.start_site_code = #{startSiteCode} - - AND DATE_FORMAT(w.send_date, '%Y-%m') IN - - #{bm} - + + AND w.send_date = ]]> #{startTime} - + + AND w.send_date #{endTime} + + AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m')