Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

zk 2 rokov pred
rodič
commit
50142857fb

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/pojo/FindMenuTreePojo.java

@@ -15,7 +15,7 @@ public class FindMenuTreePojo {
     /**
      * 客户端类型
      */
-    private String clientType;
+    private Integer clientType;
 
     /**
      * 菜单名

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

@@ -336,7 +336,7 @@ public class KwsMenuService {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ROLE_NOT_EXISTS);
         }
         //特殊处理,员工账号先查pc端的菜单,后面会做菜单关联
-        findMenuTreePojo.setClientType(String.valueOf(SystemTypeEnum.COMPANY.getCode()));
+        findMenuTreePojo.setClientType(SystemTypeEnum.COMPANY.getCode());
         findMenuTreePojo.setRoleIds(allByUserId.stream().map(KwsUserRole::getRoleId).toList());
     }
 

+ 7 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsRoleService.java

@@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.BeanUtils;
@@ -19,6 +20,7 @@ import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.dao.*;
 import com.sckw.system.model.*;
+import com.sckw.system.model.pojo.FindManagePojo;
 import com.sckw.system.model.pojo.FindMenuTreePojo;
 import com.sckw.system.model.vo.req.EditRoleReqVo;
 import com.sckw.system.model.vo.req.RoleBindMenuReqVo;
@@ -60,6 +62,9 @@ public class KwsRoleService {
     @Autowired
     KwsDeptDao kwsDeptDao;
 
+    @Autowired
+    KwsEnterpriseDao kwsEnterpriseDao;
+
     @Autowired
     KwsMenuService kwsMenuService;
 
@@ -335,7 +340,9 @@ public class KwsRoleService {
      */
     public PageResult findPage(Map<String, Object> params) {
         PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
+        FindManagePojo manageInfoByEntId = kwsEnterpriseDao.findManageInfoByEntId(LoginUserHolder.getEntId());
         params.put("entId", LoginUserHolder.getEntId());
+        params.put("manageRoleId", manageInfoByEntId.getRoleId());
         List<RoleResVo> roleResVos = kwsRoleDao.findPage(params);
         if (CollectionUtils.isEmpty(roleResVos)) {
             return PageHelperUtil.getPageResult(new PageInfo<>(roleResVos));

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

@@ -251,7 +251,6 @@
        and e.del_flag = 0
        and f.del_flag = 0
        and d.is_main = 1
-       and d.system_type = 2
        and a.id = #{entId}
   </select>
 

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

@@ -270,8 +270,8 @@
     from kws_menu sm
     left join kws_menu_rights smr on sm.id = smr.menu_id
     where sm.del_flag = 0
-    <if test="clientType != null and clientType != ''">
-      and sm.client_type = #{clientType, jdbcType=VARCHAR}
+    <if test="clientType != null">
+      and sm.client_type = #{clientType}
     </if>
     <if test="name != null and name != ''">
       and sm.name = #{name, jdbcType=VARCHAR}

+ 1 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsRoleDao.xml

@@ -145,6 +145,7 @@
     left join kws_dept d on sr.dept_id = d.id
     where sr.del_flag = 0
       and su.del_flag = 0
+      and sr.id != #{manageRoleId}
     <if test="name != null and name != ''">
       and sr.name like concat('%', #{name, jdbcType=VARCHAR}, '%')
     </if>