浏览代码

3.3.0 fix

xiaofei 1 年之前
父节点
当前提交
1e4a769097
共有 45 个文件被更改,包括 380 次插入129 次删除
  1. 9 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/SingleExamStudentAddParam.java
  2. 26 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/BasicCardRule.java
  3. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java
  4. 0 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicCardRuleServiceImpl.java
  5. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java
  6. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  7. 3 1
      distributed-print-business/src/main/resources/mapper/BasicCardRuleMapper.xml
  8. 10 23
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  9. 3 0
      distributed-print/install/mysql/init/teachcloud_db.sql
  10. 4 1
      distributed-print/install/mysql/upgrade/3.3.0.sql
  11. 6 5
      distributed-print/src/main/java/com/qmth/distributed/print/api/ConditionController.java
  12. 7 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkGroupController.java
  13. 4 3
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java
  14. 8 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java
  15. 15 10
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentQuery.java
  16. 3 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/MarkerTrackDTO.java
  17. 13 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java
  18. 3 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java
  19. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanAnswerCardMapper.java
  20. 3 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanOmrTaskMapper.java
  21. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPackageMapper.java
  22. 12 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkHeaderGroupResult.java
  23. 42 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkScoreList.java
  24. 1 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkHeaderTrackService.java
  25. 0 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkQuestionService.java
  26. 2 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkService.java
  27. 3 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  28. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanConditionService.java
  29. 3 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java
  30. 2 8
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java
  31. 12 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkHeaderTrackServiceImpl.java
  32. 0 10
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java
  33. 39 10
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java
  34. 13 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  35. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkSyncServiceImpl.java
  36. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanAnswerCardServiceImpl.java
  37. 4 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanConditionServiceImpl.java
  38. 11 8
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  39. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPackageServiceImpl.java
  40. 4 7
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/TaskServiceImpl.java
  41. 57 3
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml
  42. 1 1
      teachcloud-mark/src/main/resources/mapper/ScanAnswerCardMapper.xml
  43. 44 0
      teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml
  44. 1 0
      teachcloud-mark/src/main/resources/mapper/ScanPackageMapper.xml
  45. 1 1
      teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/SingleExamStudentAddParam.java

