lyhzzz hace 3 meses
padre
commit
ee41e68e34

+ 1 - 0
src/main/java/com/fdkankan/fusion/request/DictFileParam.java

@@ -14,4 +14,5 @@ public class DictFileParam extends RequestBase {
     private List<String> fileFormats;
     private List<Integer> dictIds;
     private String sysUserId;
+    private String deptId;
 }

+ 2 - 1
src/main/java/com/fdkankan/fusion/service/impl/DictFileServiceImpl.java

@@ -42,7 +42,8 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(!StpUtil.hasRole("admin-super")){
-            param.setSysUserId((String) StpUtil.getLoginId());
+            String deptId = (String)StpUtil.getExtra("deptId");
+            param.setDeptId(deptId);
         }
         Page<DictFileVo> pageVo = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         return PageInfo.PageInfo(pageVo);

+ 4 - 0
src/main/resources/mapper/fusion/DictFileMapper.xml

@@ -5,10 +5,14 @@
         SELECT * from t_dict_file df
         LEFT JOIN t_dict d on df.dict_id = d.id
         LEFT JOIN t_common_upload cu on df.upload_id = cu.id
+        left join tm_user u on df.sys_user_id = u.id
         where df.rec_status = 'A'
         <if test="param.sysUserId != null">
             and ( df.sys_user_id = #{param.sysUserId} or df.use_type = 'animation')
         </if>
+        <if test="param.deptId != null and param.deptId != ''">
+            and ( u.dept_id = #{param.deptId} or df.use_type = 'animation')
+        </if>
         <if test="param.name != null and param.name !=''">
             and df.name like concat('%',#{param.name}, '%')
         </if>