|
@@ -98,9 +98,9 @@ public class GetSchoolUserController {
|
|
|
|
|
|
|
|
// 获取组织架构
|
|
// 获取组织架构
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
-// @Scheduled(cron = "0 22 11 * * ? ")
|
|
|
|
|
|
|
+// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
public Map get() {
|
|
public Map get() {
|
|
|
- String token = this.token();
|
|
|
|
|
|
|
+ String token = token();
|
|
|
System.out.println("token = " + token);
|
|
System.out.println("token = " + token);
|
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/org-edu-list";
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/org-edu-list";
|
|
|
Map<String, String> param = new HashMap<>();
|
|
Map<String, String> param = new HashMap<>();
|
|
@@ -120,11 +120,12 @@ public class GetSchoolUserController {
|
|
|
String encodeName = URLEncoder.encode("\u5b66\u751f","utf-8");
|
|
String encodeName = URLEncoder.encode("\u5b66\u751f","utf-8");
|
|
|
System.out.println("encodeName = " + encodeName);
|
|
System.out.println("encodeName = " + encodeName);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//获取组织架构成员
|
|
//获取组织架构成员
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
@DSTransactional
|
|
@DSTransactional
|
|
|
public List<String> getMessong(Integer page) throws JsonProcessingException {
|
|
public List<String> getMessong(Integer page) throws JsonProcessingException {
|
|
|
- String token = this.token();
|
|
|
|
|
|
|
+ String token = token();
|
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/get-org-users";
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/get-org-users";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
@@ -155,7 +156,7 @@ public class GetSchoolUserController {
|
|
|
|
|
|
|
|
@GetMapping
|
|
@GetMapping
|
|
|
public Boolean a(Integer page) throws JsonProcessingException {
|
|
public Boolean a(Integer page) throws JsonProcessingException {
|
|
|
- List<String> messong = this.getMessong(page);
|
|
|
|
|
|
|
+ List<String> messong = getMessong(page);
|
|
|
String token = this.token();
|
|
String token = this.token();
|
|
|
System.out.println("token = " + token);
|
|
System.out.println("token = " + token);
|
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/get-user-by-card-numbers";
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/get-user-by-card-numbers";
|
|
@@ -242,19 +243,55 @@ public class GetSchoolUserController {
|
|
|
|
|
|
|
|
// 定时获取微校数据
|
|
// 定时获取微校数据
|
|
|
//
|
|
//
|
|
|
- Integer i = 0;
|
|
|
|
|
|
|
+// Integer i = 0;
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
|
|
+// @Scheduled(cron = "0 47 15 * * ? ")
|
|
|
public void getSchoolUser() {
|
|
public void getSchoolUser() {
|
|
|
- i = i + 1;
|
|
|
|
|
- try {
|
|
|
|
|
- boolean a = this.a(i);
|
|
|
|
|
- System.out.println("a = " + a);
|
|
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
|
|
+// i = i + 1;
|
|
|
|
|
+// try {
|
|
|
|
|
+// boolean a = this.a(i);
|
|
|
|
|
+// System.out.println("a = " + a);
|
|
|
|
|
+// } catch (JsonProcessingException e) {
|
|
|
|
|
+// throw new RuntimeException(e);
|
|
|
|
|
+// }
|
|
|
|
|
+// System.out.println(i);
|
|
|
|
|
+ String token = token();
|
|
|
|
|
+ String url = "https://open.wecard.qq.com/cgi-bin/user/get-org-users";
|
|
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
+ param.put("access_token", token);
|
|
|
|
|
+ param.put("org_id", 578692);
|
|
|
|
|
+ param.put("fetch_child", 1);
|
|
|
|
|
+ param.put("page", 0);
|
|
|
|
|
+// param.put("page", 2);
|
|
|
|
|
+ param.put("page_size", 1000);
|
|
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
+ headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
+ HttpEntity<Map<String, Object>> request = new HttpEntity<>(param, headers);
|
|
|
|
|
+ ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, request, String.class);
|
|
|
|
|
+ String body = responseEntity.getBody();
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(body);
|
|
|
|
|
+// 总数量
|
|
|
|
|
+ String total = jsonObject.getString("total");
|
|
|
|
|
+ System.out.println("total = " + total);
|
|
|
|
|
+ int pageSize=Integer.parseInt(total) /1000;
|
|
|
|
|
+// 获取总页数
|
|
|
|
|
+ pageSize=pageSize+1;
|
|
|
|
|
+ System.out.println("pageSize = " + pageSize);
|
|
|
|
|
+
|
|
|
|
|
+ for (int j = 0; j <= pageSize; j++) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ boolean a = a(j);
|
|
|
|
|
+ System.out.println("a = " + a);
|
|
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- System.out.println(i);
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -307,8 +344,7 @@ public class GetSchoolUserController {
|
|
|
|
|
|
|
|
// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
// @Scheduled(cron = "0 0/1 * * * ? ")
|
|
|
public Boolean b() throws JsonProcessingException {
|
|
public Boolean b() throws JsonProcessingException {
|
|
|
- String token = this.token();
|
|
|
|
|
- System.out.println("token = " + token);
|
|
|
|
|
|
|
+ String token = token();
|
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/search";
|
|
String url = "https://open.wecard.qq.com/cgi-bin/user/search";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("access_token", token);
|
|
param.put("access_token", token);
|