积分商品 优惠券类型的 回填 优惠券信息
This commit is contained in:
@@ -51,6 +51,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
|||||||
if (goods.getGoodsCategory().equals("优惠劵")) {
|
if (goods.getGoodsCategory().equals("优惠劵")) {
|
||||||
ShopCoupon one = shopCouponService.getOne(query().eq(ShopCoupon::getId, goods.getCouponId())
|
ShopCoupon one = shopCouponService.getOne(query().eq(ShopCoupon::getId, goods.getCouponId())
|
||||||
.eq(ShopCoupon::getShopId, shopId)
|
.eq(ShopCoupon::getShopId, shopId)
|
||||||
|
.eq(ShopCoupon::getStatus, 1)
|
||||||
.eq(ShopCoupon::getIsDel, 0));
|
.eq(ShopCoupon::getIsDel, 0));
|
||||||
goods.setCouponInfo(one);
|
goods.setCouponInfo(one);
|
||||||
}
|
}
|
||||||
@@ -64,6 +65,15 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
|||||||
MkPointsUser pointsUser = pointsUserService.getPointsUser(shopId, null, userId);
|
MkPointsUser pointsUser = pointsUserService.getPointsUser(shopId, null, userId);
|
||||||
PageHelper.startPage(page, size);
|
PageHelper.startPage(page, size);
|
||||||
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, goodsCategory.trim());
|
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, goodsCategory.trim());
|
||||||
|
list.forEach(goods -> {
|
||||||
|
if (goods.getGoodsCategory().equals("优惠劵")) {
|
||||||
|
ShopCoupon one = shopCouponService.getOne(query().eq(ShopCoupon::getId, goods.getCouponId())
|
||||||
|
.eq(ShopCoupon::getShopId, shopId)
|
||||||
|
.eq(ShopCoupon::getStatus, 1)
|
||||||
|
.eq(ShopCoupon::getIsDel, 0));
|
||||||
|
goods.setCouponInfo(one);
|
||||||
|
}
|
||||||
|
});
|
||||||
result.put("pointsGoods", PageUtil.convert(new PageInfo<>(list)));
|
result.put("pointsGoods", PageUtil.convert(new PageInfo<>(list)));
|
||||||
result.put("pointsUser", pointsUser == null ? "" : pointsUser);
|
result.put("pointsUser", pointsUser == null ? "" : pointsUser);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user