From f6a6a1ff88c4b81cdfbf71652b51ef76d0efc888 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 29 Sep 2024 07:28:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E7=A7=AF=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E7=9A=84=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/common/util/collection/CollectionUtils.java | 3 +-- .../controller/admin/point/PointActivityController.java | 2 +- .../admin/point/vo/activity/PointActivityRespVO.java | 6 +++--- .../controller/app/point/AppPointActivityController.java | 2 +- .../app/point/vo/AppPointActivityPageReqVO.java | 1 - .../controller/app/point/vo/AppPointActivityRespVO.java | 8 +++++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java index c52639b57e..d611fdf235 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java @@ -290,7 +290,7 @@ public class CollectionUtils { return valueFunc.apply(t); } - public static > T getMinPropertyObj(List from, Function valueFunc) { + public static > T getMinObject(List from, Function valueFunc) { if (CollUtil.isEmpty(from)) { return null; } @@ -298,7 +298,6 @@ public class CollectionUtils { return from.stream().min(Comparator.comparing(valueFunc)).get(); } - public static > V getSumValue(Collection from, Function valueFunc, BinaryOperator accumulator) { return getSumValue(from, valueFunc, accumulator, null); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/PointActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/PointActivityController.java index cd43b2164f..d8fb54b081 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/PointActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/PointActivityController.java @@ -129,7 +129,7 @@ public class PointActivityController { List result = BeanUtils.toBean(activityList, PointActivityRespVO.class); result.forEach(activity -> { // 设置 product 信息 - PointProductDO minProduct = getMinPropertyObj(productsMap.get(activity.getId()), PointProductDO::getPoint); + PointProductDO minProduct = getMinObject(productsMap.get(activity.getId()), PointProductDO::getPoint); assert minProduct != null; activity.setPoint(minProduct.getPoint()).setPrice(minProduct.getPrice()); findAndThen(spuMap, activity.getSpuId(), diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/activity/PointActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/activity/PointActivityRespVO.java index 69fa0f0c74..d81b3d6902 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/activity/PointActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/activity/PointActivityRespVO.java @@ -26,9 +26,9 @@ public class PointActivityRespVO { @ExcelProperty("活动状态") private Integer status; - @Schema(description = "积分商城活动库存(剩余库存积分兑换时扣减)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("积分商城活动库存(剩余库存积分兑换时扣减)") - private Integer stock; + @Schema(description = "积分商城活动库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("积分商城活动库存") + private Integer stock; // 剩余库存积分兑换时扣减 @Schema(description = "积分商城活动总库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("积分商城活动总库存") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/AppPointActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/AppPointActivityController.java index 20cc8b6c33..06c16c0356 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/AppPointActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/AppPointActivityController.java @@ -102,7 +102,7 @@ public class AppPointActivityController { List result = BeanUtils.toBean(activityList, AppPointActivityRespVO.class); result.forEach(activity -> { // 设置 product 信息 - PointProductDO minProduct = getMinPropertyObj(productsMap.get(activity.getId()), PointProductDO::getPoint); + PointProductDO minProduct = getMinObject(productsMap.get(activity.getId()), PointProductDO::getPoint); assert minProduct != null; activity.setPoint(minProduct.getPoint()).setPrice(minProduct.getPrice()); findAndThen(spuMap, activity.getSpuId(), diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityPageReqVO.java index 1fd2c2222e..6a4119563d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityPageReqVO.java @@ -12,5 +12,4 @@ import lombok.ToString; @ToString(callSuper = true) public class AppPointActivityPageReqVO extends PageParam { - } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityRespVO.java index 924a4394aa..29f4f97c11 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityRespVO.java @@ -22,14 +22,16 @@ public class AppPointActivityRespVO { @ExcelProperty("活动状态") private Integer status; - @Schema(description = "积分商城活动库存(剩余库存积分兑换时扣减)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("积分商城活动库存(剩余库存积分兑换时扣减)") - private Integer stock; + @Schema(description = "积分商城活动库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("积分商城活动库存") + private Integer stock; // 剩余库存积分兑换时扣减 @Schema(description = "积分商城活动总库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("积分商城活动总库存") private Integer totalStock; + // TODO @puhui999:只返回必要的字段,例如说 remark、sort、createTime 应该是不需要的呢。也可以看看别的也不需要哈。 + @Schema(description = "备注", example = "你说的对") @ExcelProperty("备注") private String remark;