浏览代码

3.2.7 评卷参数管理优化

xiaofei 1 年之前
父节点
当前提交
cb4b339f1e
共有 29 个文件被更改,包括 443 次插入163 次删除
  1. 0 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/BasicPaperInfo.java
  2. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/AnswerFile.java
  3. 68 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/ExamPaperStructureStatus.java
  4. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Group.java
  5. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Marker.java
  6. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/MarkerClass.java
  7. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/MarkerLeader.java
  8. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Objective.java
  9. 24 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Structure.java
  10. 10 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamPaperStructure.java
  11. 0 44
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/ExamPaperStructureStatusEnum.java
  12. 7 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/ExamPaperStructureStatusTypeEnum.java
  13. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPaperStructureMapper.java
  14. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/DataSyncService.java
  15. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperGroupService.java
  16. 3 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java
  17. 62 20
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java
  18. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperClassMarkerServiceImpl.java
  19. 5 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperGroupServiceImpl.java
  20. 23 24
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java
  21. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TBSyncTaskServiceImpl.java
  22. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCloudMarkingTaskService.java
  23. 14 2
      distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql
  24. 14 2
      distributed-print-business/src/main/resources/db/upgrade/3.2.7.sql
  25. 2 18
      distributed-print-business/src/main/resources/mapper/ExamPaperStructureMapper.xml
  26. 16 6
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPaperStructureController.java
  27. 1 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/WorkController.java
  28. 35 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/stmms/ClassMarkerDTO.java
  29. 6 5
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

+ 0 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/BasicPaperInfo.java

@@ -1,14 +1,11 @@
 package com.qmth.distributed.print.business.bean.marking;
 package com.qmth.distributed.print.business.bean.marking;
 
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import org.hibernate.validator.constraints.Length;
 import org.hibernate.validator.constraints.Length;
 
 
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.NotNull;
-import java.util.List;
 
 
 /**
 /**
  * @Description 基础试卷信息
  * @Description 基础试卷信息
@@ -45,9 +42,6 @@ public class BasicPaperInfo {
     @Length(min = 1,message = "请提供试卷类型")
     @Length(min = 1,message = "请提供试卷类型")
     private String paperType;
     private String paperType;
 
 
-    @ApiModelProperty(value = "状态")
-    private ExamPaperStructureStatusEnum status;
-
     @ApiModelProperty(value = "课程创建的任务序号")
     @ApiModelProperty(value = "课程创建的任务序号")
     private String sequence;
     private String sequence;
 
 
@@ -118,14 +112,6 @@ public class BasicPaperInfo {
         this.paperType = paperType;
         this.paperType = paperType;
     }
     }
 
 
-    public ExamPaperStructureStatusEnum getStatus() {
-        return status;
-    }
-
-    public void setStatus(ExamPaperStructureStatusEnum status) {
-        this.status = status;
-    }
-
     public String getSequence() {
     public String getSequence() {
         return sequence;
         return sequence;
     }
     }

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/AnswerFile.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class AnswerFile {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 68 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/ExamPaperStructureStatus.java

@@ -0,0 +1,68 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class ExamPaperStructureStatus {
+
+    private Structure structure;
+    private Group group;
+    private MarkerClass markerClass;
+    private Objective objective;
+    private MarkerLeader markerLeader;
+    private Marker marker;
+    private AnswerFile answerFile;
+
+    public Structure getStructure() {
+        return structure;
+    }
+
+    public void setStructure(Structure structure) {
+        this.structure = structure;
+    }
+
+    public Group getGroup() {
+        return group;
+    }
+
+    public void setGroup(Group group) {
+        this.group = group;
+    }
+
+    public MarkerClass getMarkerClass() {
+        return markerClass;
+    }
+
+    public void setMarkerClass(MarkerClass markerClass) {
+        this.markerClass = markerClass;
+    }
+
+    public Objective getObjective() {
+        return objective;
+    }
+
+    public void setObjective(Objective objective) {
+        this.objective = objective;
+    }
+
+    public MarkerLeader getMarkerLeader() {
+        return markerLeader;
+    }
+
+    public void setMarkerLeader(MarkerLeader markerLeader) {
+        this.markerLeader = markerLeader;
+    }
+
+    public Marker getMarker() {
+        return marker;
+    }
+
+    public void setMarker(Marker marker) {
+        this.marker = marker;
+    }
+
+    public AnswerFile getAnswerFile() {
+        return answerFile;
+    }
+
+    public void setAnswerFile(AnswerFile answerFile) {
+        this.answerFile = answerFile;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Group.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class Group {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Marker.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class Marker {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/MarkerClass.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class MarkerClass {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/MarkerLeader.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class MarkerLeader {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Objective.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class Objective {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/marking/status/Structure.java

@@ -0,0 +1,24 @@
+package com.qmth.distributed.print.business.bean.marking.status;
+
+public class Structure {
+
+    private Boolean save;
+
+    private Boolean sync;
+
+    public Boolean getSave() {
+        return save;
+    }
+
+    public void setSave(Boolean save) {
+        this.save = save;
+    }
+
+    public Boolean getSync() {
+        return sync;
+    }
+
+    public void setSync(Boolean sync) {
+        this.sync = sync;
+    }
+}

+ 10 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamPaperStructure.java

@@ -2,21 +2,15 @@ package com.qmth.distributed.print.business.entity;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.base.BaseEntity;
-
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -92,6 +86,8 @@ public class ExamPaperStructure extends BaseEntity implements Serializable {
      * 状态
      * 状态
      */
      */
     private String status;
     private String status;
