|
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import cn.com.qmth.stmms.biz.config.service.SystemConfigService;
|
|
|
import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
@@ -29,6 +30,7 @@ import cn.com.qmth.stmms.biz.lock.LockService;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
|
import cn.com.qmth.stmms.biz.report.service.ReportService;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLockUtil;
|
|
|
+import cn.com.qmth.stmms.common.enums.ConfigType;
|
|
|
import cn.com.qmth.stmms.common.enums.ExamStatus;
|
|
|
import cn.com.qmth.stmms.common.enums.LockType;
|
|
|
import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
@@ -74,6 +76,9 @@ public class MarkCronService {
|
|
|
@Autowired
|
|
|
private ReportService reportService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SystemConfigService systemConfigService;
|
|
|
+
|
|
|
/**
|
|
|
* 自动释放可清除的锁
|
|
|
*/
|
|
@@ -291,6 +296,10 @@ public class MarkCronService {
|
|
|
|
|
|
@Scheduled(fixedDelay = 30 * 60 * 1000, initialDelay = 2 * 60 * 1000)
|
|
|
public void updateReport() {
|
|
|
+ String systemConfig = systemConfigService.findByType(ConfigType.AUTO_REPORT);
|
|
|
+ if (systemConfig == null || systemConfig != "on") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
log.info("start auto-update report");
|
|
|
try {
|
|
|
Map<Integer, Set<String>> map = new HashMap<Integer, Set<String>>();
|