Переглянути джерело

组织更新

tags/24080901
PoffyZhang 1 рік тому
джерело
коміт
6129b2f446
1 змінених файлів з 11 додано та 7 видалено
  1. +11
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java

+ 11
- 7
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java Переглянути файл

@@ -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);


Завантаження…
Відмінити
Зберегти