+    @TableField("is_finish")
+    private Boolean isFinish;
     /**
     /**
      * 试卷原卷和标答附件ID
      * 试卷原卷和标答附件ID
      */
      */
@@ -236,6 +232,14 @@ public class ExamPaperStructure extends BaseEntity implements Serializable {
         this.status = status;
         this.status = status;
     }
     }
 
 
+    public Boolean getFinish() {
+        return isFinish;
+    }
+
+    public void setFinish(Boolean finish) {
+        isFinish = finish;
+    }
+
     public String getPaperAnswer() {
     public String getPaperAnswer() {
         return paperAnswer;
         return paperAnswer;
     }
     }

+ 0 - 44
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/ExamPaperStructureStatusEnum.java

@@ -1,44 +0,0 @@
-package com.qmth.distributed.print.business.enums;
-
-import com.qmth.teachcloud.common.enums.EnumResult;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 考试试卷结构同步状态
- */
-public enum ExamPaperStructureStatusEnum {
-
-    INIT("未开始"),
-    SUBJECTIVE_FINISH("主观题结构同步成功"),
-    GROUP_FINISH("分组同步成功"),
-    FINISH("绑定评卷员同步成功,结束");
-
-    ExamPaperStructureStatusEnum(String desc) {
-        this.desc = desc;
-    }
-
-    private String desc;
-
-    public String getDesc() {
-        return desc;
-    }
-
-    /**
-     * @return
-     */
-    public static List<EnumResult> listTypes() {
-        List<EnumResult> list = new ArrayList<EnumResult>();
-        for (ExamPaperStructureStatusEnum value : ExamPaperStructureStatusEnum.values()) {
-            EnumResult result = new EnumResult();
-            result.setName(value.name());
-            result.setOrdinal(value.ordinal());
-            result.setCode(null);
-            result.setDesc(value.getDesc());
-            list.add(result);
-        }
-        return list;
-    }
-
-}

+ 7 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/ExamPaperStructureStatusTypeEnum.java

@@ -10,13 +10,13 @@ import java.util.List;
  */
  */
 public enum ExamPaperStructureStatusTypeEnum {
 public enum ExamPaperStructureStatusTypeEnum {
 
 
-    STRUCTURE("structure","未开始"),
-    GROUP("group","主观题结构同步成功"),
-    CLASS("class","分组同步成功"),
-    OBJECTIVE("objective","绑定评卷员同步成功,结束"),
-    MARKER_LEADER("markerLeader","绑定评卷员同步成功,结束"),
-    MARKER("marker","绑定评卷员同步成功,结束"),
-    ANSWER_FILE("answerFile","绑定评卷员同步成功,结束");
+    STRUCTURE("structure","试卷结构"),
+    GROUP("group","分组、分组绑定评卷员"),
+    MARKER_CLASS("markerClass","评卷员绑定班级"),
+    OBJECTIVE("objective","客观题标签"),
+    MARKER_LEADER("markerLeader","科组长"),
+    MARKER("marker","评卷员"),
+    ANSWER_FILE("answerFile","标答文件");
 
 
     ExamPaperStructureStatusTypeEnum(String type, String desc) {
     ExamPaperStructureStatusTypeEnum(String type, String desc) {
         this.type = type;
         this.type = type;

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPaperStructureMapper.java

@@ -18,7 +18,7 @@ import java.util.List;
  * @author xf
  * @author xf
  */
  */
 public interface ExamPaperStructureMapper extends BaseMapper<ExamPaperStructure> {
 public interface ExamPaperStructureMapper extends BaseMapper<ExamPaperStructure> {
-    IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(@Param("page") Page<ExamPaperStructure> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("syncStatus") String syncStatus, @Param("structureStatusEnums") String[] structureStatusEnums, @Param("ready") Boolean ready, @Param("dpr") DataPermissionRule dpr);
+    IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(@Param("page") Page<ExamPaperStructure> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("syncStatus") String syncStatus, @Param("ready") Boolean ready, @Param("dpr") DataPermissionRule dpr);
 
 
-    List<ExamPaperStructure> listByPropositionTeacherId(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("propositionTeacherId") Long propositionTeacherId, @Param("syncStatus") String syncStatus, @Param("structureStatusEnums") String[] structureStatusEnums, @Param("ready") Boolean ready,@Param("dpr") DataPermissionRule dpr);
+    List<ExamPaperStructure> listByPropositionTeacherId(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("propositionTeacherId") Long propositionTeacherId, @Param("syncStatus") String syncStatus, @Param("ready") Boolean ready,@Param("dpr") DataPermissionRule dpr);
 }
 }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/DataSyncService.java

@@ -20,7 +20,7 @@ public interface DataSyncService {
 
 
     void syncMarkLeader(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
     void syncMarkLeader(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
 
 
-    void syncMarker(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
+    void syncMarkerAndClass(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
 
 
     Long saveExam(Long schoolId, Long objectId, String orgCode, Long thirdRelateId, String thirdRelateName, String examTime);
     Long saveExam(Long schoolId, Long objectId, String orgCode, Long thirdRelateId, String thirdRelateName, String examTime);
 
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperGroupService.java

@@ -38,5 +38,5 @@ public interface ExamPaperGroupService extends IService<ExamPaperGroup> {
      */
      */
     List<ExamPaperGroup> listByExamPaperStructureId(Long id);
     List<ExamPaperGroup> listByExamPaperStructureId(Long id);
 
 
-    void saveExamPaperGroupMarkerByGroupNumber(Long examPaperStructureId, Integer groupNumber, List<Marker> markerList);
+    void saveExamPaperGroupMarkerByGroupNumber(ExamPaperStructure examPaperStructure, Integer groupNumber, List<Marker> markerList);
 }
 }

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.marking.CardJpgResult;
 import com.qmth.distributed.print.business.bean.marking.CardJpgResult;
+import com.qmth.distributed.print.business.bean.marking.ClassMarker;
 import com.qmth.distributed.print.business.bean.marking.GroupInfo;
 import com.qmth.distributed.print.business.bean.marking.GroupInfo;
 import com.qmth.distributed.print.business.bean.marking.Question;
 import com.qmth.distributed.print.business.bean.marking.Question;
 import com.qmth.distributed.print.business.entity.ExamPaperStructure;
 import com.qmth.distributed.print.business.entity.ExamPaperStructure;
@@ -25,7 +26,7 @@ import java.util.Map;
  */
  */
 public interface ExamPaperStructureService extends IService<ExamPaperStructure> {
 public interface ExamPaperStructureService extends IService<ExamPaperStructure> {
 
 
-    IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, String[] structureStatusEnums, Boolean ready);
+    IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, Boolean ready);
 
 
     ExamPaperStructure upload(String examPaperStructure, String md5, String keys, MultipartFile[] files);
     ExamPaperStructure upload(String examPaperStructure, String md5, String keys, MultipartFile[] files);
 
 
@@ -78,7 +79,7 @@ public interface ExamPaperStructureService extends IService<ExamPaperStructure>
      */
      */
     ExamPaperStructure bindMarkLeader(String data);
     ExamPaperStructure bindMarkLeader(String data);
 
 
-    ExamPaperStructure saveMarker(Long examPaperStructureId, GroupInfo groupInfo);
+    ExamPaperStructure saveMarkerAndClass(String data);
 
 
     List<UserRoleDto> listSecretary();
     List<UserRoleDto> listSecretary();
 
 

+ 62 - 20
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java

@@ -7,8 +7,7 @@ import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto;
 import com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto;
 import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
 import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
 import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
 import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
-import com.qmth.distributed.print.business.bean.marking.GroupInfo;
-import com.qmth.distributed.print.business.bean.marking.Marker;
+import com.qmth.distributed.print.business.bean.marking.status.ExamPaperStructureStatus;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
@@ -330,9 +329,9 @@ public class DataSyncServiceImpl implements DataSyncService {
                         List<String> classNames = Arrays.asList(className.split(","));
                         List<String> classNames = Arrays.asList(className.split(","));
                         cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
                         cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
                     }
                     }
-                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.CLASS.getType(), "sync", true));
+                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
                 } catch (Exception e) {
                 } catch (Exception e) {
-                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.CLASS.getType(), "sync", false));
+                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
                 }
                 }
             }
             }
             result = TaskResultEnum.SUCCESS;
             result = TaskResultEnum.SUCCESS;
