权限补发更新到权限预览表中的数据去重
This commit is contained in:
parent
0b2f7b53f0
commit
18c1062b9f
@ -11,6 +11,7 @@ import com.actionsoft.bpms.util.UtilString;
|
|||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -66,6 +67,36 @@ public class ProcessEndAfterEventForPermissionSupplement extends ExecuteListener
|
|||||||
if (UtilString.isNotEmpty(postPerm)) {
|
if (UtilString.isNotEmpty(postPerm)) {
|
||||||
postPerm = postPerm + "," + postStr;
|
postPerm = postPerm + "," + postStr;
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
String postPerms = "";
|
||||||
|
String levelPerms = "";
|
||||||
|
String orgPerms = "";
|
||||||
|
if (postPerm.contains(",")){
|
||||||
|
String[] split = postPerm.split(",");
|
||||||
|
String[] post_split = removeDuplicates(split);
|
||||||
|
for (String post:post_split){
|
||||||
|
postPerms += post+",";
|
||||||
|
}
|
||||||
|
postPerm = postPerms.substring(0,postPerms.length()-1);
|
||||||
|
}
|
||||||
|
if (levelPerm.contains(",")){
|
||||||
|
String[] split = levelPerm.split(",");
|
||||||
|
String[] level_split = removeDuplicates(split);
|
||||||
|
for (String level:
|
||||||
|
level_split) {
|
||||||
|
levelPerms += level+",";
|
||||||
|
}
|
||||||
|
levelPerm = levelPerms.substring(0,levelPerms.length()-1);
|
||||||
|
}
|
||||||
|
if (orgPerm.contains(",")){
|
||||||
|
String[] split = orgPerm.split(",");
|
||||||
|
String[] org_split = removeDuplicates(split);
|
||||||
|
for (String org
|
||||||
|
:org_split){
|
||||||
|
orgPerms += org+",";
|
||||||
|
}
|
||||||
|
orgPerm = orgPerms.substring(0,orgPerms.length()-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//需要补发权限的权限阅览id
|
//需要补发权限的权限阅览id
|
||||||
String bindId = byProcess.getString("PUBLISHUSPROSSINSID");
|
String bindId = byProcess.getString("PUBLISHUSPROSSINSID");
|
||||||
@ -76,4 +107,9 @@ public class ProcessEndAfterEventForPermissionSupplement extends ExecuteListener
|
|||||||
System.out.println("权限阅览流程实例id为:" + bindId + "的权限补发成功");
|
System.out.println("权限阅览流程实例id为:" + bindId + "的权限补发成功");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String[] removeDuplicates(String[] array) {
|
||||||
|
HashSet<String> set = new HashSet<>(Arrays.asList(array));
|
||||||
|
return set.toArray(new String[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user