From a336a7401ce95d8fcdc8304ce1dce0421089b5db Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 13 一月 2025 11:02:35 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 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 cce5829..883a4c3 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
@@ -3,13 +3,17 @@
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.other.api.domain.ShopPoint;
 import com.ruoyi.other.api.enums.PointChangeType;
 import com.ruoyi.other.mapper.ShopPointMapper;
 import com.ruoyi.other.service.ShopPointService;
 import com.ruoyi.other.vo.ShopPointStatistics;
+import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.api.feignClient.SysUserClient;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -29,8 +33,18 @@
 @Service
 public class ShopPointServiceImpl extends ServiceImpl<ShopPointMapper, ShopPoint> implements ShopPointService {
 
+    @Resource
+    private TokenService tokenService;
+    @Resource
+    private SysUserClient sysUserClient;
+
+
+
+
     @Override
     public ShopPointStatistics statistics(IPage<ShopPoint> page, ShopPoint shopPoint) {
+        Long userid = tokenService.getLoginUser().getUserid();
+        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
         List<ShopPoint> shopPoints = this.baseMapper.selectShopPointList(shopPoint);
         Map<Integer, Integer> shopPointMap = shopPoints.stream()
                 .collect(Collectors.groupingBy(
@@ -54,8 +68,7 @@
         LocalDateTime endTime = shopPoint.getEndTime();
         if(null != startTime){
             List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>()
-                    // todo bug说应展示所有门店积分数据
-//                    .eq(ShopPoint::getShopId, shopPoint.getShopId())
+                    .eq(ShopPoint::getShopId, sysUser.getObjectId())
                     .last(" and create_time between '" + startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "' and '" + endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "'"));
             List<String> date = new ArrayList<>();
             List<Map<String, Integer>> data = new ArrayList<>();

--
Gitblit v1.7.1