@@ -340,6 +339,19 @@ public class DataSyncServiceImpl implements DataSyncService {
             result = TaskResultEnum.ERROR;
             result = TaskResultEnum.ERROR;
             errorMessage = errorMessage + e.getMessage();
             errorMessage = errorMessage + e.getMessage();
         } finally {
         } finally {
+            String status = examPaperStructure.getStatus();
+            ExamPaperStructureStatus examPaperStructureStatus = JSON.parseObject(status, ExamPaperStructureStatus.class);
+            if (examPaperStructureStatus.getStructure().getSave() && examPaperStructureStatus.getStructure().getSync()
+                    && examPaperStructureStatus.getGroup().getSave() && examPaperStructureStatus.getGroup().getSync()) {
+                if (examPaperStructure.getOpenClassReading()) {
+                    if (examPaperStructureStatus.getMarkerClass().getSave() && examPaperStructureStatus.getMarkerClass().getSync()) {
+                        examPaperStructure.setFinish(true);
+                    }
+                } else {
+                    examPaperStructure.setFinish(true);
+                }
+            }
+
             examPaperStructureService.updateById(examPaperStructure);
             examPaperStructureService.updateById(examPaperStructure);
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, mainProgress + errorMessage);
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, mainProgress + errorMessage);
         }
         }
@@ -416,10 +428,14 @@ public class DataSyncServiceImpl implements DataSyncService {
                             continue;
                             continue;
                         }
                         }
                         // 同步试卷文件
                         // 同步试卷文件
-                        paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
-                        String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
-                        // 试卷文件保存url
-                        paperAnswerJson.put("paperUrl", syncPaperFileUrl);
+                        try {
+                            paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
+                            String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
+                            // 试卷文件保存url
+                            paperAnswerJson.put("paperUrl", syncPaperFileUrl);
+                        } catch (Exception e) {
+                            log.error("试卷文件上传失败,不作处理");
+                        }
 
 
                         // 同步标答
                         // 同步标答
                         String answer = paperAnswerJson.getString("answer");
                         String answer = paperAnswerJson.getString("answer");
@@ -490,16 +506,18 @@ public class DataSyncServiceImpl implements DataSyncService {
             }
             }
 
 
             String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, null);
             String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, null);
