From e2a8f7b38973b21ff8f5293fb90cf23391839dd2 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 14 Aug 2023 21:26:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E9=80=BB=E8=BE=91=E3=80=81=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=A0=8D=E4=BB=B7=E6=B4=BB=E5=8A=A8=E3=80=81=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E8=AE=B0=E5=BD=95=E5=88=9B=E5=BB=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CombinationActivityConvert.java | 19 ++++++++------- .../SeckillActivityConvert.java | 23 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java index 6e73510e96..7977d8fa90 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java @@ -68,20 +68,19 @@ public interface CombinationActivityConvert { List convertList2(List productDOs); - // TODO @puhui999:参数改成 activity、product 会不会干净一点哈 @Mappings({ @Mapping(target = "id", ignore = true), - @Mapping(target = "activityId", source = "activityDO.id"), - @Mapping(target = "spuId", source = "activityDO.spuId"), - @Mapping(target = "skuId", source = "vo.skuId"), - @Mapping(target = "activePrice", source = "vo.activePrice"), - @Mapping(target = "activityStartTime", source = "activityDO.startTime"), - @Mapping(target = "activityEndTime", source = "activityDO.endTime") + @Mapping(target = "activityId", source = "activity.id"), + @Mapping(target = "spuId", source = "activity.spuId"), + @Mapping(target = "skuId", source = "product.skuId"), + @Mapping(target = "activePrice", source = "product.activePrice"), + @Mapping(target = "activityStartTime", source = "activity.startTime"), + @Mapping(target = "activityEndTime", source = "activity.endTime") }) - CombinationProductDO convert(CombinationActivityDO activityDO, CombinationProductBaseVO vo); + CombinationProductDO convert(CombinationActivityDO activity, CombinationProductBaseVO product); - default List convertList(List products, CombinationActivityDO activityDO) { - return CollectionUtils.convertList(products, item -> convert(activityDO, item).setActivityStatus(activityDO.getStatus())); + default List convertList(List products, CombinationActivityDO activity) { + return CollectionUtils.convertList(products, item -> convert(activity, item).setActivityStatus(activity.getStatus())); } default List convertList(List updateProductVOs, diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java index 65f3b9b0cb..43b114bde5 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java @@ -56,22 +56,21 @@ public interface SeckillActivityConvert { return convert1(seckillActivity).setProducts(convertList2(seckillProducts)); } - // TODO @puhui999:参数改成 activity、product 会不会干净一点哈 @Mappings({ @Mapping(target = "id", ignore = true), - @Mapping(target = "activityId", source = "activityDO.id"), - @Mapping(target = "configIds", source = "activityDO.configIds"), - @Mapping(target = "spuId", source = "activityDO.spuId"), - @Mapping(target = "skuId", source = "vo.skuId"), - @Mapping(target = "seckillPrice", source = "vo.seckillPrice"), - @Mapping(target = "stock", source = "vo.stock"), - @Mapping(target = "activityStartTime", source = "activityDO.startTime"), - @Mapping(target = "activityEndTime", source = "activityDO.endTime") + @Mapping(target = "activityId", source = "activity.id"), + @Mapping(target = "configIds", source = "activity.configIds"), + @Mapping(target = "spuId", source = "activity.spuId"), + @Mapping(target = "skuId", source = "product.skuId"), + @Mapping(target = "seckillPrice", source = "product.seckillPrice"), + @Mapping(target = "stock", source = "product.stock"), + @Mapping(target = "activityStartTime", source = "activity.startTime"), + @Mapping(target = "activityEndTime", source = "activity.endTime") }) - SeckillProductDO convert(SeckillActivityDO activityDO, SeckillProductBaseVO vo); + SeckillProductDO convert(SeckillActivityDO activity, SeckillProductBaseVO product); - default List convertList(List products, SeckillActivityDO activityDO) { - return CollectionUtils.convertList(products, item -> convert(activityDO, item).setActivityStatus(activityDO.getStatus())); + default List convertList(List products, SeckillActivityDO activity) { + return CollectionUtils.convertList(products, item -> convert(activity, item).setActivityStatus(activity.getStatus())); } List convertList2(List productDOs);