Ver código fonte

fix : 订单组长权限

bilingfeng 1 ano atrás
pai
commit
270de721e1

+ 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, 一大波修改上线> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 订单组长权限> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 6 - 7
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -206,15 +206,16 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 
     @Override
     public Tuple2<List<Long>, List<AgentDTO>> getUserAgent(String account, String pitcherId, Long agentId) {
+        //组成员列表
+        List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
         //自然量查询
         if (Objects.equals(agentId, Agent.DEFAULT_AGENT)) {
-            //管理员
-            if (SecurityUtil.isManager()) {
+            //判断管理员或者组长
+            if (SecurityUtil.isManager() || CollectionUtils.isNotEmpty(memberUserIdList)) {
                 return Tuples.of(Collections.singletonList(Agent.DEFAULT_AGENT), Collections.emptyList());
-            } else {
-                //非管理员不允许查询自然量
-                return Tuples.of(Collections.emptyList(), Collections.emptyList());
             }
+            //非管理员或者组长不允许查询自然量
+            return Tuples.of(Collections.emptyList(), Collections.emptyList());
         }
         //渠道列表
         List<Agent> agentList;
@@ -227,8 +228,6 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
                     .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
                     .eq(agentId != null, Agent::getId, agentId));
         } else {
-            //判断是否是组长
-            List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
             //组长, 可查看自己或者组员数据
             if (CollectionUtils.isNotEmpty(memberUserIdList)) {
                 groupLeader = true;