+            examPaperStructure.setCloudInfoJson(cloudInfoJson);
+            examPaperStructure.setStructureChange(false);
             UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
             UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamPaperStructure::getCloudInfoJson, cloudInfoJson).set(ExamPaperStructure::getStructureChange, false).eq(ExamPaperStructure::getId, examPaperStructure.getId());
-            examPaperStructureService.update(updateWrapper);
-
+            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", true));
             result = TaskResultEnum.SUCCESS;
             result = TaskResultEnum.SUCCESS;
         } catch (ApiException e) {
         } catch (ApiException e) {
+            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", false));
             result = TaskResultEnum.ERROR;
             result = TaskResultEnum.ERROR;
             errorMessage = e.getMessage();
             errorMessage = e.getMessage();
         } finally {
         } finally {
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
             tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
+            examPaperStructureService.updateById(examPaperStructure);
         }
         }
     }
     }
 
 
@@ -539,7 +557,9 @@ public class DataSyncServiceImpl implements DataSyncService {
 
 
     @Async
     @Async
     @Override
     @Override
-    public void syncMarker(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
+    public void syncMarkerAndClass(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
+        // 云阅卷考试ID
+        String examId = String.valueOf(examPaperStructure.getThirdRelateId());
         // 同步初始参数
         // 同步初始参数
         TaskResultEnum result = null;
         TaskResultEnum result = null;
         String errorMessage = null;
         String errorMessage = null;
@@ -548,15 +568,37 @@ public class DataSyncServiceImpl implements DataSyncService {
             // 科目代码(课程代码+卷型+课程序号)
             // 科目代码(课程代码+卷型+课程序号)
             String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
             String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
             // 同步客观题
             // 同步客观题
-            GroupInfo groupInfo = JSON.parseObject(tbSyncTask.getRemark(), GroupInfo.class);
-            List<Marker> markerList = groupInfo.getMarkerList();
-
             String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
             String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
-            for (Marker marker : markerList) {
-                // 推送用户
-                cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + marker.getLoginName(), marker.getName(), SpecialPrivilegeEnum.MARKER.getValue(), true, schoolId, orgCode);
-                // 绑定评卷员
-                cloudMarkingTaskUtils.saveMarker(schoolId, String.valueOf(examPaperStructure.getThirdRelateId()), subjectCode, groupInfo.getGroupNumber(), marker.getLoginName());
+
+            try {
+                List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
+                for (ExamPaperGroup examPaperGroup : examPaperGroups) {
+                    List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
+                    for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
+                        // 推送用户
+                        SysUser markerUser = sysUserService.getById(examPaperGroupMarker.getMarkerId());
+                        cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + markerUser.getLoginName(), markerUser.getRealName(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
+                        // 绑定评卷员
+                        cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
+                    }
+                }
+                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
+            } catch (IllegalAccessException e) {
+                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", false));
+            }
+
+            List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
+            if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
+                try {
+                    for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
+                        String className = examPaperClassMarker.getClassName();
+                        List<String> classNames = Arrays.asList(className.split(","));
+                        cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
+                    }
+                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
+                } catch (Exception e) {
+                    examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
+                }
             }
             }
             result = TaskResultEnum.SUCCESS;
             result = TaskResultEnum.SUCCESS;
         } catch (Exception e) {
         } catch (Exception e) {

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

@@ -45,7 +45,7 @@ public class ExamPaperClassMarkerServiceImpl extends ServiceImpl<ExamPaperClassM
                 list.add(examPaperClassMarker);
                 list.add(examPaperClassMarker);
             }
             }
             this.saveBatch(list);
             this.saveBatch(list);
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.CLASS.getType(), "save", true));
+            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "save", true));
             examPaperStructureService.updateById(examPaperStructure);
             examPaperStructureService.updateById(examPaperStructure);
         }
         }
     }
     }

+ 5 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperGroupServiceImpl.java

@@ -105,9 +105,9 @@ public class ExamPaperGroupServiceImpl extends ServiceImpl<ExamPaperGroupMapper,
 
 
     @Transactional
     @Transactional
     @Override
     @Override
-    public void saveExamPaperGroupMarkerByGroupNumber(Long examPaperStructureId, Integer groupNumber, List<Marker> markerList) {
+    public void saveExamPaperGroupMarkerByGroupNumber(ExamPaperStructure examPaperStructure, Integer groupNumber, List<Marker> markerList) {
         QueryWrapper<ExamPaperGroup> queryWrapper = new QueryWrapper<>();
         QueryWrapper<ExamPaperGroup> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamPaperGroup::getExamPaperStructureId, examPaperStructureId)
+        queryWrapper.lambda().eq(ExamPaperGroup::getExamPaperStructureId, examPaperStructure.getId())
                 .eq(ExamPaperGroup::getGroupNumber, groupNumber);
                 .eq(ExamPaperGroup::getGroupNumber, groupNumber);
         ExamPaperGroup examPaperGroup = this.getOne(queryWrapper);
         ExamPaperGroup examPaperGroup = this.getOne(queryWrapper);
         if (examPaperGroup == null) {
         if (examPaperGroup == null) {
@@ -117,5 +117,8 @@ public class ExamPaperGroupServiceImpl extends ServiceImpl<ExamPaperGroupMapper,
         // 删除分组下评卷员
         // 删除分组下评卷员
         examPaperGroupMarkerService.deleteExamPaperGroupMarkerService(new HashSet<>(Arrays.asList(examPaperGroup.getId())));
         examPaperGroupMarkerService.deleteExamPaperGroupMarkerService(new HashSet<>(Arrays.asList(examPaperGroup.getId())));
         examPaperGroupMarkerService.saveExamPaperGroupMarkerByGroupId(examPaperGroup.getId(), markerList);
         examPaperGroupMarkerService.saveExamPaperGroupMarkerByGroupId(examPaperGroup.getId(), markerList);
+
+        examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "save", true));
+        examPaperStructureService.updateById(examPaperStructure);
     }
     }
 }
 }

