mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-15 18:51:54 +08:00
Merge branch 'master-jdk21' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into develop
# Conflicts: # yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/comment/ProductCommentServiceImplTest.java
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
import static java.util.Collections.singletonList;
|
||||
|
||||
@Tag(name = "用户 App - 优惠劵模板")
|
||||
@RestController
|
||||
@@ -53,7 +54,7 @@ public class AppCouponTemplateController {
|
||||
return success(null);
|
||||
}
|
||||
// 处理是否可领取
|
||||
Map<Long, Boolean> canCanTakeMap = couponService.getUserCanCanTakeMap(getLoginUserId(), List.of(template));
|
||||
Map<Long, Boolean> canCanTakeMap = couponService.getUserCanCanTakeMap(getLoginUserId(), singletonList(template));
|
||||
return success(BeanUtils.toBean(template, AppCouponTemplateRespVO.class)
|
||||
.setCanTake(canCanTakeMap.get(template.getId())));
|
||||
}
|
||||
@@ -72,7 +73,7 @@ public class AppCouponTemplateController {
|
||||
// 1.1 处理查询条件:商品范围编号
|
||||
Long productScopeValue = getProductScopeValue(productScope, spuId);
|
||||
// 1.2 处理查询条件:领取方式 = 直接领取
|
||||
List<Integer> canTakeTypes = Collections.singletonList(CouponTakeTypeEnum.USER.getValue());
|
||||
List<Integer> canTakeTypes = singletonList(CouponTakeTypeEnum.USER.getValue());
|
||||
|
||||
// 2. 查询
|
||||
List<CouponTemplateDO> list = couponTemplateService.getCouponTemplateList(canTakeTypes, productScope,
|
||||
@@ -104,7 +105,7 @@ public class AppCouponTemplateController {
|
||||
// 1.1 处理查询条件:商品范围编号
|
||||
Long productScopeValue = getProductScopeValue(pageReqVO.getProductScope(), pageReqVO.getSpuId());
|
||||
// 1.2 处理查询条件:领取方式 = 直接领取
|
||||
List<Integer> canTakeTypes = Collections.singletonList(CouponTakeTypeEnum.USER.getValue());
|
||||
List<Integer> canTakeTypes = singletonList(CouponTakeTypeEnum.USER.getValue());
|
||||
|
||||
// 2. 分页查询
|
||||
PageResult<CouponTemplateDO> pageResult = couponTemplateService.getCouponTemplatePage(
|
||||
|
@@ -70,7 +70,7 @@ public class CouponServiceImpl implements CouponService {
|
||||
throw exception(COUPON_STATUS_NOT_UNUSED);
|
||||
}
|
||||
// 校验有效期;为避免定时器没跑,实际优惠劵已经过期
|
||||
if (LocalDateTimeUtils.isBetween(coupon.getValidStartTime(), coupon.getValidEndTime())) {
|
||||
if (!LocalDateTimeUtils.isBetween(coupon.getValidStartTime(), coupon.getValidEndTime())) {
|
||||
throw exception(COUPON_VALID_TIME_NOT_NOW);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user