|
@@ -892,4 +892,33 @@ public class EPaperStudentService {
|
892
|
892
|
batchids = batchids.stream().distinct().collect(Collectors.toList());
|
893
|
893
|
eScanbatchMapper.updateBatchErrornum(batchids);//更改异常已处理数量
|
894
|
894
|
}
|
|
895
|
+
|
|
896
|
+ /*
|
|
897
|
+ * 定时更新学生考试状态
|
|
898
|
+ * @Param [esids(考试科目ids), cs(执行的次数), stime(隔几毫秒执行一次)]
|
|
899
|
+ * @Author ywx
|
|
900
|
+ * @Date 2022/11/9 19:02
|
|
901
|
+ * @return java.lang.Integer
|
|
902
|
+ **/
|
|
903
|
+ public Integer update(String esids, Integer cs, Integer stime) {
|
|
904
|
+ Integer num = 0;
|
|
905
|
+ try {
|
|
906
|
+ if (N_Utils.isEmpty(esids)) {
|
|
907
|
+ List<Map> list = ePaperStudentMapper.listExam();
|
|
908
|
+ esids = list.stream().map(s -> s.get("esid").toString()).collect(Collectors.joining(","));
|
|
909
|
+ log.info(JSON.toJSONString(list));
|
|
910
|
+ }
|
|
911
|
+ if (N_Utils.isEmpty(esids)) return 0;
|
|
912
|
+ for (int i = 0; i < cs; i++) {
|
|
913
|
+ Integer unum = ePaperStudentMapper.updateSstateByEsIds(esids);
|
|
914
|
+ num += unum;
|
|
915
|
+ log.error("本次更新:【" + unum + "】条");
|
|
916
|
+ Thread.sleep(stime);
|
|
917
|
+ }
|
|
918
|
+ log.error("共更新:【" + num + "】条");
|
|
919
|
+ } catch (InterruptedException e) {
|
|
920
|
+ log.error("定时更新学生考试状态出错", e.getMessage());
|
|
921
|
+ }
|
|
922
|
+ return num;
|
|
923
|
+ }
|
895
|
924
|
}
|