demand: TMS系统 - 运输管理 - 漏组批次统计 - 查询漏组批次统计列表、导出漏组详细数据、导出漏组批次统计查询接口数据支持根据时间范围查询/导出 TMS系统 - 客户账单管理 - 发票收款针对相同账单不同发票合并收款特殊逻辑特殊处理

committer: heyu
This commit is contained in:
aike 2025-09-28 16:21:20 +08:00
parent 7fd45c391a
commit 3b74434320
3 changed files with 33 additions and 64 deletions

View File

@ -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<String> billMonthList;
/** 结束时间(含) */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
}

View File

@ -46,7 +46,6 @@ public class EmisTmsSiteBatchMissStatisticsServiceImpl implements IEmisTmsSiteBa
@Override
public List<EmisTmsSiteBatchMissStatistics> 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<String> 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);
}
}
}

View File

@ -24,13 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startSiteCode != null and startSiteCode != ''">
AND bm.start_site_code = #{startSiteCode}
</if>
<if test="billMonthList != null and billMonthList.size() &gt; 0">
AND DATE_FORMAT(w.send_date, '%Y-%m') IN
<foreach collection="billMonthList" item="bm" open="(" separator="," close=")">
#{bm}
</foreach>
<if test="startTime != null">
AND w.send_date <![CDATA[ >= ]]> #{startTime}
</if>
<if test="billMonthList == null or billMonthList.size() == 0">
<if test="endTime != null">
AND w.send_date <![CDATA[ <= ]]> #{endTime}
</if>
<if test="startTime == null and endTime == null">
<if test="billMonth != null">
AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m')
</if>
@ -76,13 +76,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startSiteCode != null and startSiteCode != ''">
AND m.start_site_code = #{startSiteCode}
</if>
<if test="billMonthList != null and billMonthList.size() &gt; 0">
AND DATE_FORMAT(w.send_date, '%Y-%m') IN
<foreach collection="billMonthList" item="bm" open="(" separator="," close=")">
#{bm}
</foreach>
<if test="startTime != null">
AND w.send_date <![CDATA[ >= ]]> #{startTime}
</if>
<if test="billMonthList == null or billMonthList.size() == 0">
<if test="endTime != null">
AND w.send_date <![CDATA[ <= ]]> #{endTime}
</if>
<if test="startTime == null and endTime == null">
<if test="billMonth != null">
AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m')
</if>
@ -128,13 +128,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.startSiteCode != null and query.startSiteCode != ''">
AND m.start_site_code = #{query.startSiteCode}
</if>
<if test="query.billMonthList != null and query.billMonthList.size() &gt; 0">
AND DATE_FORMAT(w.send_date, '%Y-%m') IN
<foreach collection="query.billMonthList" item="bm" open="(" separator="," close=")">
#{bm}
</foreach>
<if test="query.startTime != null">
AND w.send_date <![CDATA[ >= ]]> #{query.startTime}
</if>
<if test="query.billMonthList == null or query.billMonthList.size() == 0">
<if test="query.endTime != null">
AND w.send_date <![CDATA[ <= ]]> #{query.endTime}
</if>
<if test="query.startTime == null and query.endTime == null">
<if test="query.billMonth != null">
AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{query.billMonth}, '%Y-%m')
</if>
@ -152,13 +152,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startSiteCode != null and startSiteCode != ''">
AND m.start_site_code = #{startSiteCode}
</if>
<if test="billMonthList != null and billMonthList.size() &gt; 0">
AND DATE_FORMAT(w.send_date, '%Y-%m') IN
<foreach collection="billMonthList" item="bm" open="(" separator="," close=")">
#{bm}
</foreach>
<if test="startTime != null">
AND w.send_date <![CDATA[ >= ]]> #{startTime}
</if>
<if test="billMonthList == null or billMonthList.size() == 0">
<if test="endTime != null">
AND w.send_date <![CDATA[ <= ]]> #{endTime}
</if>
<if test="startTime == null and endTime == null">
<if test="billMonth != null">
AND DATE_FORMAT(w.send_date, '%Y-%m') = DATE_FORMAT(#{billMonth}, '%Y-%m')
</if>