添加 todo

如果没有优惠券
This commit is contained in:
sin 2019-04-19 20:37:38 +08:00
parent c6883c7531
commit ea4593adbc
1 changed files with 2 additions and 0 deletions

View File

@ -254,6 +254,8 @@ public class CouponServiceImpl implements CouponService {
public CommonResult<List<CouponCardAvailableBO>> getCouponCardList(Integer userId, List<CouponCardSpuDTO> spus) {
// 查询用户未使用的优惠劵列表
List<CouponCardDO> cards = couponCardMapper.selectListByUserIdAndStatus(userId, CouponCardStatusEnum.UNUSED.getValue());
// TODO: 2019-04-19 芋艿 如果没有优惠券处理
Map<Integer, CouponTemplateDO> templates = couponTemplateMapper.selectListByIds(cards.stream().map(CouponCardDO::getTemplateId).collect(Collectors.toSet()))
.stream().collect(Collectors.toMap(CouponTemplateDO::getId, template -> template));
// 逐个判断是否可用