定时用户同步,和组织机构同步

This commit is contained in:
zhaokaiyao@91isoft.com
2021-10-14 14:40:54 +08:00
parent 38ad74e9ee
commit b33d2da29d
7 changed files with 232 additions and 104 deletions
@@ -0,0 +1,33 @@
package com.adc.da.scheduled;
import com.adc.da.slrs.DataSync.DataSyncController;
import com.adc.da.slrs.DataSync.service.IDataSyncService;
import com.sun.org.apache.bcel.internal.generic.NEW;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* 定时同步用户和组织机构信息
*/
@EnableScheduling
@Component
@Slf4j
public class ScheduledSync {
@Autowired
private IDataSyncService iDataSyncService;
@Scheduled(cron = "0 */40 * * * ?") //40分钟执行同步一次
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void syncSchedulingTasks() throws Exception {
iDataSyncService.orgDataSync(); //时间短
iDataSyncService.dataSync(); //时间长
}
}