diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml index c991ebc2a0..2392dfb9e2 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml @@ -14,7 +14,7 @@ - select menu_id as id, pid from sys_menu + select menu_id as id, pid from sys_menu where hidden != 1 diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 66c37b712e..6ac0078c7f 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -19,6 +19,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -45,14 +46,15 @@ public class PanelGroupService { @Resource private ExtPanelGroupMapper extPanelGroupMapper; @Resource - private PanelDesignMapper panelDesignMapper; - @Resource private ChartViewService chartViewService; @Resource private ChartViewMapper chartViewMapper; @Resource - private ExtPanelDesignMapper extPanelDesignMapper; - + private StoreService storeService; + @Resource + private ShareService shareService; + @Resource + private PanelLinkService panelLinkService; public List tree(PanelGroupRequest panelGroupRequest) { String userId = String.valueOf(AuthUtils.getUser().getUserId()); panelGroupRequest.setUserId(userId); @@ -93,6 +95,9 @@ public class PanelGroupService { public void deleteCircle(String id) { Assert.notNull(id, "id cannot be null"); extPanelGroupMapper.deleteCircle(id); + storeService.removeByPanelId(id); + shareService.delete(id, null); + panelLinkService.deleteByResourceId(id); } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java b/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java index 3929bbe9ee..4048fe7fb5 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java @@ -73,6 +73,10 @@ public class PanelLinkService { return convertDto(one); } + public void deleteByResourceId(String resourceId){ + mapper.deleteByPrimaryKey(resourceId); + } + public String decryptParam(String text) throws Exception { return RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, text); } @@ -100,7 +104,6 @@ public class PanelLinkService { } catch (Exception e) { e.printStackTrace(); } - System.out.println(s); return encrypt; } private GenerateDto convertDto(PanelLink linl){ diff --git a/backend/src/main/java/io/dataease/service/panel/ShareService.java b/backend/src/main/java/io/dataease/service/panel/ShareService.java index 16bfa83eae..efa71c3127 100644 --- a/backend/src/main/java/io/dataease/service/panel/ShareService.java +++ b/backend/src/main/java/io/dataease/service/panel/ShareService.java @@ -76,7 +76,11 @@ public class ShareService { @Transactional public void delete(String panel_group_id, Integer type){ PanelShareExample example = new PanelShareExample(); - example.createCriteria().andPanelGroupIdEqualTo(panel_group_id).andTypeEqualTo(type); + PanelShareExample.Criteria criteria = example.createCriteria(); + criteria.andPanelGroupIdEqualTo(panel_group_id); + if(type != null){ + criteria.andTypeEqualTo(type); + } mapper.deleteByExample(example); } diff --git a/backend/src/main/java/io/dataease/service/sys/MenuService.java b/backend/src/main/java/io/dataease/service/sys/MenuService.java index 361d98d768..647ddd7ad7 100644 --- a/backend/src/main/java/io/dataease/service/sys/MenuService.java +++ b/backend/src/main/java/io/dataease/service/sys/MenuService.java @@ -157,7 +157,7 @@ public class MenuService { private MenuTreeNode format(SysMenu sysMenu) { MenuTreeNode menuTreeNode = new MenuTreeNode(); menuTreeNode.setId(sysMenu.getMenuId()); - menuTreeNode.setLabel(sysMenu.getName()); + menuTreeNode.setLabel(sysMenu.getTitle()); menuTreeNode.setHasChildren(false); Optional.ofNullable(sysMenu.getMenuSort()).ifPresent(num -> menuTreeNode.setHasChildren(num > 0)); return menuTreeNode;