wisdomisite-java/src/main/java/com/zhgd/xmgl/task/ProjectWorkerStatisticsTask.java
2024-04-14 21:05:01 +08:00

38 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.zhgd.xmgl.task;
import com.zhgd.xmgl.modules.project.service.IProjectWorkerStatisticsService;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.core.SchedulerLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @program: wisdomSite
* @description:
* @author: Mr.Peng
* @create: 2022-06-13 16:56
**/
@Slf4j
@Component
public class ProjectWorkerStatisticsTask {
@Autowired
private IProjectWorkerStatisticsService projectWorkerStatisticsService;
/**
* 定时统计人员统计数据
*
*/
@Scheduled(cron = "0 0 */1 * * ?")
@SchedulerLock(name = "getProjectWorkerStatisticsTask", lockAtMostFor = 1000*60*10, lockAtLeastFor = 1000*60*3)
public void getProjectWorkerStatisticsTask() {
try {
projectWorkerStatisticsService.saveProjectWorkerStatistics();
} catch (Exception e) {
log.error("error", e);
}
}
}