mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06: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() {
|
public UserOrgIds getOrgIds() {
|
||||||
UserOrgIds uids=new UserOrgIds();
|
UserOrgIds uids=new UserOrgIds();
|
||||||
List<String> orgIds = new ArrayList<>();
|
List<String> orgIds = new ArrayList<>();
|
||||||
|
|
||||||
uids.setIds(orgIds);
|
uids.setIds(orgIds);
|
||||||
String token = TokenProxy.getToken(request);
|
String token = TokenProxy.getToken(request);
|
||||||
String type="application/json";
|
String type="application/json";
|
||||||
@@ -259,12 +260,29 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
|||||||
// orgIds.add(elements.next().toString());
|
// orgIds.add(elements.next().toString());
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
Set<String> orgSetIds = new HashSet<>();//用于排重判断
|
||||||
|
|
||||||
if(rootNode.get("result")!=null & rootNode.get("result").get("mainList")!=null) {
|
if(rootNode.get("result")!=null) {
|
||||||
JsonNode result = rootNode.get("result").get("mainList");
|
JsonNode mainList = rootNode.get("result").get("mainList");
|
||||||
Iterator<JsonNode> elements = result.elements();
|
JsonNode readOnlyList = rootNode.get("result").get("readOnlyList");
|
||||||
|
//主列表
|
||||||
|
if(mainList!=null && !mainList.isEmpty()) {
|
||||||
|
Iterator<JsonNode> elements = mainList.elements();
|
||||||
while (elements.hasNext()){
|
while (elements.hasNext()){
|
||||||
orgIds.add(elements.next().toString());
|
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