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")) {