|
|
@@ -10,6 +10,7 @@ import com.ningdatech.zwdd.model.Page; |
|
|
|
import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery; |
|
|
|
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
@@ -20,6 +21,7 @@ import java.util.List; |
|
|
|
* @date 2023/2/10 上午9:52 |
|
|
|
*/ |
|
|
|
|
|
|
|
@Component |
|
|
|
public class EmployeeBatchGetTask { |
|
|
|
|
|
|
|
private final static Integer PAGE_SIZE = 20; |
|
|
@@ -48,27 +50,23 @@ public class EmployeeBatchGetTask { |
|
|
|
|
|
|
|
GenericResult<Page<OrganizationEmployeePosition>> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); |
|
|
|
Page<OrganizationEmployeePosition> data = firstPageGenericResult.getData(); |
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(data.getData())) { |
|
|
|
allOrganizationEmployeePositionList.addAll(data.getData()); |
|
|
|
} |
|
|
|
|
|
|
|
Long totalSize = data.getTotalSize(); |
|
|
|
if (totalSize > PAGE_SIZE) { |
|
|
|
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE); |
|
|
|
for (pageNo = 2; pageNo <= maxPageNo; pageNo++) { |
|
|
|
query.setPageNo(maxPageNo); |
|
|
|
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query); |
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(pageGenericResult.getData().getData())) { |
|
|
|
allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// zwddClient.pageOrganizationEmployeePositions(query); |
|
|
|