优惠券问题

This commit is contained in:
wangw 2025-03-08 15:36:21 +08:00
parent 15d6664ef1
commit 41a27794b2
1 changed files with 6 additions and 3 deletions

View File

@ -49,15 +49,18 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
private ShopUserService shopUserService;
@Resource
private ShopInfoService shopInfoService;
@Resource
@DubboReference
private ProductService productService;
@Override
public List<ShopCouponDTO> getList(Long shopId, Integer type, Integer status) {
List<ShopCouponDTO> coupons = queryChain().select().eq(ShopCoupon::getShopId, shopId)
List<ShopCouponDTO> coupons = queryChain().select()
.eq(ShopCoupon::getShopId, shopId)
.eq(ShopCoupon::getType, type)
.eq(ShopCoupon::getStatus, status)
.orderBy(ShopCoupon::getCreateTime).desc().listAs(ShopCouponDTO.class);
.orderBy(ShopCoupon::getCreateTime).desc()
.listAs(ShopCouponDTO.class);
System.out.println(coupons);
coupons.forEach(coupon -> {
if (coupon.getProId() != null) {
Product product = productService.getById(coupon.getProId());