From e7a4c604b4703caf135ec3d360106e7cf028cc89 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 27 三月 2025 00:45:08 +0800 Subject: [PATCH] 修改统计bug和部分功能修改 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java index 82b5c84..3c1fe92 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java +++ b/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 -- Gitblit v1.7.1