|
@@ -8,12 +8,14 @@
|
|
|
package cn.com.qmth.examcloud.core.print.config;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.print.common.utils.DateUtils;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.CoursePaperService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.CourseStatisticService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
|
|
|
import cn.com.qmth.examcloud.core.print.service.PrintingProjectStatisticService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.Serializable;
|
|
@@ -29,12 +31,14 @@ public class StatisticScheduler implements Serializable {
|
|
|
private PrintingProjectService printingProjectService;
|
|
|
@Autowired
|
|
|
private PrintingProjectStatisticService printingProjectStatisticService;
|
|
|
+ @Autowired
|
|
|
+ private CoursePaperService coursePaperService;
|
|
|
|
|
|
/**
|
|
|
* 定时统计数据(每N分钟执行)
|
|
|
*/
|
|
|
//@Scheduled(cron = "0 1/1 * * * ?")
|
|
|
- public void execute() throws Exception {
|
|
|
+ public void statistic() throws Exception {
|
|
|
Date start = new Date();
|
|
|
|
|
|
//初始所有印刷项目的基本信息
|
|
@@ -49,4 +53,12 @@ public class StatisticScheduler implements Serializable {
|
|
|
log.info("统计耗时:" + DateUtils.diff(start, new Date()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 定时执行转换PDF(每N分钟执行)
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 3/3 * * * ?")
|
|
|
+ public void convert() throws Exception {
|
|
|
+ coursePaperService.convertCoursePapers();
|
|
|
+ }
|
|
|
+
|
|
|
}
|