@@ -16,6 +16,7 @@ public class SingleExamStudentAddParam extends BasePage {
     private String studentCode;
     private String studentName;
     private String college;
+    private String majorName;
     private String className;
 
     public Long getExamDetailCourseId() {
@@ -58,6 +59,14 @@ public class SingleExamStudentAddParam extends BasePage {
         this.college = college;
     }
 
+    public String getMajorName() {
+        return majorName;
+    }
+
+    public void setMajorName(String majorName) {
+        this.majorName = majorName;
+    }
+
     public String getClassName() {
         return className;
     }

+ 26 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/BasicCardRule.java

@@ -72,6 +72,16 @@ public class BasicCardRule extends BaseEntity implements Serializable {
      */
     @TableField("discipline")
     private Boolean discipline;
+    /**
+     * 启用考生承诺书:0-禁用,1-启用
+     */
+    @TableField("undertaking_enable")
+    private Boolean undertakingEnable;
+    /**
+     * 考生承诺书内容
+     */
+    @TableField(value = "undertaking_body", updateStrategy = FieldStrategy.IGNORED)
+    private String undertakingBody;
     /**
      * 必选字段
      */
@@ -202,6 +212,22 @@ public class BasicCardRule extends BaseEntity implements Serializable {
         this.discipline = discipline;
     }
 
+    public Boolean getUndertakingEnable() {
+        return undertakingEnable;
+    }
+
+    public void setUndertakingEnable(Boolean undertakingEnable) {
+        this.undertakingEnable = undertakingEnable;
+    }
+
+    public String getUndertakingBody() {
+        return undertakingBody;
+    }
+
+    public void setUndertakingBody(String undertakingBody) {
+        this.undertakingBody = undertakingBody;
+    }
+
     public String getRequiredFields() {
         return requiredFields;
     }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -29,7 +29,7 @@ public interface ConditionMapper {
 
     List<PrintPlanBrief> listPrintPlan(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseForScore(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("basicCourses") List<BasicCourse> basicCourses, @Param("dpr") DataPermissionRule dpr);
+    List<BasicCourse> listCourseForScore(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("basicCourses") List<BasicCourse> basicCourses, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
     List<BasicClazz> listClazz(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("clazzName") String clazzName, @Param("dpr") DataPermissionRule dpr);
 

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

@@ -153,7 +153,6 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
         queryWrapper.lambda().eq(BasicCardRule::getSchoolId, schoolId)
                 .eq(BasicCardRule::getName, cardRule.getName());
         BasicCardRule basicCardRule = this.getOne(queryWrapper);
-        boolean isSuccess;
         // 新增
         if (Objects.isNull(cardRule.getId())) {
             if (basicCardRule != null) {

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

@@ -10,6 +10,7 @@ import com.qmth.distributed.print.business.service.ConditionService;
 import com.qmth.distributed.print.business.service.TeachCourseService;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.entity.*;
+import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.BasicSemesterService;
 import com.qmth.teachcloud.common.service.SysOrgService;
@@ -92,7 +93,7 @@ public class ConditionServiceImpl implements ConditionService {
             if (basicCourses.isEmpty()) {
                 dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
             }
-            return conditionMapper.listCourseForScore(semesterId, examId, basicCourses, dpr);
+            return conditionMapper.listCourseForScore(semesterId, examId, basicCourses, MarkPaperStatus.FINISH.name(), dpr);
         } else {
             dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
             return conditionMapper.listCourse(semesterId, examId, enable, printPlanIds, dpr);

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

@@ -181,8 +181,8 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
                     examDetailCourse.getCoursePaperId(), singleExamStudentAddParam.getPaperType(),
                     singleExamStudentAddParam.getStudentCode(), singleExamStudentAddParam.getStudentName(),
                     examDetail.getPackageCode(), examDetail.getExamPlace(), examDetail.getExamRoom(),
-                    singleExamStudentAddParam.getCollege(), singleExamStudentAddParam.getClassName(),
-                    examDetail.getExamStartTime(), examDetail.getExamEndTime(),markPaper.getUserId());
+                    singleExamStudentAddParam.getCollege(), singleExamStudentAddParam.getMajorName(), singleExamStudentAddParam.getClassName(),
+                    examDetail.getExamStartTime(), examDetail.getExamEndTime(), markPaper.getUserId());
             if (markStudent.getSecretNumber() == null) {
                 markStudent.randomSecretNumber();
                 while (markStudentService.countByExamIdAndSecretNumber(markStudent.getExamId(), markStudent.getSecretNumber()) > 0) {

+ 3 - 1
distributed-print-business/src/main/resources/mapper/BasicCardRuleMapper.xml

@@ -13,6 +13,8 @@
         <result column="exam_absent" property="examAbsent" />
         <result column="write_sign" property="writeSign" />
         <result column="discipline" property="discipline" />
+        <result column="undertaking_enable" property="undertakingEnable" />
+        <result column="undertaking_body" property="undertakingBody" />
         <result column="required_fields" property="requiredFields" />
         <result column="extend_fields" property="extendFields" />
         <result column="title_rule" property="titleRule" />
@@ -30,7 +32,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        select id, school_id, name, exam_number_style,exam_number_digit, paper_type, exam_absent, write_sign, discipline, required_fields, extend_fields, title_rule, attention, objective_attention, subjective_attention, enable, remark, create_id, create_time, update_id, update_time, fill_number from basic_card_rule
+        select id, school_id, name, exam_number_style,exam_number_digit, paper_type, exam_absent, write_sign, discipline,undertaking_enable, undertaking_body,required_fields, extend_fields, title_rule, attention, objective_attention, subjective_attention, enable, remark, create_id, create_time, update_id, update_time, fill_number from basic_card_rule
     </sql>
     <select id="listPage" resultType="com.qmth.distributed.print.business.entity.BasicCardRule">
         <include refid="Base_Column_List"></include>

+ 10 - 23
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -211,41 +211,28 @@
     </select>
     <select id="listCourseForScore" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
         SELECT DISTINCT
-            et.course_code code, et.course_name name
+            mp.course_code code, mp.course_name name
         FROM
-            (SELECT DISTINCT
-                 school_id, semester_id, exam_id, paper_number
-             FROM
-                 t_sync_exam_student_score) tsess
-                JOIN
-            exam_task et ON tsess.school_id = et.school_id
-                AND tsess.paper_number = et.paper_number
-                JOIN
-            sys_user su ON et.user_id = su.id
-                JOIN
-            basic_exam be ON et.exam_id = be.id
-                JOIN
-            basic_course bc ON et.school_id = bc.school_id
-                AND et.course_code = bc.code
-                LEFT JOIN
-            teach_course tc ON bc.school_id = tc.school_id
-                AND bc.id = tc.basic_course_id
+            mark_paper mp
+                left join sys_user su ON mp.user_id = su.id
+                left join basic_exam be ON mp.exam_id = be.id
         <where>
+                and mp.status = #{status}
             <if test="semesterId != null">
-                AND tsess.semester_id = #{semesterId}
+                AND be.semester_id = #{semesterId}
             </if>
             <if test="examId != null">
-                AND et.exam_id = #{examId}
+                AND mp.exam_id = #{examId}
             </if>
             <if test="basicCourses.size > 0">
-                and bc.code in
+                and mp.course_code in
                 <foreach collection="basicCourses" item="item" index="index" open="(" separator="," close=")">
                     #{item.code}
                 </foreach>
             </if>
             <if test="dpr != null">
                 <if test="dpr.requestUserId != null">
-                    AND et.user_id = #{dpr.requestUserId}
+                    AND mp.user_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                     AND su.org_id IN
@@ -255,7 +242,7 @@
                 </if>
             </if>
         </where>
-        order by et.course_code
+        order by mp.course_code
     </select>
     <select id="listClazz" resultType="com.qmth.teachcloud.common.entity.BasicClazz">
         SELECT DISTINCT

+ 3 - 0
distributed-print/install/mysql/init/teachcloud_db.sql

@@ -55,6 +55,8 @@ CREATE TABLE IF NOT EXISTS `basic_card_rule` (
         `exam_absent` tinyint NOT NULL COMMENT '0-禁用,1-启用',
         `write_sign` tinyint NOT NULL COMMENT '0-禁用,1-启用',
         `discipline` tinyint(1) DEFAULT NULL COMMENT '违纪填涂(1:是,0:否)',
+        `undertaking_enable` TINYINT(1) NULL COMMENT '启用考生承诺书',
+        `undertaking_body` VARCHAR(300) NULL COMMENT '考生承诺书内容',
         `required_fields` text NOT NULL COMMENT '必选字段',
         `extend_fields` text NOT NULL COMMENT '扩展字段',
         `title_rule` varchar(200) NOT NULL COMMENT '题卡标题规则',
@@ -1531,6 +1533,7 @@ CREATE TABLE IF NOT EXISTS `mark_student` (
         `subjective_score` double DEFAULT NULL COMMENT '主观总分',
         `subjective_score_list` text COMMENT '主观得分明细',
         `college` varchar(64) DEFAULT NULL COMMENT '学院',
+        `major_name` VARCHAR(100) NULL COMMENT '专业',
         `class_name` varchar(64) DEFAULT NULL COMMENT '班级',
         `teacher` varchar(64) DEFAULT NULL COMMENT '任课老师',
         `scan_status` varchar(20) DEFAULT NULL COMMENT '扫描状态',

+ 4 - 1
distributed-print/install/mysql/upgrade/3.3.0.sql

@@ -233,4 +233,7 @@ ALTER TABLE `basic_template`
     ADD COLUMN `add_blank_page` TINYINT(1) NULL DEFAULT 1 COMMENT '是否增加空白页' AFTER `update_time`,
 ADD COLUMN `line_height_times` DOUBLE NULL DEFAULT 1 COMMENT '行间距在初始值扩大倍数(默认1)' AFTER `add_blank_page`;
 
-ALTER TABLE `basic_school` ADD COLUMN `default_school` TINYINT(1) NULL DEFAULT 0 AFTER `init_password`;
+ALTER TABLE `basic_school` ADD COLUMN `default_school` TINYINT(1) NULL DEFAULT 0 AFTER `init_password`;
+ALTER TABLE `basic_card_rule`
+    ADD COLUMN `undertaking_enable` TINYINT(1) NULL COMMENT '启用考生承诺书' AFTER `discipline`,
+ADD COLUMN `undertaking_body` VARCHAR(300) NULL COMMENT '考生承诺书内容' AFTER `undertaking_enable`;

+ 6 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/ConditionController.java

@@ -94,25 +94,26 @@ public class ConditionController {
         return ResultUtil.ok(conditionService.listCollege());
     }
 
-    @ApiOperation(value = "获取学期、考试列表")
+    @ApiOperation(value = "扫描-获取学期、考试列表")
     @RequestMapping(value = "/scan/semester/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Map.class)})
     public Result scanSemesterList(@ApiParam(value = "启用/禁用") @RequestParam(required = false, defaultValue = "true") Boolean enable) {
         return ResultUtil.ok(scanConditionService.scanSemesterList(enable));
     }
 
-    @ApiOperation(value = "获取课程、试卷编号列表")
+    @ApiOperation(value = "扫描-获取课程、试卷编号列表")
     @RequestMapping(value = "/scan/course/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Map.class)})
     public Result scanCourseList(@ApiParam(value = "考试ID", required = true) @RequestParam(value = "examId") Long examId) {
         return ResultUtil.ok(scanConditionService.scanCourseList(examId));
     }
 
-    @ApiOperation(value = "获取校区、考场")
+    @ApiOperation(value = "扫描-获取校区、考场")
     @RequestMapping(value = "/scan/campus/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Map.class)})
     public Result scanCampusList(@ApiParam(value = "考试ID", required = true) @RequestParam(value = "examId") Long examId,
-                                 @ApiParam(value = "试卷编号", required = true) @RequestParam(value = "coursePaperId") String coursePaperId) {
-        return ResultUtil.ok(scanConditionService.scanCampusList(examId, coursePaperId));
+                                 @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                 @ApiParam(value = "试卷编号") @RequestParam(value = "coursePaperId", required = false) String coursePaperId) {
+        return ResultUtil.ok(scanConditionService.scanCampusList(examId, courseCode, coursePaperId));
     }
 }

+ 7 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkGroupController.java

@@ -35,7 +35,7 @@ import java.util.List;
 @Api(tags = "评卷-分组管理")
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_MARK + "/group")
-public class MarkGroupController {
+public class MarkGroupController extends BaseController {
 
     @Resource
     private MarkGroupService markGroupService;
@@ -58,6 +58,7 @@ public class MarkGroupController {
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.ADD)
     public Result add(@RequestBody MarkGroupSingleDto markGroupSingleDto) {
+        validMarkPaperForMark(markGroupSingleDto.getExamId(), markGroupSingleDto.getPaperNumber());
         markGroupService.saveGroup(markGroupSingleDto);
         return ResultUtil.ok(true);
     }
@@ -69,6 +70,7 @@ public class MarkGroupController {
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
     public Result update(@RequestBody MarkGroupSingleDto markGroupSingleDto) {
+        validMarkPaperForMark(markGroupSingleDto.getExamId(), markGroupSingleDto.getPaperNumber());
         markGroupService.updateGroup(markGroupSingleDto);
         return ResultUtil.ok(true);
     }
@@ -82,6 +84,7 @@ public class MarkGroupController {
     public Result delete(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                          @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                          @ApiParam(value = "分组号", required = true) @RequestParam Integer groupNumber) {
+        validMarkPaperForMark(examId, paperNumber);
         markGroupService.deleteGroupByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, groupNumber);
         return ResultUtil.ok(true);
     }
@@ -93,6 +96,7 @@ public class MarkGroupController {
     @RequestMapping(value = "/update_picture_config", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     public Result updatePictureConfig(@RequestBody GroupPictureConfigParams groupPictureConfigParams) {
+        validMarkPaperForMark(groupPictureConfigParams.getExamId(), groupPictureConfigParams.getPaperNumber());
         markGroupService.updatePicListByExamIdAndPaperNumberAndGroupNumber(groupPictureConfigParams);
         return ResultUtil.ok(true);
     }
@@ -106,6 +110,7 @@ public class MarkGroupController {
     public Result delete(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                          @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
                          @ApiParam(value = "是否开启分班阅", required = true) @RequestParam Boolean openMarkClass) {
+        validMarkPaperForMark(examId, paperNumber);
         markGroupService.updateOpenMarkClassByExamIdAndPaperNumber(examId, paperNumber, openMarkClass);
         return ResultUtil.ok(true);
     }
@@ -141,7 +146,7 @@ public class MarkGroupController {
     @ApiOperation(value = "评阅题目列表")
     @RequestMapping(value = "/list/groupQuestions", method = RequestMethod.POST)
     public Result listGroupQuestions(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                               @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) {
+                                     @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) {
         List<MarkGroupQuestionsDto> markGroupQuestionsDtoList = markGroupService.listGroupQuestions(examId, paperNumber);
         return ResultUtil.ok(markGroupQuestionsDtoList);
     }

+ 4 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java

@@ -58,9 +58,10 @@ public class ScanOmrTaskController extends BaseController {
 
     @ApiOperation(value = "识别对照任务状态")
     @RequestMapping(value = "/status", method = RequestMethod.POST)
-    public Result status(@RequestParam Long examId) {
-        SysUser user = (SysUser) ServletUtil.getRequestUser();
-        return ResultUtil.ok(omrTaskService.getStatus(examId, user.getId()));
+    public Result status(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+                         @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                         @ApiParam(value = "课程试卷编号") @RequestParam(required = false) String coursePaperId) {
+        return ResultUtil.ok(omrTaskService.getStatus(examId, courseCode, coursePaperId));
     }
 
 //    @ApiOperation(value = "识别对照任务状态")

+ 8 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java

@@ -4,11 +4,13 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ScanStatus;
+import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.mark.bean.UpdateTimeVo;
 import com.qmth.teachcloud.mark.bean.student.AbsentManualUpdateVo;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
+import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.service.MarkStudentService;
 import io.swagger.annotations.Api;
@@ -44,9 +46,9 @@ public class ScanStudentController extends BaseController {
     @ApiOperation(value = "更新缺考状态")
     @PostMapping("absent/update")
     public AbsentManualUpdateVo absentManualUpdate(@ApiParam(name = "考试ID", required = true) @RequestParam Long examId,
-                                                   @ApiParam(name = "课程试卷号", required = true)@RequestParam String coursePaperId,
-                                                   @ApiParam(name = "学号", required = true)@RequestParam String studentCode,
-                                                   @ApiParam(name = "状态", required = true)@RequestParam ScanStatus status) {
+                                                   @ApiParam(name = "课程试卷号", required = true) @RequestParam String coursePaperId,
+                                                   @ApiParam(name = "学号", required = true) @RequestParam String studentCode,
+                                                   @ApiParam(name = "状态", required = true) @RequestParam ScanStatus status) {
         validMarkPaperForScan(examId, coursePaperId);
         return markStudentService.absentManualUpdate(examId, coursePaperId, studentCode, status);
     }
@@ -77,7 +79,9 @@ public class ScanStudentController extends BaseController {
     @ApiOperation(value = "未扫描-导出")
     @RequestMapping(value = "/unexist/export", method = RequestMethod.POST)
     public void exportUnexist(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+                              @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                              @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId,
                               HttpServletResponse response) {
-        markStudentService.exportUnexist(examId, response);
+        markStudentService.exportUnexist(examId, courseCode, coursePaperId, response);
     }
 }

+ 15 - 10
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentQuery.java

@@ -9,8 +9,8 @@ public class ArchiveStudentQuery extends PagerQuery {
 	private Long examId;
 	@NotNull(message = "paperNumber不能为空")
 	private String paperNumber;
-	private String college;
-	private String major;
+	private String collegeName;
+	private String majorName;
 	private String className;
 	private String studentName;
 	private String studentCode;
@@ -26,18 +26,23 @@ public class ArchiveStudentQuery extends PagerQuery {
 	public void setPaperNumber(String paperNumber) {
 		this.paperNumber = paperNumber;
 	}
-	public String getCollege() {
-		return college;
+
+	public String getCollegeName() {
+		return collegeName;
 	}
-	public void setCollege(String college) {
-		this.college = college;
+
+	public void setCollegeName(String collegeName) {
+		this.collegeName = collegeName;
 	}
-	public String getMajor() {
-		return major;
+
+	public String getMajorName() {
+		return majorName;
 	}
-	public void setMajor(String major) {
-		this.major = major;
+
+	public void setMajorName(String majorName) {
+		this.majorName = majorName;
 	}
+
 	public String getClassName() {
 		return className;
 	}

+ 3 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/MarkerTrackDTO.java

@@ -1,5 +1,7 @@
 package com.qmth.teachcloud.mark.dto.mark.manage;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.mark.entity.MarkHeaderTrack;
 import com.qmth.teachcloud.mark.entity.MarkTrack;
 
@@ -7,6 +9,7 @@ public class MarkerTrackDTO extends TrackDTO {
 
     private static final long serialVersionUID = -7010285593473357594L;
 
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long userId;
 
     public MarkerTrackDTO(MarkTrack track) {

+ 13 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java

@@ -153,6 +153,9 @@ public class MarkStudent implements Serializable {
     @ApiModelProperty(value = "学院")
     private String college;
 
+    @ApiModelProperty(value = "专业")
+    private String majorName;
+
     @ApiModelProperty(value = "班级")
     private String className;
 
@@ -195,7 +198,7 @@ public class MarkStudent implements Serializable {
     public MarkStudent(Long id, Long examId, String courseCode, String courseName,
                        String paperNumber, String coursePaperId, String paperType,
                        String studentCode, String studentName, String packageCode,
-                       String examPlace, String examRoom, String college, String className,
+                       String examPlace, String examRoom, String college, String majorName, String className,
                        Long examStartTime, Long examEndTime, Long createId) {
         this.id = id;
         this.examId = examId;
@@ -210,6 +213,7 @@ public class MarkStudent implements Serializable {
         this.examPlace = examPlace;
         this.examRoom = examRoom;
         this.college = college;
+        this.majorName = majorName;
         this.className = className;
         this.sheetCount = 0;
         this.upload = false;
@@ -467,6 +471,14 @@ public class MarkStudent implements Serializable {
         this.college = college;
     }
 
+    public String getMajorName() {
+        return majorName;
+    }
+
+    public void setMajorName(String majorName) {
+        this.majorName = majorName;
+    }
+
     public String getClassName() {
         return className;
     }

+ 3 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
+import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.mark.bean.archivescore.*;
 import com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryDomain;
 import com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryVo;
@@ -12,9 +13,7 @@ import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
-import com.qmth.teachcloud.mark.entity.ScanPaper;
 import org.apache.ibatis.annotations.Param;
-import org.omg.CORBA.MARSHAL;
 
 import java.util.List;
 
@@ -62,7 +61,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 	List<ClassVo> classData(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 	List<TeacherVo> teacher(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
-    List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId);
+    List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 	IPage<ArchiveStudentVo> studentList(@Param("page") Page<ArchiveStudentVo> page, @Param("req") ArchiveStudentQuery query);
 
@@ -72,4 +71,5 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
 	int countAssigned(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
 
+	List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanAnswerCardMapper.java

@@ -19,7 +19,7 @@ import com.qmth.teachcloud.mark.entity.ScanAnswerCard;
  */
 public interface ScanAnswerCardMapper extends BaseMapper<ScanAnswerCard> {
 
-	List<AnswerCardVo> cardList(@Param("examId")Long examId, @Param("coursePaperId") String coursePaperId, @Param("dpr") DataPermissionRule dpr);
+	List<AnswerCardVo> cardList(@Param("examId")Long examId, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 	List<AnswerCardVo> cardGet(@Param("examId")Long examId,@Param("number")Integer number);
 

+ 3 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanOmrTaskMapper.java

@@ -28,13 +28,13 @@ public interface ScanOmrTaskMapper extends BaseMapper<ScanOmrTask> {
 														@Param("coursePaperId") String coursePaperId,
 														@Param(value = "status") OmrTaskStatus status,
 														@Param(value = "userId") Long userId,
-														@Param("dpr") DataPermissionRule dpr);
+														@Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
 
 	int getStudentCountByExamAndStatusAndUserId(@Param(value = "examId") Long examId,
-			@Param(value = "userId") Long userId, @Param(value = "status") OmrTaskStatus status);
+												@Param(value = "userId") Long userId, @Param(value = "status") OmrTaskStatus status, @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
 
 	int getStudentCountByExamAndStatus(@Param(value = "examId") Long examId,
-			@Param(value = "status") OmrTaskStatus status);
+									   @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param(value = "status") OmrTaskStatus status, @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
 
     int countOmrTask(@Param("scanOmrTask") ScanOmrTask scanOmrTask, @Param("dpr") DataPermissionRule dpr);
 }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPackageMapper.java

@@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  */
 public interface ScanPackageMapper extends BaseMapper<ScanPackage> {
 
-	IPage<ScanPackageVo> page(@Param("page") Page<ScanPackageVo> page, @Param("req")ScanPackageQuery query, @Param("dpr") DataPermissionRule dpr);
+	IPage<ScanPackageVo> page(@Param("page") Page<ScanPackageVo> page, @Param("req")ScanPackageQuery query, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
     int countPackageCode(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 }

+ 12 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkHeaderGroupResult.java

@@ -26,7 +26,8 @@ public class MarkHeaderGroupResult {
     /**
      * 总分
      */
-    private double markerScore;
+    private List<MarkScoreList> markerScore;
+    private double groupScore;
 
     /**
      * 分值列表
@@ -58,14 +59,22 @@ public class MarkHeaderGroupResult {
         this.groupNumber = groupNumber;
     }
 
-    public double getMarkerScore() {
+    public List<MarkScoreList> getMarkerScore() {
         return markerScore;
     }
 
-    public void setMarkerScore(double markerScore) {
+    public void setMarkerScore(List<MarkScoreList> markerScore) {
         this.markerScore = markerScore;
     }
 
+    public double getGroupScore() {
+        return groupScore;
+    }
+
+    public void setGroupScore(double groupScore) {
+        this.groupScore = groupScore;
+    }
+
     public String getScoreList() {
         List<Object> list = new ArrayList<Object>();
         for (int i = 0; i < scoreList.length; i++) {

+ 42 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/params/MarkScoreList.java

@@ -0,0 +1,42 @@
+package com.qmth.teachcloud.mark.params;
+
+/**
+ * 各题分数(管理员直接分打)
+ */
+public class MarkScoreList {
+
+    public static final String SPLIT = ",";
+
+    private Integer mainNumber;
+
+    private Integer subNumber;
+
+    /**
+     * 总分
+     */
+    private double score;
+
+    public Integer getMainNumber() {
+        return mainNumber;
+    }
+
+    public void setMainNumber(Integer mainNumber) {
+        this.mainNumber = mainNumber;
+    }
+
+    public Integer getSubNumber() {
+        return subNumber;
+    }
+
+    public void setSubNumber(Integer subNumber) {
+        this.subNumber = subNumber;
+    }
+
+    public double getScore() {
+        return score;
+    }
+
+    public void setScore(double score) {
+        this.score = score;
+    }
+}

+ 1 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkHeaderTrackService.java

@@ -24,4 +24,5 @@ public interface MarkHeaderTrackService extends IMppService<MarkHeaderTrack> {
 
     void deleteByStudentId(Long studentId);
 
+    void deleteByExamIdAndPaperNumberAndGroupNumberAndStudentIdAndQuestionNumber(Long examId, String paperNumber, Integer groupNumber, Long studentId, String questionNumber);
 }

+ 0 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkQuestionService.java

@@ -44,8 +44,6 @@ public interface MarkQuestionService extends IService<MarkQuestion> {
 
     double sumTotalScoreByGroupNumber(Long examId, String paperNumber, Integer groupNumber);
 
-    long countQuestionByExamIdAndPaperNumberAndGroupNumberIsNull(Long examId, String paperNumber, boolean isObjective);
-
     MarkQuestion getByExamIdAndPaperNumberAndMainNumberAndSubNumberAndObjective(Long examId, String paperNumber, Integer mainNumber, Integer subNumber, boolean isObjective);
 
     List<MarkQuestion> listByExamIdAndPaperNumberAndPaperIndexAndPageIndex(Long examId, String paperNumber,

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkService.java

@@ -97,4 +97,6 @@ public interface MarkService {
     void deleteInitMarkData(Long examId, String paperNumber);
 
     void calcObjectiveScore(MarkPaper markPaper);
+
+    void updateMarkGroupStatus(Long examId, String paperNumber);
 }

+ 3 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -114,7 +114,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
     ScoreReportVo scoreReport(Long examId, String paperNumber);
 
-    void exportUnexist(Long examId, HttpServletResponse response);
+    void exportUnexist(Long examId, String courseCode, String coursePaperId, HttpServletResponse response);
 
     long countUnmarkByExamIdAndPaperNumber(Long examId, String paperNumber);
 
@@ -137,4 +137,6 @@ public interface MarkStudentService extends IService<MarkStudent> {
     int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
 
     int countAbsentByExamIdAndPaperNumber(Long examId, String paperNumber);
+
+    List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(Long examId, String courseCode, String coursePaperId, String status, DataPermissionRule dpr);
 }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanConditionService.java

@@ -16,5 +16,5 @@ public interface ScanConditionService {
 
     List<CoursePaperNumberDto> scanCourseList(Long examId);
 
-    List<CampusExamRoomDto> scanCampusList(Long examId, String coursePaperId);
+    List<CampusExamRoomDto> scanCampusList(Long examId, String courseCode, String coursePaperId);
 }

+ 3 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java

@@ -30,11 +30,11 @@ public interface ScanOmrTaskService extends IService<ScanOmrTask> {
 
 	ScanOmrTaskSaveDto submitTask(List<ScanOmrTaskResultDto> result, Long userId);
 
-	ScanOmrTaskStatusDto getStatus(Long examId, Long userId);
+	ScanOmrTaskStatusDto getStatus(Long examId, String courseCode, String coursePaperId);
 
-	int getFinishStudentCountByExamAndUserId(Long examId, Long userId);
+	int getFinishStudentCountByExamAndUserId(Long examId, String courseCode, String coursePaperId, Long userId, DataPermissionRule dpr);
 
-	int getTodoStudentCountByExam(Long examId);
+	int getTodoStudentCountByExam(Long examId, String courseCode, String coursePaperId, DataPermissionRule dpr);
 
 	void deleteByStudentId(Long examId, Long studentId);
 

+ 2 - 8
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java

@@ -342,7 +342,7 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
         }
 
         // 更新MarkPaper中groupStatus
-        updateMarkGroupStatus(examId, paperNumber);
+        markService.updateMarkGroupStatus(examId, paperNumber);
     }
 
     @Transactional
@@ -406,7 +406,7 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
         }
 
         // 更新MarkPaper中groupStatus
-        updateMarkGroupStatus(examId, paperNumber);
+        markService.updateMarkGroupStatus(examId, paperNumber);
     }
 
     @Override
@@ -461,10 +461,4 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
                 .eq(MarkGroup::getNumber, groupNumber);
         this.update(markGroupUpdateWrapper);
     }
-
-    private void updateMarkGroupStatus(Long examId, String paperNumber){
-        // 更新MarkPaper中groupStatus
-        long groupNumberIsNull = markQuestionService.countQuestionByExamIdAndPaperNumberAndGroupNumberIsNull(examId, paperNumber, false);
-        markPaperService.updateGroupStatusByExamIdAndPaperNumber(groupNumberIsNull == 0, examId, paperNumber);
-    }
 }

+ 12 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkHeaderTrackServiceImpl.java

@@ -62,4 +62,16 @@ public class MarkHeaderTrackServiceImpl extends MppServiceImpl<MarkHeaderTrackMa
         this.remove(updateWrapper);
     }
 
+    @Override
+    public void deleteByExamIdAndPaperNumberAndGroupNumberAndStudentIdAndQuestionNumber(Long examId, String paperNumber, Integer groupNumber, Long studentId, String questionNumber) {
+        UpdateWrapper<MarkHeaderTrack> updateWrapper = new UpdateWrapper<>();
+        LambdaUpdateWrapper<MarkHeaderTrack> lambdaUpdateWrapper = updateWrapper.lambda();
+        lambdaUpdateWrapper.eq(MarkHeaderTrack::getExamId, examId)
+                .eq(MarkHeaderTrack::getPaperNumber, paperNumber)
+                .eq(MarkHeaderTrack::getGroupNumber, groupNumber)
+                .eq(MarkHeaderTrack::getStudentId, studentId)
+                .eq(MarkHeaderTrack::getQuestionNumber, questionNumber);
+        this.remove(updateWrapper);
+    }
+
 }

+ 0 - 10
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -211,16 +211,6 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         return score != null ? score.doubleValue() : 0d;
     }
 
-    @Override
-    public long countQuestionByExamIdAndPaperNumberAndGroupNumberIsNull(Long examId, String paperNumber, boolean isObjective) {
-        QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
-                .eq(MarkQuestion::getPaperNumber, paperNumber)
-                .eq(MarkQuestion::getObjective, isObjective)
-                .isNull(MarkQuestion::getGroupNumber);
-        return this.count(queryWrapper);
-    }
-
     @Override
     public MarkQuestion getByExamIdAndPaperNumberAndMainNumberAndSubNumberAndObjective(Long examId, String paperNumber, Integer mainNumber, Integer subNumber, boolean isObjective) {
         QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();

+ 39 - 10
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java

@@ -25,6 +25,7 @@ import com.qmth.teachcloud.mark.enums.ScorePolicy;
 import com.qmth.teachcloud.mark.lock.LockService;
 import com.qmth.teachcloud.mark.params.MarkHeaderGroupResult;
 import com.qmth.teachcloud.mark.params.MarkResult;
+import com.qmth.teachcloud.mark.params.MarkScoreList;
 import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BigDecimalUtils;
 import com.qmth.teachcloud.mark.utils.TaskLock;
@@ -41,6 +42,7 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
 
 @Service
 public class MarkServiceImpl implements MarkService {
@@ -366,7 +368,7 @@ public class MarkServiceImpl implements MarkService {
             updateStudentGroupScore(studentId, group.getExamId(), group.getPaperNumber(), group, group.getMarkScore(),
                     group.getMarkScoreDetail());
             // 未分组的题目
-            long unGroupQuestionCount = markQuestionService.countQuestionByExamIdAndPaperNumberAndGroupNumberIsNull(
+            long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
                     group.getExamId(), group.getPaperNumber(), false);
             long groupCount = CollectionUtils
                     .size(markGroupService.listGroupByExamIdAndPaperNumber(group.getExamId(), group.getPaperNumber()));
@@ -837,17 +839,16 @@ public class MarkServiceImpl implements MarkService {
                     markGroup.getPaperNumber(), markGroup.getNumber());
             markGroupService.deleteByExamIdAndPaperNumberAndGroupNumber(markGroup.getExamId(), markGroup.getPaperNumber(),
                     markGroup.getNumber());
+            // 更新MarkPaper中groupStatus
+            updateMarkGroupStatus(markGroup.getExamId(), markGroup.getPaperNumber());
         }
 
-        // 更新MarkPaper中groupStatus
-        markPaperService.updateGroupStatusByExamIdAndPaperNumber(false, markGroup.getExamId(),
-                markGroup.getPaperNumber());
         // 未分组的题目
         long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(
                 markGroup.getExamId(), markGroup.getPaperNumber(), false);
+
         // 考生整体状态与总分更新
-        long groupCount = markGroupService.countByExamIdAndPaperNumber(markGroup.getExamId(),
-                markGroup.getPaperNumber());
+        long groupCount = markGroupService.countByExamIdAndPaperNumber(markGroup.getExamId(), markGroup.getPaperNumber());
         if (groupCount == 0 || unGroupQuestionCount > 0) {
             markStudentService.updateSubjectiveStatusAndScore(markGroup.getExamId(), markGroup.getPaperNumber(),
                     SubjectiveStatus.UNMARK, 0D, null);
@@ -899,8 +900,11 @@ public class MarkServiceImpl implements MarkService {
                 lockService.watch(LockType.GROUP, markStudent.getExamId(), markStudent.getPaperNumber(), groupResult.getGroupNumber());
                 Long currentTime = System.currentTimeMillis();
                 if (groupResult.getTrackList() != null) {
-                    markHeaderTrackService.deleteByExamIdAndPaperNumberAndGroupNumberAndStudentId(markStudent.getExamId(),
-                            markStudent.getPaperNumber(), groupResult.getGroupNumber(), groupResult.getStudentId());
+                    for (MarkScoreList scoreList : groupResult.getMarkerScore()) {
+                        String questionNumber = scoreList.getMainNumber() + "." + scoreList.getSubNumber();
+                        markHeaderTrackService.deleteByExamIdAndPaperNumberAndGroupNumberAndStudentIdAndQuestionNumber(markStudent.getExamId(),
+                                markStudent.getPaperNumber(), groupResult.getGroupNumber(), groupResult.getStudentId(), questionNumber);
+                    }
                     List<MarkHeaderTrack> tracks = groupResult.getTrackList(groupResult, markStudent, userId);
                     markHeaderTrackService.saveOrUpdateBatchByMultiId(tracks);
                 }
@@ -910,9 +914,10 @@ public class MarkServiceImpl implements MarkService {
                     List<MarkHeaderTag> tags = groupResult.getHeaderTagList(groupResult, userId);
                     markHeaderTagService.saveOrUpdateBatch(tags);
                 }
+                updateMarkSubjectScore(markStudent, groupResult);
                 markTaskService.updateHeaderResult(markStudent.getExamId(), markStudent.getPaperNumber(),
                         groupResult.getGroupNumber(), groupResult.getStudentId(), userId,
-                        groupResult.getMarkerScore(), groupResult.getScoreList(), currentTime, MarkTaskStatus.MARKED);
+                        groupResult.getGroupScore(), groupResult.getScoreList(), currentTime, MarkTaskStatus.MARKED);
                 updateMarkedCount(markStudent.getExamId(), markStudent.getPaperNumber(), groupResult.getGroupNumber());
                 markStudentService.updateCheckInfo(markStudent.getId(), userId);
                 checkStudentGroup(groupResult.getStudentId(),
@@ -925,11 +930,28 @@ public class MarkServiceImpl implements MarkService {
         }
 
         // 未分组的题目
-        long unGroupQuestionCount = markQuestionService.countQuestionByExamIdAndPaperNumberAndGroupNumberIsNull(markStudent.getExamId(), markStudent.getPaperNumber(), false);
+        long unGroupQuestionCount = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(markStudent.getExamId(), markStudent.getPaperNumber(), false);
         long groupCount = CollectionUtils.size(markGroupService.listGroupByExamIdAndPaperNumber(markStudent.getExamId(), markStudent.getPaperNumber()));
         checkStudentSubjective(markStudent.getId(), groupCount, unGroupQuestionCount);
     }
 
+    private void updateMarkSubjectScore(MarkStudent markStudent, MarkHeaderGroupResult groupResult) {
+        List<MarkSubjectiveScore> markSubjectiveScoreList = markSubjectiveScoreService.listByStudentIdAndGroupNumber(markStudent.getId(), groupResult.getGroupNumber());
+        markSubjectiveScoreList.sort(Comparator.comparing(MarkSubjectiveScore::getMainNumber).thenComparingInt(MarkSubjectiveScore::getSubNumber));
+        List<Double> scoreList = new ArrayList<>();
+        for (MarkSubjectiveScore markSubjectiveScore : markSubjectiveScoreList) {
+            List<MarkScoreList> markScoreLists = groupResult.getMarkerScore();
+            Optional<MarkScoreList> optional = markScoreLists.stream().filter(m -> m.getMainNumber().equals(markSubjectiveScore.getMainNumber()) && m.getSubNumber().equals(markSubjectiveScore.getSubNumber())).findFirst();
+            if (optional.isPresent()) {
+                markSubjectiveScore.setScore(optional.get().getScore());
+            }
+            scoreList.add(markSubjectiveScore.getScore());
+        }
+        groupResult.setGroupScore(scoreList.stream().collect(Collectors.summingDouble(x -> x)));
+        groupResult.setScoreList(scoreList.toArray(new Double[]{}));
+        markSubjectiveScoreService.saveOrUpdateBatchByMultiId(markSubjectiveScoreList);
+    }
+
     private String getKey(MarkStudent student) {
         return student.getExamId() + "_" + student.getPaperNumber();
     }
@@ -1276,4 +1298,11 @@ public class MarkServiceImpl implements MarkService {
         return history;
     }
 
+    @Override
+    public void updateMarkGroupStatus(Long examId, String paperNumber) {
+        // 更新MarkPaper中groupStatus
+        long groupNumberIsNull = markQuestionService.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(examId, paperNumber, false);
+        markPaperService.updateGroupStatusByExamIdAndPaperNumber(groupNumberIsNull == 0, examId, paperNumber);
+    }
+
 }

+ 13 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -786,8 +786,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         Page<ArchiveStudentVo> page = new Page<>(query.getPageNumber(), query.getPageSize());
         IPage<ArchiveStudentVo> ret = baseMapper.studentList(page, query);
         for (ArchiveStudentVo record : ret.getRecords()) {
-            List<String> list = new ArrayList<String>();
+            List<String> list = new ArrayList<>();
             List<FilePathVo> vos = JSON.parseArray(StringUtils.trimToNull(record.getSheetPath()), FilePathVo.class);
+            if (CollectionUtils.isEmpty(vos)) {
+                continue;
+            }
             for (FilePathVo filePathVo : vos) {
                 list.add(JSON.toJSONString(filePathVo));
             }
@@ -879,9 +882,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
 
     @Override
-    public void exportUnexist(Long examId, HttpServletResponse response) {
+    public void exportUnexist(Long examId, String courseCode, String coursePaperId, HttpServletResponse response) {
         try {
-            List<UnexistStudentDto> unexistStudentDtoList = this.baseMapper.listUnexistStudentByExamIdAndCoursePaperId(examId);
+            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+            DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
+            List<UnexistStudentDto> unexistStudentDtoList = this.baseMapper.listUnexistStudentByExamIdAndCoursePaperId(examId, courseCode, coursePaperId, MarkPaperStatus.FORMAL.name(), dpr);
             ExcelUtil.excelExport("评卷员工作量", UnexistStudentDto.class, unexistStudentDtoList, response);
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception("导出评卷员工作量失败");
@@ -1135,4 +1140,9 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 .and(o -> o.eq(MarkStudent::getAbsent, true).or().eq(MarkStudent::getOmrAbsent, true));
         return this.count(queryWrapper);
     }
+
+    @Override
+    public List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(Long examId, String courseCode, String coursePaperId, String status, DataPermissionRule dpr) {
+        return this.baseMapper.listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(examId, courseCode, coursePaperId, status, dpr);
+    }
 }

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkSyncServiceImpl.java

@@ -62,7 +62,7 @@ public class MarkSyncServiceImpl implements MarkSyncService {
         lockService.unlock(LockType.BATCH_QUALITY, lockKey);
     }
 
-    @Async
+//    @Async
     @Override
     public void deleteMarkGroup(MarkGroup markGroup, boolean deleteGroupInfo) {
         if (markGroup == null) {

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanAnswerCardServiceImpl.java

@@ -83,7 +83,7 @@ public class ScanAnswerCardServiceImpl extends ServiceImpl<ScanAnswerCardMapper,
     public List<AnswerCardVo> cardList(Long examId, String coursePaperId) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        List<AnswerCardVo> answerCardVos = baseMapper.cardList(examId, coursePaperId, dpr);
+        List<AnswerCardVo> answerCardVos = baseMapper.cardList(examId, coursePaperId, MarkPaperStatus.FORMAL.name(), dpr);
         for (AnswerCardVo answerCardVo : answerCardVos) {
             answerCardVo.setCanAdapte(scanPaperService.getCountByExamAndCardNumber(examId, answerCardVo.getNumber()) == 0);
             answerCardVo.setUri(fileStoreUtils.filePreview(answerCardVo.getUri()));

+ 4 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanConditionServiceImpl.java

@@ -96,8 +96,10 @@ public class ScanConditionServiceImpl implements ScanConditionService {
     }
 
     @Override
-    public List<CampusExamRoomDto> scanCampusList(Long examId, String coursePaperId) {
-        List<MarkStudent> markStudentList = markStudentService.listByExamIdAndCoursePaperId(examId, coursePaperId);
+    public List<CampusExamRoomDto> scanCampusList(Long examId, String courseCode, String coursePaperId) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
+        List<MarkStudent> markStudentList = markStudentService.listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(examId, courseCode, coursePaperId, MarkPaperStatus.FORMAL.name(), dpr);
         Map<String, List<MarkStudent>> map = markStudentList.stream().collect(Collectors.groupingBy(x -> x.getExamPlace()));
         List<CampusExamRoomDto> campusExamRoomDtoList = new ArrayList<>();
         for (Map.Entry<String, List<MarkStudent>> entry : map.entrySet()) {

+ 11 - 8
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -10,6 +10,7 @@ import com.qmth.boot.core.exception.ParameterException;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
+import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.QuestionType;
 import com.qmth.teachcloud.common.enums.ScanStatus;
@@ -560,21 +561,23 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
     }
 
     @Override
-    public ScanOmrTaskStatusDto getStatus(Long examId, Long userId) {
+    public ScanOmrTaskStatusDto getStatus(Long examId, String courseCode, String coursePaperId) {
+        SysUser user = (SysUser) ServletUtil.getRequestUser();
+        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(user.getSchoolId(), user.getId(), ServletUtil.getRequest().getServletPath());
         ScanOmrTaskStatusDto status = new ScanOmrTaskStatusDto();
-        status.setFinishCount(this.getFinishStudentCountByExamAndUserId(examId, userId));
-        status.setTodoCount(this.getTodoStudentCountByExam(examId));
+        status.setFinishCount(this.getFinishStudentCountByExamAndUserId(examId, courseCode, coursePaperId, user.getId(), dpr));
+        status.setTodoCount(this.getTodoStudentCountByExam(examId, courseCode, coursePaperId, dpr));
         return status;
     }
 
     @Override
-    public int getFinishStudentCountByExamAndUserId(Long examId, Long userId) {
-        return this.baseMapper.getStudentCountByExamAndStatusAndUserId(examId, userId, OmrTaskStatus.PROCESSED);
+    public int getFinishStudentCountByExamAndUserId(Long examId, String courseCode, String coursePaperId, Long userId, DataPermissionRule dpr) {
+        return this.baseMapper.getStudentCountByExamAndStatusAndUserId(examId, userId, OmrTaskStatus.PROCESSED, MarkPaperStatus.FORMAL.name(), dpr);
     }
 
     @Override
-    public int getTodoStudentCountByExam(Long examId) {
-        return this.baseMapper.getStudentCountByExamAndStatus(examId, OmrTaskStatus.WAITING);
+    public int getTodoStudentCountByExam(Long examId, String courseCode, String coursePaperId, DataPermissionRule dpr) {
+        return this.baseMapper.getStudentCountByExamAndStatus(examId, courseCode, coursePaperId, OmrTaskStatus.WAITING, MarkPaperStatus.FORMAL.name(), dpr);
     }
 
     @Transactional
@@ -612,7 +615,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
     public List<ScanStudentDto> list(Long examId, String courseCode, String coursePaperId, OmrTaskStatus status, Long userId) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, userId, ServletUtil.getRequest().getServletPath());
-        return this.baseMapper.listByExamIdAndStatusAndUserId(examId, courseCode, coursePaperId, status, userId, dpr);
+        return this.baseMapper.listByExamIdAndStatusAndUserId(examId, courseCode, coursePaperId, status, userId, MarkPaperStatus.FORMAL.name(), dpr);
     }
 
     @Override

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPackageServiceImpl.java

@@ -144,7 +144,7 @@ public class ScanPackageServiceImpl extends ServiceImpl<ScanPackageMapper, ScanP
     public IPage<ScanPackageVo> imagePage(ScanPackageQuery query) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        IPage<ScanPackageVo> iPage = this.baseMapper.page(new Page<>(query.getPageNumber(), query.getPageSize()), query, dpr);
+        IPage<ScanPackageVo> iPage = this.baseMapper.page(new Page<>(query.getPageNumber(), query.getPageSize()), query, MarkPaperStatus.FORMAL.name(), dpr);
         if (CollectionUtils.isNotEmpty(iPage.getRecords())) {
             List<ScanPackage> sps = getByExamIdAndCoursePaperId(query.getExamId(), query.getCoursePaperId());
             if (CollectionUtils.isNotEmpty(sps)) {

+ 4 - 7
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/TaskServiceImpl.java

@@ -138,19 +138,16 @@ public class TaskServiceImpl implements TaskService {
                 }
             }
             // 增加阅卷轨迹列表获取
-            List<MarkTask> markTaskList = markTaskService.listByStudentIdAndGroupNumber(markStudent.getId(),
-                    question.getGroupNumber());
+            List<MarkTask> markTaskList = markTaskService.listByStudentIdAndGroupNumber(markStudent.getId(), question.getGroupNumber());
             // 仲裁轨迹
-            List<MarkHeaderTrack> headerTracks = markHeaderTrackService
-                    .listByStudentIdAndQuestionNumber(markStudent.getId(), questionNumber);
+            List<MarkHeaderTrack> headerTracks = markHeaderTrackService.listByStudentIdAndQuestionNumber(markStudent.getId(), questionNumber);
             List<String> questionList = new ArrayList<>();
             // 不管单评还是多评显示所有评卷员给分轨迹
             for (MarkTask markTask : markTaskList) {
-                List<MarkTrack> tracks = markTrackService.listByTaskIdAndQuestionNumber(markTask.getId(),
-                        questionNumber);
+                List<MarkTrack> tracks = markTrackService.listByTaskIdAndQuestionNumber(markTask.getId(), questionNumber);
                 if (!questionList.contains(questionNumber)) {
                     questionList.add(questionNumber);
-                } else {
+                } else if (CollectionUtils.isNotEmpty(headerTracks)) {
                     continue;
                 }
                 for (MarkTrack track : tracks) {

+ 57 - 3
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -292,8 +292,11 @@
         <if test="req.studentName != null and req.studentName !=''">
             and t.student_name=#{req.studentName}
         </if>
-        <if test="req.college != null and req.college !=''">
-            and t.college=#{req.college}
+        <if test="req.collegeName != null and req.collegeName !=''">
+            and t.college=#{req.collegeName}
+        </if>
+        <if test="req.majorName != null and req.majorName !=''">
+            and t.major_name=#{req.majorName}
         </if>
         <if test="req.className != null and req.className !=''">
             and t.class_name=#{req.className}
@@ -397,10 +400,30 @@
             t.student_code studentCode,
             t.student_name studentName
         FROM
-            mark_student t
+            mark_student t left join sys_user su on t.create_id = su.id
         WHERE
             t.exam_id = #{examId}
           AND t.scan_status = 'UNEXIST'
+            <if test="courseCode != null and courseCode != ''">
+                and t.course_code = #{courseCode}
+            </if>
+            <if test="coursePaperId != null and coursePaperId != ''">
+                and t.course_paper_id = #{coursePaperId}
+            </if>
+            <if test="status != null and status != ''">
+                and exists(select 1 from mark_paper mp where t.exam_id = mp.exam_id and t.course_paper_id = mp.course_paper_id and t.paper_type = mp.paper_type and mp.status = #{status})
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND t.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND su.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
         order by t.student_code
     </select>
     <select id="teacherClass" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherClassVo">
@@ -496,5 +519,36 @@
             </if>
         </where>
     </select>
+    <select id="listScanCollegeByExamIdAndCourseCodeAndCoursePaperId"
+            resultType="com.qmth.teachcloud.mark.entity.MarkStudent">
+        SELECT
+        distinct ms.exam_place, ms.exam_room
+        FROM
+        mark_student ms
+        LEFT JOIN sys_user su ON ms.create_id = su.id
+        <where>
+            ms.exam_id = #{markStudent.examId}
+            <if test="courseCode != null">
+                AND ms.course_code = #{courseCode}
+            </if>
+            <if test="coursePaperId != null">
+                AND ms.course_paper_id = #{coursePaperId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND ms.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND su.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+            <if test="status != null">
+                AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{status})
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 1 - 1
teachcloud-mark/src/main/resources/mapper/ScanAnswerCardMapper.xml

@@ -30,7 +30,7 @@
             resultType="com.qmth.teachcloud.mark.bean.answercard.AnswerCardVo">
         select t.*,t.paper_number coursePaperNumber,f.course_code,f.course_name
         from scan_answer_card t
-        left join mark_paper f on t.exam_id=f.exam_id and t.course_paper_id=f.course_paper_id
+        left join (select * from mark_paper where status = #{status}) f on t.exam_id=f.exam_id and t.course_paper_id=f.course_paper_id
         left join sys_user su on f.user_id = su.id
         where t.exam_id=#{examId}
         <if test="coursePaperId != null and coursePaperId !=''">

+ 44 - 0
teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

@@ -48,6 +48,7 @@
 				<if test="coursePaperId != null and coursePaperId != ''">
 					and s.course_paper_id = #{coursePaperId}
 				</if>
+					and exists (select 1 from mark_paper mp where s.exam_id = mp.exam_id and s.course_paper_id = mp.course_paper_id and s.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
 					and exists(select 1
 						from scan_omr_task t
 						where s.id = t.student_id
@@ -77,6 +78,27 @@
 				and t1.status!=#{status}
 				and t1.user_id is null 
 			)
+			and exists (select 1 from mark_student ms left join sys_user su on ms.create_id = su.id
+			            where t.student_id = ms.id
+						<if test="courseCode != null and courseCode != ''">
+							and ms.course_code = #{courseCode}
+						</if>
+						<if test="coursePaperId != null and coursePaperId != ''">
+							and ms.course_paper_id = #{coursePaperId}
+						</if>
+						<if test="dpr != null">
+							<if test="dpr.requestUserId != null">
+								AND ms.create_id = #{dpr.requestUserId}
+							</if>
+							<if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+								AND su.org_id IN
+								<foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+									#{item}
+								</foreach>
+							</if>
+						</if>
+						and exists (select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.course_paper_id = mp.course_paper_id and ms.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
+			            )
 	</select>
 	
 	<select id="getStudentCountByExamAndStatus" resultType="int">
@@ -85,6 +107,28 @@
 			where 
 			t.exam_id=#{examId}
 			and t.status=#{status}
+			and exists(select 1 from mark_student ms left join sys_user su on ms.create_id = su.id where t.student_id = ms.id
+			    <if test="courseCode != null and courseCode != ''">
+					and ms.course_code = #{courseCode}
+				</if>
+				<if test="coursePaperId != null and coursePaperId != ''">
+					and ms.course_paper_id = #{coursePaperId}
+				</if>
+			    <if test="markPaperStatus != null">
+					and exists(select 1 from mark_paper mp on ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
+				</if>
+				<if test="dpr != null">
+					<if test="dpr.requestUserId != null">
+						AND ms.create_id = #{dpr.requestUserId}
+					</if>
+					<if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+						AND su.org_id IN
+						<foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+							#{item}
+						</foreach>
+					</if>
+				</if>
+			    )
 	</select>
     <select id="countOmrTask" resultType="java.lang.Integer">
 		SELECT

+ 1 - 0
teachcloud-mark/src/main/resources/mapper/ScanPackageMapper.xml

@@ -46,6 +46,7 @@
           	and exists (select 1 from mark_paper mp left join sys_user su on mp.user_id = su.id where t.exam_id = mp.exam_id
           	    and t.course_paper_id = mp.course_paper_id
           	    and t.paper_type = mp.paper_type
+          	    and mp.status = #{status}
 			<if test="dpr.requestUserId != null">
 				AND mp.user_id = #{dpr.requestUserId}
 			</if>

+ 1 - 1
teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

@@ -121,7 +121,7 @@ public class PrintFinishServiceImpl implements PrintFinishService {
                     if (markStudent != null) {
                         continue;
                     }
-                    MarkStudent student = new MarkStudent(examStudent.getId(), dto.getExamId(), dto.getCourseCode(), dto.getCourseName(), dto.getPaperNumber(), dto.getCoursePaperId(), dto.getPaperType(), examStudent.getStudentCode(), examStudent.getStudentName(), examDetail.getPackageCode(), examDetail.getExamPlace(), examDetail.getExamRoom(), examStudent.getCollegeName(), examStudent.getClazzName(), dto.getExamStartTime(), dto.getExamEndTime(), dto.getCreateId());
+                    MarkStudent student = new MarkStudent(examStudent.getId(), dto.getExamId(), dto.getCourseCode(), dto.getCourseName(), dto.getPaperNumber(), dto.getCoursePaperId(), dto.getPaperType(), examStudent.getStudentCode(), examStudent.getStudentName(), examDetail.getPackageCode(), examDetail.getExamPlace(), examDetail.getExamRoom(), examStudent.getCollegeName(), examStudent.getMajorName(), examStudent.getClazzName(), dto.getExamStartTime(), dto.getExamEndTime(), dto.getCreateId());
                     if (student.getSecretNumber() == null) {
                         student.randomSecretNumber();
                         while (secretNumberSet.contains(student.getSecretNumber())