From c611f1ad15f8d564142c25a303dce4359ebe38cb Mon Sep 17 00:00:00 2001 From: xubinbin0303 Date: Tue, 1 Jul 2025 19:17:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor.trade:=20=E4=BC=98=E5=8C=96=20Kd100Exp?= =?UTF-8?q?ressQueryRespDTO=20=E4=B8=AD=E6=97=B6=E9=97=B4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 timeStr 字段用于存储原始时间字符串 - 添加 parseTime 方法将时间字符串解析为 LocalDateTime 对象- 保留原有的 @JsonFormat 注解以确保序列化格式不变 --- .../core/client/dto/kd100/Kd100ExpressQueryRespDTO.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/dto/kd100/Kd100ExpressQueryRespDTO.java b/yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/dto/kd100/Kd100ExpressQueryRespDTO.java index 9d33cac21b..0b3034737b 100644 --- a/yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/dto/kd100/Kd100ExpressQueryRespDTO.java +++ b/yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/dto/kd100/Kd100ExpressQueryRespDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -58,9 +59,13 @@ public class Kd100ExpressQueryRespDTO { /** * 轨迹发生时间 */ - @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) - private LocalDateTime time; + private String timeStr; + @JsonProperty("time") + public void parseTime(String timeStr) { + this.time = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern(FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); + } + private LocalDateTime time; /** * 轨迹描述 */