|
@@ -1,5 +1,6 @@ |
|
|
package com.ningdatech.pmapi.ding.task; |
|
|
package com.ningdatech.pmapi.ding.task; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
import com.google.common.collect.Lists; |
|
|
import com.google.common.collect.Lists; |
|
@@ -134,33 +135,34 @@ public class OrganizationBatchGetTask { |
|
|
GenericResult<PageSubOrganizationCodeDTO> pageSubOrganizationCodeDTOGenericResult = zwddClient.pageSubOrganizationCodes(currentPage++, pageSize, parentOrgCode); |
|
|
GenericResult<PageSubOrganizationCodeDTO> pageSubOrganizationCodeDTOGenericResult = zwddClient.pageSubOrganizationCodes(currentPage++, pageSize, parentOrgCode); |
|
|
PageSubOrganizationCodeDTO pageSubOrganizationCodeDTO = pageSubOrganizationCodeDTOGenericResult.getData(); |
|
|
PageSubOrganizationCodeDTO pageSubOrganizationCodeDTO = pageSubOrganizationCodeDTOGenericResult.getData(); |
|
|
|
|
|
|
|
|
List<String> subOrganizationCodeList = new ArrayList<>(pageSubOrganizationCodeDTO.getSubOrganizationCodeList()); |
|
|
|
|
|
Long totalSize = pageSubOrganizationCodeDTO.getTotalSize(); |
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(pageSubOrganizationCodeDTO.getSubOrganizationCodeList())) { |
|
|
|
|
|
List<String> subOrganizationCodeList = new ArrayList<>(pageSubOrganizationCodeDTO.getSubOrganizationCodeList()); |
|
|
|
|
|
Long totalSize = pageSubOrganizationCodeDTO.getTotalSize(); |
|
|
|
|
|
|
|
|
while (totalSize > (long) currentPage * pageSize) { |
|
|
|
|
|
GenericResult<PageSubOrganizationCodeDTO> subPageSubOrganizationCodeDTOGenericResult = zwddClient |
|
|
|
|
|
.pageSubOrganizationCodes(currentPage++, pageSize, parentOrgCode); |
|
|
|
|
|
PageSubOrganizationCodeDTO subOrganizationCodeDTO = subPageSubOrganizationCodeDTOGenericResult.getData(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(subOrganizationCodeDTO.getSubOrganizationCodeList())) { |
|
|
|
|
|
subOrganizationCodeList.addAll(subOrganizationCodeDTO.getSubOrganizationCodeList()); |
|
|
|
|
|
|
|
|
while (totalSize > (long) currentPage * pageSize) { |
|
|
|
|
|
GenericResult<PageSubOrganizationCodeDTO> subPageSubOrganizationCodeDTOGenericResult = zwddClient |
|
|
|
|
|
.pageSubOrganizationCodes(currentPage++, pageSize, parentOrgCode); |
|
|
|
|
|
PageSubOrganizationCodeDTO subOrganizationCodeDTO = subPageSubOrganizationCodeDTOGenericResult.getData(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(subOrganizationCodeDTO.getSubOrganizationCodeList())) { |
|
|
|
|
|
subOrganizationCodeList.addAll(subOrganizationCodeDTO.getSubOrganizationCodeList()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(subOrganizationCodeList)) { |
|
|
|
|
|
GenericResult<List<DingOrgInfoDTO>> listGenericResult = zwddClient |
|
|
|
|
|
.listOrganizationsByCodes(subOrganizationCodeList); |
|
|
|
|
|
List<DingOrgInfoDTO> dingOrgInfoDtos = listGenericResult.getData(); |
|
|
|
|
|
List<DingOrgInfoTreeDTO> dingOrgInfoTreeDTOList = dingOrgInfoDtos.stream().map(r -> { |
|
|
|
|
|
DingOrgInfoTreeDTO dingOrgInfoTreeDTO = new DingOrgInfoTreeDTO(); |
|
|
|
|
|
dingOrgInfoTreeDTO.setCode(r.getOrganizationCode()); |
|
|
|
|
|
dingOrgInfoTreeDTO.setDingOrgInfoDTO(r); |
|
|
|
|
|
dingOrgInfoTreeDTO.setChildCodes(new ArrayList<>()); |
|
|
|
|
|
getDingOrgChild(dingOrgInfoTreeDTO); |
|
|
|
|
|
return dingOrgInfoTreeDTO; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
parentDingOrgInfoTreeDTO.setChildCodes(dingOrgInfoTreeDTOList); |
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(subOrganizationCodeList)) { |
|
|
|
|
|
GenericResult<List<DingOrgInfoDTO>> listGenericResult = zwddClient |
|
|
|
|
|
.listOrganizationsByCodes(subOrganizationCodeList); |
|
|
|
|
|
List<DingOrgInfoDTO> dingOrgInfoDtos = listGenericResult.getData(); |
|
|
|
|
|
List<DingOrgInfoTreeDTO> dingOrgInfoTreeDTOList = dingOrgInfoDtos.stream().map(r -> { |
|
|
|
|
|
DingOrgInfoTreeDTO dingOrgInfoTreeDTO = new DingOrgInfoTreeDTO(); |
|
|
|
|
|
dingOrgInfoTreeDTO.setCode(r.getOrganizationCode()); |
|
|
|
|
|
dingOrgInfoTreeDTO.setDingOrgInfoDTO(r); |
|
|
|
|
|
dingOrgInfoTreeDTO.setChildCodes(new ArrayList<>()); |
|
|
|
|
|
getDingOrgChild(dingOrgInfoTreeDTO); |
|
|
|
|
|
return dingOrgInfoTreeDTO; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
parentDingOrgInfoTreeDTO.setChildCodes(dingOrgInfoTreeDTOList); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|