fix(仪表板): 修复仪表板目录删除后,目录目录下的仪表板对应的默认仪表板可能没有跟随删除问题 #5171

This commit is contained in:
Wangjiahao 2023-05-23 12:48:58 +08:00
parent cc40c628d6
commit ae49e8810a
3 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,8 @@ public interface ExtPanelGroupMapper {
//会级联删除pid 下的所有数据
int deleteCircle(@Param("pid") String pid, @Param("nodeType") String nodeType);
int deleteLinkDefaultCircle(@Param("pid") String pid);
int deleteCircleView(@Param("pid") String pid, @Param("nodeType") String nodeType);
int deleteCircleViewCache(@Param("pid") String pid, @Param("nodeType") String nodeType);

View File

@ -202,6 +202,10 @@
ORDER BY panel_group.node_type desc, CONVERT(panel_group.name using gbk)
</select>
<delete id="deleteLinkDefaultCircle">
delete from panel_group where FIND_IN_SET(panel_group.source, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
</delete>
<delete id="deleteCircle">
delete
from panel_group
@ -211,7 +215,6 @@
panel_group.source = #{pid}
<if test="nodeType == 'folder'">
or FIND_IN_SET(panel_group.id, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
or FIND_IN_SET(panel_group.source, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
</if>
</delete>

View File

@ -305,6 +305,7 @@ public class PanelGroupService {
extPanelGroupMapper.deleteCircleView(id, nodeType);
extPanelGroupMapper.deleteCircleViewCache(id, nodeType);
// 同时会删除对应默认仪表盘
extPanelGroupMapper.deleteLinkDefaultCircle(id);
extPanelGroupMapper.deleteCircle(id, nodeType);
storeService.removeByPanelId(id);
shareService.delete(id, null);