mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 02:16:49 +08:00
课程资源归属查询匹配规则当前只MainList数组匹配。修改为 Main List和Readonly List 两个数组的合集。
This commit is contained in:
@@ -228,6 +228,7 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
public UserOrgIds getOrgIds() {
|
||||
UserOrgIds uids=new UserOrgIds();
|
||||
List<String> orgIds = new ArrayList<>();
|
||||
|
||||
uids.setIds(orgIds);
|
||||
String token = TokenProxy.getToken(request);
|
||||
String type="application/json";
|
||||
@@ -259,12 +260,29 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
// orgIds.add(elements.next().toString());
|
||||
// }
|
||||
// }
|
||||
Set<String> orgSetIds = new HashSet<>();//用于排重判断
|
||||
|
||||
if(rootNode.get("result")!=null & rootNode.get("result").get("mainList")!=null) {
|
||||
JsonNode result = rootNode.get("result").get("mainList");
|
||||
Iterator<JsonNode> elements = result.elements();
|
||||
while (elements.hasNext()){
|
||||
orgIds.add(elements.next().toString());
|
||||
if(rootNode.get("result")!=null) {
|
||||
JsonNode mainList = rootNode.get("result").get("mainList");
|
||||
JsonNode readOnlyList = rootNode.get("result").get("readOnlyList");
|
||||
//主列表
|
||||
if(mainList!=null && !mainList.isEmpty()) {
|
||||
Iterator<JsonNode> elements = mainList.elements();
|
||||
while (elements.hasNext()){
|
||||
String oid=elements.next().toString();
|
||||
orgIds.add(oid);
|
||||
orgSetIds.add(oid);
|
||||
}
|
||||
}
|
||||
//只读列表
|
||||
if(readOnlyList!=null && !readOnlyList.isEmpty()) {
|
||||
Iterator<JsonNode> elements = readOnlyList.elements();
|
||||
while (elements.hasNext()){
|
||||
String oid=elements.next().toString();
|
||||
if(!orgSetIds.contains(oid)) {
|
||||
orgIds.add(oid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user