门槛商品 可用商品

This commit is contained in:
2025-10-09 17:08:29 +08:00
parent 9a9b72e038
commit 5054534e01

View File

@@ -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);