Commit 0cb0f7de authored by 梁光意's avatar 梁光意

修改查询仪表盘树接口

parent f9ac13d6
...@@ -210,6 +210,8 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT ...@@ -210,6 +210,8 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
if (CollectionUtils.isNotEmpty(trees)) { if (CollectionUtils.isNotEmpty(trees)) {
Set<String> panelIds = trees.stream().map(BaseEntity::getId).collect(Collectors.toSet()); Set<String> panelIds = trees.stream().map(BaseEntity::getId).collect(Collectors.toSet());
List<InstrumentPanelDraft> panels = draftService.selectDraftList(appId,panelIds,officeIds,userId,roleId); List<InstrumentPanelDraft> panels = draftService.selectDraftList(appId,panelIds,officeIds,userId,roleId);
if(CollectionUtils.isNotEmpty(panels)) { if(CollectionUtils.isNotEmpty(panels)) {
Set<String> publishIds = panels.stream().map(InstrumentPanelDraft::getPanelId).collect(Collectors.toSet()); Set<String> publishIds = panels.stream().map(InstrumentPanelDraft::getPanelId).collect(Collectors.toSet());
Set<String[]> finalPanelArrays = trees.stream() Set<String[]> finalPanelArrays = trees.stream()
...@@ -218,9 +220,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT ...@@ -218,9 +220,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
.collect(Collectors.toSet()); .collect(Collectors.toSet());
Set<String> finalPanelIds = Sets.newHashSet(); Set<String> finalPanelIds = Sets.newHashSet();
finalPanelArrays.forEach(x -> { finalPanelArrays.forEach(x -> {
if (x.length > 3) { if (x.length >= 3) {
for (int i = 0; i < x.length; i++) { for (int i = 0; i < x.length; i++) {
if (i == 2) { if (i == 3) {
break; break;
} }
finalPanelIds.add(x[i]); finalPanelIds.add(x[i]);
......
...@@ -15,7 +15,7 @@ import lombok.Data; ...@@ -15,7 +15,7 @@ import lombok.Data;
public class CustomPermissionVo { public class CustomPermissionVo {
@ApiModelProperty(value = "自定义权限类型", required = true) @ApiModelProperty(value = "自定义权限类型", required = true)
private String type; private String bizType;
@ApiModelProperty(value = "代表岗位、部门或个体用户id", required = true) @ApiModelProperty(value = "代表岗位、部门或个体用户id", required = true)
private String bizId; private String bizId;
......
...@@ -42,14 +42,16 @@ ...@@ -42,14 +42,16 @@
</if> </if>
and access_permission='private' and record_status=1 and IFNULL(updater,creator)=#{userId} and access_permission='private' and record_status=1 and IFNULL(updater,creator)=#{userId}
union ALL union ALL
select * from instrument_panel_draft where panel_id in select * from instrument_panel_draft where
access_permission='custom'
and record_status=1
<if test="panelIds!=null"> <if test="panelIds!=null">
and
( (
<foreach collection="panelIds" item="id" separator=","> <foreach collection="panelIds" item="id" separator="or">
#{id} (panel_id = #{id} and check_panel_permissions(#{appId},#{id},#{officeIds},#{userId},#{roleId})>0)
</foreach> </foreach>
) )
</if> </if>
and access_permission='custom' and record_status=1 and check_panel_permissions(#{appId},id,#{officeIds},#{userId},#{roleId})>0
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment