门槛商品 可用商品
This commit is contained in:
@@ -333,17 +333,16 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||
if (CollUtil.isNotEmpty(couponFoodIds)) {
|
||||
List<Product> list = productService.list(new QueryWrapper()
|
||||
.in(Product::getId, couponFoodIds).eq(Product::getIsDel, 0));
|
||||
log.info("优惠券商品列表:{}", list);
|
||||
// log.info("优惠券商品列表:{}", list);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
continue;
|
||||
}
|
||||
if (tbUserCouponVo.getType() == 2) {
|
||||
tbUserCouponVo.setUseFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
|
||||
}));
|
||||
|
||||
} else {
|
||||
if (tbUserCouponVo.getType() == 1 || tbUserCouponVo.getType() == 3) {
|
||||
tbUserCouponVo.setThresholdFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
|
||||
}));
|
||||
} else {
|
||||
tbUserCouponVo.setUseFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
|
||||
}));
|
||||
}
|
||||
String foods = list.stream().map(Product::getName).collect(Collectors.joining(","));
|
||||
tbUserCouponVo.setFoods(foods);
|
||||
|
||||
Reference in New Issue
Block a user