chenxiaofei 10 часов назад
Родитель
Сommit
9d21daaf4d

+ 1 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsMenuDao.java

@@ -70,6 +70,7 @@ public interface KwsMenuDao {
      * @throws Exception
      */
     List<KwsMenuResVo> findList(FindMenuTreePojo params);
+    List<KwsMenuResVo> findList3(FindMenuTreePojo params);
 
     List<KwsMenuResVo> findList1(FindMenuTreePojo params);
 

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

@@ -911,7 +911,8 @@ public class KwsMenuService {
             menuList = kwsMenuDao.findList1(findMenuTreePojo);
            // menuList = kwsMenuDao.findList2(findMenuTreePojo);
         }else {
-            menuList = kwsMenuDao.findList(findMenuTreePojo);
+            //menuList = kwsMenuDao.findList(findMenuTreePojo);3
+            menuList = kwsMenuDao.findList3(findMenuTreePojo);
         }
        // List<KwsMenuResVo> menuList = kwsMenuDao.findList(findMenuTreePojo);
         if (CollectionUtils.isEmpty(menuList)) {
@@ -984,6 +985,7 @@ public class KwsMenuService {
         // 根据用户id查询角色id
         if (Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.COMPANY.getCode()) && org.apache.commons.lang3.StringUtils.equals(clientType, String.valueOf(Global.NUMERICAL_THREE)) && Objects.equals(LoginUserHolder.getIsMain(), Global.YES)) {
             log.info("企业端管理员管理员,不做过滤");
+            findMenuTreePojo.setEntId(LoginUserHolder.getEntId());
             return;
         }
 

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

@@ -310,6 +310,40 @@
     </if>
     ORDER BY sm.level, sm.sort
   </select>
+
+  <select id="findList3" resultType="com.sckw.system.model.vo.res.KwsMenuResVo"
+          parameterType="com.sckw.system.model.pojo.FindMenuTreePojo" >
+    select distinct
+    <include refid="Base_Column_List" />
+    from kws_menu sm
+    left join kws_menu_rights smr on sm.id = smr.menu_id
+    where sm.del_flag = 0 and smr.del_flag = 0
+    <if test="clientType != null">
+      and sm.client_type = #{clientType}
+    </if>
+    <if test="name != null and name != ''">
+      and sm.name = #{name, jdbcType=VARCHAR}
+    </if>
+    <if test="entTypeList != null and entTypeList.size() > 0">
+      and
+      <foreach collection="entTypeList" item="item" open="(" close=")" separator=" or ">
+        using_roles like concat('%', #{item}, '%')
+      </foreach>
+    </if>
+    <if test="entId != null">
+      and smr.ent_id = #{entId}
+    </if>
+    <if test="roleIds != null and roleIds.size() > 0 and clientType != 3">
+      and smr.role_id in
+      <foreach collection="roleIds" separator="," open="(" close=")" item="item">
+        #{item}
+      </foreach>
+    </if>
+    <if test="type != null">
+      and sm.type = #{type}
+    </if>
+    ORDER BY sm.level, sm.sort
+  </select>
   <select id="findList1" resultType="com.sckw.system.model.vo.res.KwsMenuResVo"
           parameterType="com.sckw.system.model.pojo.FindMenuTreePojo" >
     select distinct