bug: 修改人员同步定时任务
This commit is contained in:
@@ -59,6 +59,12 @@ public class DataSyncController {
|
|||||||
return iDataSyncService.orgDataSync2();
|
return iDataSyncService.orgDataSync2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("同步组织机构,改成全量同步")
|
||||||
|
@PostMapping("/importOrgData3")
|
||||||
|
public String importOrgData3() throws Exception {
|
||||||
|
return iDataSyncService.orgDataSync3();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("同步组织机构,添加参数")
|
@ApiOperation("同步组织机构,添加参数")
|
||||||
@PostMapping("/updateByOrgs")
|
@PostMapping("/updateByOrgs")
|
||||||
public String updateByOrgs() throws Exception {
|
public String updateByOrgs() throws Exception {
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ public class SyncUserService {
|
|||||||
|
|
||||||
List<String> json=new ArrayList<>();
|
List<String> json=new ArrayList<>();
|
||||||
byte[] cookie = null;
|
byte[] cookie = null;
|
||||||
|
int index = 1;
|
||||||
do {
|
do {
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||||
@@ -137,7 +138,7 @@ public class SyncUserService {
|
|||||||
params.forEach((key, value) -> log.info("同步用户数据的请求参数:" + key + " : " + value));
|
params.forEach((key, value) -> log.info("同步用户数据的请求参数:" + key + " : " + value));
|
||||||
// 用户测试
|
// 用户测试
|
||||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||||
log.info("远程调用同步的员工数据:"+rs);
|
log.info("第{}次调用,远程调用同步的员工数据:{}",index,rs);
|
||||||
JSONObject responseStr = JSON.parseObject(rs);
|
JSONObject responseStr = JSON.parseObject(rs);
|
||||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
json.add(rs);
|
json.add(rs);
|
||||||
@@ -159,7 +160,7 @@ public class SyncUserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
index++;
|
||||||
} while (cookie != null);
|
} while (cookie != null);
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
@@ -265,6 +266,7 @@ public class SyncUserService {
|
|||||||
|
|
||||||
byte[] cookie = null;
|
byte[] cookie = null;
|
||||||
List<String> json=new ArrayList<>();
|
List<String> json=new ArrayList<>();
|
||||||
|
int index=1;
|
||||||
do {
|
do {
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||||
@@ -274,7 +276,7 @@ public class SyncUserService {
|
|||||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||||
// 组织测试
|
// 组织测试
|
||||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
||||||
log.info("远程调用同步的部门数据:"+rs);
|
log.info("第{}次调用:远程调用同步的部门数据:{}",index,rs);
|
||||||
JSONObject responseStr = JSONObject.parseObject(rs);
|
JSONObject responseStr = JSONObject.parseObject(rs);
|
||||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
json.add(rs);
|
json.add(rs);
|
||||||
@@ -296,6 +298,7 @@ public class SyncUserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
index++;
|
||||||
} while (cookie != null);
|
} while (cookie != null);
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user