From 89580e79039ee7614250d6faa9bc852135e6fe46 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 13 Nov 2022 12:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=20master=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/util/date/LocalDateTimeUtils.java | 17 +++++++++++++++++ .../trade/convert/order/TradeOrderConvert.java | 5 +---- .../pay/api/order/PayOrderInfoCreateReqDTO.java | 1 - 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java new file mode 100644 index 000000000..67b0d0f4f --- /dev/null +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.framework.common.util.date; + +import java.time.Duration; +import java.time.LocalDateTime; + +/** + * 时间工具类,用于 {@link java.time.LocalDateTime} + * + * @author 芋道源码 + */ +public class LocalDateTimeUtils { + + public static LocalDateTime addTime(Duration duration) { + return LocalDateTime.now().plus(duration); + } + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 7b1ff5aa1..54abc9698 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.trade.convert.order; -import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO; import cn.iocoder.yudao.module.pay.api.order.PayOrderInfoCreateReqDTO; import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; @@ -20,12 +18,11 @@ import org.mapstruct.Mapping; import org.mapstruct.Mappings; import org.mapstruct.factory.Mappers; -import java.time.Duration; import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.addTime; @Mapper public interface TradeOrderConvert { diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/PayOrderInfoCreateReqDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/PayOrderInfoCreateReqDTO.java index 0e9d1e0e7..b5f64478d 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/PayOrderInfoCreateReqDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/PayOrderInfoCreateReqDTO.java @@ -9,7 +9,6 @@ import javax.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; -// TODO @LeeYan9: 1) 新建一个 dto 包, 然后挪进去哈; 2) 在 order下; Info 可以去掉; /** * 支付单创建 Request DTO *