From 14a233afceee4c3faa8803ad8d2df352924f3a3d Mon Sep 17 00:00:00 2001 From: ningjingzhiyuan1024 <596928539@qq.com> Date: Sat, 5 Jul 2025 16:18:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(trade):=20=E4=BC=98=E5=8C=96=20Kd100Ex?= =?UTF-8?q?pressQueryRespDTO=20=E4=B8=AD=E6=97=B6=E9=97=B4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=8F=8D=E5=BA=8F=E5=88=97=E5=8C=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除手动解析时间字符串的方法 - 使用 @JsonFormat 和 @JsonDeserialize 注解实现自动反序列化 - 提高代码简洁性和可维护性 --- .../core/client/dto/kd100/Kd100ExpressQueryRespDTO.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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 0b3034737b..2c0f8cba44 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 @@ -62,9 +62,8 @@ public class Kd100ExpressQueryRespDTO { private String timeStr; @JsonProperty("time") - public void parseTime(String timeStr) { - this.time = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern(FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); - } + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) private LocalDateTime time; /** * 轨迹描述