Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 year ago
parent
commit
fadd50f1c1
3 changed files with 61 additions and 6 deletions
  1. +59
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  2. +1
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java

+ 59
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java View File

@@ -1,9 +1,20 @@
package com.ningdatech.pmapi.ding.task; package com.ningdatech.pmapi.ding.task;


import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.pmapi.common.config.GovDingProperties;
import com.ningdatech.pmapi.organization.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.zwdd.client.ZwddClient; import com.ningdatech.zwdd.client.ZwddClient;
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.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;


import java.util.ArrayList;
import java.util.List;

/** /**
* @author liuxinxin * @author liuxinxin
* @date 2023/2/10 上午9:52 * @date 2023/2/10 上午9:52
@@ -11,11 +22,59 @@ import org.springframework.transaction.annotation.Transactional;


public class EmployeeBatchGetTask { public class EmployeeBatchGetTask {


private final static Integer PAGE_SIZE = 20;

@Autowired @Autowired
private ZwddClient zwddClient; private ZwddClient zwddClient;
private IDingOrganizationService iDingOrganizationService;


@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void batchGetEmployeeTask() { public void batchGetEmployeeTask() {
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list();
if (CollUtil.isNotEmpty(dingOrganizationList)) {
List<OrganizationEmployeePosition> allOrganizationEmployeePositionList = new ArrayList<>();

for (DingOrganization dingOrganization : dingOrganizationList) {
String organizationCode = dingOrganization.getOrganizationCode();
PageOrganizationEmployeePositionsQuery query = new PageOrganizationEmployeePositionsQuery();
query.setEmployeeStatus("A");
query.setOrganizationCode(organizationCode);
query.setReturnTotalSize(true);
query.setTenantId(GovDingProperties.tenantId);

int pageNo = 1;
query.setPageNo(pageNo);
query.setPageSize(PAGE_SIZE);

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

}



} }
} }

+ 1
- 5
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java View File

@@ -6,7 +6,6 @@ import com.ningdatech.pmapi.fiscal.model.po.ReqCompanyFiscalCodeAndSealSnPO;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,13 +28,10 @@ public class CompanyFiscalCodeController {
private final CompanyFiscalCodeManage companyFiscalCodeManage; private final CompanyFiscalCodeManage companyFiscalCodeManage;


@ApiOperation(value = "财政编码/配置", notes = "财政编码配置") @ApiOperation(value = "财政编码/配置", notes = "财政编码配置")
@PostMapping("/configure")
@PostMapping("/fiscal-and-seal/configure")
public void fiscalAndSealCodeConfigure(@Valid @RequestBody ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) { public void fiscalAndSealCodeConfigure(@Valid @RequestBody ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) {
companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO); companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO);
} }







} }

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java View File

@@ -14,7 +14,7 @@ import org.springframework.stereotype.Controller;
* @since 2023-02-09 * @since 2023-02-09
*/ */
@Controller @Controller
@RequestMapping("/pmapi.organization/ding-organization")
@RequestMapping("/api/v1/organization")
public class DingOrganizationController { public class DingOrganizationController {


} }

Loading…
Cancel
Save