Browse Source

Pull request #15160: REPORT-138360 fix: 本地获取规则需要单独补充

Merge in DESIGN/design from ~ANNER/design:fbp/master to fbp/master

* commit '337132bed08c05d77720a0712b61fe8701b2d258':
  REPORT-138360 fix: 本地获取规则需要单独补充
fbp/master
Anner-王敬松 1 month ago
parent
commit
7696631148
  1. 4
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java
  2. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java

4
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;
}

8
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<Map<String, Object>, Void> {
protected Map<String, Object> doInBackground() {
Map<String, Object> result = new HashMap<>();
Map<String, String> allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization();
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap();
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> 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);

Loading…
Cancel
Save