czh 2 years ago
parent
commit
b9482489e7

+ 7 - 4
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -204,23 +204,26 @@ public class RemoteUserServiceImpl implements RemoteUserService {
             return Collections.emptyList();
         }
 
+        List<Long> list = new ArrayList<>();
+        list.add(id);
         List<KwsRoleResDto> kwsRoleResDtos = remoteBaseService.queryRoleInfoByUserId(id);
         if (CollectionUtils.isEmpty(kwsRoleResDtos)) {
-            return Collections.emptyList();
+            return list;
         }
 
         List<KwsAuthority> kwsAuthorities = remoteBaseService.queryAuthorityByRoles(kwsRoleResDtos.stream().map(KwsRoleResDto::getId).toList());
         if (CollectionUtils.isEmpty(kwsAuthorities)) {
-            return Collections.emptyList();
+            return list;
         }
 
         List<Long> deptIds = kwsAuthorities.stream().map(KwsAuthority::getDeptId).toList();
         List<KwsUser> kwsUsers = remoteBaseService.queryUserByDeptIds(deptIds);
         if(CollectionUtils.isEmpty(kwsUsers)) {
-            return Collections.emptyList();
+            return list;
         }
 
-        return kwsUsers.stream().filter(item -> item.getIsMain().equals(Global.NO)).map(KwsUser::getId).distinct().toList();
+        list.addAll(kwsUsers.stream().filter(item -> item.getIsMain().equals(Global.NO) && !item.getId().equals(id)).map(KwsUser::getId).distinct().toList());
+        return list;
     }
 
 

+ 1 - 2
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -92,14 +92,13 @@
     from kws_enterprise a
     left join kws_user k on a.create_by = k.id
     left join kws_user ku on a.update_by = ku.id
-    left join kws_ent_type b on a.id = b.ent_id
+    left join kws_ent_type b on a.id = b.ent_id and b.del_flag = 0
     <if test="dto.typeList != null and dto.typeList.size() > 0">and b.type in
       <foreach collection="dto.typeList" item="item" open="(" close=")" separator=",">
         #{item}
       </foreach>
     </if>
     where a.del_flag = 0
-    and b.del_flag = 0
     <if test="dto.approval != null">
       and a.approval = #{dto.approval}
     </if>