|
|
@@ -115,12 +115,14 @@ public class OrganizationBatchGetTask { |
|
|
|
.eq(DingOrganization::getOrganizationCode, orgCode) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
// 顶级组织code |
|
|
|
List<String> topOrgCodes = Lists.newArrayList(orgCode); |
|
|
|
GenericResult<List<DingOrgInfoDTO>> listGenericResult = zwddClient.listOrganizationsByCodes(topOrgCodes); |
|
|
|
log.info("listGenericResult: {}" + JSON.toJSONString(listGenericResult)); |
|
|
|
List<DingOrgInfoDTO> dingOrgInfoDtos = listGenericResult.getData(); |
|
|
|
|
|
|
|
for(DingOrgInfoDTO dingOrgInfo : dingOrgInfoDtos){ |
|
|
|
GenericResult<PageSubOrganizationCodeDTO> subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 10000, orgCode); |
|
|
|
log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); |
|
|
|
PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); |
|
|
|
List<String> subOrganizationCodeList = data.getSubOrganizationCodeList(); |
|
|
|
|
|
|
|
for(String subOrganizationCode : subOrganizationCodeList){ |
|
|
|
GenericResult<DingOrgInfoDTO> organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); |
|
|
|
DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); |
|
|
|
DingOrganization old = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.eq(DingOrganization::getOrganizationCode, dingOrgInfo.getOrganizationCode()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
@@ -142,7 +144,9 @@ public class OrganizationBatchGetTask { |
|
|
|
organization.setGmtCreate(LocalDateTime.now()); |
|
|
|
organization.setInstitutionLevelCode(dingOrgInfo.getInstitutionLevelCode()); |
|
|
|
organization.setParentName(dingOrgInfo.getParentName()); |
|
|
|
iDingOrganizationService.save(organization); |
|
|
|
if(iDingOrganizationService.save(organization)){ |
|
|
|
organizationGetSubs(organization.getOrganizationCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.info("----拉取浙政钉组织子单位结束---,顶级code:" + orgCode); |
|
|
|