Commit c74d85d940332220c9daaead155c0e30987a0f2e
Merge remote-tracking branch 'yudao/develop' into develop
Showing
6 changed files
with
11 additions
and
11 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java
| ... | ... | @@ -290,7 +290,7 @@ public class CollectionUtils { |
| 290 | 290 | return valueFunc.apply(t); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - public static <T, V extends Comparable<? super V>> T getMinPropertyObj(List<T> from, Function<T, V> valueFunc) { | |
| 293 | + public static <T, V extends Comparable<? super V>> T getMinObject(List<T> from, Function<T, V> valueFunc) { | |
| 294 | 294 | if (CollUtil.isEmpty(from)) { |
| 295 | 295 | return null; |
| 296 | 296 | } |
| ... | ... | @@ -298,7 +298,6 @@ public class CollectionUtils { |
| 298 | 298 | return from.stream().min(Comparator.comparing(valueFunc)).get(); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - | |
| 302 | 301 | public static <T, V extends Comparable<? super V>> V getSumValue(Collection<T> from, Function<T, V> valueFunc, |
| 303 | 302 | BinaryOperator<V> accumulator) { |
| 304 | 303 | return getSumValue(from, valueFunc, accumulator, null); | ... | ... |
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 { |
| 129 | 129 | List<PointActivityRespVO> result = BeanUtils.toBean(activityList, PointActivityRespVO.class); |
| 130 | 130 | result.forEach(activity -> { |
| 131 | 131 | // 设置 product 信息 |
| 132 | - PointProductDO minProduct = getMinPropertyObj(productsMap.get(activity.getId()), PointProductDO::getPoint); | |
| 132 | + PointProductDO minProduct = getMinObject(productsMap.get(activity.getId()), PointProductDO::getPoint); | |
| 133 | 133 | assert minProduct != null; |
| 134 | 134 | activity.setPoint(minProduct.getPoint()).setPrice(minProduct.getPrice()); |
| 135 | 135 | findAndThen(spuMap, activity.getSpuId(), | ... | ... |
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 { |
| 26 | 26 | @ExcelProperty("活动状态") |
| 27 | 27 | private Integer status; |
| 28 | 28 | |
| 29 | - @Schema(description = "积分商城活动库存(剩余库存积分兑换时扣减)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 30 | - @ExcelProperty("积分商城活动库存(剩余库存积分兑换时扣减)") | |
| 31 | - private Integer stock; | |
| 29 | + @Schema(description = "积分商城活动库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 30 | + @ExcelProperty("积分商城活动库存") | |
| 31 | + private Integer stock; // 剩余库存积分兑换时扣减 | |
| 32 | 32 | |
| 33 | 33 | @Schema(description = "积分商城活动总库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
| 34 | 34 | @ExcelProperty("积分商城活动总库存") | ... | ... |
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 { |
| 106 | 106 | List<AppPointActivityRespVO> result = BeanUtils.toBean(activityList, AppPointActivityRespVO.class); |
| 107 | 107 | result.forEach(activity -> { |
| 108 | 108 | // 设置 product 信息 |
| 109 | - PointProductDO minProduct = getMinPropertyObj(productsMap.get(activity.getId()), PointProductDO::getPoint); | |
| 109 | + PointProductDO minProduct = getMinObject(productsMap.get(activity.getId()), PointProductDO::getPoint); | |
| 110 | 110 | assert minProduct != null; |
| 111 | 111 | activity.setPoint(minProduct.getPoint()).setPrice(minProduct.getPrice()); |
| 112 | 112 | findAndThen(spuMap, activity.getSpuId(), | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/point/vo/AppPointActivityPageReqVO.java
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 { |
| 22 | 22 | @ExcelProperty("活动状态") |
| 23 | 23 | private Integer status; |
| 24 | 24 | |
| 25 | - @Schema(description = "积分商城活动库存(剩余库存积分兑换时扣减)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 26 | - @ExcelProperty("积分商城活动库存(剩余库存积分兑换时扣减)") | |
| 27 | - private Integer stock; | |
| 25 | + @Schema(description = "积分商城活动库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 26 | + @ExcelProperty("积分商城活动库存") | |
| 27 | + private Integer stock; // 剩余库存积分兑换时扣减 | |
| 28 | 28 | |
| 29 | 29 | @Schema(description = "积分商城活动总库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") |
| 30 | 30 | @ExcelProperty("积分商城活动总库存") |
| 31 | 31 | private Integer totalStock; |
| 32 | 32 | |
| 33 | + // TODO @puhui999:只返回必要的字段,例如说 remark、sort、createTime 应该是不需要的呢。也可以看看别的也不需要哈。 | |
| 34 | + | |
| 33 | 35 | @Schema(description = "备注", example = "你说的对") |
| 34 | 36 | @ExcelProperty("备注") |
| 35 | 37 | private String remark; | ... | ... |