Pārlūkot izejas kodu

3.1.0-设置科组长

xiaof 3 gadi atpakaļ
vecāks
revīzija
cfd370abb2

+ 2 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java

@@ -71,8 +71,7 @@ public interface ExamPaperStructureService extends IService<ExamPaperStructure>
 
     /**
      * 绑定科组长
-     * @param id id
-     * @param markLeader 科组长
+     * @param data data
      */
-    ExamPaperStructure bindMarkLeader(String id, String markLeader);
+    ExamPaperStructure bindMarkLeader(String data);
 }

+ 2 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java

@@ -39,8 +39,6 @@ import org.springframework.util.CollectionUtils;
 import javax.annotation.Resource;
 import java.io.*;
 import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 import java.util.stream.Collectors;
 
 /**
@@ -204,7 +202,7 @@ public class DataSyncServiceImpl implements DataSyncService {
                     return syncStructureData;
                 }).collect(Collectors.toList());
 
-                cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, false, null, syncSubjectiveStructureDatas);
+                cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, false, examPaperStructure.getPaperType(), syncSubjectiveStructureDatas);
             }
 
             // 清掉云阅卷主观题答案
@@ -403,7 +401,7 @@ public class DataSyncServiceImpl implements DataSyncService {
                     syncStructureData.setAnswer(m.getString("answer"));
                     return syncStructureData;
                 }).collect(Collectors.toList());
-                cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
+                cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, examPaperStructure.getPaperType(), syncObjectiveStructureDatas);
             }
 
             result = TaskResultEnum.SUCCESS;

+ 4 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -387,7 +387,10 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
     }
 
     @Override
-    public ExamPaperStructure bindMarkLeader(String id, String markLeader) {
+    public ExamPaperStructure bindMarkLeader(String data) {
+        JSONObject jsonObject = JSON.parseObject(data);
+        Long id = jsonObject.getLong("id");
+        String markLeader = jsonObject.getString("markLeader");
         ExamPaperStructure examPaperStructure = this.getById(id);
         if (examPaperStructure == null) {
             throw ExceptionResultEnum.ERROR.exception("请先设置试卷结构");

+ 2 - 1
distributed-print-business/src/main/resources/mapper/ExamPaperStructureMapper.xml

@@ -21,7 +21,8 @@
             edc.paper_type paperType,
             IFNULL(eps.status, 'INIT') status,
             eps.paper_answer paperAnswer,
-            et.user_id propositionTeacherId
+            et.user_id propositionTeacherId,
+            eps.mark_leader markLeader
         FROM
             exam_print_plan epp
                 LEFT JOIN

+ 3 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPaperStructureController.java

@@ -106,15 +106,13 @@ public class ExamPaperStructureController {
     /**
      * 绑定科组长
      *
-     * @param id  id
-     * @param markLeader 文件数组(样例:[{markerId:1, loginName:"mt01"}])
+     * @param data  data
      * @return Result
      */
     @ApiOperation(value = "绑定科组长")
     @RequestMapping(value = "/bind_mark_leader", method = RequestMethod.POST)
-    public Result uploadAnswer(@RequestParam("id") String id,
-                               @RequestParam("markLeader") String markLeader) {
-        ExamPaperStructure examPaperStructure = examPaperStructureService.bindMarkLeader(id, markLeader);
+    public Result uploadAnswer(@RequestBody String data) {
+        ExamPaperStructure examPaperStructure = examPaperStructureService.bindMarkLeader(data);
         // 异步同步到云阅卷
         asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructure);
         return ResultUtil.ok(true);