+ 23 - 24
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -15,8 +15,8 @@ import com.qmth.distributed.print.business.bean.dto.ExamPaperStructureDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperSubjectiveStructureDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperSubjectiveStructureDto;
 import com.qmth.distributed.print.business.bean.marking.*;
 import com.qmth.distributed.print.business.bean.marking.*;
+import com.qmth.distributed.print.business.bean.marking.status.ExamPaperStructureStatus;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.entity.*;
-import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamPaperStructureMapper;
 import com.qmth.distributed.print.business.mapper.ExamPaperStructureMapper;
@@ -109,12 +109,12 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
     ExamPaperClassMarkerService examPaperClassMarkerService;
     ExamPaperClassMarkerService examPaperClassMarkerService;
 
 
     @Override
     @Override
-    public IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, String[] structureStatusEnums, Boolean ready) {
+    public IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, Boolean ready) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
         Page<ExamPaperStructure> page = new Page<>(pageNumber, pageSize);
         Page<ExamPaperStructure> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamPaperStructurePageDto> examPaperStructureIPage = this.baseMapper.listByPropositionTeacherId(page, schoolId, semesterId, examId, ExamTaskSyncStatusEnum.FINISH.name(), structureStatusEnums, ready, dpr);
+        IPage<ExamPaperStructurePageDto> examPaperStructureIPage = this.baseMapper.listByPropositionTeacherId(page, schoolId, semesterId, examId, ExamTaskSyncStatusEnum.FINISH.name(), ready, dpr);
         examPaperStructureIPage.getRecords().forEach(m -> {
         examPaperStructureIPage.getRecords().forEach(m -> {
             // 试卷结构同步任务状态
             // 试卷结构同步任务状态
             if (m.getId() != null) {
             if (m.getId() != null) {
@@ -289,9 +289,6 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
             throw ExceptionResultEnum.ERROR.exception("参数有误");
             throw ExceptionResultEnum.ERROR.exception("参数有误");
         }
         }
         ExamPaperStructure examPaperStructure = this.getById(id);
         ExamPaperStructure examPaperStructure = this.getById(id);
-        if (!ExamPaperStructureStatusEnum.FINISH.equals(examPaperStructure.getStatus())) {
-            throw ExceptionResultEnum.ERROR.exception("试卷结构没有同步成功");
-        }
         ExamTask examTask = examTaskService.getByCourseCodeAndPaperNumber(examPaperStructure.getSchoolId(), examPaperStructure.getExamId(), examPaperStructure.getCourseCode(), examPaperStructure.getPaperNumber());
         ExamTask examTask = examTaskService.getByCourseCodeAndPaperNumber(examPaperStructure.getSchoolId(), examPaperStructure.getExamId(), examPaperStructure.getCourseCode(), examPaperStructure.getPaperNumber());
         String paperType = examPaperStructure.getPaperType();
         String paperType = examPaperStructure.getPaperType();
         List<Map> list = new ArrayList<>();
         List<Map> list = new ArrayList<>();
@@ -341,8 +338,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
     public long countByPropositionTeacherId(Boolean ready) {
     public long countByPropositionTeacherId(Boolean ready) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        String[] structureStatusEnums = new String[]{ExamPaperStructureStatusEnum.FINISH.name()};
-        List<ExamPaperStructure> examPaperStructureList = this.baseMapper.listByPropositionTeacherId(schoolId, null, null, sysUser.getId(), ExamTaskSyncStatusEnum.FINISH.name(), structureStatusEnums, ready, null);
+        List<ExamPaperStructure> examPaperStructureList = this.baseMapper.listByPropositionTeacherId(schoolId, null, null, sysUser.getId(), ExamTaskSyncStatusEnum.FINISH.name(), ready, null);
         return CollectionUtils.isEmpty(examPaperStructureList) ? 0 : examPaperStructureList.size();
         return CollectionUtils.isEmpty(examPaperStructureList) ? 0 : examPaperStructureList.size();
     }
     }
 
 
@@ -466,24 +462,27 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
 
 
     @Transactional
     @Transactional
     @Override
     @Override
-    public ExamPaperStructure saveMarker(Long examPaperStructureId, GroupInfo groupInfo) {
-        examPaperGroupService.saveExamPaperGroupMarkerByGroupNumber(examPaperStructureId, groupInfo.getGroupNumber(), groupInfo.getMarkerList());
+    public ExamPaperStructure saveMarkerAndClass(String data) {
+        JSONObject jsonObject = JSON.parseObject(data, JSONObject.class);
+        Long examPaperStructureId = jsonObject.getLong("paperStructureId");
         ExamPaperStructure examPaperStructure = this.getById(examPaperStructureId);
         ExamPaperStructure examPaperStructure = this.getById(examPaperStructureId);
-
         EvaluationParameters evaluationParameters = JSON.parseObject(examPaperStructure.getPaperInfoJson(), EvaluationParameters.class);
         EvaluationParameters evaluationParameters = JSON.parseObject(examPaperStructure.getPaperInfoJson(), EvaluationParameters.class);
-        List<GroupInfo> groupInfoList = evaluationParameters.getGroupInfo();
-        for (int i = 0; i < groupInfoList.size(); i++) {
-            GroupInfo info = groupInfoList.get(i);
-            if (info.getGroupNumber().equals(groupInfo.getGroupNumber())) {
-                groupInfoList.remove(i);
-                groupInfoList.add(i, groupInfo);
-            }
-        }
-        UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().set(ExamPaperStructure::getPaperInfoJson, JSON.toJSONString(evaluationParameters))
-                .set(ExamPaperStructure::getStatus, ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "save", true))
-                .eq(ExamPaperStructure::getId, examPaperStructureId);
-        this.update(updateWrapper);
+
+        List<GroupInfo> groupInfo = JSON.parseArray(jsonObject.getString("groupInfo"), GroupInfo.class);
+        evaluationParameters.setGroupInfo(groupInfo);
+
+        Boolean openClassReading = jsonObject.getBoolean("openClassReading");
+        List<ClassMarker> classInfo = openClassReading ? JSON.parseArray(jsonObject.getString("classInfo"), ClassMarker.class) : null;
+        evaluationParameters.setClassInfo(classInfo);
+
+        examPaperStructure.setOpenClassReading(openClassReading);
+        examPaperStructure.setPaperInfoJson(JSON.toJSONString(evaluationParameters));
+
+        // 保存分组和分组关系信息
+        examPaperGroupService.saveExamPaperGroupInfo(examPaperStructure, evaluationParameters.getGroupInfo());
+        // 保存分班阅信息
+        examPaperClassMarkerService.saveExamPaperClassInfo(examPaperStructure, examPaperStructure.getOpenClassReading(), evaluationParameters.getClassInfo());
+        // 返回试卷结构信息
         return examPaperStructure;
         return examPaperStructure;
     }
     }
 
 

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

@@ -303,7 +303,7 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
                 cloudUserPushService.pushCloudUser(tbSyncTask.getObjectId(), requestUser);
                 cloudUserPushService.pushCloudUser(tbSyncTask.getObjectId(), requestUser);
                 break;
                 break;
             case MARKER_PUSH:
             case MARKER_PUSH:
-                asyncCloudMarkingTaskService.syncMarker(examPaperStructureService.getById(tbSyncTask.getObjectId()), JSON.parseObject(tbSyncTask.getRemark(), GroupInfo.class));
+                asyncCloudMarkingTaskService.syncMarkerAndClass(examPaperStructureService.getById(tbSyncTask.getObjectId()));
                 break;
                 break;
             case MARK_LEADER_PUSH:
             case MARK_LEADER_PUSH:
                 asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructureService.getById(tbSyncTask.getObjectId()));
                 asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructureService.getById(tbSyncTask.getObjectId()));

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCloudMarkingTaskService.java

