Pu Zhibing
2025-03-27 e7a4c604b4703caf135ec3d360106e7cf028cc89
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -16,8 +16,12 @@
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.domain.ShopGiveawayTemporary;
import com.ruoyi.other.api.domain.ShopPointCopy;
import com.ruoyi.other.api.domain.ShopScore;
import com.ruoyi.other.mapper.ShopGiveawayTemporaryMapper;
import com.ruoyi.other.mapper.ShopMapper;
import com.ruoyi.other.mapper.ShopPointCopyMapper;
import com.ruoyi.other.service.ShopScoreService;
import com.ruoyi.other.service.ShopService;
import com.ruoyi.other.vo.NearbyShopVO;
@@ -53,6 +57,9 @@
    private TokenService tokenService;
    @Resource
    private SysUserClient sysUserClient;
    @Resource
    private ShopGiveawayTemporaryMapper shopGiveawayTemporaryMapper;
    @Override
@@ -60,7 +67,13 @@
        Page<Shop> page = new Page<>();
        page.setCurrent(PageNum);
        page.setSize(pageSize);
        return shopMapper.selectShopList(page, shop);
        IPage<Shop> shopIPage = shopMapper.selectShopList(page, shop);
        for (Shop record : shopIPage.getRecords()) {
            List<ShopGiveawayTemporary> shopPointCopies = shopGiveawayTemporaryMapper.selectList(new LambdaQueryWrapper<ShopGiveawayTemporary>().eq(ShopGiveawayTemporary::getShopId, record.getId()));
            int shopAllPoint = shopPointCopies.stream().mapToInt(ShopGiveawayTemporary::getShopAllPoint).sum();
            record.setShopAllPoint(record.getShopAllPoint() + shopAllPoint);
        }
        return shopIPage;
    }
    @Override