Przeglądaj źródła

组织更新

tags/24080901
PoffyZhang 1 rok temu
rodzic
commit
6129b2f446
1 zmienionych plików z 11 dodań i 7 usunięć
  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 Wyświetl plik

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


Ładowanie…
Anuluj
Zapisz