From 834e6a7f48e97f941af5d7c284dbb454f8a850cd Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 21 May 2021 10:36:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/base/mapper/ext/ExtSysMenuMapper.xml | 3 ++- backend/src/main/java/io/dataease/service/sys/MenuService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMenuMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMenuMapper.xml index 5314bba41d..56e79e0b8a 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMenuMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMenuMapper.xml @@ -8,13 +8,14 @@ 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; From 14ea0f17a1834f89f467902f04c771279bdbb7c7 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 21 May 2021 10:52:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E6=97=B6=EF=BC=8C=E5=90=8C=E6=AD=A5=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E6=94=B6=E8=97=8F=EF=BC=8C=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/panel/PanelGroupService.java | 13 +++++++++---- .../io/dataease/service/panel/PanelLinkService.java | 5 ++++- .../io/dataease/service/panel/ShareService.java | 6 +++++- 3 files changed, 18 insertions(+), 6 deletions(-) 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); }