From 97d99b76bdde8952cf257c3c85c1a8a080927af4 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期一, 31 三月 2025 16:44:22 +0800 Subject: [PATCH] 修改反馈文档bug --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java | 54 ++++++++++++++++-------------------------------------- 1 files changed, 16 insertions(+), 38 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java index 9971d47..73b96ae 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.api.domain.ShopGiveawayTemporary; @@ -65,12 +66,19 @@ if (sysUser.getRoleType()==1){ ShopPointStatistics shopPointStatistics = new ShopPointStatistics(); + shopPointStatistics.setTotalPoint(0); + shopPointStatistics.setSubShopCommissionPoint(0); + shopPointStatistics.setShopPoint(0); + shopPointStatistics.setShopCommissionPoint(0); + IPage<ShopPoint> shopPointIPage = this.baseMapper.queryShpointPage(page, shopPoint); shopPointIPage.getRecords().forEach(s->s.setVariablePoint(s.getVariablePoint() * s.getChangeDirection())); shopPointStatistics.setShopPointIPage(shopPointIPage); - - - List<ShopPoint> shopPointList = list(); + + IPage<ShopPoint> page1 = new PageInfo<>(0, 100000); + IPage<ShopPoint> shopPointIPage1 = this.baseMapper.queryShpointPage(page1, shopPoint); + List<ShopPoint> shopPointList = shopPointIPage1.getRecords(); + shopPointList.forEach(s->s.setVariablePoint(s.getVariablePoint() * s.getChangeDirection())); Map<Integer, List<ShopPoint>> shopPointByTypeMap = shopPointList.stream().collect(Collectors.groupingBy(ShopPoint::getType)); shopPointByTypeMap.forEach((type, shopPoints) -> { shopPoints.stream().map(ShopPoint::getVariablePoint).reduce(Integer::sum).ifPresent(sum -> { @@ -89,41 +97,6 @@ } }); }); - - List<ShopPointCopy> shopPointCopyList = shopPointCopyMapper.selectList(null); - Map<Integer, List<ShopPointCopy>> shopPointByTypeMaps = shopPointCopyList.stream().collect(Collectors.groupingBy(ShopPointCopy::getType)); - shopPointByTypeMaps.forEach((type, shopPoints) -> { - shopPoints.stream().map(ShopPointCopy::getVariablePoint).reduce(Integer::sum).ifPresent(sum -> { - switch (type) { - case 1: - shopPointStatistics.setShopPoint((null == shopPointStatistics.getShopPoint() ? 0 : shopPointStatistics.getShopPoint()) + sum); - break; - case 2: - shopPointStatistics.setShopCommissionPoint((null == shopPointStatistics.getShopCommissionPoint() ? 0 : shopPointStatistics.getShopCommissionPoint()) + sum); - break; - case 3: - shopPointStatistics.setSubShopCommissionPoint((null == shopPointStatistics.getSubShopCommissionPoint() ? 0 : shopPointStatistics.getSubShopCommissionPoint()) + sum); - break; - default: - break; - } - }); - }); - - - List<ShopGiveawayTemporary> list1 = shopGiveawayTemporaryMapper.selectList(null); - int serverPointCopy = list1.stream().mapToInt(ShopGiveawayTemporary::getServerPoint).sum(); - int sharePointCopy = list1.stream().mapToInt(ShopGiveawayTemporary::getSharePoint).sum(); - int lowerLevelSharePointCopy = list1.stream().mapToInt(ShopGiveawayTemporary::getLowerLevelSharePoint).sum(); - Integer point = shopPointStatistics.getShopPoint() == null ? 0 : shopPointStatistics.getShopPoint() + serverPointCopy; - Integer shopCommissionPoint = shopPointStatistics.getShopCommissionPoint() == null ? 0 : shopPointStatistics.getShopCommissionPoint() + sharePointCopy; - Integer setSubShopCommissionPoint = shopPointStatistics.getSubShopCommissionPoint() == null ? 0 : shopPointStatistics.getSubShopCommissionPoint() + lowerLevelSharePointCopy; - Integer totalPoint = point + shopCommissionPoint + setSubShopCommissionPoint; - shopPointStatistics.setShopPoint(point); - shopPointStatistics.setShopCommissionPoint(shopCommissionPoint); - shopPointStatistics.setSubShopCommissionPoint(setSubShopCommissionPoint); - shopPointStatistics.setTotalPoint(totalPoint); - LocalDateTime startTime = shopPoint.getStartTime(); LocalDateTime endTime = shopPoint.getEndTime(); @@ -162,6 +135,11 @@ brokenLine.put("data", data); shopPointStatistics.setBrokenLine(brokenLine); } + + Integer shopPoint1 = shopPointStatistics.getShopPoint(); + Integer shopCommissionPoint = shopPointStatistics.getShopCommissionPoint(); + Integer subShopCommissionPoint = shopPointStatistics.getSubShopCommissionPoint(); + shopPointStatistics.setTotalPoint(shopPoint1 + shopCommissionPoint + subShopCommissionPoint); return shopPointStatistics; }else{ Shop shop = shopService.getById(sysUser.getObjectId()); -- Gitblit v1.7.1