Эх сурвалжийг харах

fix 修改疫苗权限查询

Administrator 3 жил өмнө
parent
commit
8aeb1699d5

+ 5 - 2
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysDeptServiceImpl.java

@@ -58,20 +58,23 @@ public class SysDeptServiceImpl implements ISysDeptService {
     public List<SysDept> selectDeptList(SysDept dept) {
         LoginUser loginUser = redisService.getCacheObject(CacheConstants.LOGIN_TOKEN_KEY + SecurityUtils.getToken());
         SysUser sysUser = loginUser.getSysUser();
-        List<SysRole> roles = sysUser.getRoles();
+        Long deptId = sysUser.getDeptId();
+/*        List<SysRole> roles = sysUser.getRoles();
         dept.setListByParentId(Boolean.TRUE);
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
             if (DATA_SCOPE_ALL.equals(dataScope)){
                 dept.setListByParentId(Boolean.FALSE);
             }
-        }
+        }*/
         if (StringUtils.isNotEmpty(dept.getDeptName()) || StringUtils.isNotEmpty(dept.getStatus())) {
             return deptMapper.selectDeptList(dept);
         }
         Long id = dept.getId();
         if (id != null) {
             dept.setParentId(id);
+        }else {
+            dept.setId(deptId);
         }
         List<SysDept> depts = deptMapper.selectDeptList(dept);
         // 这里的逻辑是:根据id获取到这个下面的所有子部门,每个部门判断是否有下一级别

+ 2 - 2
boman-modules/boman-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -31,8 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<select id="selectDeptList" parameterType="com.boman.domain.SysDept" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0'
-		<if test="listByParentId != null and listByParentId == false">
-			AND (parent_id is null or parent_id = 0)
+		<if test="id != null">
+			AND id = #{id}
 		</if>
         <if test="parentId != null and parentId != 0">
 			AND parent_id = #{parentId}