提交修改

This commit is contained in:
daihh
2023-02-02 13:50:38 +08:00
parent 12de3fd451
commit dfe85895e3

View File

@@ -56,8 +56,8 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
String responseStr = okHttpUtil.doPostJson(url, json, headers);
JsonNode rootNode= mapper.readTree(responseStr);
JsonNode result = rootNode.get("result")!=null ?( rootNode.get("result").get("data") !=null ? rootNode.get("result").get("data"):null):null;
if(rootNode.get("result")!=null & rootNode.get("result").isArray()) {
JsonNode result = rootNode.get("result")!=null ? ( rootNode.get("result").get("data") !=null ? rootNode.get("result").get("data"):null):null;
if(result!=null && result.isArray()) {
//这里应该是单独的线程去处理
for(JsonNode JsonNode :result) {
AudienceUser au=new AudienceUser();
@@ -191,37 +191,68 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
}
// public static void main(String[] args) {
// List<String> orgIds = new ArrayList<>();
// String token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzUzMDkxMDcsImV4cCI6MTY3NTMxNjMwNywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjdFMDY1NzQxLTkzRUItRTc1Ni02Mzk5LUIwQTA1QUY2NEE3OSIsInVJZCI6Ijk2NTM2OTU4MjM5Mjk3MTI2NCIsInBlcm1pc3Npb24iOiIifQ==.6780daf88206d3f4f2cfc184268f4c1b80f25a916105219a5a6f2e904762b1e8";
// String type="application/json";
// String[] headers=new String[] {"token",token,"Content-Type",type};
// String url= ("https://u.boe.com/userbasic/org/manageOrgIds");
// ObjectMapper mapper=new ObjectMapper();
// String responseStr=null;
// try{
// OkHttpUtil http=new OkHttpUtil();
// responseStr = http.doPostJson(url,"{}", headers);
// System.out.println(responseStr);
// JsonNode rootNode= mapper.readTree(responseStr);
// int code = rootNode.get("status").asInt();
// System.out.println("code="+code);
// if(code!=200) {
// log.error("获取当前用户拥有权限机构id错误"+responseStr);
// }
//
// if(rootNode.get("result")!=null & rootNode.get("result").isArray()) {
// JsonNode result = rootNode.get("result");
// Iterator<JsonNode> elements = result.elements();
// while (elements.hasNext()){
// orgIds.add(elements.next().toString());
// }
// }
// for(String str : orgIds) {
// System.out.println(str);
// }
// }catch (Exception e){
// log.error("获取当前用户有权限的机构id错误",e);
// }
//// List<String> orgIds = new ArrayList<>();
//// String token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzUzMDkxMDcsImV4cCI6MTY3NTMxNjMwNywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjdFMDY1NzQxLTkzRUItRTc1Ni02Mzk5LUIwQTA1QUY2NEE3OSIsInVJZCI6Ijk2NTM2OTU4MjM5Mjk3MTI2NCIsInBlcm1pc3Npb24iOiIifQ==.6780daf88206d3f4f2cfc184268f4c1b80f25a916105219a5a6f2e904762b1e8";
//// String type="application/json";
//// String[] headers=new String[] {"token",token,"Content-Type",type};
//// String url= ("https://u.boe.com/userbasic/org/manageOrgIds");
//// ObjectMapper mapper=new ObjectMapper();
//// String responseStr=null;
//// try{
//// OkHttpUtil http=new OkHttpUtil();
//// responseStr = http.doPostJson(url,"{}", headers);
//// System.out.println(responseStr);
//// JsonNode rootNode= mapper.readTree(responseStr);
//// int code = rootNode.get("status").asInt();
//// System.out.println("code="+code);
//// if(code!=200) {
//// log.error("获取当前用户拥有权限机构id错误"+responseStr);
//// }
////
//// if(rootNode.get("result")!=null & rootNode.get("result").isArray()) {
//// JsonNode result = rootNode.get("result");
//// Iterator<JsonNode> elements = result.elements();
//// while (elements.hasNext()){
//// orgIds.add(elements.next().toString());
//// }
//// }
//// for(String str : orgIds) {
//// System.out.println(str);
//// }
//// }catch (Exception e){
//// log.error("获取当前用户有权限的机构id错误",e);
//// }
// String token="eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzUzMTY3OTMsImV4cCI6MTY3NTMyMzk5MywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjdFMDY1NzQxLTkzRUItRTc1Ni02Mzk5LUIwQTA1QUY2NEE3OSIsInVJZCI6Ijk2NTM2OTU4MjM5Mjk3MTI2NCIsInBlcm1pc3Npb24iOiIifQ==.75814a454f8a022cbe24f29eb956b5350f1212fc105b951df8bc2a82975a05a4";
// String url= "https://u.boe.com/userbasic/audience/memberList";
// Map<String, String> params = new HashMap<>();
// params.put("audienceId", "70061506155860912129");
// String json = null;
// List<AudienceUser> list=new ArrayList<AudienceUser>();
// ObjectMapper mapper=new ObjectMapper();
// try {
//
// json = mapper.writeValueAsString(params);
// OkHttpUtil http=new OkHttpUtil();
// String[] headers=new String[] {"token",token,"Content-Type","application/json"};
// String responseStr = http.doPostJson(url, json, headers);
// System.out.println(responseStr);
// JsonNode rootNode= mapper.readTree(responseStr);
//
// JsonNode result = rootNode.get("result")!=null ? ( rootNode.get("result").get("data") !=null ? rootNode.get("result").get("data"):null):null;
// if(result!=null && result.isArray()) {
// //这里应该是单独的线程去处理
// for(JsonNode JsonNode :result) {
// AudienceUser au=new AudienceUser();
// au.setId(JsonNode.get("id").asText());
// au.setName(JsonNode.get("userName").asText());
// au.setCode(JsonNode.get("userNo").asText());
// list.add(au);
// System.out.println(au.getName());
// }
// }
// } catch (Exception e) {
// log.error("获取受众用户列表错误",e);
// }
//
// }