Commit 3a96d22f authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents ef91da76 5710dcc4
......@@ -48,10 +48,13 @@ public class OrgSyncJob extends QuartzJobBean {
Map<String, String> headers = new HashMap<>();
headers.put("token", token);
headers.put("Content-Type", "application/x-www-form-urlencoded");
headers.put("Idap", "eddie.wu_v");
int pageSize = 1;
try {
// todo 这里要加分页查询的参数
String response = HttpUtil.get(orgSyncUrl, headers);
for (int i = 1; i <= pageSize; i++) {
String response = HttpUtil.get(orgSyncUrl+"?currentPage="+i, headers);
DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(response, DDSyncOrgInfo.class);
pageSize = ddSyncOrgInfo.getPageSize();
List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
orgSyncDatas.forEach(osd -> {
OrganizationExample example = new OrganizationExample();
......@@ -76,6 +79,8 @@ public class OrgSyncJob extends QuartzJobBean {
}
organizationMapper.updateByExampleSelective(o, example);
});
}
} catch (Exception e) {
logger.error(String.format("机构信息同步异常:[%s]", e.getMessage()), e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment