fix(仪表板): 仪表板分享报错

This commit is contained in:
taojinlong 2022-08-01 16:59:11 +08:00
parent 0bdbb72253
commit 0d7f4bb235
2 changed files with 14 additions and 8 deletions

View File

@ -41,13 +41,19 @@
left join panel_group g on g.id = s.panel_group_id
left join sys_user u on u.username = IFNULL(s.granter,g.create_by)
where
( s.target_id = #{userId} and s.type = 0 ) or
( s.target_id = #{deptId} and s.type = 2 ) or
( s.target_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and s.type = 1 )
( s.target_id = #{userId} and s.type = 0 )
<if test="deptId != null">
or ( s.target_id = #{deptId} and s.type = 2 )
</if>
<if test="roleIds != null">
or
( s.target_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and s.type = 1 )
</if>
<if test="orderByClause == null">
order by s.create_time desc
</if>

View File

@ -349,7 +349,7 @@ public class ShareService {
Map<String, Object> param = new HashMap<>();
param.put("userId", userId);
param.put("deptId", deptId);
param.put("roleIds", roleIds);
param.put("roleIds", CollectionUtils.isNotEmpty(roleIds)? roleIds: null);
List<PanelSharePo> datas = extPanelShareMapper.query(param);
List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))