@@ -142,11 +142,11 @@ public class AsyncCloudMarkingTaskService {
      *
      *
      * @param examPaperStructure 试卷结构对象
      * @param examPaperStructure 试卷结构对象
      */
      */
-    public void syncMarker(ExamPaperStructure examPaperStructure, GroupInfo groupInfo) {
+    public void syncMarkerAndClass(ExamPaperStructure examPaperStructure) {
         if (examPaperStructure == null) {
         if (examPaperStructure == null) {
             throw ExceptionResultEnum.ERROR.exception("未找到同步数据");
             throw ExceptionResultEnum.ERROR.exception("未找到同步数据");
         }
         }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTask(examPaperStructure.getSchoolId(), examPaperStructure.getId(), PushTypeEnum.MARKER_PUSH, JSON.toJSONString(groupInfo));
-        dataSyncService.syncMarker(examPaperStructure, tbSyncTask);
+        TBSyncTask tbSyncTask = tbSyncTaskService.saveTask(examPaperStructure.getSchoolId(), examPaperStructure.getId(), PushTypeEnum.MARKER_PUSH, null);
+        dataSyncService.syncMarkerAndClass(examPaperStructure, tbSyncTask);
     }
     }
 }
 }

+ 14 - 2
distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql

@@ -279,7 +279,19 @@ ALTER TABLE `exam_paper_structure`
     ADD COLUMN `open_class_reading` TINYINT(1) NULL DEFAULT 0 COMMENT '是否开启分班阅' AFTER `object_answer_change`;
     ADD COLUMN `open_class_reading` TINYINT(1) NULL DEFAULT 0 COMMENT '是否开启分班阅' AFTER `object_answer_change`;
 
 
 ALTER TABLE `exam_paper_structure`
 ALTER TABLE `exam_paper_structure`
