From 56cafbd5866b1185c1beeb5a9eefca1eae31d86e Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 30 Nov 2021 16:30:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9D=83=E9=99=90):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=95=B0=E6=8D=AE=E9=9B=86tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/authModel/VAuthModelService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/authModel/VAuthModelService.java b/backend/src/main/java/io/dataease/service/authModel/VAuthModelService.java index a7f0a68272..9f681b174a 100644 --- a/backend/src/main/java/io/dataease/service/authModel/VAuthModelService.java +++ b/backend/src/main/java/io/dataease/service/authModel/VAuthModelService.java @@ -27,16 +27,18 @@ public class VAuthModelService { public List queryAuthModel(VAuthModelRequest request) { request.setUserId(String.valueOf(AuthUtils.getUser().getUserId())); List result = extVAuthModelMapper.queryAuthModel(request); - result = filterData(request, result); - List vAuthModelDTOS = TreeUtils.mergeTree(result); + // 定时任务选数据集时,列表需去除空目录 if (request.isClearEmptyDir()) { + result = filterData(request, result); + List vAuthModelDTOS = TreeUtils.mergeTree(result); setAllLeafs(vAuthModelDTOS); removeEmptyDir(vAuthModelDTOS); + return vAuthModelDTOS; } - return vAuthModelDTOS; + return TreeUtils.mergeTree(result); } - private List filterData(VAuthModelRequest request, List result){ + private List filterData(VAuthModelRequest request, List result) { if (request.getDatasetMode() != null && request.getDatasetMode() == 1) { result = result.stream().filter(vAuthModelDTO -> { if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getMode().equals(1L)) && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("excel") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("custom")) {