|
|
@ -0,0 +1,23 @@ |
|
|
|
|
|
package com.jianteng.common.utils; |
|
|
|
|
|
|
|
|
|
|
|
import com.jianteng.modules.pms.service.EamService; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling; |
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
@Component |
|
|
|
|
|
@Configuration |
|
|
|
|
|
@EnableScheduling |
|
|
|
|
|
public class TaskUtils { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EamService eamService; |
|
|
|
|
|
|
|
|
|
|
|
// 添加定时任务 |
|
|
|
|
|
@Scheduled(cron = "${task.data.eamWorkPlanTime}") // 每天0点执行 |
|
|
|
|
|
public void doTask() { |
|
|
|
|
|
eamService.eamWorkPlanTask(); |
|
|
|
|
|
} |
|
|
|
|
|
} |