提交 044faf78 authored 作者: wangjiahao's avatar wangjiahao

refactor:增加demo

上级 8be42ca5
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
))) )))
WHERE WHERE
sys_auth_detail.privilege_value = 1 sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = 'chart' AND sys_auth.auth_source_type = 'link'
AND ( AND (
( (
sys_auth.auth_target_type = 'dept' sys_auth.auth_target_type = 'dept'
......
package io.dataease.service.panel; package io.dataease.service.panel;
import io.dataease.base.domain.PanelGroupWithBLOBs;
import io.dataease.base.domain.PanelViewLinkage; import io.dataease.base.domain.PanelViewLinkage;
import io.dataease.base.domain.PanelViewLinkageField; import io.dataease.base.domain.PanelViewLinkageField;
import io.dataease.base.mapper.PanelGroupMapper;
import io.dataease.base.mapper.PanelViewLinkageFieldMapper; import io.dataease.base.mapper.PanelViewLinkageFieldMapper;
import io.dataease.base.mapper.PanelViewLinkageMapper; import io.dataease.base.mapper.PanelViewLinkageMapper;
import io.dataease.base.mapper.ext.ExtPanelViewLinkageMapper; import io.dataease.base.mapper.ext.ExtPanelViewLinkageMapper;
...@@ -10,6 +12,7 @@ import io.dataease.controller.request.panel.PanelLinkageRequest; ...@@ -10,6 +12,7 @@ import io.dataease.controller.request.panel.PanelLinkageRequest;
import io.dataease.dto.LinkageInfoDTO; import io.dataease.dto.LinkageInfoDTO;
import io.dataease.dto.PanelViewLinkageDTO; import io.dataease.dto.PanelViewLinkageDTO;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
...@@ -35,6 +38,9 @@ public class PanelViewLinkageService { ...@@ -35,6 +38,9 @@ public class PanelViewLinkageService {
@Resource @Resource
private ExtPanelViewLinkageMapper extPanelViewLinkageMapper; private ExtPanelViewLinkageMapper extPanelViewLinkageMapper;
@Resource
private PanelGroupMapper panelGroupMapper;
public Map<String, PanelViewLinkageDTO> getViewLinkageGather(PanelLinkageRequest request) { public Map<String, PanelViewLinkageDTO> getViewLinkageGather(PanelLinkageRequest request) {
if(CollectionUtils.isNotEmpty(request.getTargetViewIds())){ if(CollectionUtils.isNotEmpty(request.getTargetViewIds())){
...@@ -92,6 +98,10 @@ public class PanelViewLinkageService { ...@@ -92,6 +98,10 @@ public class PanelViewLinkageService {
} }
public Map<String, List<String>> getPanelAllLinkageInfo(String panelId) { public Map<String, List<String>> getPanelAllLinkageInfo(String panelId) {
PanelGroupWithBLOBs panelInfo = panelGroupMapper.selectByPrimaryKey(panelId);
if(panelInfo!=null && StringUtils.isNotEmpty(panelInfo.getSource())){
panelId=panelInfo.getSource();
}
List<LinkageInfoDTO> info = extPanelViewLinkageMapper.getPanelAllLinkageInfo(panelId); List<LinkageInfoDTO> info = extPanelViewLinkageMapper.getPanelAllLinkageInfo(panelId);
return Optional.ofNullable(info).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(LinkageInfoDTO::getSourceInfo,LinkageInfoDTO::getTargetInfoList)); return Optional.ofNullable(info).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(LinkageInfoDTO::getSourceInfo,LinkageInfoDTO::getTargetInfoList));
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论