소스 검색

增加浙政钉信息拉去的任务

tags/24080901
WendyYang 1 년 전
부모
커밋
64ade210bb
4개의 변경된 파일50개의 추가작업 그리고 0개의 파일을 삭제
  1. +44
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  2. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  3. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/GovBusinessStripsTask.java
  4. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java

+ 44
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java 파일 보기

@@ -0,0 +1,44 @@
package com.ningdatech.pmapi.ding.controller;

import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask;
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* <p>
* PullDingInfoController
* </p>
*
* @author WendyYang
* @since 2023/6/2
**/
@RestController
@RequestMapping("/api/v1/zwdd/pull")
@RequiredArgsConstructor
public class DingInfoPullController {

private final EmployeeBatchGetTask employeeBatchGetTask;
private final GovBusinessStripsTask businessStripsTask;
private final OrganizationBatchGetTask organizationBatchGetTask;


@GetMapping("/employee")
public void employeeBatchGet() {
employeeBatchGetTask.batchGetEmployeeTask();
}

@GetMapping("/businessStrips")
public void businessStripsBatchGet() {
businessStripsTask.batchGetGovBusinessStripsTask();
}

@GetMapping("/organization")
public void organizationBatchGet() {
organizationBatchGetTask.batchGetOrganizationTask();
}

}

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java 파일 보기

@@ -21,6 +21,7 @@ import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition;
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition.GovEmployeePosition;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -56,6 +57,7 @@ public class EmployeeBatchGetTask {
private IUserInfoService iUserInfoService;

@Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 1 0/1 0 ?")
public void batchGetEmployeeTask() {
// 获取所有的组织列表用户获取组织下的 用户信息
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list();


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/GovBusinessStripsTask.java 파일 보기

@@ -9,6 +9,7 @@ import com.ningdatech.zwdd.model.Page;
import com.ningdatech.zwdd.model.dto.SubGovBusinessStripsDTO;
import com.ningdatech.zwdd.model.query.PageSubGovBusinessStripsQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -34,6 +35,7 @@ public class GovBusinessStripsTask {
private IGovBusinessStripService iGovBusinessStripService;

@Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 1 0/1 0 ?")
public void batchGetGovBusinessStripsTask() {
PageSubGovBusinessStripsQuery pageSubGovBusinessStripsQuery = new PageSubGovBusinessStripsQuery();
pageSubGovBusinessStripsQuery.setPageNo(1);


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java 파일 보기

@@ -16,6 +16,7 @@ import com.ningdatech.zwdd.model.dto.DingScopesV2DTO;
import com.ningdatech.zwdd.model.dto.PageSubOrganizationCodeDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -45,6 +46,7 @@ public class OrganizationBatchGetTask {
* 获取浙政钉组织架构
*/
@Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 1 0/1 0 ?")
public void batchGetOrganizationTask() {
// List<DingOrganization> allList = iDingOrganizationService.list();
// List<String> currentAllOrganizationCodeList = allList.stream().map(DingOrganization::getOrganizationCode).collect(Collectors.toList());


불러오는 중...
취소
저장