Browse Source
Merge in DESIGN/design from ~LEO.QIN/design:release/11.0 to release/11.0 * commit '2e97b4532853134885d9f5b5fc2867462e044109': REPORT-83849 && REPORT-89327 修改代码质量 REPORT-83849 && REPORT-89327 【问题原因】未设计远程调用接口;脱敏计算获取的部门id api接口有误,未拼接部分id与职位id 【改动思路】增加远程调用接口;修改获取部分id 的api接口release/11.0
Leo.Qin-覃宇攀
2 years ago
5 changed files with 92 additions and 94 deletions
@ -0,0 +1,47 @@
|
||||
package com.fr.design.mainframe.cell.settingpane.desensitization.model; |
||||
|
||||
import com.fr.base.operator.org.OrganizationOperator; |
||||
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.WorkContext; |
||||
|
||||
import javax.swing.SwingWorker; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.concurrent.ExecutionException; |
||||
|
||||
/** |
||||
* 刷新脱敏设置全局 roles 和 rules SwingWorker |
||||
* |
||||
* @author Leo.Qin |
||||
* @version 11.0 |
||||
* Created by Leo.Qin on 2023/1/5 |
||||
*/ |
||||
public class UpdateDataWorker extends SwingWorker<Map<String, Object>, Void> { |
||||
|
||||
private final String ROLE_KEY = "Roles"; |
||||
private final String RULE_KEY = "Rules"; |
||||
|
||||
@Override |
||||
protected Map<String, Object> doInBackground() { |
||||
Map<String, Object> result = new HashMap<>(); |
||||
Map<String, String> allRoles = WorkContext.getCurrent().get(OrganizationOperator.class).getAllRoles4Desensitization(); |
||||
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = DesensitizationRuleManager.getInstance().getAllRules(); |
||||
|
||||
result.put(ROLE_KEY, allRoles); |
||||
result.put(RULE_KEY, allRules); |
||||
|
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
protected void done() { |
||||
try { |
||||
Map<String, Object> result = get(); |
||||
DesensitizationCellPane.updateData((Map<String, String>) result.get(ROLE_KEY), (Map<DesensitizationRuleSource, Map<String, DesensitizationRule>>) result.get(RULE_KEY)); |
||||
} catch (InterruptedException | ExecutionException e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue