deason 2 vuotta sitten
vanhempi
commit
9da8f34646

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/tool/service/export_student_answer_and_score_detail/ExportStudentAnswerAndScoreDetailTask.java

@@ -73,7 +73,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
         } else {
             todoCourses = courses;
         }
-        log.info("examId = {}, 待处理的课程数为:{}", examId, todoCourses.size());
+        log.info("examId:{}, 待处理的课程数为:{}", examId, todoCourses.size());
 
         for (CourseVO course : todoCourses) {
             // 按考试课程逐个处理

+ 2 - 3
src/main/java/cn/com/qmth/examcloud/tool/service/paper_struct/PaperStructTask.java

@@ -1,7 +1,6 @@
 package cn.com.qmth.examcloud.tool.service.paper_struct;
 
 import cn.com.qmth.examcloud.tool.config.SysProperty;
-import cn.com.qmth.examcloud.tool.entity.TaskEntity;
 import cn.com.qmth.examcloud.tool.service.CommonService;
 import cn.com.qmth.examcloud.tool.service.export_student_answer_and_score_detail.vo.CourseVO;
 import cn.com.qmth.examcloud.tool.service.paper_struct.vo.ExamPaperVO;
@@ -33,9 +32,9 @@ public class PaperStructTask {
     @Autowired
     private CommonService commonService;
 
-    public void start(TaskEntity task) {
+    public void start(Long examId) {
         User user = commonService.login(sysProperty.getServerRootOrgId(), sysProperty.getServerLoginName(), sysProperty.getServerPassword());
-        this.execute(user, 51L);
+        this.execute(user, examId);
     }
 
     private void execute(User user, Long examId) {

+ 6 - 6
src/main/java/cn/com/qmth/examcloud/tool/service/reset_student_password/ResetStudentPasswordTask.java

@@ -1,7 +1,6 @@
 package cn.com.qmth.examcloud.tool.service.reset_student_password;
 
 import cn.com.qmth.examcloud.tool.config.SysProperty;
-import cn.com.qmth.examcloud.tool.entity.TaskEntity;
 import cn.com.qmth.examcloud.tool.service.CommonService;
 import cn.com.qmth.examcloud.tool.service.reset_student_password.vo.StudentVO;
 import cn.com.qmth.examcloud.tool.utils.HttpHelper;
@@ -29,13 +28,14 @@ public class ResetStudentPasswordTask {
     @Autowired
     private CommonService commonService;
 
-    public void start(TaskEntity task) {
-        User user = new User();
-        user.setKey("U_C_0_9");
-        user.setToken("c7377229debb4c6594c071a57e9d983f");
-        this.execute(user, 0L);
+    public void start(Long rootOrgId) {
+        User user = commonService.login(sysProperty.getServerRootOrgId(), sysProperty.getServerLoginName(), sysProperty.getServerPassword());
+        this.execute(user, rootOrgId);
     }
 
+    /**
+     * 将某个学校的所有学生重置密码
+     */
     private void execute(User user, Long rootOrgId) {
         Map<String, String> headers = new HashMap<>();
         headers.put("key", user.getKey());

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/tool/service/update_correct_answer_and_re_fix_score/UpdateCorrectAnswerAndReFixScoreTask.java

@@ -66,7 +66,7 @@ public class UpdateCorrectAnswerAndReFixScoreTask {
         } else {
             todoCourses = courses;
         }
-        log.info("examId = {}, 待处理的课程数为:{}", examId, todoCourses.size());
+        log.info("examId:{}, 待处理的课程数为:{}", examId, todoCourses.size());
 
         for (CourseVO course : todoCourses) {
             // 按考试课程逐个处理

+ 2 - 0
src/test/java/cn/com/qmth/examcloud/tool/ToolTest.java

@@ -30,6 +30,8 @@ public class ToolTest {
     @Test
     public void demo() throws Exception {
         // testLogin();
+        // resetStudentPasswordTask.start(0L);
+        // paperStructTask.start(0L);
     }
 
     private void testLogin() {