From 28f27703b575d6bf3d55f669cb8c26db61afac82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Mon, 26 Jan 2026 13:56:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(handlingunit):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8D=95=E5=85=83DTO=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=8C=83=E5=9B=B4=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在HandlingUnitDto中新增startDate和endDate字段 - 为新字段添加DateTimeFormat和JsonFormat注解配置 - 在LabelQueryMapper.xml中添加基于创建日期的条件筛选 - 实现开始日期和结束日期的区间查询逻辑 - 配置日期格式化模式为yyyy-MM-dd,时区为GMT+8 --- .../modules/handlingunit/entity/dto/HandlingUnitDto.java | 6 ++++++ src/main/resources/mapper/warehouse/LabelQueryMapper.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java b/src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java index 73f1c56..2d416e9 100644 --- a/src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java +++ b/src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java @@ -91,6 +91,12 @@ public class HandlingUnitDto { private String locationName; private String position; private Integer layer; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date startDate; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date endDate; /** * 上次盘点日期 - rqrq diff --git a/src/main/resources/mapper/warehouse/LabelQueryMapper.xml b/src/main/resources/mapper/warehouse/LabelQueryMapper.xml index c744f41..e60921f 100644 --- a/src/main/resources/mapper/warehouse/LabelQueryMapper.xml +++ b/src/main/resources/mapper/warehouse/LabelQueryMapper.xml @@ -59,6 +59,12 @@ AND h.source_type = #{params.sourceType} + + AND h.created_date >= #{params.startDate} + + + AND dateadd( DAY, 1, #{params.endDate} ) > h.created_date + ORDER BY h.created_date DESC