mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 07:11:52 +08:00
【代码优化】商城: 满减送活动
This commit is contained in:
parent
5ea3e5db0d
commit
81e3866665
@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionConditionTypeEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
|
||||
@ -77,24 +76,16 @@ public class RewardActivityBaseVO {
|
||||
@NotNull(message = "规则是否包邮不能为空")
|
||||
private Boolean freeDelivery;
|
||||
|
||||
@Schema(description = "是否赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@NotNull(message = "规则是否赠送积分不能为空")
|
||||
private Boolean givePoint;
|
||||
|
||||
@Schema(description = "赠送的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "是否赠送优惠券", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@NotNull(message = "规则是否赠送优惠券不能为空")
|
||||
private Boolean giveCoupon;
|
||||
|
||||
@Schema(description = "赠送的优惠劵编号的数组", example = "1,2,3")
|
||||
private Map<Long, Integer> giveCouponsMap;
|
||||
|
||||
@AssertTrue(message = "赠送的积分不能小于 1")
|
||||
@JsonIgnore
|
||||
public boolean isPointValid() {
|
||||
return BooleanUtil.isFalse(givePoint) || (point != null && point >= 1);
|
||||
return point == null || point >= 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,20 +100,10 @@ public class RewardActivityDO extends BaseDO {
|
||||
* 是否包邮
|
||||
*/
|
||||
private Boolean freeDelivery;
|
||||
// TODO @puhui999:是不是大于零,就认为赠送积分哈;简洁一点;
|
||||
/**
|
||||
* 是否赠送积分
|
||||
*/
|
||||
private Boolean givePoint;
|
||||
/**
|
||||
* 赠送的积分
|
||||
*/
|
||||
private Integer point;
|
||||
// TODO @puhui999:非空,就认为赠送优惠劵
|
||||
/**
|
||||
* 是否赠送优惠券
|
||||
*/
|
||||
private Boolean giveCoupon;
|
||||
/**
|
||||
* 赠送的优惠劵
|
||||
*
|
||||
|
@ -159,7 +159,6 @@ public class RewardActivityServiceImpl implements RewardActivityService {
|
||||
|
||||
@Override
|
||||
public List<RewardActivityMatchRespDTO> getMatchRewardActivityList(Collection<Long> spuIds) {
|
||||
// TODO 芋艿:待实现;先指定,然后再全局的;
|
||||
List<RewardActivityDO> list = rewardActivityMapper.selectListBySpuIdsAndStatus(spuIds, CommonStatusEnum.ENABLE.getStatus());
|
||||
return BeanUtils.toBean(list, RewardActivityMatchRespDTO.class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user