积分问题
This commit is contained in:
@@ -19,6 +19,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -66,22 +67,22 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
||||
@Override
|
||||
public Map<String, Object> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, String goodsCategory, Long userId) {
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
|
||||
if (!exists) {
|
||||
return result;
|
||||
}
|
||||
MkPointsUser pointsUser = pointsUserService.getPointsUser(shopId, null, userId);
|
||||
PageHelper.startPage(page, size);
|
||||
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId, StrUtil.trim(goodsCategory));
|
||||
list.forEach(goods -> {
|
||||
if ("优惠券".equals(goods.getGoodsCategory())) {
|
||||
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);
|
||||
}
|
||||
});
|
||||
List<MkPointsGoods> list = new ArrayList<>();
|
||||
boolean exists = mkPointsConfigService.exists(query().eq(MkPointsConfig::getShopId, shopId).eq(MkPointsConfig::getEnablePointsMall, 1));
|
||||
if (exists) {
|
||||
PageHelper.startPage(page, size);
|
||||
list = mapper.getPointsGoodsPageByUser(shopId, userId, StrUtil.trim(goodsCategory));
|
||||
list.forEach(goods -> {
|
||||
if ("优惠券".equals(goods.getGoodsCategory())) {
|
||||
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("pointsUser", pointsUser == null ? "" : pointsUser);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user