Prechádzať zdrojové kódy

定时器异步执行

dzx 8 mesiacov pred
rodič
commit
98ffb8dc58
21 zmenil súbory, kde vykonal 42 pridanie a 1 odobranie
  1. 2 0
      src/main/java/com/xjrsoft/module/job/ActivityInfoTask.java
  2. 2 0
      src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java
  3. 2 0
      src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java
  4. 2 0
      src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java
  5. 2 0
      src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java
  6. 2 0
      src/main/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTask.java
  7. 2 0
      src/main/java/com/xjrsoft/module/job/EvaluateTask.java
  8. 2 0
      src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java
  9. 2 0
      src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java
  10. 2 0
      src/main/java/com/xjrsoft/module/job/HikvisionLeaveTask.java
  11. 2 0
      src/main/java/com/xjrsoft/module/job/HolidayTask.java
  12. 2 0
      src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java
  13. 2 0
      src/main/java/com/xjrsoft/module/job/JianyuekbBaseDataTask.java
  14. 2 0
      src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java
  15. 2 0
      src/main/java/com/xjrsoft/module/job/ProcessNotProcessingAlertTask.java
  16. 2 0
      src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java
  17. 2 0
      src/main/java/com/xjrsoft/module/job/StudentDropOutTask.java
  18. 2 0
      src/main/java/com/xjrsoft/module/job/StudentLeaveNoticeTask.java
  19. 2 0
      src/main/java/com/xjrsoft/module/job/StudentReportPlanTask.java
  20. 2 1
      src/main/java/com/xjrsoft/module/job/WfCourseAdjustTask.java
  21. 2 0
      src/main/java/com/xjrsoft/module/job/WhitelistTask.java

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ActivityInfoTask.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.job;
 
 import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class ActivityInfoTask {
 
+    @Async
     @Scheduled(cron = "0 */5 * * * ?")
     public void RefreshConnectionPool() {
 //        String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java

@@ -19,6 +19,7 @@ import com.xjrsoft.module.organization.service.IWeChatService;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -56,6 +57,7 @@ public class AttenDanceWarnNoticeTask {
     @Autowired
     private IHolidayDateService holidayDateService;
 
+    @Async
     @Scheduled(cron = "0 */1 * * * ?")
     public void execute() {
         RefreshConnectionPool();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -31,6 +31,7 @@ import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -77,6 +78,7 @@ public class AttendanceMessageTask {
     @Autowired
     private WeChatUtil weChatUtil;
 
+    @Async
     @Scheduled(cron = "0 */1 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java

@@ -25,6 +25,7 @@ import com.xjrsoft.module.teacher.entity.WfTeacherleave;
 import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -68,6 +69,7 @@ public class AttendanceRecordTask {
     private IHolidayDateService holidayDateService;
 
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java

@@ -17,6 +17,7 @@ import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -50,6 +51,7 @@ public class BaseNewStudentTask {
     @Autowired
     private IBaseMajorSetService majorSetService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTask.java

@@ -14,6 +14,7 @@ import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
 import com.yomahub.liteflow.util.JsonUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -40,6 +41,7 @@ public class EnrollmentStatisticsInfoTask {
     @Autowired
     private EnrollmentStatisticsInfoMapper enrollmentStatisticsInfoMapper;
 
+    @Async
     @Scheduled(cron = "00 0/15 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/EvaluateTask.java

@@ -5,6 +5,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.evaluate.entity.EvaluateManage;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -22,6 +23,7 @@ public class EvaluateTask {
     /**
      * 需要重复评价的,每天凌晨1点自动生成新的评价提交记录
      */
+    @Async
     @Scheduled(cron = "0 0 1 * * ?")
     public void addSubmitRecord() {
         System.out.printf("定时新增评价提交记录:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java

@@ -7,6 +7,7 @@ import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
 import com.xjrsoft.module.xycxedu.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class ExamScoreDataTask {
     @Autowired
     private IBaseCourseSubjectService courseService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java

@@ -9,6 +9,7 @@ import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -25,6 +26,7 @@ public class HikvisionBaseDataTask {
     @Autowired
     private HikvisionDataMapper hikvisionDataMapper;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HikvisionLeaveTask.java

@@ -15,6 +15,7 @@ import com.xjrsoft.module.teacher.entity.WfTeacherleave;
 import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -40,6 +41,7 @@ public class HikvisionLeaveTask {
     @Autowired
     private HikvisionDataMapper hikvisionDataMapper;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HolidayTask.java

@@ -4,6 +4,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.module.holiday.service.IHolidayDateService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -20,6 +21,7 @@ public class HolidayTask {
     /**
      * 定时拉取节假日数据
      */
+    @Async
     @Scheduled(cron = "0 0 1 * * ?")
     public void RefreshHoliday() {
         System.out.printf("定时拉取节假日数据:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.hikvision.util.OutInRecordUtil;
 import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -24,6 +25,7 @@ public class InsertOutInRecordTask {
     @Autowired
     private IHikvisionDataService hikvisionDataService;
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbBaseDataTask.java

@@ -7,6 +7,7 @@ import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.schedule.entity.JianyueData;
 import com.xjrsoft.module.schedule.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -21,6 +22,7 @@ import java.util.*;
 public class JianyuekbBaseDataTask {
 
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -61,6 +61,7 @@ import org.camunda.bpm.engine.runtime.ActivityInstance;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
 import org.camunda.bpm.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -129,6 +130,7 @@ public class JianyuekbScheduleTask {
     @Autowired
     private IBaseGradeService gradeService;
 
+    @Async
     @Scheduled(cron = "0 */10 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ProcessNotProcessingAlertTask.java

@@ -8,6 +8,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.module.oa.utils.SendMessageUtil;
 import com.xjrsoft.module.workflow.entity.WorkflowExtra;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class ProcessNotProcessingAlertTask {
     /**
      * 流程未处理提醒
      */
+    @Async
     @Scheduled(cron = "0 0 14 * * ?")
     public void alertProcessNotProcessing() {
         System.out.printf("定时提醒流程未处理:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java

@@ -14,6 +14,7 @@ import org.camunda.bpm.engine.HistoryService;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -43,6 +44,7 @@ public class ProcessTimeoutAlertTask {
     @Autowired
     private IWorkflowAlertRecordService alertRecordService;
 
+    @Async
     @Scheduled(cron = "0 0 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentDropOutTask.java

@@ -15,6 +15,7 @@ import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -34,6 +35,7 @@ public class StudentDropOutTask {
     @Autowired
     private IHikvisionDataService hikvisionDataService;
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentLeaveNoticeTask.java

@@ -19,6 +19,7 @@ import com.xjrsoft.module.student.vo.NoBackStudentInfoVo;
 import lombok.extern.slf4j.Slf4j;
 import me.zhyd.oauth.log.Log;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -43,6 +44,7 @@ public class StudentLeaveNoticeTask {
     @Autowired
     private IWeChatService weChatService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         //doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentReportPlanTask.java

@@ -8,6 +8,7 @@ import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -28,6 +29,7 @@ public class StudentReportPlanTask {
     private IStudentReportPlanService planService;
 
 
+    @Async
     @Scheduled(cron = "0 */5 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 1
src/main/java/com/xjrsoft/module/job/WfCourseAdjustTask.java

@@ -12,6 +12,7 @@ import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import lombok.extern.slf4j.Slf4j;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -32,7 +33,7 @@ public class WfCourseAdjustTask {
     @Autowired
     private ICourseTableService courseTableService;
 
-
+    @Async
     @Scheduled(cron = "0 */10 * * * ?")
     public void execute() {
         List<WfCourseAdjust> list = wfCourseAdjustService.list(

+ 2 - 0
src/main/java/com/xjrsoft/module/job/WhitelistTask.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class WhitelistTask {
     @Autowired
     private RedisUtil redisUtil;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();