Merge remote-tracking branch 'yudao/develop' into develop

This commit is contained in:
puhui999 2024-10-04 13:59:11 +08:00
commit c74d85d940
6 changed files with 11 additions and 11 deletions

View File

@ -290,7 +290,7 @@ public class CollectionUtils {
return valueFunc.apply(t);
}
public static <T, V extends Comparable<? super V>> T getMinPropertyObj(List<T> from, Function<T, V> valueFunc) {
public static <T, V extends Comparable<? super V>> T getMinObject(List<T> from, Function<T, V> valueFunc) {
if (CollUtil.isEmpty(from)) {
return null;
}
@ -298,7 +298,6 @@ public class CollectionUtils {
return from.stream().min(Comparator.comparing(valueFunc)).get();
}
public static <T, V extends Comparable<? super V>> V getSumValue(Collection<T> from, Function<T, V> valueFunc,
BinaryOperator<V> accumulator) {
return getSumValue(from, valueFunc, accumulator, null);

View File

@ -129,7 +129,7 @@ public class PointActivityController {
List<PointActivityRespVO> 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(),

View File

@ -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("积分商城活动总库存")

View File

@ -106,7 +106,7 @@ public class AppPointActivityController {
List<AppPointActivityRespVO> 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(),

View File

@ -12,5 +12,4 @@ import lombok.ToString;
@ToString(callSuper = true)
public class AppPointActivityPageReqVO extends PageParam {
}

View File

@ -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只返回必要的字段例如说 remarksortcreateTime 应该是不需要的呢也可以看看别的也不需要哈
@Schema(description = "备注", example = "你说的对")
@ExcelProperty("备注")
private String remark;