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 { ...@@ -48,10 +48,13 @@ public class OrgSyncJob extends QuartzJobBean {
Map<String, String> headers = new HashMap<>(); Map<String, String> headers = new HashMap<>();
headers.put("token", token); headers.put("token", token);
headers.put("Content-Type", "application/x-www-form-urlencoded"); headers.put("Content-Type", "application/x-www-form-urlencoded");
headers.put("Idap", "eddie.wu_v");
int pageSize = 1;
try { try {
// todo 这里要加分页查询的参数 for (int i = 1; i <= pageSize; i++) {
String response = HttpUtil.get(orgSyncUrl, headers); String response = HttpUtil.get(orgSyncUrl+"?currentPage="+i, headers);
DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(response, DDSyncOrgInfo.class); DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(response, DDSyncOrgInfo.class);
pageSize = ddSyncOrgInfo.getPageSize();
List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData(); List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
orgSyncDatas.forEach(osd -> { orgSyncDatas.forEach(osd -> {
OrganizationExample example = new OrganizationExample(); OrganizationExample example = new OrganizationExample();
...@@ -76,6 +79,8 @@ public class OrgSyncJob extends QuartzJobBean { ...@@ -76,6 +79,8 @@ public class OrgSyncJob extends QuartzJobBean {
} }
organizationMapper.updateByExampleSelective(o, example); organizationMapper.updateByExampleSelective(o, example);
}); });
}
} catch (Exception e) { } catch (Exception e) {
logger.error(String.format("机构信息同步异常:[%s]", e.getMessage()), 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