-    CHANGE COLUMN `status` `status` VARCHAR(200) NULL DEFAULT NULL COMMENT '{\n    \"structure\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"group\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"class\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"objective\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"markerLeader\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"marker\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"answerFile\":\n    {\n        \"save\": false,\n        \"sync\": false\n    }\n}' ;
+    CHANGE COLUMN `status` `status` VARCHAR(2000) NULL DEFAULT NULL COMMENT '{\n    \"structure\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"group\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"class\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"objective\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"markerLeader\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"marker\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"answerFile\":\n    {\n        \"save\": false,\n        \"sync\": false\n    }\n}' ;
 
 
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('882', '查询分班阅班级', '/api/admin/exam/structure/list_user_class', 'URL', '488', '13', 'AUTH', '1', '1', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('882', '查询分班阅班级', '/api/admin/exam/structure/list_user_class', 'URL', '488', '13', 'AUTH', '1', '1', '1');
-UPDATE `sys_privilege` SET `related` = '671,672,882' WHERE (`id` = '670');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('883', '查询评卷参数状态', '/api/admin/exam/structure/get_structure_status', 'URL', '488', '14', 'AUTH', '1', '1', '1');
+
+UPDATE `sys_privilege` SET `related` = '490,540,667,669,671,672,754,855,882,883' WHERE (`id` = '670');
+UPDATE `sys_privilege` SET `name` = '分班阅(开关)', `url` = 'OpenClassReading', `type` = 'BUTTON', `sequence` = '9', `related` = NULL, `enable` = '1', `default_auth` = '0', `front_display` = '1' WHERE (`id` = '495');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '496');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '497');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '666');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '668');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '753');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '854');
+
+ALTER TABLE `exam_paper_structure`
+    ADD COLUMN `is_finish` TINYINT(1) NULL DEFAULT 0 COMMENT '是否完成。根据status中组合状态计算。用于当查询条件' AFTER `status`;

+ 14 - 2
distributed-print-business/src/main/resources/db/upgrade/3.2.7.sql

@@ -185,7 +185,19 @@ ALTER TABLE `exam_paper_structure`
     ADD COLUMN `open_class_reading` TINYINT(1) NULL DEFAULT 0 COMMENT '是否开启分班阅' AFTER `object_answer_change`;
     ADD COLUMN `open_class_reading` TINYINT(1) NULL DEFAULT 0 COMMENT '是否开启分班阅' AFTER `object_answer_change`;
 
 
 ALTER TABLE `exam_paper_structure`
 ALTER TABLE `exam_paper_structure`
-    CHANGE COLUMN `status` `status` VARCHAR(200) NULL DEFAULT NULL COMMENT '{\n    \"structure\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"group\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"class\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"objective\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"markerLeader\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"marker\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"answerFile\":\n    {\n        \"save\": false,\n        \"sync\": false\n    }\n}' ;
+    CHANGE COLUMN `status` `status` VARCHAR(2000) NULL DEFAULT NULL COMMENT '{\n    \"structure\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"group\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"class\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"objective\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"markerLeader\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"marker\":\n    {\n        \"save\": false,\n        \"sync\": false\n    },\n    \"answerFile\":\n    {\n        \"save\": false,\n        \"sync\": false\n    }\n}' ;
 
 
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('882', '查询分班阅班级', '/api/admin/exam/structure/list_user_class', 'URL', '488', '13', 'AUTH', '1', '1', '1');
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('882', '查询分班阅班级', '/api/admin/exam/structure/list_user_class', 'URL', '488', '13', 'AUTH', '1', '1', '1');
-UPDATE `sys_privilege` SET `related` = '671,672,882' WHERE (`id` = '670');
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('883', '查询评卷参数状态', '/api/admin/exam/structure/get_structure_status', 'URL', '488', '14', 'AUTH', '1', '1', '1');
+
+UPDATE `sys_privilege` SET `related` = '490,540,667,669,671,672,754,855,882,883' WHERE (`id` = '670');
+UPDATE `sys_privilege` SET `name` = '分班阅(开关)', `url` = 'OpenClassReading', `type` = 'BUTTON', `sequence` = '9', `related` = NULL, `enable` = '1', `default_auth` = '0', `front_display` = '1' WHERE (`id` = '495');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '496');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '497');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '666');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '668');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '753');
+DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '854');
+
+ALTER TABLE `exam_paper_structure`
+    ADD COLUMN `is_finish` TINYINT(1) NULL DEFAULT 0 COMMENT '是否完成。根据status中组合状态计算。用于当查询条件' AFTER `status`;

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

@@ -66,24 +66,8 @@
             <if test="examId != null">
             <if test="examId != null">
                 and be.id = #{examId}
                 and be.id = #{examId}
             </if>
             </if>
-
-            <if test="structureStatusEnums != null and structureStatusEnums != ''">
-                <choose>
-                    <when test="ready != null and ready != '' and ready == true">
-                        AND IFNULL(eps.status, 'INIT') IN
-                        <foreach collection="structureStatusEnums" item="item" index="index" open="(" separator=
-                                "," close=")">
-                            #{item}
-                        </foreach>
-                    </when>
-                    <otherwise>
-                        AND ifnull(eps.status, 'INIT') NOT IN
-                        <foreach collection="structureStatusEnums" item="item" index="index" open="(" separator
-                                ="," close=")">
-                            #{item}
-                        </foreach>
-                    </otherwise>
-                </choose>
+            <if test="ready != null">
+                and eps.is_finish = #{ready}
             </if>
             </if>
             <if test="dpr != null">
             <if test="dpr != null">
                 <if test="dpr.requestUserId != null">
                 <if test="dpr.requestUserId != null">

+ 16 - 6
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPaperStructureController.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
+import com.qmth.distributed.print.business.bean.marking.ClassMarker;
 import com.qmth.distributed.print.business.bean.marking.EvaluationParameters;
 import com.qmth.distributed.print.business.bean.marking.EvaluationParameters;
 import com.qmth.distributed.print.business.bean.marking.GroupInfo;
 import com.qmth.distributed.print.business.bean.marking.GroupInfo;
 import com.qmth.distributed.print.business.bean.result.EditResult;
 import com.qmth.distributed.print.business.bean.result.EditResult;
