Ver código fonte

Merge branch 'system-zyj' into system-165

james 1 semana atrás
pai
commit
8452a2e849

+ 15 - 5
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/HceCategoryServiceImpl.java

@@ -1,7 +1,6 @@
 package com.usky.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.exception.BusinessException;
@@ -54,9 +53,20 @@ public class HceCategoryServiceImpl extends AbstractCrudService<HceCategoryMappe
                 for (int i = 0; i < list1.size(); i++) {
                     categoryIdList.add(list1.get(i).getId());
                 }
+                if(("00").equals(sysUser.getUserType())){
+                    if (1L == userId)
+                    {
+                        list = baseMapper.selectMenuTreeAll(categoryIdList,hceCategoryVO.getStartTime(),hceCategoryVO.getEndTime());
+                    }
+                    else
+                    {
+                        list = baseMapper.selectMenuTreeByUserId(categoryIdList,hceCategoryVO.getStartTime(),hceCategoryVO.getEndTime(),userId);
+                    }
+                }else{
+                    list = baseMapper.selectMenuTreeByUserIdOne(categoryIdList,hceCategoryVO.getStartTime(),hceCategoryVO.getEndTime(),SecurityUtils.getTenantId());
+                }
             }
-        }
-        if(CollectionUtils.isNotEmpty(categoryIdList)){
+        }else{
             if(("00").equals(sysUser.getUserType())){
                 if (1L == userId)
                 {
@@ -93,9 +103,9 @@ public class HceCategoryServiceImpl extends AbstractCrudService<HceCategoryMappe
                 for (int i = 0; i < list2.size(); i++) {
                     categoryIdList.add(list2.get(i).getId());
                 }
+                list = baseMapper.selectMenuTreeAll(categoryIdList,hceCategoryVO.getStartTime(),hceCategoryVO.getEndTime());
             }
-        }
-        if(CollectionUtils.isNotEmpty(categoryIdList)){
+        }else{
             list = baseMapper.selectMenuTreeAll(categoryIdList,hceCategoryVO.getStartTime(),hceCategoryVO.getEndTime());
         }
 

+ 18 - 12
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/HceCategoryMapper.xml

@@ -41,10 +41,12 @@
         where m.menu_type in ('M', 'C')
           and m.visible = 0
           and m.status = 0
-        and h.id in
-        <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
-            #{categoryId}
-        </foreach>
+          <if test="categoryIdList != null and categoryIdList.size() > 0 ">
+              and h.id in
+              <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
+                  #{categoryId}
+              </foreach>
+          </if>
           <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
               and h.createdate between #{startTime} and #{endTime}
           </if>
@@ -77,10 +79,12 @@
           and m.visible = 0
           and m.status = 0
           AND ro.status = 0
-        and h.id in
-        <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
-            #{categoryId}
-        </foreach>
+        <if test="categoryIdList != null and categoryIdList.size() > 0 ">
+            and h.id in
+            <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
+                #{categoryId}
+            </foreach>
+        </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and h.createdate between #{startTime} and #{endTime}
         </if>
@@ -111,10 +115,12 @@
           and m.visible = 0
           and m.status = 0
           AND t.tenant_id=#{tenantId}
-        and h.id in
-        <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
-            #{categoryId}
-        </foreach>
+        <if test="categoryIdList != null and categoryIdList.size() > 0 ">
+            and h.id in
+            <foreach collection="categoryIdList" item="categoryId" index="index" open="(" close=")" separator=",">
+                #{categoryId}
+            </foreach>
+        </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and h.createdate between #{startTime} and #{endTime}
         </if>