Browse Source

fix : SDK后台组长权限修改

bilingfeng 1 year ago
parent
commit
530d59585e

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, SDK后台功能修改优化> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, SDK后台组长权限修改> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 9 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -217,6 +217,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         //渠道列表
         List<Agent> agentList;
         List<AgentDTO> agentDTOList = new ArrayList<>();
+        boolean groupLeader = false;
         //超管权限
         if (SecurityUtil.isManager()) {
             agentList = super.list(new LambdaQueryWrapper<Agent>()
@@ -228,6 +229,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
             List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
             //组长, 可查看自己或者组员数据
             if (CollectionUtils.isNotEmpty(memberUserIdList)) {
+                groupLeader = true;
+                if (!memberUserIdList.contains(SecurityUtil.getUserId())) {
+                    memberUserIdList.add(SecurityUtil.getUserId());
+                }
                 agentList = super.list(new LambdaQueryWrapper<Agent>()
                         .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                         .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
@@ -261,6 +266,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         if (SecurityUtil.isManager() && Strings.isBlank(account) && Strings.isBlank(pitcherId) && agentId == null) {
             agentIds.add(Agent.DEFAULT_AGENT);
         }
+        //组长可见自然量
+        if (groupLeader && !agentIds.contains(Agent.DEFAULT_AGENT)) {
+            agentIds.add(Agent.DEFAULT_AGENT);
+        }
         return Tuples.of(agentIds, agentDTOList);
     }