@@ -59,10 +60,22 @@ public class ExamPaperStructureController {
                        @ApiParam(value = "考试ID", required = false) @RequestParam(required = false) Long examId,
                        @ApiParam(value = "考试ID", required = false) @RequestParam(required = false) Long examId,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<ExamPaperStructurePageDto> examPaperStructureIPage = examPaperStructureService.listByPropositionTeacherId(semesterId, examId, pageNumber, pageSize, null, false);
+        IPage<ExamPaperStructurePageDto> examPaperStructureIPage = examPaperStructureService.listByPropositionTeacherId(semesterId, examId, pageNumber, pageSize, null);
         return ResultUtil.ok(examPaperStructureIPage);
         return ResultUtil.ok(examPaperStructureIPage);
     }
     }
 
 
+    /**
+     * 查询最新状态
+     *
+     * @param id 评卷参数ID
+     */
+    @ApiOperation(value = "查询最新状态")
+    @RequestMapping(value = "/get_structure_status", method = RequestMethod.POST)
+    public Result getStructureStatus(@RequestParam("id") String id) {
+        ExamPaperStructure examPaperStructure = examPaperStructureService.getById(id);
+        return ResultUtil.ok(examPaperStructure == null ? null : examPaperStructure.getStatus(), null);
+    }
+
 
 
     /**
     /**
      * 上传
      * 上传
@@ -140,12 +153,9 @@ public class ExamPaperStructureController {
     @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = EditResult.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = EditResult.class)})
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
     public Result bindMarker(@RequestBody String data) {
     public Result bindMarker(@RequestBody String data) {
-        JSONObject jsonObject = JSON.parseObject(data, JSONObject.class);
-        Long examPaperStructureId = jsonObject.getLong("paperStructureId");
-        GroupInfo groupInfo = jsonObject.getObject("groupInfo", GroupInfo.class);
-        ExamPaperStructure examPaperStructure = examPaperStructureService.saveMarker(examPaperStructureId, groupInfo);
+        ExamPaperStructure examPaperStructure = examPaperStructureService.saveMarkerAndClass(data);
         // 异步同步到云阅卷
         // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncMarker(examPaperStructure, groupInfo);
+        asyncCloudMarkingTaskService.syncMarkerAndClass(examPaperStructure);
         return ResultUtil.ok(true);
         return ResultUtil.ok(true);
     }
     }
 
 

+ 1 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/WorkController.java

@@ -3,7 +3,6 @@ package com.qmth.distributed.print.api;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.result.WorkResult;
 import com.qmth.distributed.print.business.bean.result.WorkResult;
-import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
 import com.qmth.distributed.print.business.service.ExamPaperStructureService;
 import com.qmth.distributed.print.business.service.ExamPaperStructureService;
 import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.distributed.print.business.service.GradeInitializeService;
 import com.qmth.distributed.print.business.service.GradeInitializeService;
@@ -85,7 +84,7 @@ public class WorkController {
     @RequestMapping(value = "/structure/task/ready", method = RequestMethod.POST)
     @RequestMapping(value = "/structure/task/ready", method = RequestMethod.POST)
     public Result list(@RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
     public Result list(@RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(2) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
                        @RequestParam @Min(2) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(examPaperStructureService.listByPropositionTeacherId(null, null, pageNumber, pageSize, new String[]{ExamPaperStructureStatusEnum.FINISH.name()}, false));
+        return ResultUtil.ok(examPaperStructureService.listByPropositionTeacherId(null, null, pageNumber, pageSize, false));
     }
     }
 
 
     /**
     /**

+ 35 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/stmms/ClassMarkerDTO.java

@@ -0,0 +1,35 @@
+package com.qmth.teachcloud.common.bean.dto.stmms;
+
+import java.util.List;
+
+public class ClassMarkerDTO {
+    //是 考试ID
+    private Integer examId;
+    //是 账号
+    private String account;
+    List<String> className;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public List<String> getClassName() {
+        return className;
+    }
+
+    public void setClassName(List<String> className) {
+        this.className = className;
+    }
+}

+ 6 - 5
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

@@ -587,12 +587,13 @@ public class CloudMarkingTaskUtils {
         String postUrl = hostUrl.concat(userClassSaveUrl);
         String postUrl = hostUrl.concat(userClassSaveUrl);
         try {
         try {
             //参数
             //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("className", validParam(className, null, true, "班级名称"));
-            map.put("account", SpecialPrivilegeEnum.MARKER.getPrefix() + validParam(loginName, null, true, "用户名"));
+            ClassMarkerDTO classMarkerDTO = new ClassMarkerDTO();
+            classMarkerDTO.setExamId(Integer.valueOf(validParam(examId, null, true, "考试ID")));
+            classMarkerDTO.setAccount(SpecialPrivilegeEnum.MARKER.getPrefix() + validParam(loginName, null, true, "用户名"));
+            classMarkerDTO.setClassName(validParam(className, null, true, "班级名称"));
 
 
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, userClassSaveUrl), map, null, null, null);
+            String jsonData = JSONObject.toJSONString(classMarkerDTO);
+            String result = HttpKit.sendPost(postUrl, jsonData, getHeaders(schoolId, userClassSaveUrl));
             JSONObject jsonObject = JSONObject.parseObject(result);
             JSONObject jsonObject = JSONObject.parseObject(result);
             return jsonObject.containsKey("updateTime");
             return jsonObject.containsKey("updateTime");
         } catch (Exception e) {
         } catch (Exception e) {