Browse Source

组织更新代码

master
PoffyZhang 1 year ago
parent
commit
45f724602f
2 changed files with 25 additions and 2 deletions
  1. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java
  2. +21
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java

+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java View File

@@ -128,6 +128,8 @@ public class OrganizationBatchGetTask {
return;
}

employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode);

for(String subOrganizationCode : subOrganizationCodeList){
GenericResult<DingOrgInfoDTO> organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode);
DingOrgInfoDTO dingOrgInfo = organizationByCode.getData();
@@ -137,7 +139,7 @@ public class OrganizationBatchGetTask {
if(Objects.nonNull(old)){
log.info("该单位已经存在 :{}",old.getOrganizationName());
organizationGetSubs(dingOrgInfo.getOrganizationCode());
employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode());
// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode());
continue;
}

@@ -156,7 +158,7 @@ public class OrganizationBatchGetTask {
organization.setParentName(dingOrgInfo.getParentName());
if(iDingOrganizationService.save(organization)){
organizationGetSubs(organization.getOrganizationCode());
employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode());
// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode());
}
}



+ 21
- 0
pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java View File

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
@@ -34,6 +36,12 @@ public class EmployeeTest extends AppTests {
@Autowired
private IUserInfoService userInfoService;

@Autowired
private OrganizationBatchGetTask organizationBatchGetTask;

@Autowired
private EmployeeBatchGetTask employeeBatchGetTask;

@Test
public void test(){
List<DingEmployeeInfo> employees = dingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
@@ -72,4 +80,17 @@ public class EmployeeTest extends AppTests {
}
}

@Test
public void test2(){
String orgCode = "GO_4e6be07f25594df88e7bd1b7b7cdf9a8";
organizationBatchGetTask.organizationGetSubs(orgCode);
}

@Test
public void test3(){
String orgCode = "GO_1aceac0b3a664afbb31ea0d627189781";
employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode);
}


}

Loading…
Cancel
Save