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 c52639b57..d611fdf23 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 cd43b2164..d8fb54b08 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 69fa0f0c7..d81b3d690 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 ed6998340..f607aea77 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 @@ -106,7 +106,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 1fd2c2222..6a4119563 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 924a4394a..29f4f97c1 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;