From b4976cf30d3f2ed4c5f41593617bbae5672ec839 Mon Sep 17 00:00:00 2001 From: Anner Date: Wed, 23 Oct 2024 15:23:50 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-138360=20fix:=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=84=E5=88=99=E9=9C=80=E8=A6=81=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/setting/TableDataDesensitizationTablePane.java | 4 +++- .../desensitization/model/UpdateDataWorker.java | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java index 197341caeb..622693263b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java @@ -2,6 +2,7 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationItem; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; @@ -91,7 +92,8 @@ public class TableDataDesensitizationTablePane extends JPanel { // 获取当前所有用户组 roleMap.putAll(RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization()); // 获取当前最新的所有规则 - latestRules.putAll(RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap()); + latestRules.put(DesensitizationRuleSource.SERVER, RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap().get(DesensitizationRuleSource.SERVER)); + latestRules.put(DesensitizationRuleSource.CUSTOM, DesensitizationRuleManager.getInstance().getRulesBySource(DesensitizationRuleSource.CUSTOM)); return null; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java index 284c290f6d..d89c4eac6d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java @@ -1,10 +1,11 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; -import javax.swing.*; +import javax.swing.SwingWorker; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -25,8 +26,9 @@ public class UpdateDataWorker extends SwingWorker, Void> { protected Map doInBackground() { Map result = new HashMap<>(); Map allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization(); - Map> allRules = RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap(); - + Map> allRules = new HashMap<>(); + allRules.put(DesensitizationRuleSource.SERVER, RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap().get(DesensitizationRuleSource.SERVER)); + allRules.put(DesensitizationRuleSource.CUSTOM, DesensitizationRuleManager.getInstance().getRulesBySource(DesensitizationRuleSource.CUSTOM)); result.put(ROLE_KEY, allRoles); result.put(RULE_KEY, allRules);