lyhzzz 9 mesiacov pred
rodič
commit
058780f04f

+ 14 - 0
src/main/java/com/fdkankan/manage/service/impl/DataService.java

@@ -1,6 +1,8 @@
 package com.fdkankan.manage.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.manage.entity.JyUser;
 import com.fdkankan.manage.entity.User;
 import com.fdkankan.manage.mapper.IDataMapper;
 import com.fdkankan.manage.service.*;
@@ -53,6 +55,12 @@ public class DataService implements IDataService {
         List<Long> userIds = new ArrayList<>();
         if(loginPlatformId != null) {
             userIds = jyUserService.getByUserIdPlatform(loginPlatformId);
+        }else {
+            JyUser jyUser = jyUserService.getBySysId(StpUtil.getLoginId());
+            if(jyUser == null){
+                return new SceneTotalVo();
+            }
+            userIds.add(jyUser.getUserId());
         }
         SceneTotalVo totalVo = new SceneTotalVo();
         Long totalSceneCount = dataMapper.totalUserCount("t_scene_pro",1,userIds) + dataMapper.totalUserCount("t_scene_plus",0,userIds);
@@ -253,6 +261,12 @@ public class DataService implements IDataService {
         List<Long> userIds = new ArrayList<>();
         if(loginPlatformId != null) {
             userIds = jyUserService.getByUserIdPlatform(loginPlatformId);
+        }else {
+            JyUser jyUser = jyUserService.getBySysId(StpUtil.getLoginId());
+            if(jyUser == null){
+                return new HashMap<>();
+            }
+            userIds.add(jyUser.getUserId());
         }
 
         HashMap<String,List<DataGroupByCount>> map = new HashMap<>();