From 79c97c04b4e479eb290afdba7503184f7e0ff0c4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 11 Sep 2025 17:16:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E6=8E=A5=20SQLBot=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E6=8D=AE=E6=BA=90=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/dataset/manage/DatasetSQLBotManage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLBotManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLBotManage.java index ea24e8d52a..4520b840ab 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLBotManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLBotManage.java @@ -169,7 +169,8 @@ public class DatasetSQLBotManage { if (!isAdmin) { List> roleMapList = dataSetAssistantMapper.roleInfoByUid(uid, oid); if (CollectionUtils.isNotEmpty(roleMapList)) { - isRootRole = roleMapList.stream().anyMatch(item -> ObjectUtils.isNotEmpty(item.get("pid")) && (Integer.parseInt(item.get("pid").toString())) == 0); + Long rootPid = 0L; + isRootRole = roleMapList.stream().anyMatch(item -> ObjectUtils.isNotEmpty(item.get("pid")) && rootPid.equals(Long.parseLong(item.get("pid").toString()))); roleIds = roleMapList.stream().map(item -> Long.parseLong(item.get("id").toString())).distinct().collect(Collectors.toList()); } else { roleIds = new ArrayList<>();