|
@@ -2,6 +2,7 @@ package com.ruoyi.sim.service.impl;
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
import cn.ele6.catalyzer.ruoyi.vue.custom.Ele6RYBaseService;
|
|
import cn.ele6.catalyzer.ruoyi.vue.custom.Ele6RYBaseService;
|
|
|
import cn.ele6.catalyzer.ruoyi.vue.enhance.TableDataInfo;
|
|
import cn.ele6.catalyzer.ruoyi.vue.enhance.TableDataInfo;
|
|
@@ -504,13 +505,24 @@ public class RealExamCollectionService extends Ele6RYBaseService {
|
|
|
return list.get(0);
|
|
return list.get(0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void deleteRefTypeSelfExercise() {
|
|
|
|
|
|
|
+ public void scheduledDeleteRefTypeSelfExercise() {
|
|
|
|
|
+ AjaxResult ar = deleteRefTypeSelfExercise();
|
|
|
|
|
+ l.debug("scheduledDeleteRefTypeSelfExercise {}", ar);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 每天01:00定时执行。删除所有 练习 的考试集合数据。
|
|
|
|
|
+ */
|
|
|
|
|
+ public AjaxResult deleteRefTypeSelfExercise() {
|
|
|
RealExamCollection q = new RealExamCollection();
|
|
RealExamCollection q = new RealExamCollection();
|
|
|
q.setExamCollectionType(RealExamCollection.Type.SELF_EXERCISE);
|
|
q.setExamCollectionType(RealExamCollection.Type.SELF_EXERCISE);
|
|
|
List<RealExamCollection> list = selectRealExamCollectionList(q);
|
|
List<RealExamCollection> list = selectRealExamCollectionList(q);
|
|
|
|
|
+ AtomicInteger count = new AtomicInteger();
|
|
|
list.forEach((RealExamCollection rec) -> {
|
|
list.forEach((RealExamCollection rec) -> {
|
|
|
deleteRef(rec.getExamCollectionId());
|
|
deleteRef(rec.getExamCollectionId());
|
|
|
|
|
+ count.set(count.get() + 1);
|
|
|
});
|
|
});
|
|
|
|
|
+ return AjaxResult.success(count.intValue());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void deleteRef(Long id) {
|
|
public void deleteRef(Long id) {
|