浏览代码

3.4.0 update

xiaofei 1 年之前
父节点
当前提交
48c0cdc9f4
共有 63 个文件被更改,包括 946 次插入523 次删除
  1. 5 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/pdf/ExamStudentInfo.java
  2. 6 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamStudent.java
  3. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  4. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ClientService.java
  5. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/DownloadService.java
  6. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  7. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TeachCourseService.java
  8. 32 22
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  9. 8 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  10. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  11. 2 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java
  12. 1 17
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  13. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  14. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  15. 9 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/OpenApiServiceImpl.java
  16. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  17. 15 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TeachCourseServiceImpl.java
  18. 6 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentTeacherImportService.java
  19. 15 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCreatePdfTemplateService.java
  20. 12 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/SyncBasicExamStudentImportService.java
  21. 3 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/PdfTaskLogicService.java
  22. 17 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  23. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java
  24. 4 4
      distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml
  25. 7 6
      distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml
  26. 2 2
      distributed-print-business/src/main/resources/mapper/ExamStudentMapper.xml
  27. 7 6
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  28. 42 2
      distributed-print/install/mysql/upgrade/3.4.0.sql
  29. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicCourseController.java
  30. 2 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/DownloadController.java
  31. 0 33
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java
  32. 28 5
      distributed-print/src/main/java/com/qmth/distributed/print/api/client/PrintController.java
  33. 15 14
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkStudentController.java
  34. 1 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/mark/MarkSettingDto.java
  35. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/BasicCourseMapper.java
  36. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java
  37. 3 3
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java
  38. 2 2
      teachcloud-common/src/main/resources/mapper/BasicCourseMapper.xml
  39. 9 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentQuery.java
  40. 36 6
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentVo.java
  41. 3 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/CollegeVo.java
  42. 10 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/TeacherClassVo.java
  43. 10 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/TeacherVo.java
  44. 95 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/student/MarkStudentQuery.java
  45. 115 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/MarkStudentVo.java
  46. 28 0
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java
  47. 2 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkDocument.java
  48. 9 109
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java
  49. 44 38
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java
  50. 19 8
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  51. 2 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkArbitrateHistoryServiceImpl.java
  52. 40 41
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkDocumentServiceImpl.java
  53. 1 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java
  54. 2 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkProblemHistoryServiceImpl.java
  55. 20 20
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java
  56. 44 30
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  57. 2 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  58. 2 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/TaskServiceImpl.java
  59. 4 4
      teachcloud-mark/src/main/resources/mapper/MarkPaperMapper.xml
  60. 177 68
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml
  61. 4 2
      teachcloud-mark/src/main/resources/mapper/MarkUserGroupMapper.xml
  62. 4 2
      teachcloud-mark/src/main/resources/mapper/ScanAnswerCardMapper.xml
  63. 1 1
      teachcloud-task/src/main/java/com/qmth/teachcloud/task/service/impl/PrintFinishServiceImpl.java

+ 5 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/pdf/ExamStudentInfo.java

@@ -15,7 +15,7 @@ public class ExamStudentInfo {
     @ApiModelProperty("考务学生ID")
     private Long examStudentId;
     @ApiModelProperty("考生ID")
-    private Long studentId;
+    private Long basicStudentId;
     @ApiModelProperty("试卷类型")
     private String paperType;
     @ApiModelProperty("学号")
@@ -44,12 +44,12 @@ public class ExamStudentInfo {
         this.examStudentId = examStudentId;
     }
 
-    public Long getStudentId() {
-        return studentId;
+    public Long getBasicStudentId() {
+        return basicStudentId;
     }
 
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
+    public void setBasicStudentId(Long basicStudentId) {
+        this.basicStudentId = basicStudentId;
     }
 
     public String getPaperType() {

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

@@ -37,8 +37,8 @@ public class ExamStudent extends BaseEntity implements Serializable {
     private Long examDetailCourseId;
 
     @JsonSerialize(using = ToStringSerializer.class)
-    @TableField("student_id")
-    private Long studentId;
+    @TableField("basic_student_id")
+    private Long basicStudentId;
 
     @TableField("student_name")
     private String studentName;
@@ -135,12 +135,12 @@ public class ExamStudent extends BaseEntity implements Serializable {
         this.examDetailCourseId = examDetailCourseId;
     }
 
-    public Long getStudentId() {
-        return studentId;
+    public Long getBasicStudentId() {
+        return basicStudentId;
     }
 
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
+    public void setBasicStudentId(Long basicStudentId) {
+        this.basicStudentId = basicStudentId;
     }
 
     public String getStudentName() {

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

@@ -74,7 +74,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
 
     ExamTaskDto getByExamTaskId(Long examTaskId);
 
-    IPage<ExamTaskDetailDto> listExamTaskDetailDownload(@Param("page") Page<ExamTaskDetailDto> page, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("userParam") String userParam, @Param("dpr") DataPermissionRule dpr);
+    IPage<ExamTaskDetailDto> listExamTaskDetailDownload(@Param("page") Page<ExamTaskDetailDto> page, @Param("examId") Long examId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("userParam") String userParam, @Param("dpr") DataPermissionRule dpr);
 
     /**
      * 根据条件查询要下载的试卷文件

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

@@ -48,7 +48,7 @@ public interface ClientService {
 
     boolean updatePassword(Long userId, String password);
 
-    List<BasicSchool> listSchool(String code);
+    List<BasicSchool> listSchool();
 
     List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId);
 

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

@@ -15,7 +15,7 @@ import java.util.Set;
  * </p>
  */
 public interface DownloadService {
-    IPage<ExamTaskDetailDto> page(Long examId, String courseCode, String paperNumber, Long orgId, String userParam, Integer pageNumber, Integer pageSize);
+    IPage<ExamTaskDetailDto> page(Long examId, Long courseId, String paperNumber, Long orgId, String userParam, Integer pageNumber, Integer pageSize);
 
     void paperDownload(HttpServletResponse response, Long id) throws Exception;
 

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -165,8 +165,6 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     boolean taskBatchCancel(Map data);
 
-//    boolean resubmitTask(ExamDetail examDetail) throws IOException;
-
     /**
      * 根据考务数据Excel数据处理考务-场次表
      *

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TeachCourseService.java

@@ -10,6 +10,7 @@ import com.qmth.distributed.print.business.bean.result.TeachCourseResult;
 import com.qmth.distributed.print.business.entity.TeachCourse;
 import com.qmth.distributed.print.business.enums.CourseSettingTypeEnum;
 import com.qmth.teachcloud.common.entity.BasicCourse;
+import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysUser;
 
 import java.util.List;
@@ -91,4 +92,6 @@ public interface TeachCourseService extends IService<TeachCourse> {
     CourseResult listUserCourse(String param, Long teachingRoomId);
 
     List<BasicCourse> listByUserId(Long userId);
+
+    void batchCreateTeachCourse(Long schoolId, Long examId, List<BasicExamStudent> basicExamStudentList);
 }

+ 32 - 22
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -835,28 +835,28 @@ public class ActivitiServiceImpl implements ActivitiService {
         }
 
         // 驳回给命题任务发起人,需要清除绑定的题卡id
-        if (approvePass == FlowApprovePassEnum.REJECT && nextFlowTaskResult.getSetup() == 1) {
-            ExamTask examTask = examTaskService.findByFlowId(tfFlowLog.getFlowId());
-            ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTask.getId());
-            String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
-            if (StringUtils.isNotBlank(paperAttachmentIds)) {
-                List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
-                List<String> cardIds = new ArrayList<>();
-                for (PaperInfoVo paperInfoVo : paperInfoVoList) {
-                    cardIds.add(paperInfoVo.getCardId());
-                    paperInfoVo.setCardId(null);
-                    paperInfoVo.setCardType(null);
-                    paperInfoVo.setCardTitle(null);
-                }
-                examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(paperInfoVoList));
-                examTaskDetailService.updateById(examTaskDetail);
-
-                // 更新题卡为未使用
-                UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
-                updateWrapper.lambda().set(ExamCard::getUsed, false).in(ExamCard::getId, cardIds);
-                examCardService.update(updateWrapper);
-            }
-        }
+//        if (approvePass == FlowApprovePassEnum.REJECT && nextFlowTaskResult.getSetup() == 1) {
+//            ExamTask examTask = examTaskService.findByFlowId(tfFlowLog.getFlowId());
+//            ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTask.getId());
+//            String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
+//            if (StringUtils.isNotBlank(paperAttachmentIds)) {
+//                List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
+//                List<String> cardIds = new ArrayList<>();
+//                for (PaperInfoVo paperInfoVo : paperInfoVoList) {
+//                    cardIds.add(paperInfoVo.getCardId());
+//                    paperInfoVo.setCardId(null);
+//                    paperInfoVo.setCardType(null);
+//                    paperInfoVo.setCardTitle(null);
+//                }
+//                examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(paperInfoVoList));
+//                examTaskDetailService.updateById(examTaskDetail);
+//
+//                // 更新题卡为未使用
+//                UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
+//                updateWrapper.lambda().set(ExamCard::getUsed, false).in(ExamCard::getId, cardIds);
+//                examCardService.update(updateWrapper);
+//            }
+//        }
     }
 
     /**
@@ -1765,6 +1765,16 @@ public class ActivitiServiceImpl implements ActivitiService {
         //获取流程审批历史
         List<TFFlowLogResult> tfFlowLogResultList = tfFlowLogService.findByObjectId(tfFlowJoinList.get(0).getObjectId());
         if (Objects.nonNull(tfFlowLogResultList) && tfFlowLogResultList.size() > 0) {
+            TFFlowLogResult tfFlowLogResult0 = tfFlowLogResultList.get(0);
+            TFFlowLogResult tfFlowLogResult1 = tfFlowLogResultList.get(1);
+            // 剔除命题任务提交时自动审核记录
+            if (tfFlowLogResult0 != null && tfFlowLogResult1 != null
+                    && tfFlowLogResult0.getApproveSetup() == null && tfFlowLogResult1.getApproveSetup() == 1
+                    && tfFlowLogResult0.getApproveId().equals(tfFlowLogResult1.getApproveId())
+                    && FlowApproveOperationEnum.SUBMIT.equals(tfFlowLogResult0.getApproveOperation())
+                    && FlowApproveOperationEnum.APPROVE.equals(tfFlowLogResult1.getApproveOperation())) {
+                tfFlowLogResultList.remove(1);
+            }
             List<TFFlowViewLogResult> flowViewTaskResultList = gson.fromJson(gson.toJson(tfFlowLogResultList), new TypeToken<List<TFFlowViewLogResult>>() {
             }.getType());
             if (Objects.nonNull(currFlowTaskResult)) {

+ 8 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -68,6 +68,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Resource
     private SysOrgService sysOrgService;
     @Resource
+    private TeachCourseService teachCourseService;
+    @Resource
     private CommonCacheService commonCacheService;
     @Resource
     private MarkPaperService markPaperService;
@@ -176,16 +178,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         }
 
         // 自动创建课程管理数据
-        autoCreateTeachCourse(Arrays.asList(basicExamStudent));
+        teachCourseService.batchCreateTeachCourse(basicExamStudent.getSchoolId(), basicExamStudent.getExamId(), Arrays.asList(basicExamStudent));
         return basicExamStudent.getId();
     }
 
-    private void autoCreateTeachCourse(List<BasicExamStudent> basicExamStudentList) {
-        basicExamStudentList.stream().collect(Collectors.groupingBy(BasicExamStudent::getTeacherId, BasicExamStudent::getCourseId));
-        TeachCourseSelectParam teachCourseSelectParam = new TeachCourseSelectParam();
-        teachCourseSelectParam.setExamId(basicExamStudentL);
-    }
-
     @Transactional
     @Override
     public void buildImportObjects(Map<String, Object> map) {
@@ -377,7 +373,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                     }
                 } else {
                     if (enumResultMap.containsKey(fieldName)) {
-                        requiredFields.add(new CodeNameEnableDisabledValue(fieldName, enumResultMap.get(fieldName).getName(), enumResultMap.get(fieldName).getEnable(), enumResultMap.get(fieldName).getDisabled(), declaredField.get(basicExamStudent).toString()));
+                        requiredFields.add(new CodeNameEnableDisabledValue(fieldName, enumResultMap.get(fieldName).getName(), enumResultMap.get(fieldName).getEnable(), enumResultMap.get(fieldName).getDisabled(), declaredField.get(basicExamStudent) != null ? declaredField.get(basicExamStudent).toString() : ""));
                     }
                 }
             }
@@ -410,7 +406,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Override
     public void updateTeacherIdById(List<BasicExamStudent> basicExamStudentList) {
         for (BasicExamStudent basicExamStudent : basicExamStudentList) {
-            this.update(new UpdateWrapper<BasicExamStudent>().lambda().set(BasicExamStudent::getTeacherId, basicExamStudent.getTeacherId()).eq(BasicExamStudent::getId, basicExamStudent.getId()));
+            this.update(new UpdateWrapper<BasicExamStudent>().lambda()
+                    .set(BasicExamStudent::getTeacherId, basicExamStudent.getTeacherId())
+                    .set(BasicExamStudent::getRequiredFields, basicExamStudent.getRequiredFields())
+                    .eq(BasicExamStudent::getId, basicExamStudent.getId()));
         }
     }
 }

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

@@ -749,8 +749,8 @@ public class ClientServiceImpl implements ClientService {
     }
 
     @Override
-    public List<BasicSchool> listSchool(String code) {
-        return basicSchoolService.listSchool(code);
+    public List<BasicSchool> listSchool() {
+        return basicSchoolService.listSchool(null);
     }
 
     @Override

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

@@ -65,11 +65,11 @@ public class DownloadServiceImpl implements DownloadService {
     private BasicRoleDataPermissionService basicRoleDataPermissionService;
 
     @Override
-    public IPage<ExamTaskDetailDto> page(Long examId, String courseCode, String paperNumber, Long orgId, String userParam, Integer pageNumber, Integer pageSize) {
+    public IPage<ExamTaskDetailDto> page(Long examId, Long courseId, String paperNumber, Long orgId, String userParam, Integer pageNumber, Integer pageSize) {
         Page<ExamTaskDetailDto> page = new Page<>(pageNumber, pageSize);
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(), ServletUtil.getRequest().getServletPath());
-        return examTaskMapper.listExamTaskDetailDownload(page, examId, courseCode, paperNumber, orgId, userParam, dpr);
+        return examTaskMapper.listExamTaskDetailDownload(page, examId, courseId, paperNumber, orgId, userParam, dpr);
     }
 
     @Override
@@ -87,7 +87,6 @@ public class DownloadServiceImpl implements DownloadService {
             throw ExceptionResultEnum.ERROR.exception("没有未曝光试卷,无法下载");
         }
 
-
         // 收集处理试卷和题卡
         // 本地存储目录
         File fileTemp = null;

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

@@ -582,22 +582,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return true;
     }
 
-//    @Override
-//    public boolean resubmitTask(ExamDetail examDetail) {
-//        ExamDetail detail = this.getById(examDetail.getId());
-//        if (!detail.getStatus().name().equals(ExamDetailStatusEnum.PRINTING.name())
-//                && !detail.getStatus().name().equals(ExamDetailStatusEnum.FINISH.name())) {
-//            throw ExceptionResultEnum.ERROR.exception("印刷状态为“印刷中”、“已完成”的任务可重新提交印刷");
-//        }
-//        TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(detail.getId());
-//        // 调用生成pdf方法
-//        Map<String, Object> map = tbTaskService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, detail.getPrintPlanId(), (SysUser) ServletUtil.getRequestUser(), detail.getId());
-////        asyncCreatePdfTempleteService.createPdf(map, null);
-//        MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(map.get(SystemConstant.TB_TASK_ID)));
-//        redisUtil.sendMessage(mqDto.getTopic(), mqDto);
-//        return true;
-//    }
-
     @Transactional(rollbackFor = Exception.class)
     @Override
     public List<Long> disposeExamDataByExaminationExcel(ExamPrintPlan examPrintPlan, List<ExaminationImportDto> dataList, SysUser sysUser) {
@@ -908,7 +892,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             throw ExceptionResultEnum.ERROR.exception("考场数据已提交印刷,请先撤回后再删除");
         } else if (ExamDetailStatusEnum.PRINTING.equals(examDetail.getStatus())) {
             throw ExceptionResultEnum.ERROR.exception("考场数据已提交印刷,正在打印中,无法删除");
-        } else if (ExamDetailStatusEnum.FINISH.equals(examDetail.getStatus())) {
+        } else if (ExamDetailStatusEnum.FINISH.equals(examDetail.getStatus()) && examDetail.getNormal()) {
             throw ExceptionResultEnum.ERROR.exception("考场数据已打印完成,无法删除");
         }
         //删除exam_detail

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

@@ -126,7 +126,8 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
             examStudent.setId(SystemConstant.getDbUuid());
             examStudent.setSchoolId(sysUser.getSchoolId());
             examStudent.setExamDetailCourseId(examDetailCourseId);
-            examStudent.setStudentId(studentId);
+            examStudent.setBasicStudentId(studentId);
+            examStudent.setStudentCode(basicExamStudent.getStudentCode());
             examStudent.setExamId(examTask.getExamId());
             examStudent.setPaperNumber(examTask.getPaperNumber());
             examStudent.setCoursePaperId(String.valueOf(examTask.getId()));

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

@@ -1966,7 +1966,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     examStudent.setId(SystemConstant.getDbUuid());
                     examStudent.setSchoolId(schoolId);
                     examStudent.setExamId(examTask.getExamId());
-                    examStudent.setStudentId(basicExamStudent.getId());
+                    examStudent.setBasicStudentId(basicExamStudent.getId());
                     examStudent.setExamDetailCourseId(examDetailCourse.getId());
                     examStudent.setPaperNumber(paperNumber);
                     examStudent.setCoursePaperId(examDetailCourse.getCoursePaperId());

+ 9 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/OpenApiServiceImpl.java

@@ -13,6 +13,8 @@ import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
+import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.ScoreItem;
 import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
@@ -195,12 +197,13 @@ public class OpenApiServiceImpl implements OpenApiService {
             throw ExceptionResultEnum.ERROR.exception(
                     String.format("考试id为[%s],试卷编号为[%s],试卷类型为[%s]的考试科目未评卷结束,不能开始分析计算", examId, paperNumber, paperType));
         }
-        QueryWrapper<MarkStudent> markStudentQueryWrapper = new QueryWrapper<>();
-        markStudentQueryWrapper.lambda().eq(MarkStudent::getExamId, examId).eq(MarkStudent::getPaperNumber, paperNumber)
-                .eq(MarkStudent::getPaperType, paperType);
 
-        Page<MarkStudent> page = new Page<>(pageNumber, pageSize);
-        IPage<MarkStudent> markStudentIPage = markStudentService.page(page, markStudentQueryWrapper);
+        Page<MarkStudentVo> page = new Page<>(pageNumber, pageSize);
+        MarkStudentQuery markStudentQuery = new MarkStudentQuery();
+        markStudentQuery.setExamId(examId);
+        markStudentQuery.setPaperNumber(paperNumber);
+        markStudentQuery.setPaperType(paperType);
+        IPage<MarkStudentVo> markStudentIPage = markStudentService.pageMarkStudentVo(page, markStudentQuery);
 
         // 任课老师
         QueryWrapper<GradeBatchStudentClazz> queryWrapper = new QueryWrapper<>();
@@ -223,7 +226,7 @@ public class OpenApiServiceImpl implements OpenApiService {
             examStudentScore.setPaperNumber(gradeBatchPaper.getPaperNumber());
             examStudentScore.setPaperName(e.getCourseName());
             examStudentScore.setPaperType(paperType);
-            examStudentScore.setCollege(e.getCollege());
+            examStudentScore.setCollege(e.getCollegeName());
             examStudentScore.setMajor(SystemConstant.strNotNull(e.getMajorName()) ? e.getMajorName() : "未知专业");
             examStudentScore.setClassName(SystemConstant.strNotNull(e.getClassName()) ? e.getClassName() : "未知班级");
 

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

@@ -849,7 +849,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
      * @param schoolId
      * @param printPlanId
      * @param examId
-     * @param courseCode
+     * @param courseId
      * @param paperNumber
      * @return
      */

+ 15 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TeachCourseServiceImpl.java

@@ -17,6 +17,7 @@ import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicCourse;
+import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysOrg;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -30,10 +31,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -267,4 +265,17 @@ public class TeachCourseServiceImpl extends ServiceImpl<TeachCourseMapper, Teach
         List<BasicCourse> basicCourseList = list.stream().map(m -> basicCourseService.getById(m.getCourseId())).collect(Collectors.toList());
         return basicCourseList;
     }
+
+    @Override
+    public void batchCreateTeachCourse(Long schoolId, Long examId, List<BasicExamStudent> basicExamStudentList) {
+        Map<Long, List<BasicExamStudent>> listMap = basicExamStudentList.stream().filter(e -> Objects.nonNull(e.getTeacherId())).collect(Collectors.groupingBy(BasicExamStudent::getTeacherId));
+        for (Map.Entry<Long, List<BasicExamStudent>> entry : listMap.entrySet()) {
+            TeachCourseSelectParam teachCourseSelectParam = new TeachCourseSelectParam();
+            teachCourseSelectParam.setSchoolId(schoolId);
+            teachCourseSelectParam.setExamId(examId);
+            teachCourseSelectParam.setUserId(entry.getKey());
+            teachCourseSelectParam.setCourseIds(entry.getValue().stream().map(BasicExamStudent::getCourseId).distinct().collect(Collectors.toList()));
+            selectCreate(teachCourseSelectParam);
+        }
+    }
 }

+ 6 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentTeacherImportService.java

@@ -7,6 +7,7 @@ import com.qmth.boot.tools.excel.enums.ExcelType;
 import com.qmth.distributed.print.business.bean.dto.importFile.BasicExamStudentImport;
 import com.qmth.distributed.print.business.service.BasicExamService;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
+import com.qmth.distributed.print.business.service.TeachCourseService;
 import com.qmth.distributed.print.business.templete.importData.AsyncImportTaskTemplete;
 import com.qmth.distributed.print.business.templete.importData.SyncImportTaskTemplate;
 import com.qmth.distributed.print.business.templete.service.ImportLogicService;
@@ -59,6 +60,8 @@ public class AsyncBasicExamStudentTeacherImportService extends AsyncImportTaskTe
     @Resource
     private BasicExamStudentService basicExamStudentService;
     @Resource
+    private TeachCourseService teachCourseService;
+    @Resource
     private FileUploadService fileUploadService;
 
     @Override
@@ -110,6 +113,9 @@ public class AsyncBasicExamStudentTeacherImportService extends AsyncImportTaskTe
                 List<BasicExamStudent> basicExamStudentList = JSON.parseArray(JSON.toJSONString(result.get(SystemConstant.DATASOURCE)), BasicExamStudent.class);
                 basicExamStudentService.updateTeacherIdById(basicExamStudentList);
                 SystemConstant.addSummary(stringJoinerSummary, "更新数据库中考生任课老师完成");
+
+                // 自动创建课程管理数据
+                teachCourseService.batchCreateTeachCourse(tbTask.getSchoolId(), tbTask.getExamId(), basicExamStudentList);
                 tbTask.setResult(TaskResultEnum.SUCCESS);
             }
         } catch (Exception e) {

+ 15 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCreatePdfTemplateService.java

@@ -1,7 +1,9 @@
 package com.qmth.distributed.print.business.templete.execute;
 
 import cn.hutool.core.date.DateUtil;
+import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.TBTaskPdf;
+import com.qmth.distributed.print.business.service.ExamTaskWholeService;
 import com.qmth.distributed.print.business.service.TBTaskPdfService;
 import com.qmth.distributed.print.business.templete.callback.CallbackCreatePdf;
 import com.qmth.distributed.print.business.templete.create.AsyncCreateTaskTemplete;
@@ -12,6 +14,7 @@ import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
+import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.StringJoiner;
 
@@ -54,18 +58,27 @@ public class AsyncCreatePdfTemplateService extends AsyncCreateTaskTemplete {
         }
         tbTaskPdf.setStatus(TaskStatusEnum.RUNNING);
         tbTaskPdfService.updateById(tbTaskPdf);
+        List<ExamDetailCourse> examDetailCourseList = null;
         try {
             PdfTaskLogicService pdfTaskLogicService = SpringContextHolder.getBean(PdfTaskLogicService.class);
-            pdfTaskLogicService.executeCreatePdfLogic(tbTaskPdf, stringJoinerSummary);
+            examDetailCourseList = pdfTaskLogicService.executeCreatePdfLogic(tbTaskPdf, stringJoinerSummary);
             tbTaskPdf.setResult(TaskResultEnum.SUCCESS);
         } catch (Exception e) {
-            SystemConstant.addSummary(stringJoinerSummary, "数据处理完成且发生异常。异常信息为["+ e.getMessage()+"]");
+            SystemConstant.addSummary(stringJoinerSummary, "数据处理完成且发生异常。异常信息为[" + e.getMessage() + "]");
             tbTaskPdf.setResult(TaskResultEnum.ERROR);
         } finally {
             tbTaskPdf.setStatus(TaskStatusEnum.FINISH);
             tbTaskPdf.setSummary(stringJoinerSummary.toString());
             tbTaskPdf.setUpdateTime(System.currentTimeMillis());
             tbTaskPdfService.updateById(tbTaskPdf);
+
+            if (TaskResultEnum.SUCCESS.equals(tbTaskPdf.getResult()) && CollectionUtils.isNotEmpty(examDetailCourseList)) {
+                ExamTaskWholeService examTaskWholeService = SpringContextHolder.getBean(ExamTaskWholeService.class);
+                for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
+                    // 生成合并文件
+                    examTaskWholeService.checkAndCreateTask(tbTaskPdf.getExamId(), examDetailCourse.getCourseId(), examDetailCourse.getPaperNumber());
+                }
+            }
         }
         return ResultUtil.ok(tbTaskPdf);
     }

+ 12 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/SyncBasicExamStudentImportService.java

@@ -5,19 +5,22 @@ import com.alibaba.fastjson.JSON;
 import com.qmth.boot.tools.excel.ExcelWriter;
 import com.qmth.boot.tools.excel.enums.ExcelType;
 import com.qmth.distributed.print.business.bean.dto.importFile.BasicExamStudentImport;
-import com.qmth.distributed.print.business.templete.importData.AsyncImportTaskTemplete;
-import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.distributed.print.business.service.BasicExamService;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
-import com.qmth.distributed.print.business.templete.importData.SyncImportTaskTemplate;
+import com.qmth.distributed.print.business.service.TeachCourseService;
+import com.qmth.distributed.print.business.templete.importData.AsyncImportTaskTemplete;
 import com.qmth.distributed.print.business.templete.service.ImportLogicService;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.teachcloud.common.bean.vo.FilePathVo;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.TBTask;
-import com.qmth.teachcloud.common.enums.*;
+import com.qmth.teachcloud.common.enums.ExamModelEnum;
+import com.qmth.teachcloud.common.enums.TaskResultEnum;
+import com.qmth.teachcloud.common.enums.TaskStatusEnum;
+import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.service.FileUploadService;
 import com.qmth.teachcloud.common.service.TBTaskService;
 import com.qmth.teachcloud.common.util.Result;
@@ -56,6 +59,8 @@ public class SyncBasicExamStudentImportService extends AsyncImportTaskTemplete {
     @Resource
     private BasicExamService basicExamService;
     @Resource
+    private TeachCourseService teachCourseService;
+    @Resource
     private BasicExamStudentService basicExamStudentService;
     @Resource
     private MarkPaperService markPaperService;
@@ -125,6 +130,9 @@ public class SyncBasicExamStudentImportService extends AsyncImportTaskTemplete {
                         markPaperService.deleteByExamIdAndPaperNumber(tbTask.getExamId(), paperNumber, true);
                     }
                 }
+
+                // 自动创建课程管理数据
+                teachCourseService.batchCreateTeachCourse(tbTask.getSchoolId(), tbTask.getExamId(), basicExamStudentList);
                 tbTask.setResult(TaskResultEnum.SUCCESS);
             }
         } catch (Exception e) {

+ 3 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/PdfTaskLogicService.java

@@ -1,8 +1,10 @@
 package com.qmth.distributed.print.business.templete.service;
 
+import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.TBTaskPdf;
 
 import java.io.IOException;
+import java.util.List;
 import java.util.Map;
 import java.util.StringJoiner;
 
@@ -23,5 +25,5 @@ public interface PdfTaskLogicService {
      * @return
      */
 
-    void executeCreatePdfLogic(TBTaskPdf tbTaskPdf, StringJoiner stringJoinerSummary);
+    List<ExamDetailCourse> executeCreatePdfLogic(TBTaskPdf tbTaskPdf, StringJoiner stringJoinerSummary);
 }

+ 17 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java

@@ -18,6 +18,7 @@ import com.qmth.distributed.print.business.templete.service.ImportLogicService;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.bean.dto.mark.MarkUser;
 import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableDisabledValue;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.teachcloud.common.bean.params.UserSaveParams;
 import com.qmth.teachcloud.common.bean.result.ExcelResult;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -160,7 +161,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                 basicExamStudent.setExamStartTime(Long.valueOf(String.valueOf(timeMap.get("startTime"))));
                 basicExamStudent.setExamEndTime(Long.valueOf(String.valueOf(timeMap.get("endTime"))));
             } catch (Exception e) {
-                stringJoiner.add("考试时间格式错误");
+                stringJoiner.add("考试日期或考试时间格式错误");
             }
 
             // 校验课程
@@ -277,12 +278,12 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                         } catch (IllegalAccessException e) {
                             throw ExceptionResultEnum.ERROR.exception("表头为[" + entry.getKey() + "]的值赋值失败");
                         }
-                        basicExamStudentImport.getRequiredFieldList().add(new CodeNameEnableDisabledValue(enumResult.getCode(), enumResult.getName(), enumResult.getEnable(), enumResult.getDisabled(), entry.getValue()));
+                        basicExamStudentImport.getRequiredFieldList().add(new CodeNameEnableDisabledValue(enumResult.getCode(), enumResult.getName(), enumResult.getEnable(), enumResult.getDisabled(), StringUtils.isNotBlank(entry.getValue()) ? entry.getValue() : ""));
                     }
                     // 扩展字段
                     if (extendMap.containsKey(entry.getKey())) {
                         EnumResult enumResult = extendMap.get(entry.getKey());
-                        basicExamStudentImport.getExtendFieldList().add(new CodeNameEnableDisabledValue(enumResult.getCode(), enumResult.getName(), enumResult.getEnable(), enumResult.getDisabled(), entry.getValue()));
+                        basicExamStudentImport.getExtendFieldList().add(new CodeNameEnableDisabledValue(enumResult.getCode(), enumResult.getName(), enumResult.getEnable(), enumResult.getDisabled(), StringUtils.isNotBlank(entry.getValue()) ? entry.getValue() : ""));
                     }
                 }
                 list.add(basicExamStudentImport);
@@ -793,7 +794,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(new QueryWrapper<BasicExamStudent>().lambda()
                 .select(BasicExamStudent::getId, BasicExamStudent::getCourseId, BasicExamStudent::getStudentCode, BasicExamStudent::getPaperNumber)
                 .eq(BasicExamStudent::getSchoolId, schoolId).eq(BasicExamStudent::getExamId, examId));
-        Map<String, Long> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), BaseEntity::getId));
+        Map<String, BasicExamStudent> courseIdStudentCodeMap = basicExamStudentList.stream().collect(Collectors.toMap(k -> k.getCourseId() + SystemConstant.HYPHEN + k.getStudentCode(), e -> e));
 
         Map<String, Long> basicCourseIdMap = new HashMap<>();
         // 是否有错误提示
@@ -852,7 +853,18 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             if (basicExamStudent.getCourseId() != null) {
                 String studentKey = basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudentImport.getStudentCode();
                 if (courseIdStudentCodeMap.containsKey(studentKey)) {
-                    basicExamStudent.setId(courseIdStudentCodeMap.get(studentKey));
+                    BasicExamStudent student = courseIdStudentCodeMap.get(studentKey);
+                    basicExamStudent.setId(student.getId());
+                    // 更新requiredFields中的任课老师和任课老师工号
+                    for (CodeNameEnableValue codeNameEnableValue : student.getRequiredFieldList()) {
+                        if (codeNameEnableValue.getCode().equals(RequiredFieldsEnum.TEACHER_CODE.getCode())) {
+                            codeNameEnableValue.setValue(basicExamStudentImport.getTeacherCode());
+                        }
+                        if (codeNameEnableValue.getCode().equals(RequiredFieldsEnum.TEACHER_NAME.getCode())) {
+                            codeNameEnableValue.setValue(basicExamStudentImport.getTeacherName());
+                        }
+                    }
+                    basicExamStudent.setRequiredFields(JSON.toJSONString(student.getRequiredFieldList()));
                 } else {
                     stringJoiner.add(String.format("课程代码[%s],开课学院[%s],学号[%s]考生管理中不存在", basicExamStudentImport.getCourseCode(), basicExamStudentImport.getTeachingRoomName(), basicExamStudentImport.getStudentCode()));
                 }

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

@@ -81,7 +81,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
     private FileUploadService fileUploadService;
 
     @Override
-    public void executeCreatePdfLogic(TBTaskPdf tbTaskPdf, StringJoiner stringJoinerSummary) {
+    public List<ExamDetailCourse> executeCreatePdfLogic(TBTaskPdf tbTaskPdf, StringJoiner stringJoinerSummary) {
         CreatePdfDto createPdfDto = new CreatePdfDto();
         try {
             long startTime = System.currentTimeMillis();
@@ -118,6 +118,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
                 }
             }
         }
+        return createPdfDto.getExamDetailCourseList();
     }
 
     @Transactional

+ 4 - 4
distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml

@@ -71,11 +71,13 @@
     </select>
     <select id="listCoursesByPrintPlanId" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
         SELECT
-            distinct a.course_code code, a.course_name name
+            distinct bc.code, bc.name
         FROM
             exam_detail_course a
                 LEFT JOIN
             exam_detail b ON a.exam_detail_id = b.id
+                LEFT JOIN
+            basic_course bc ON a.course_code = bc.code
         <where>
             <if test="printPlanIdList != null and printPlanIdList != '' and printPlanIdList.size() > 0">
                 and b.print_plan_id IN
@@ -84,11 +86,9 @@
                 </foreach>
             </if>
             <if test="param != null and param != ''">
-                and (a.course_code like concat('%', #{param},'%')
-                or a.course_name like concat('%', #{param},'%'))
+                and (bc.code like concat('%', #{param},'%') or bc.name like concat('%', #{param},'%'))
             </if>
         </where>
-
     </select>
     <select id="listByPrintPlanIdAndCourseCodeAndPaperNumber" resultMap="BaseResultMap">
         SELECT

+ 7 - 6
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -350,7 +350,7 @@
                 join
             exam_student stu ON a.exam_detail_course_id = stu.exam_detail_course_id
                 join
-            basic_exam_student bes ON stu.student_id = bes.id
+            basic_exam_student bes ON stu.basic_student_id = bes.id
         <where>
 
             <if test="studentParams != null and studentParams != ''">
@@ -385,7 +385,7 @@
         FROM
             exam_student stu
                 LEFT JOIN
-            basic_exam_student bes ON stu.student_id = bes.id
+            basic_exam_student bes ON stu.basic_student_id = bes.id
                 INNER JOIN
             exam_detail_course cou ON stu.exam_detail_course_id = cou.id
                 LEFT JOIN
@@ -403,10 +403,10 @@
                 AND det.id = #{examDetailId}
             </if>
             <if test="param != null and param != ''">
-                AND (stu.student_name like concat('%', #{param}) or stu.student_code like concat('%', #{param}))
+                AND (bes.student_name like concat('%', #{param}) or bes.student_code like concat('%', #{param}))
             </if>
         </where>
-        order by stu.student_code
+        order by bes.student_code
     </select>
     <select id="taskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto">
         SELECT
@@ -647,7 +647,7 @@
             ed.*,
             bs.name as semesterName,
             be.name as examName,
-            GROUP_CONCAT(CONCAT(edc.course_name, '(', edc.course_code, ')')) as courseNameCode,
+            GROUP_CONCAT(CONCAT(bc.name, '(', bc.code, ')')) as courseNameCode,
             GROUP_CONCAT(edc.paper_number) paperNumber
         from
             exam_detail ed
@@ -659,6 +659,7 @@
                 bs.id = be.semester_id
                 join exam_detail_course edc on
                 edc.exam_detail_id = ed.id
+                join basic_course bc on edc.course_id = bc.id
         <where>
             <if test="ids != null and ids != '' and ids.size > 0">
                 AND ed.id IN
@@ -794,7 +795,7 @@
                               ed.exam_id = mp.exam_id
                             AND edc.paper_number = mp.paper_number
                             AND mp.status = #{markStatus})
-        GROUP BY ed.school_id , be.semester_id, ed.exam_id , edc.course_code , edc.course_name , edc.paper_number , et.id , edc.paper_type , et.user_id, ed.exam_start_time, ed.exam_end_time
+        GROUP BY ed.school_id , be.semester_id, ed.exam_id , edc.course_id , edc.paper_number , et.id , edc.paper_type , et.user_id, ed.exam_start_time, ed.exam_end_time
     </select>
     <select id="countMakeupUsedByExamIdAndPaperNumber" resultType="java.lang.Integer">
         SELECT

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

@@ -224,7 +224,7 @@
         SELECT
             es.id examStudentId,
             es.paper_type paperType,
-            es.student_id studentId,
+            es.basic_student_id basicStudentId,
             bes.student_code studentCode,
             bes.student_name studentName,
             bc.code courseCode,
@@ -234,7 +234,7 @@
         FROM
             exam_student es
                 LEFT JOIN
-            basic_exam_student bes ON es.student_id = bes.id
+            basic_exam_student bes ON es.basic_student_id = bes.id
                 LEFT JOIN
             basic_course bc ON bes.course_id = bc.id
         WHERE

+ 7 - 6
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -178,6 +178,7 @@
         SELECT
             a.id,
             a.school_id schoolId,
+            a.course_id courseId,
             bc.code courseCode,
             bc.name courseName,
             a.specialty,
@@ -998,8 +999,8 @@
             a.id,
             be.name examName,
             bs.name semesterName,
-            a.course_code courseCode,
-            a.course_name courseName,
+            bc.code courseCode,
+            bc.name courseName,
             a.paper_number paperNumber,
             b.enable,
             b.paper_type paperType,
@@ -1014,7 +1015,7 @@
                 LEFT JOIN
             exam_task_detail b ON a.id = b.exam_task_id
                 LEFT JOIN
-            basic_course bc ON a.school_id = bc.school_id and a.course_code = bc.code
+            basic_course bc ON a.course_id = bc.id
                 LEFT JOIN
             sys_org so ON bc.teaching_room_id = so.id
                 LEFT JOIN
@@ -1034,8 +1035,8 @@
             <if test="examId != null and examId != ''">
                 and a.exam_id = #{examId}
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                and a.course_code = #{courseCode}
+            <if test="courseId != null">
+                and a.course_id = #{courseId}
             </if>
             <if test="paperNumber != null and paperNumber != ''">
                 and a.paper_number = #{paperNumber}
@@ -1051,7 +1052,7 @@
                     AND a.user_id = #{dpr.requestUserId}
                 </if>
                 <if test="dpr.courseUserId != null">
-                    AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = a.course_code)
+                    AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = a.course_id)
                 </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                     AND su.org_id IN

+ 42 - 2
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -1,8 +1,8 @@
 USE teachcloud_db;
 
-ALTER TABLE `exam_student` ADD COLUMN `student_id` BIGINT(20) NULL COMMENT '考生ID(basic_exam_student表ID)' AFTER `exam_detail_course_id`;
+ALTER TABLE `exam_student` ADD COLUMN `basic_student_id` BIGINT(20) NULL COMMENT '考生ID(basic_exam_student表ID)' AFTER `exam_detail_course_id`;
 ALTER TABLE `mark_student`
-    ADD COLUMN `student_id` BIGINT(20) NULL COMMENT '考生ID(basic_exam_student表ID)' AFTER `exam_id`,
+    ADD COLUMN `basic_student_id` BIGINT(20) NULL COMMENT '考生ID(basic_exam_student表ID)' AFTER `exam_id`,
 ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID(basic_course表ID)' AFTER `student_id`;
 ALTER TABLE `basic_exam_student` ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID(basic_course表ID)' AFTER `exam_id`;
 ALTER TABLE `exam_card` ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID(basic_course表ID)' AFTER `org_id`;
@@ -65,12 +65,32 @@ ALTER TABLE `exam_detail_course`
     CHANGE COLUMN `course_code` `course_code` VARCHAR(20) CHARACTER SET 'utf8mb4' NULL COMMENT '课程编码' ,
     CHANGE COLUMN `course_name` `course_name` VARCHAR(50) CHARACTER SET 'utf8mb4' NULL COMMENT '课程名称' ;
 
+ALTER TABLE `mark_student`
+    CHANGE COLUMN `course_code` `course_code` VARCHAR(32) CHARACTER SET 'utf8mb4' NULL COMMENT '科目代码' ,
+    CHANGE COLUMN `course_name` `course_name` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '科目名称',
+    CHANGE COLUMN `paper_number` `paper_number` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '试卷类型' ,
+    CHANGE COLUMN `student_code` `student_code` VARCHAR(64) CHARACTER SET 'utf8mb4' NULL COMMENT '学号' ,
+    CHANGE COLUMN `student_name` `student_name` VARCHAR(64) CHARACTER SET 'utf8mb4' NULL COMMENT '姓名' ;
+
+
 ALTER TABLE `sys_org` DROP COLUMN `third_relate_id`;
 
 ALTER TABLE `exam_student`
     CHANGE COLUMN `student_name` `student_name` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '考生姓名' ,
     CHANGE COLUMN `student_code` `student_code` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '考生代码' ;
 
+ALTER TABLE `mark_paper`
+    CHANGE COLUMN `course_code` `course_code` VARCHAR(32) CHARACTER SET 'utf8mb4' NULL COMMENT '课程代码' ,
+    CHANGE COLUMN `course_name` `course_name` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '科目名称' ;
+
+ALTER TABLE `mark_task`
+    CHANGE COLUMN `course_code` `course_code` VARCHAR(32) CHARACTER SET 'utf8mb4' NULL COMMENT '课程代码' ,
+    CHANGE COLUMN `course_name` `course_name` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '课程名称' ;
+
+ALTER TABLE `mark_document`
+    CHANGE COLUMN `course_code` `course_code` VARCHAR(32) CHARACTER SET 'utf8mb4' NULL COMMENT '课程代码' ,
+    CHANGE COLUMN `course_name` `course_name` VARCHAR(100) CHARACTER SET 'utf8mb4' NULL COMMENT '科目名称' ;
+
 
 update exam_task a set a.course_id = (select bc.id from basic_course bc where a.school_id = bc.school_id and a.course_code = bc.code) where a.course_id is null;
 update exam_card a set a.course_id = (select bc.id from basic_course bc where a.school_id = bc.school_id and a.course_code = bc.code) where a.course_id is null;
@@ -135,6 +155,26 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 
 
 ALTER TABLE `mark_student` ADD COLUMN `miss_scan` TINYINT(1) NULL DEFAULT 0 COMMENT '是否漏扫' AFTER `invalid`;
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1148', '更新漏扫状态', '/api/scan/student/missScan/update', 'URL', '970', '39', 'AUTH', '1', '1', '1');
+UPDATE `sys_privilege` SET `related` = '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148' WHERE (`id` = '1006');
+UPDATE `sys_privilege` SET `related` = '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148' WHERE (`id` = '970');
+
+UPDATE `basic_school` SET has_paper_number = '0' where has_paper_number is null;
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`) VALUES ('242', '查询条件-课程', '/api/admin/client/course/list', 'URL', '199', '18', 'AUTH');
+UPDATE `sys_privilege` SET `related` = '200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,241,242,973,974,975' WHERE (`id` = '199');
+
+ALTER TABLE `teachcloud-3.4.0`.`mark_student`
+DROP COLUMN `teacher`,
+DROP COLUMN `teacher_id`,
+DROP COLUMN `class_name`,
+DROP COLUMN `major_name`,
+DROP COLUMN `college`,
+DROP COLUMN `student1_name`,
+DROP COLUMN `course_name`,
+DROP COLUMN `course_code`,
+DROP INDEX `index3` ,
+ADD INDEX `index3` USING BTREE (`exam_id`, `course_id`, `upload_time`);
+
 
 -- drop table if exists exam_detail_course_paper_type;
 -- drop table if exists basic_template_org;

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

@@ -64,11 +64,11 @@ public class BasicCourseController {
     @ApiOperation(value = "课程管理-查询")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
-    public Result findBasicCourseList(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程名称(模糊查询)") @RequestParam(required = false) String courseName,
+    public Result findBasicCourseList(@ApiParam(value = "所属机构id") @RequestParam(required = false) String belongOrgId, @ApiParam(value = "课程代码/名称(模糊查询)") @RequestParam(required = false) String courseCodeOrName,
                                       @ApiParam(value = "创建时间(起始位置)") @RequestParam(required = false) String startCreateTime, @ApiParam(value = "创建时间(终止位置)") @RequestParam(required = false) String endCreateTime,
                                       @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                       @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(basicCourseService.basicCoursePage(SystemConstant.convertIdToLong(belongOrgId), courseName,
+        return ResultUtil.ok(basicCourseService.basicCoursePage(SystemConstant.convertIdToLong(belongOrgId), courseCodeOrName,
                 SystemConstant.convertIdToLong(startCreateTime), SystemConstant.convertIdToLong(endCreateTime),
                 pageNumber, pageSize));
     }

+ 2 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/DownloadController.java

@@ -48,7 +48,7 @@ public class DownloadController {
     public Object page(@ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId,
                        @ApiParam(value = "考试ID") @RequestParam(required = false) Long examId,
                        @ApiParam(value = "课程开课机构ID") @RequestParam(required = false) Long orgId,
-                       @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                       @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                        @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
                        @ApiParam(value = "命题老师工号/姓名") @RequestParam(required = false) String userParam,
                        @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
@@ -59,13 +59,11 @@ public class DownloadController {
         if (examId == null) {
             throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
-        return ResultUtil.ok(downloadService.page(examId, courseCode, paperNumber, orgId, userParam, pageNumber, pageSize));
+        return ResultUtil.ok(downloadService.page(examId, courseId, paperNumber, orgId, userParam, pageNumber, pageSize));
     }
 
     /**
      * 单个科目下载(只下载未曝光试卷)
-     *
-     * @param id 任务ID
      */
     @ApiOperation(value = "单课程下载")
     @RequestMapping(value = "/download_one", method = RequestMethod.POST)

+ 0 - 33
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java

@@ -92,16 +92,6 @@ public class ExamPrintTaskController {
 
     /**
      * 印刷任务管理-汇总数据查询
-     *
-     * @param printPlanId
-     * @param status
-     * @param courseCode
-     * @param paperNumber
-     * @param examPlace
-     * @param examRoom
-     * @param examStartTime
-     * @param examEndTime
-     * @return
      */
     @ApiOperation(value = "印刷任务管理-汇总数据查询")
     @RequestMapping(value = "/task_total_data", method = RequestMethod.POST)
@@ -124,9 +114,6 @@ public class ExamPrintTaskController {
 
     /**
      * 提交印刷
-     *
-     * @param examDetail
-     * @return
      */
     @ApiOperation(value = "印刷任务管理-提交印刷")
     @RequestMapping(value = "/task_submit", method = RequestMethod.POST)
@@ -165,25 +152,8 @@ public class ExamPrintTaskController {
     }
 
 
-//    /**
-//     * 重新提交
-//     *
-//     * @param examDetail
-//     * @return
-//     */
-//    @ApiOperation(value = "印刷任务管理-重新提交")
-//    @RequestMapping(value = "/task_resubmit", method = RequestMethod.POST)
-//    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
-//    public Result taskResubmit(@RequestBody ExamDetail examDetail) throws IOException {
-//        boolean isSuccess = examDetailService.resubmitTask(examDetail);
-//        return ResultUtil.ok(isSuccess);
-//    }
-
     /**
      * 印刷任务管理-查看印品
-     *
-     * @param map
-     * @return
      */
     @ApiOperation(value = "印刷任务管理-查看印品")
     @RequestMapping(value = "/template_view", method = RequestMethod.POST)
@@ -194,9 +164,6 @@ public class ExamPrintTaskController {
 
     /**
      * 印刷任务管理-预览PDF
-     *
-     * @param map
-     * @return
      */
     @ApiOperation(value = "印刷任务管理-预览")
     @RequestMapping(value = "/task_view_pdf", method = RequestMethod.POST)

+ 28 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/client/PrintController.java

@@ -8,7 +8,9 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.dto.client.PrintSingleDto;
 import com.qmth.distributed.print.business.service.ClientService;
+import com.qmth.distributed.print.business.service.PrintCommonService;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.util.Result;
 import com.qmth.teachcloud.common.util.ResultUtil;
@@ -21,8 +23,10 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -37,6 +41,21 @@ public class PrintController {
     @Resource
     ClientService clientService;
 
+    @Resource
+    private PrintCommonService printCommonService;
+
+    @ApiOperation(value = "课程查询")
+    @RequestMapping(value = "/course/list", method = RequestMethod.POST)
+    public Result query(@RequestParam(value = "param", required = false) String param, @RequestParam(value = "printPlanId", required = false) List<String> printPlanId,
+                        @RequestParam(value = "teachingRoomId", required = false) Long teachingRoomId) {
+        if (Objects.isNull(printPlanId)) {
+            printPlanId = new ArrayList<>();
+        }
+        List<Long> printPlanIdList = printPlanId.stream().map(SystemConstant::convertIdToLong).collect(Collectors.toList());
+        List<BasicCourse> userDtos = printCommonService.list(param, printPlanIdList, teachingRoomId);
+        return ResultUtil.ok(userDtos);
+    }
+
     @ApiOperation(value = "试卷打样-列表")
     @PostMapping("/paper_try/list")
     public Result paperTryList(@ApiParam(value = "机器唯一码", required = true) @RequestParam("machineCode") String machineCode,
@@ -274,12 +293,16 @@ public class PrintController {
     @RequestMapping(value = "/school/list", method = RequestMethod.POST)
     @Aac(strict = false, auth = false)
     public Result list(@ApiParam(value = "学校Code") @RequestParam(required = false) String code) {
-        List<BasicSchool> list = clientService.listSchool(code);
+        List<BasicSchool> list = clientService.listSchool();
+        List<BasicSchool> finalList = new ArrayList<>();
         // 指定code后,只返回code对应学校,否则查默认学校,没有默认,返回所有
-        if (CollectionUtils.isNotEmpty(list) && StringUtils.isBlank(code)) {
-            List<BasicSchool> defaultSchools = list.stream().filter(m -> m.getDefaultSchool() != null && m.getDefaultSchool()).collect(Collectors.toList());
-            if (CollectionUtils.isNotEmpty(defaultSchools)) {
-                return ResultUtil.ok(defaultSchools);
+        if (CollectionUtils.isNotEmpty(list)) {
+            finalList = list.stream().filter(m -> m.getDefaultSchool() != null && m.getDefaultSchool()).collect(Collectors.toList());
+            if(CollectionUtils.isEmpty(finalList) && StringUtils.isNotBlank(code)){
+                finalList = list.stream().filter(m -> m.getCode().equals(code)).collect(Collectors.toList());
+            }
+            if (CollectionUtils.isNotEmpty(finalList)) {
+                return ResultUtil.ok(finalList);
             }
         }
         return ResultUtil.ok(list);

+ 15 - 14
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkStudentController.java

@@ -43,21 +43,22 @@ public class MarkStudentController {
     @ApiOperation(value = "详情列表")
     @RequestMapping(value = "/score", method = RequestMethod.POST)
     public Result listStudentScore(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber,
-            @ApiParam(value = "学院") @RequestParam(required = false) String college, @ApiParam(value = "专业") @RequestParam(required = false) String majorName,
-            @ApiParam(value = "班级") @RequestParam(required = false) String className, @ApiParam(value = "任课老师") @RequestParam(required = false) String teacher,
-            @ApiParam(value = "0:无 1:客观题0分 2:客观题0分,主观题有分 3:主观题0分,客观题有分") @RequestParam(required = false) Integer filter,
-            @ApiParam(value = "状态") @RequestParam(required = false) String status, @ApiParam(value = "是否违纪") @RequestParam(required = false) Boolean breach,
-            @ApiParam(value = "总分开始") @RequestParam(required = false) Double startScore, @ApiParam(value = "总分结束") @RequestParam(required = false) Double endScore,
-            @ApiParam(value = "主观题总分开始") @RequestParam(required = false) Double subjectiveStartScore,
-            @ApiParam(value = "主观题总分结束") @RequestParam(required = false) Double subjectiveEndScore,
-            @ApiParam(value = "客观题总分开始") @RequestParam(required = false) Double objectiveStartScore,
-            @ApiParam(value = "客观题总分结束") @RequestParam(required = false) Double objectiveEndScore, @ApiParam(value = "小题得分") @RequestParam(required = false) Double subScore,
-            @ApiParam(value = "客观题分小于x%") @RequestParam(required = false) Integer objectiveScoreRateLt, @ApiParam(value = "姓名") @RequestParam(required = false) String studentName,
-            @ApiParam(value = "学号") @RequestParam(required = false) String studentCode, @ApiParam(value = "排序方式") @RequestParam(required = false) String orderType,
-            @ApiParam(value = "排序字段") @RequestParam(required = false) String orderField, @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-            @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+                                   @ApiParam(value = "学院") @RequestParam(required = false) String college, @ApiParam(value = "专业") @RequestParam(required = false) String majorName,
+                                   @ApiParam(value = "班级") @RequestParam(required = false) String teachClassName,
+                                   @ApiParam(value = "班级") @RequestParam(required = false) String className, @ApiParam(value = "任课老师") @RequestParam(required = false) String teacher,
+                                   @ApiParam(value = "0:无 1:客观题0分 2:客观题0分,主观题有分 3:主观题0分,客观题有分") @RequestParam(required = false) Integer filter,
+                                   @ApiParam(value = "状态") @RequestParam(required = false) String status, @ApiParam(value = "是否违纪") @RequestParam(required = false) Boolean breach,
+                                   @ApiParam(value = "总分开始") @RequestParam(required = false) Double startScore, @ApiParam(value = "总分结束") @RequestParam(required = false) Double endScore,
+                                   @ApiParam(value = "主观题总分开始") @RequestParam(required = false) Double subjectiveStartScore,
+                                   @ApiParam(value = "主观题总分结束") @RequestParam(required = false) Double subjectiveEndScore,
+                                   @ApiParam(value = "客观题总分开始") @RequestParam(required = false) Double objectiveStartScore,
+                                   @ApiParam(value = "客观题总分结束") @RequestParam(required = false) Double objectiveEndScore, @ApiParam(value = "小题得分") @RequestParam(required = false) Double subScore,
+                                   @ApiParam(value = "客观题分小于x%") @RequestParam(required = false) Integer objectiveScoreRateLt, @ApiParam(value = "姓名") @RequestParam(required = false) String studentName,
+                                   @ApiParam(value = "学号") @RequestParam(required = false) String studentCode, @ApiParam(value = "排序方式") @RequestParam(required = false) String orderType,
+                                   @ApiParam(value = "排序字段") @RequestParam(required = false) String orderField, @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                                   @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
         IPage<StudentScoreDetailDto> scoreListDtoIPage = markStudentService.pageStudentScore(examId, paperNumber,
-                college, majorName, className, teacher, filter, status, breach, startScore, endScore,
+                college, majorName,teachClassName, className, teacher, filter, status, breach, startScore, endScore,
                 subjectiveStartScore, subjectiveEndScore, objectiveStartScore, objectiveEndScore, subScore,
                 objectiveScoreRateLt, studentName, studentCode, orderType, orderField, pageNumber, pageSize);
         return ResultUtil.ok(scoreListDtoIPage);

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/mark/MarkSettingDto.java

@@ -11,6 +11,7 @@ public class MarkSettingDto {
 
     @JsonSerialize(using = ToStringSerializer.class)
     private Long examId;
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long courseId;
     private String courseCode;
     private String courseName;

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/BasicCourseMapper.java

@@ -42,7 +42,7 @@ public interface BasicCourseMapper extends BaseMapper<BasicCourse> {
      * @return 结果
      */
     IPage<BasicCourseResult> findBasicCoursePage(@Param("iPage") Page<BasicCourseResult> iPage, @Param("belongOrgId") Long belongOrgId,
-            @Param("courseName") String courseName, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime,
+            @Param("courseCodeOrName") String courseCodeOrName, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime,
             @Param("schoolId") Long schoolId, @Param("dpr") DataPermissionRule dpr);
 
     @SuppressWarnings("MybatisXMapperMethodInspection")

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java

@@ -41,14 +41,14 @@ public interface BasicCourseService extends IService<BasicCourse> {
      * 查询课程信息-分页查询
      *
      * @param belongOrgId     所属机构id
-     * @param courseName      课程名称(模糊查询)
+     * @param courseCodeOrName      课程名称(模糊查询)
      * @param startCreateTime 课程创建时间(起始)
      * @param endCreateTime   课程创建时间(终止)
      * @param pageNumber      分页页码
      * @param pageSize        分页容量
      * @return 查询结果
      */
-    IPage<BasicCourseResult> basicCoursePage(Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime, int pageNumber, int pageSize);
+    IPage<BasicCourseResult> basicCoursePage(Long belongOrgId, String courseCodeOrName, Long startCreateTime, Long endCreateTime, int pageNumber, int pageSize);
 
     /**
      * 新增/编辑 课程基础信息

+ 3 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java

@@ -97,16 +97,16 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
     }
 
     @Override
-    public IPage<BasicCourseResult> basicCoursePage(Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime, int pageNumber, int pageSize) {
+    public IPage<BasicCourseResult> basicCoursePage(Long belongOrgId, String courseCodeOrName, Long startCreateTime, Long endCreateTime, int pageNumber, int pageSize) {
         Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
 
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(),
                 ServletUtil.getRequest().getServletPath());
 
-        courseName = SystemConstant.translateSpecificSign(courseName);
+        courseCodeOrName = SystemConstant.translateSpecificSign(courseCodeOrName);
         IPage<BasicCourseResult> iPage = basicCourseMapper.findBasicCoursePage(new Page<>(pageNumber, pageSize),
-                belongOrgId, courseName, startCreateTime, endCreateTime, schoolId, dpr);
+                belongOrgId, courseCodeOrName, startCreateTime, endCreateTime, schoolId, dpr);
         List<BasicCourseResult> list = iPage.getRecords();
         for (BasicCourseResult basicCourseResult : list) {
             Long courseId = basicCourseResult.getId();

+ 2 - 2
teachcloud-common/src/main/resources/mapper/BasicCourseMapper.xml

@@ -67,8 +67,8 @@
             <if test="belongOrgId != null and belongOrgId != ''">
                 AND bc.teaching_room_id = #{belongOrgId}
             </if>
-            <if test="courseName != null and courseName != ''">
-                AND bc.name LIKE CONCAT('%',#{courseName},'%')
+            <if test="courseCodeOrName != null and courseCodeOrName != ''">
+                AND (bc.code LIKE CONCAT('%',#{courseCodeOrName},'%') or bc.name LIKE CONCAT('%',#{courseCodeOrName},'%'))
             </if>
             <if test="startCreateTime != null and startCreateTime != ''">
                 AND bc.create_time >= #{startCreateTime}

+ 9 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentQuery.java

@@ -11,6 +11,7 @@ public class ArchiveStudentQuery extends PagerQuery {
     private String paperNumber;
     private String college;
     private String majorName;
+    private String teachClassName;
     private String className;
     private String studentName;
     private String studentCode;
@@ -67,6 +68,14 @@ public class ArchiveStudentQuery extends PagerQuery {
         this.majorName = majorName;
     }
 
+    public String getTeachClassName() {
+        return teachClassName;
+    }
+
+    public void setTeachClassName(String teachClassName) {
+        this.teachClassName = teachClassName;
+    }
+
     public String getClassName() {
         return className;
     }

+ 36 - 6
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveStudentVo.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.mark.bean.archivescore;
 import java.util.LinkedList;
 import java.util.List;
 
+import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 import org.apache.commons.lang3.StringUtils;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -22,9 +23,10 @@ public class ArchiveStudentVo {
     @ExcelProperty(name = "学号", width = 20, index = 2)
     private String studentCode;
     @ExcelProperty(name = "学院", width = 20, index = 3)
-    private String college;
+    private String collegeName;
     private String majorName;
-    @ExcelProperty(name = "班级", width = 20, index = 4)
+    private String teachClassName;
+    @ExcelProperty(name = "行政班", width = 20, index = 4)
     private String className;
     @ExcelProperty(name = "课程代码", width = 20, index = 5)
     private String courseCode;
@@ -36,6 +38,9 @@ public class ArchiveStudentVo {
     private Double subjectiveScore;
     @ExcelProperty(name = "成绩", width = 20, index = 9)
     private Double totalScore;
+    private BasicExamStudentStatusEnum status;
+    @ExcelProperty(name = "状态", width = 20, index = 10)
+    private String statusDisplay;
 
     private String subjectiveScoreList;
 
@@ -79,12 +84,12 @@ public class ArchiveStudentVo {
         this.studentName = studentName;
     }
 
-    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 getMajorName() {
@@ -95,6 +100,14 @@ public class ArchiveStudentVo {
         this.majorName = majorName;
     }
 
+    public String getTeachClassName() {
+        return teachClassName;
+    }
+
+    public void setTeachClassName(String teachClassName) {
+        this.teachClassName = teachClassName;
+    }
+
     public String getClassName() {
         return className;
     }
@@ -183,6 +196,22 @@ public class ArchiveStudentVo {
         this.objectiveScoreList = objectiveScoreList;
     }
 
+    public BasicExamStudentStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(BasicExamStudentStatusEnum status) {
+        this.status = status;
+    }
+
+    public String getStatusDisplay() {
+        return this.status != null ? this.status.getName() : "";
+    }
+
+    public void setStatusDisplay(String statusDisplay) {
+        this.statusDisplay = statusDisplay;
+    }
+
     public List<ScoreItem> getScoreList(boolean objective) {
         List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
         try {
@@ -198,6 +227,7 @@ public class ArchiveStudentVo {
         }
         return scoreList;
     }
+
     public List<ScoreItem> getScoreList(boolean objective, List<MarkQuestion> questionList) {
         List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
         try {

+ 3 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/CollegeVo.java

@@ -11,12 +11,15 @@ public class CollegeVo {
 	private String passRate;
 	private Integer excellentCount;
 	private String excellentRate;
+
 	public String getCollege() {
 		return college;
 	}
+
 	public void setCollege(String college) {
 		this.college = college;
 	}
+
 	public Double getAvgScore() {
 		return avgScore;
 	}

+ 10 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/TeacherClassVo.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.mark.bean.archivescore;
 public class TeacherClassVo {
 	private Integer studentCount;
 	private Integer absentCount;
+	private Long teacherId;
 	private String teacher;
 	private String className;
 	private Double avgScore;
@@ -12,8 +13,15 @@ public class TeacherClassVo {
 	private String passRate;
 	private Integer excellentCount;
 	private String excellentRate;
-	
-	
+
+	public Long getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(Long teacherId) {
+		this.teacherId = teacherId;
+	}
+
 	public String getTeacher() {
 		return teacher;
 	}

+ 10 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/TeacherVo.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.mark.bean.archivescore;
 public class TeacherVo {
 	private Integer studentCount;
 	private Integer absentCount;
+	private Long teacherId;
 	private String teacher;
 	private Double avgScore;
 	private Double maxScore;
@@ -11,8 +12,15 @@ public class TeacherVo {
 	private String passRate;
 	private Integer excellentCount;
 	private String excellentRate;
-	
-	
+
+	public Long getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(Long teacherId) {
+		this.teacherId = teacherId;
+	}
+
 	public String getTeacher() {
 		return teacher;
 	}

+ 95 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/student/MarkStudentQuery.java

@@ -0,0 +1,95 @@
+package com.qmth.teachcloud.mark.bean.student;
+
+public class MarkStudentQuery {
+
+	private Long id;
+    private Long examId;
+    private String coursePaperId;
+	private String paperNumber;
+	private String paperType;
+    private String studentCode;
+    private Boolean upload;
+    private Boolean absent;
+    private Boolean breach;
+    private Boolean omrAbsent;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public String getCoursePaperId() {
+		return coursePaperId;
+	}
+
+	public void setCoursePaperId(String coursePaperId) {
+		this.coursePaperId = coursePaperId;
+	}
+
+	public String getPaperNumber() {
+		return paperNumber;
+	}
+
+	public void setPaperNumber(String paperNumber) {
+		this.paperNumber = paperNumber;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public String getStudentCode() {
+		return studentCode;
+	}
+
+	public void setStudentCode(String studentCode) {
+		this.studentCode = studentCode;
+	}
+
+	public Boolean getUpload() {
+		return upload;
+	}
+
+	public void setUpload(Boolean upload) {
+		this.upload = upload;
+	}
+
+	public Boolean getAbsent() {
+		return absent;
+	}
+
+	public void setAbsent(Boolean absent) {
+		this.absent = absent;
+	}
+
+	public Boolean getBreach() {
+		return breach;
+	}
+
+	public void setBreach(Boolean breach) {
+		this.breach = breach;
+	}
+
+	public Boolean getOmrAbsent() {
+		return omrAbsent;
+	}
+
+	public void setOmrAbsent(Boolean omrAbsent) {
+		this.omrAbsent = omrAbsent;
+	}
+}

+ 115 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/MarkStudentVo.java

@@ -0,0 +1,115 @@
+package com.qmth.teachcloud.mark.dto.mark;
+
+import com.qmth.teachcloud.mark.entity.MarkStudent;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 考试考生库
+ * </p>
+ *
+ * @author xf
+ * @since 2023-09-22
+ */
+public class MarkStudentVo extends MarkStudent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "科目代码")
+    private String courseCode;
+
+    @ApiModelProperty(value = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(value = "姓名")
+    private String studentName;
+
+    @ApiModelProperty(value = "学院")
+    private String collegeName;
+
+    @ApiModelProperty(value = "专业")
+    private String majorName;
+    @ApiModelProperty(value = "教学班")
+    private String teachClassName;
+    @ApiModelProperty(value = "行政班")
+    private String className;
+
+    @ApiModelProperty(value = "任课老师")
+    private String teacher;
+
+    @ApiModelProperty(value = "任课老师ID")
+    private Long teacherId;
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getCollegeName() {
+        return collegeName;
+    }
+
+    public void setCollegeName(String collegeName) {
+        this.collegeName = collegeName;
+    }
+
+    public String getMajorName() {
+        return majorName;
+    }
+
+    public void setMajorName(String majorName) {
+        this.majorName = majorName;
+    }
+
+    public String getTeachClassName() {
+        return teachClassName;
+    }
+
+    public void setTeachClassName(String teachClassName) {
+        this.teachClassName = teachClassName;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+
+    public String getTeacher() {
+        return teacher;
+    }
+
+    public void setTeacher(String teacher) {
+        this.teacher = teacher;
+    }
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+}

+ 28 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java

@@ -2,6 +2,7 @@ package com.qmth.teachcloud.mark.dto.mark.score;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 import com.qmth.teachcloud.common.enums.ScanStatus;
 import com.qmth.teachcloud.common.enums.mark.SubjectiveStatus;
 
@@ -21,6 +22,7 @@ public class StudentScoreDetailDto {
     private String secretNumber;
     private String college;
     private String majorName;
+    private String teachClassName;
     private String className;
     private String objectiveScore;
     private String subjectiveScore;
@@ -45,6 +47,8 @@ public class StudentScoreDetailDto {
     private Boolean subjectiveCheckFlag;
     // 客观题标记
     private Boolean objectiveCheckFlag;
+    private BasicExamStudentStatusEnum studentStatus;
+    private String studentStatusDisplay;
 
     public Long getStudentId() {
         return studentId;
@@ -126,6 +130,14 @@ public class StudentScoreDetailDto {
         this.majorName = majorName;
     }
 
+    public String getTeachClassName() {
+        return teachClassName;
+    }
+
+    public void setTeachClassName(String teachClassName) {
+        this.teachClassName = teachClassName;
+    }
+
     public String getClassName() {
         return className;
     }
@@ -301,4 +313,20 @@ public class StudentScoreDetailDto {
     public void setObjectiveCheckFlag(Boolean objectiveCheckFlag) {
         this.objectiveCheckFlag = objectiveCheckFlag;
     }
+
+    public BasicExamStudentStatusEnum getStudentStatus() {
+        return studentStatus;
+    }
+
+    public void setStudentStatus(BasicExamStudentStatusEnum studentStatus) {
+        this.studentStatus = studentStatus;
+    }
+
+    public String getStudentStatusDisplay() {
+        return this.studentStatus != null ? this.studentStatus.getName() : "";
+    }
+
+    public void setStudentStatusDisplay(String studentStatusDisplay) {
+        this.studentStatusDisplay = studentStatusDisplay;
+    }
 }

+ 2 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkDocument.java

@@ -57,11 +57,10 @@ public class MarkDocument implements Serializable {
     public MarkDocument() {
     }
 
-    public MarkDocument(Long examId, String courseCode, String courseName, String paperNumber, DocumentType type, String name, Integer fileCount) {
+    public MarkDocument(Long examId, Long courseId, String paperNumber, DocumentType type, String name, Integer fileCount) {
         this.id = SystemConstant.getDbUuid();
         this.examId = examId;
-        this.courseCode = courseCode;
-        this.courseName = courseName;
+        this.courseId = courseId;
         this.paperNumber = paperNumber;
         this.type = type;
         this.name = name;

+ 9 - 109
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java

@@ -58,18 +58,12 @@ public class MarkStudent implements Serializable {
 
     @JsonSerialize(using = ToStringSerializer.class)
     @ApiModelProperty(value = "考生ID")
-    private Long studentId;
+    private Long basicStudentId;
 
     @JsonSerialize(using = ToStringSerializer.class)
     @ApiModelProperty(value = "课程ID")
     private Long courseId;
 
-    @ApiModelProperty(value = "科目代码")
-    private String courseCode;
-
-    @ApiModelProperty(value = "科目名称")
-    private String courseName;
-
     @ApiModelProperty(value = "试卷编号(交互)")
     private String coursePaperId;
 
@@ -85,9 +79,6 @@ public class MarkStudent implements Serializable {
     @ApiModelProperty(value = "学号")
     private String studentCode;
 
-    @ApiModelProperty(value = "姓名")
-    private String studentName;
-
     @ApiModelProperty(value = "试卷袋编号")
     private String packageCode;
 
@@ -162,21 +153,6 @@ public class MarkStudent implements Serializable {
     @TableField(value = "subjective_score_list", updateStrategy = FieldStrategy.IGNORED)
     private String subjectiveScoreList;
 
-    @ApiModelProperty(value = "学院")
-    private String college;
-
-    @ApiModelProperty(value = "专业")
-    private String majorName;
-
-    @ApiModelProperty(value = "班级")
-    private String className;
-
-    @ApiModelProperty(value = "任课老师")
-    private String teacher;
-
-    @ApiModelProperty(value = "任课老师ID")
-    private Long teacherId;
-
     @ApiModelProperty(value = "扫描状态")
     private ScanStatus scanStatus;
     //识别缺考
@@ -216,27 +192,21 @@ public class MarkStudent implements Serializable {
     public MarkStudent() {
     }
 
-    public MarkStudent(Long id, Long examId, Long courseId,
+    public MarkStudent(Long id, Long examId, Long basicStudentId, Long courseId,
                        String paperNumber, String coursePaperId, String paperType,
-                       String studentCode, String studentName, String packageCode,
-                       String examPlace, String examRoom, String college, String majorName, String className,
-                       Long teacherId, String teacher, Long examStartTime, Long examEndTime, Long createId) {
+                       String studentCode, String packageCode, String examPlace,
+                       String examRoom,  Long examStartTime, Long examEndTime, Long createId) {
         this.id = id;
         this.examId = examId;
+        this.basicStudentId = basicStudentId;
         this.courseId = courseId;
         this.paperNumber = paperNumber;
         this.coursePaperId = coursePaperId;
         this.paperType = paperType;
         this.studentCode = studentCode;
-        this.studentName = studentName;
         this.packageCode = packageCode;
         this.examPlace = examPlace;
         this.examRoom = examRoom;
-        this.college = college;
-        this.majorName = majorName;
-        this.className = className;
-        this.teacherId = teacherId;
-        this.teacher = teacher;
         this.sheetCount = 0;
         this.upload = false;
         this.absent = false;
@@ -270,12 +240,12 @@ public class MarkStudent implements Serializable {
         this.examId = examId;
     }
 
-    public Long getStudentId() {
-        return studentId;
+    public Long getBasicStudentId() {
+        return basicStudentId;
     }
 
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
+    public void setBasicStudentId(Long basicStudentId) {
+        this.basicStudentId = basicStudentId;
     }
 
     public Long getCourseId() {
@@ -286,22 +256,6 @@ public class MarkStudent implements Serializable {
         this.courseId = courseId;
     }
 
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
     public String getPaperNumber() {
         return paperNumber;
     }
@@ -334,14 +288,6 @@ public class MarkStudent implements Serializable {
         this.studentCode = studentCode;
     }
 
-    public String getStudentName() {
-        return studentName;
-    }
-
-    public void setStudentName(String studentName) {
-        this.studentName = studentName;
-    }
-
     public String getPackageCode() {
         return packageCode;
     }
@@ -502,46 +448,6 @@ public class MarkStudent implements Serializable {
         this.subjectiveScoreList = subjectiveScoreList;
     }
 
-    public String getCollege() {
-        return college;
-    }
-
-    public void setCollege(String college) {
-        this.college = college;
-    }
-
-    public String getMajorName() {
-        return majorName;
-    }
-
-    public void setMajorName(String majorName) {
-        this.majorName = majorName;
-    }
-
-    public String getClassName() {
-        return className;
-    }
-
-    public void setClassName(String className) {
-        this.className = className;
-    }
-
-    public String getTeacher() {
-        return teacher;
-    }
-
-    public void setTeacher(String teacher) {
-        this.teacher = teacher;
-    }
-
-    public Long getTeacherId() {
-        return teacherId;
-    }
-
-    public void setTeacherId(Long teacherId) {
-        this.teacherId = teacherId;
-    }
-
     public ScanStatus getScanStatus() {
         return scanStatus;
     }
@@ -789,12 +695,9 @@ public class MarkStudent implements Serializable {
         return "MarkStudent{" +
                 "id=" + id +
                 ", examId=" + examId +
-                ", courseCode=" + courseCode +
-                ", courseName=" + courseName +
                 ", paperNumber=" + paperNumber +
                 ", secretNumber=" + secretNumber +
                 ", studentCode=" + studentCode +
-                ", studentName=" + studentName +
                 ", packageCode=" + packageCode +
                 ", examPlace=" + examPlace +
                 ", examRoom=" + examRoom +
@@ -814,9 +717,6 @@ public class MarkStudent implements Serializable {
                 ", subjectiveStatus=" + subjectiveStatus +
                 ", subjectiveScore=" + subjectiveScore +
                 ", subjectiveScoreList=" + subjectiveScoreList +
-                ", college=" + college +
-                ", className=" + className +
-                ", teacher=" + teacher +
                 ", scanStatus=" + scanStatus +
                 ", questionFilled=" + questionFilled +
                 ", assigned=" + assigned +

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

@@ -1,23 +1,23 @@
 package com.qmth.teachcloud.mark.mapper;
 
-import java.util.List;
-
-import com.qmth.teachcloud.common.entity.BasicTeachClazz;
-import io.swagger.models.auth.In;
-import org.apache.ibatis.annotations.Param;
-
 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.entity.BasicTeachClazz;
 import com.qmth.teachcloud.mark.bean.archivescore.*;
 import com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryDomain;
 import com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryVo;
+import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
 import com.qmth.teachcloud.mark.dto.UnexistStudentDto;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentScoreDetailDto;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -29,57 +29,63 @@ import com.qmth.teachcloud.mark.entity.MarkStudent;
  */
 public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
-	IPage<StudentScoreDetailDto> pageStudentScore(@Param("page") Page<StudentScoreDetailDto> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("college") String college,
-			@Param("majorName") String majorName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
-			@Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
-			@Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
-			@Param("objectiveStartScore") Double objectiveStartScore,
-			@Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore, @Param("objectiveScoreLt") Double objectiveScoreLt,
-			@Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("orderType") String orderType,
-			@Param("orderField") String orderField);
+    IPage<StudentScoreDetailDto> pageStudentScore(@Param("page") Page<StudentScoreDetailDto> page, @Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("college") String college,
+                                                  @Param("majorName") String majorName, @Param("teachClassName") String teachClassName, @Param("className") String className, @Param("teacher") String teacher, @Param("filter") Integer filter,
+                                                  @Param("status") String status, @Param("breach") Boolean breach, @Param("startScore") Double startScore, @Param("endScore") Double endScore,
+                                                  @Param("subjectiveStartScore") Double subjectiveStartScore, @Param("subjectiveEndScore") Double subjectiveEndScore,
+                                                  @Param("objectiveStartScore") Double objectiveStartScore,
+                                                  @Param("objectiveEndScore") Double objectiveEndScore, @Param("subScore") Double subScore, @Param("objectiveScoreLt") Double objectiveScoreLt,
+                                                  @Param("studentName") String studentName, @Param("studentCode") String studentCode, @Param("orderType") String orderType,
+                                                  @Param("orderField") String orderField);
 
-	List<MarkStudent> listAbsentOrBreachMarkTaskStudent(@Param("examId") Long examId,
-			@Param("paperNumber") String paperNumber);
+    List<MarkStudent> listAbsentOrBreachMarkTaskStudent(@Param("examId") Long examId,
+                                                        @Param("paperNumber") String paperNumber);
 
-	IPage<MarkStudent> listUnMarkTaskStudent(@Param("page") Page<MarkStudent> page, @Param("examId") Long examId,
-			@Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber);
+    IPage<MarkStudent> listUnMarkTaskStudent(@Param("page") Page<MarkStudent> page, @Param("examId") Long examId,
+                                             @Param("paperNumber") String paperNumber, @Param("groupNumber") Integer groupNumber);
 
-	StudentVo findOne(@Param("query") StudentQuery query);
+    StudentVo findOne(@Param("query") StudentQuery query);
 
-	IPage<AnswerQueryVo> queryPage(Page<AnswerQueryVo> page, @Param("query") AnswerQueryDomain query, @Param("dpr") DataPermissionRule dpr);
+    IPage<AnswerQueryVo> queryPage(Page<AnswerQueryVo> page, @Param("query") AnswerQueryDomain query, @Param("dpr") DataPermissionRule dpr);
 
-	List<String> querySummary(@Param("query") AnswerQueryDomain query, @Param("dpr") DataPermissionRule dpr);
+    List<String> querySummary(@Param("query") AnswerQueryDomain query, @Param("dpr") DataPermissionRule dpr);
 
-	List<Long> findIdByExamIdAndPaperNumber(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
+    List<Long> findIdByExamIdAndPaperNumber(@Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
-	List<ArchiveStudentVo> studentList(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<ArchiveStudentVo> studentList(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	OverViewVo overview(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    OverViewVo overview(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	int getCountByScoreRange(@Param("examId") Long examId, @Param("paperNumber") String paperNumber,
-			@Param("start") Double start, @Param("end") Double end);
+    int getCountByScoreRange(@Param("examId") Long examId, @Param("paperNumber") String paperNumber,
+                             @Param("start") Double start, @Param("end") Double end);
 
-	List<CollegeVo> college(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<CollegeVo> college(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	List<ClassVo> classData(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<ClassVo> classData(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	List<TeacherVo> teacher(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<TeacherVo> teacher(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId,
-			@Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+    List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId,
+                                                                       @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
-	IPage<ArchiveStudentVo> studentList(@Param("page") Page<ArchiveStudentVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    IPage<ArchiveStudentVo> studentList(@Param("page") Page<ArchiveStudentVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	List<TeacherClassVo> teacherClass(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<TeacherClassVo> teacherClass(@Param("schoolId") Long schoolId, @Param("req") ArchiveStudentQuery query, @Param("dpr") DataPermissionRule dpr);
 
-	int selectCountByQuery(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
+    int selectCountByQuery(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
 
-	int countAssigned(@Param("markStudent") MarkStudent markStudent, @Param("dpr") DataPermissionRule dpr);
+    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);
+    List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId,
+                                                                           @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
-	BasicTeachClazz getBasicTeachClazzById(Long clazzId);
+    BasicTeachClazz getBasicTeachClazzById(Long clazzId);
 
     Integer maxCardNumber(@Param("examId") Long examId, @Param("paperNumber") String paperNumber, @Param("paperType") String paperType);
+
+    MarkStudent selectByExamIdAndCoursePaperIdAndStudentCode(@Param("examId") Long examId, @Param("coursePaperId") String coursePaperId, @Param("studentCode") String studentCode);
+
+    List<MarkStudentVo> listMarkStudentVo(@Param("markStudentQuery") MarkStudentQuery markStudentQuery);
+
+    IPage<MarkStudentVo> listMarkStudentVo(@Param("page") Page<MarkStudentVo> page, @Param("markStudentQuery") MarkStudentQuery markStudentQuery);
 }

+ 19 - 8
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java

@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.entity.BasicExam;
@@ -27,8 +28,10 @@ import com.qmth.teachcloud.mark.bean.scananswer.AnswerQueryVo;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamCheckInfoVo;
 import com.qmth.teachcloud.mark.bean.scanexaminfo.ScanExamInfoVo;
 import com.qmth.teachcloud.mark.bean.student.AbsentManualUpdateVo;
+import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentQuery;
 import com.qmth.teachcloud.mark.bean.student.StudentVo;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.manage.Task;
 import com.qmth.teachcloud.mark.dto.mark.score.SheetUrlDto;
 import com.qmth.teachcloud.mark.dto.mark.score.StudentObjectiveDetailDto;
@@ -37,6 +40,7 @@ import com.qmth.teachcloud.mark.entity.MarkPaper;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.entity.ScanStudentPaper;
 import com.qmth.teachcloud.mark.params.MarkHeaderResult;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -53,15 +57,15 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void updateSubjectiveStatusAndScore(Long studentId, SubjectiveStatus status, Double score, String scoreList);
 
     void updateSubjectiveStatusAndScore(Long examId, String paperNumber, SubjectiveStatus status, Double score,
-            String scoreList);
+                                        String scoreList);
 
     ScanExamInfoVo getScanExamInfo(BasicExam exam, Long courseId, String coursePaperId);
 
-    IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName,
-            String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore,
-            Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore,
-            Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, String orderType,
-            String orderField, Integer pageNumber, Integer pageSize);
+    IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName,String teachClassName,
+                                                  String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore,
+                                                  Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore,
+                                                  Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode, String orderType,
+                                                  String orderField, Integer pageNumber, Integer pageSize);
 
     List<SheetUrlDto> buildSheetUrls(Long studentId);
 
@@ -75,6 +79,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     MarkStudent findByExamIdAndCoursePaperIdAndStudentCode(Long examId, String coursePaperId, String studentCode);
 
     MarkStudent findByExamIdAndPaperNumberAndStudentCode(Long examId, String paperNumber, String studentCode);
+
     List<MarkStudent> listByStudentId(Long studentId);
 
     StudentObjectiveDetailDto getObjectiveInspectedTask(Long studentId);
@@ -146,12 +151,12 @@ public interface MarkStudentService extends IService<MarkStudent> {
     boolean updateAssignConfirm(Long studentId, boolean assignConfirm);
 
     int getAssignedCount(Long examId, Boolean checked, Long courseId, String coursePaperId, MarkPaperStatus status,
-            DataPermissionRule dpr);
+                         DataPermissionRule dpr);
 
     int countAbsentByExamIdAndPaperNumber(Long examId, String paperNumber);
 
     List<MarkStudent> listScanCollegeByExamIdAndCourseCodeAndCoursePaperId(Long examId, String courseCode,
-            String coursePaperId, String status, DataPermissionRule dpr);
+                                                                           String coursePaperId, String status, DataPermissionRule dpr);
 
     int countUnexistByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType);
 
@@ -172,4 +177,10 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void scoreDownload(ArchiveStudentQuery query, HttpServletResponse response);
 
     Boolean missScanUpdate(Long examId, String coursePaperId, String studentCode, Boolean missScan);
+
+    MarkStudentVo getMarkStudentVoByStudentId(Long studentId);
+
+    List<MarkStudentVo> listMarkStudentVo(MarkStudentQuery markStudentQuery);
+
+    IPage<MarkStudentVo> pageMarkStudentVo(Page<MarkStudentVo> page, MarkStudentQuery markStudentQuery);
 }

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

@@ -13,6 +13,7 @@ import com.qmth.teachcloud.common.enums.mark.MarkMode;
 import com.qmth.teachcloud.common.service.FileUploadService;
 import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import com.qmth.teachcloud.mark.dto.mark.manage.MarkArbitrateDto;
 import com.qmth.teachcloud.mark.dto.mark.manage.MarkArbitrateMarkerDto;
 import com.qmth.teachcloud.mark.dto.mark.manage.MarkArbitrateSettingDto;
@@ -73,7 +74,7 @@ public class MarkArbitrateHistoryServiceImpl extends ServiceImpl<MarkArbitrateHi
         IPage<MarkArbitrateDto> markArbitrateDtoIPage = this.baseMapper.pageArbitrate(page, examId, paperNumber, groupNumber, status, className);
         for (MarkArbitrateDto arbitrateDto : markArbitrateDtoIPage.getRecords()) {
             if (arbitrateDto.getStudentId() != null) {
-                MarkStudent markStudent = markStudentService.getById(arbitrateDto.getStudentId());
+                MarkStudentVo markStudent = markStudentService.getMarkStudentVoByStudentId(arbitrateDto.getStudentId());
                 if (markStudent != null) {
                     arbitrateDto.setStudentCode(markStudent.getStudentCode());
                     arbitrateDto.setStudentName(markStudent.getStudentName());

+ 40 - 41
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkDocumentServiceImpl.java

@@ -56,8 +56,8 @@ public class MarkDocumentServiceImpl extends ServiceImpl<MarkDocumentMapper, Mar
         queryWrapper.lambda().eq(MarkDocument::getExamId, examId)
                 .eq(MarkDocument::getPaperNumber, paperNumber);
         List<MarkDocument> list = this.list(queryWrapper);
-        list.sort((d1,d2)->{
-            return d1.getType().getValue()-d2.getType().getValue();
+        list.sort((d1, d2) -> {
+            return d1.getType().getValue() - d2.getType().getValue();
         });
         for (MarkDocument d : list) {
             d.setFilePath(teachcloudCommonService.filePreview(d.getFilePath()));
@@ -139,8 +139,7 @@ public class MarkDocumentServiceImpl extends ServiceImpl<MarkDocumentMapper, Mar
             document.setId(id);
             document.setExamId(examId);
             document.setPaperNumber(paperNumber);
-            document.setCourseCode(markPaper.getCourseCode());
-            document.setCourseName(markPaper.getCourseName());
+            document.setCourseId(markPaper.getCourseId());
             document.setType(DocumentType.CUSTOM);
             document.setName(documentName);
             document.setFileCount(1);
@@ -162,49 +161,49 @@ public class MarkDocumentServiceImpl extends ServiceImpl<MarkDocumentMapper, Mar
 
     @Override
     public void initMarkDocument(MarkPaper markPaper) {
-            List<MarkDocument> markDocuments = new ArrayList<>();
-            for (DocumentType documentType : DocumentType.getOptionList(false)) {
-                MarkDocument markDocument = null;
-                if(!DocumentType.CUSTOM.equals(documentType)){
-                    QueryWrapper<MarkDocument> queryWrapper = new QueryWrapper<>();
-                    queryWrapper.lambda().eq(MarkDocument::getExamId, markPaper.getExamId())
-                            .eq(MarkDocument::getPaperNumber, markPaper.getPaperNumber())
-                            .eq(MarkDocument::getType, documentType);
-                    markDocument =  this.getOne(queryWrapper);
+        List<MarkDocument> markDocuments = new ArrayList<>();
+        for (DocumentType documentType : DocumentType.getOptionList(false)) {
+            MarkDocument markDocument = null;
+            if (!DocumentType.CUSTOM.equals(documentType)) {
+                QueryWrapper<MarkDocument> queryWrapper = new QueryWrapper<>();
+                queryWrapper.lambda().eq(MarkDocument::getExamId, markPaper.getExamId())
+                        .eq(MarkDocument::getPaperNumber, markPaper.getPaperNumber())
+                        .eq(MarkDocument::getType, documentType);
+                markDocument = this.getOne(queryWrapper);
+            }
+            if (markDocument == null) {
+                markDocument = new MarkDocument(markPaper.getExamId(), markPaper.getCourseId(), markPaper.getPaperNumber(), documentType, documentType.getName(), 0);
+            }
+            if (documentType.equals(DocumentType.PAPER)) {
+                if (StringUtils.isNotBlank(markPaper.getPaperFilePath())) {
+                    markDocument.setFileCount(1);
+                    markDocument.setFilePath(markPaper.getPaperFilePath());
                 }
-                if(markDocument == null){
-                    markDocument = new MarkDocument(markPaper.getExamId(), markPaper.getCourseCode(), markPaper.getCourseName(), markPaper.getPaperNumber(), documentType, documentType.getName(), 0);
+            } else if (documentType.equals(DocumentType.ANSWER)) {
+                if (StringUtils.isNotBlank(markPaper.getAnswerFilePath())) {
+                    markDocument.setFileCount(1);
+                    markDocument.setFilePath(markPaper.getAnswerFilePath());
                 }
-                if (documentType.equals(DocumentType.PAPER)) {
-                    if (StringUtils.isNotBlank(markPaper.getPaperFilePath())) {
-                        markDocument.setFileCount(1);
-                        markDocument.setFilePath(markPaper.getPaperFilePath());
-                    }
-                } else if (documentType.equals(DocumentType.ANSWER)) {
-                    if (StringUtils.isNotBlank(markPaper.getAnswerFilePath())) {
-                        markDocument.setFileCount(1);
-                        markDocument.setFilePath(markPaper.getAnswerFilePath());
-                    }
-                } else if (documentType.equals(DocumentType.PAPER_REPORT)) {
+            } else if (documentType.equals(DocumentType.PAPER_REPORT)) {
 //                    markDocument.setFileCount(1);
-                } else if (documentType.equals(DocumentType.APPROVE_RECORD)) {
-                    markDocument.setFileCount(1);
-                } else if (documentType.equals(DocumentType.SCORE)) {
-                    markDocument.setFileCount(1);
-                } else if (documentType.equals(DocumentType.SCORE_REPORT)) {
-                    markDocument.setFileCount(1);
-                } else if (documentType.equals(DocumentType.SHEET)) {
-                    markDocument.setFileCount(markPaper.getUploadCount());
+            } else if (documentType.equals(DocumentType.APPROVE_RECORD)) {
+                markDocument.setFileCount(1);
+            } else if (documentType.equals(DocumentType.SCORE)) {
+                markDocument.setFileCount(1);
+            } else if (documentType.equals(DocumentType.SCORE_REPORT)) {
+                markDocument.setFileCount(1);
+            } else if (documentType.equals(DocumentType.SHEET)) {
+                markDocument.setFileCount(markPaper.getUploadCount());
 //                } else if (documentType.equals(DocumentType.TRACK)) {
 //                    markDocument.setFileCount(markPaper.getUploadCount());
-                } else if (documentType.equals(DocumentType.SIGN)) {
-                    List<ScanPackage> scanPackageList = scanPackageService.listByExamIdAndCoursePaperIdAndPackageCode(markPaper.getExamId(), markPaper.getCoursePaperId(), null);
-                    markDocument.setFileCount(scanPackageList.size());
-                } else if (documentType.equals(DocumentType.CHECK_IN)) {
+            } else if (documentType.equals(DocumentType.SIGN)) {
+                List<ScanPackage> scanPackageList = scanPackageService.listByExamIdAndCoursePaperIdAndPackageCode(markPaper.getExamId(), markPaper.getCoursePaperId(), null);
+                markDocument.setFileCount(scanPackageList.size());
+            } else if (documentType.equals(DocumentType.CHECK_IN)) {
 
-                }
-                markDocuments.add(markDocument);
             }
-            this.saveOrUpdateBatch(markDocuments);
+            markDocuments.add(markDocument);
+        }
+        this.saveOrUpdateBatch(markDocuments);
     }
 }

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

@@ -279,8 +279,7 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
         markGroup.setExamId(examId);
         markGroup.setPaperNumber(paperNumber);
         MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
-        markGroup.setCourseCode(markPaper.getCourseCode());
-        markGroup.setCourseName(markPaper.getCourseName());
+        markGroup.setCourseId(markPaper.getCourseId());
         markGroup.setNumber(markGroupDto.getGroupNumber());
         markGroup.setPicList(CardFile.getMarkConfigAdd(markGroupDto.getPictureConfigs(), 0.015));
         Double totalScore = questions.stream().mapToDouble(MarkQuestion::getTotalScore).sum();

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

@@ -5,6 +5,7 @@ import java.util.List;
 import javax.annotation.Resource;
 
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -64,7 +65,7 @@ public class MarkProblemHistoryServiceImpl extends ServiceImpl<MarkProblemHistor
 		IPage<MarkProblemDto> markProblemDtoIPage = this.baseMapper.pageProblem(page, examId, paperNumber, groupNumber,
 				problemType, status, secretNumber);
 		for (MarkProblemDto problemDto : markProblemDtoIPage.getRecords()) {
-			MarkStudent markStudent = markStudentService.getById(problemDto.getStudentId());
+			MarkStudentVo markStudent = markStudentService.getMarkStudentVoByStudentId(problemDto.getStudentId());
 			problemDto.setStudentName(markStudent.getStudentName());
 			problemDto.setStudentCode(markStudent.getStudentCode());
 			problemDto.setSheetUrls(teachcloudCommonService.filePreview(markStudent.getSheetPathList()));

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

@@ -1,28 +1,16 @@
 package com.qmth.teachcloud.mark.service.impl;
 
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
-
-import javax.annotation.Resource;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 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.mark.*;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -45,8 +33,19 @@ import com.qmth.teachcloud.mark.service.*;
 import com.qmth.teachcloud.mark.utils.BigDecimalUtils;
 import com.qmth.teachcloud.mark.utils.TaskLock;
 import com.qmth.teachcloud.mark.utils.TaskLockUtil;
-
 import io.lettuce.core.GeoArgs.Sort;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+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 {
@@ -57,6 +56,8 @@ public class MarkServiceImpl implements MarkService {
 
     private Map<Long, Long> markerLastUpdateTime = new ConcurrentHashMap<>();
 
+    @Resource
+    private BasicCourseService basicCourseService;
     @Resource
     private MarkPaperService markPaperService;
 
@@ -483,8 +484,7 @@ public class MarkServiceImpl implements MarkService {
                     MarkTask markTask = new MarkTask();
                     markTask.setId(SystemConstant.getDbUuid());
                     markTask.setExamId(student.getExamId());
-                    markTask.setCourseCode(student.getCourseCode());
-                    markTask.setCourseName(student.getCourseName());
+                    markTask.setCourseId(student.getCourseId());
                     markTask.setPaperNumber(student.getPaperNumber());
                     markTask.setGroupNumber(group.getNumber());
                     markTask.setStudentId(student.getId());
@@ -512,8 +512,7 @@ public class MarkServiceImpl implements MarkService {
                             markTask = new MarkTask();
                             markTask.setId(SystemConstant.getDbUuid());
                             markTask.setExamId(student.getExamId());
-                            markTask.setCourseCode(student.getCourseCode());
-                            markTask.setCourseName(student.getCourseName());
+                            markTask.setCourseId(student.getCourseId());
                             markTask.setPaperNumber(student.getPaperNumber());
                             markTask.setGroupNumber(group.getNumber());
                             markTask.setStudentId(student.getId());
@@ -787,8 +786,9 @@ public class MarkServiceImpl implements MarkService {
                 : teachcloudCommonService.filePreview(markPaper.getAnswerFilePath()));
         dto.getSubject().setPaperUrl(StringUtils.isBlank(markPaper.getPaperFilePath()) ? null
                 : teachcloudCommonService.filePreview(markPaper.getPaperFilePath()));
+        BasicCourse basicCourse = basicCourseService.getById(markPaper.getCourseId());
         dto.getSubject().setCode(markPaper.getPaperNumber());
-        dto.getSubject().setName(markPaper.getCourseName());
+        dto.getSubject().setName(basicCourse != null ? basicCourse.getName() : null);
         dto.setForceSpecialTag(false);
         dto.setUiSetting(user.getUiSetting());
         dto.setStatusValue(markPaper.getStatus());

+ 44 - 30
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -18,6 +18,8 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotNull;
 
+import com.qmth.teachcloud.mark.bean.student.MarkStudentQuery;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -155,14 +157,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
     @Override
     public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
-        QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(MarkStudent::getExamId, examId).eq(MarkStudent::getPaperNumber, paperNumber);
-        List<MarkStudent> markStudentList = this.list(queryWrapper);
+        MarkStudentQuery markStudentQuery = new MarkStudentQuery();
+        markStudentQuery.setExamId(examId);
+        markStudentQuery.setPaperNumber(paperNumber);
+        List<MarkStudentVo> markStudentList = this.listMarkStudentVo(markStudentQuery);
 
         List<String> classNameList = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(markStudentList)) {
             classNameList = markStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getClassName()))
-                    .map(MarkStudent::getClassName).distinct().collect(Collectors.toList());
+                    .map(MarkStudentVo::getClassName).distinct().collect(Collectors.toList());
         }
         return classNameList;
     }
@@ -212,7 +215,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
 
     @Override
-    public IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName,
+    public IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName, String teachClassName,
                                                          String className, String teacher, Integer filter, String status, Boolean breach, Double startScore,
                                                          Double endScore, Double subjectiveStartScore, Double subjectiveEndScore, Double objectiveStartScore, Double objectiveEndScore,
                                                          Double subScore, Integer objectiveScoreRateLt, String studentName, String studentCode,
@@ -237,7 +240,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 null :
                 Calculator.round(Calculator.divide(Calculator.multiply(markPaper.getObjectiveScore(), Double.parseDouble(String.valueOf(objectiveScoreRateLt))), 100), 2);
         IPage<StudentScoreDetailDto> studentScoreDetailDtoIPage = this.baseMapper.pageStudentScore(page, examId,
-                paperNumber, college, majorName, className, teacher, filter, status, breach, startScore, endScore,
+                paperNumber, college, majorName,teachClassName, className, teacher, filter, status, breach, startScore, endScore,
                 subjectiveStartScore, subjectiveEndScore, objectiveStartScore, objectiveEndScore, subScore,
                 objectiveScoreLt, studentName, studentCode, orderType, orderField);
         for (StudentScoreDetailDto scoreDetailDto : studentScoreDetailDtoIPage.getRecords()) {
@@ -298,7 +301,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
 
     private int getMissScanCount(Long examId, Long courseId, String coursePaperId,
-                         MarkPaperStatus markPaperStatus, DataPermissionRule dpr) {
+                                 MarkPaperStatus markPaperStatus, DataPermissionRule dpr) {
         MarkStudent markStudent = new MarkStudent();
         markStudent.setExamId(examId);
         markStudent.setCourseId(courseId);
@@ -469,12 +472,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
 
     @Override
     public MarkStudent findByExamIdAndCoursePaperIdAndStudentCode(Long examId, String coursePaperId, String studentCode) {
-        QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
-        LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
-        lw.eq(MarkStudent::getExamId, examId);
-        lw.eq(MarkStudent::getCoursePaperId, coursePaperId);
-        lw.eq(MarkStudent::getStudentCode, studentCode);
-        return baseMapper.selectOne(wrapper);
+        return baseMapper.selectByExamIdAndCoursePaperIdAndStudentCode(examId, coursePaperId, studentCode);
     }
 
     @Override
@@ -494,13 +492,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     @Override
     public List<MarkStudent> listByStudentId(Long studentId) {
         QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
-        wrapper.lambda().eq(MarkStudent::getStudentId, studentId);
+        wrapper.lambda().eq(MarkStudent::getBasicStudentId, studentId);
         return this.list(wrapper);
     }
 
     @Override
     public StudentObjectiveDetailDto getObjectiveInspectedTask(Long studentId) {
-        MarkStudent markStudent = this.getById(studentId);
+        MarkStudentVo markStudent = this.getMarkStudentVoByStudentId(studentId);
         StudentObjectiveDetailDto studentObjectiveDetailDto = new StudentObjectiveDetailDto();
         if (markStudent != null) {
             studentObjectiveDetailDto.setStudentId(markStudent.getId());
@@ -998,7 +996,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             List<String> valueList = new ArrayList<>();
             valueList.add(s.getStudentName());
             valueList.add(s.getStudentCode());
-            valueList.add(s.getCollege());
+            valueList.add(s.getCollegeName());
             valueList.add(s.getClassName());
             valueList.add(s.getCourseCode());
             valueList.add(s.getCourseName());
@@ -1313,17 +1311,15 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         ret.setObjective(list);
     }
 
-    private List<MarkStudent> listByExamIdAndPaperNumberAndNotAbsent(Long examId, String paperNumber) {
-        QueryWrapper<MarkStudent> wrapper = new QueryWrapper<>();
-        LambdaQueryWrapper<MarkStudent> lw = wrapper.lambda();
-        lw.eq(MarkStudent::getExamId, examId);
-        lw.eq(MarkStudent::getPaperNumber, paperNumber);
-        lw.eq(MarkStudent::getUpload, true);
-        lw.eq(MarkStudent::getAbsent, false);
-        lw.eq(MarkStudent::getBreach, false);
-        lw.eq(MarkStudent::getOmrAbsent, false);
-
-        return this.list(wrapper);
+    private List<MarkStudentVo> listByExamIdAndPaperNumberAndNotAbsent(Long examId, String paperNumber) {
+        MarkStudentQuery markStudentQuery = new MarkStudentQuery();
+        markStudentQuery.setExamId(examId);
+        markStudentQuery.setPaperNumber(paperNumber);
+        markStudentQuery.setUpload(true);
+        markStudentQuery.setAbsent(false);
+        markStudentQuery.setBreach(false);
+        markStudentQuery.setOmrAbsent(false);
+        return this.listMarkStudentVo(markStudentQuery);
     }
 
     private void fillScoreRange(ScoreReportVo ret, List<ArchiveStudentVo> list) {
@@ -1434,11 +1430,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             throw ExceptionResultEnum.ERROR.exception("科目未结束评卷,不能同步考生成绩");
         }
 
-        List<MarkStudent> markStudentList = this.listByExamIdAndPaperNumberAndNotAbsent(examId, paperNumber);
+        List<MarkStudentVo> markStudentList = this.listByExamIdAndPaperNumberAndNotAbsent(examId, paperNumber);
         List<MarkQuestion> objectiveQuestionList = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null, true);
         List<MarkQuestion> subjectiveQuestionList = markQuestionService.listByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null, false);
         List<MarkStudentScoreVo> markStudentScoreVoList = new ArrayList<>();
-        for (MarkStudent markStudent : markStudentList) {
+        for (MarkStudentVo markStudent : markStudentList) {
             MarkStudentScoreVo markStudentScoreVo = new MarkStudentScoreVo();
             markStudentScoreVo.setExamId(markStudent.getExamId());
             markStudentScoreVo.setCourseCode(markStudent.getCourseCode());
@@ -1583,7 +1579,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         MarkStudent markStudent = this.findByExamIdAndPaperNumberAndStudentCode(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), basicExamStudent.getStudentCode());
         SysUser sysUser = sysUserService.getById(basicExamStudent.getTeacherId());
         if (markStudent == null) {
-            markStudent = new MarkStudent(basicExamStudent.getId(), basicExamStudent.getExamId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), markPaper.getCoursePaperId(), "A", basicExamStudent.getStudentCode(), basicExamStudent.getStudentName(), "", basicExamStudent.getExamPlace(), basicExamStudent.getExamRoom(), basicExamStudent.getCollegeName(), basicExamStudent.getMajorName(), basicExamStudent.getTeachClassName(), basicExamStudent.getTeacherId(), sysUser == null ? null : sysUser.getRealName(), basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime(), markPaper.getUserId());
+            markStudent = new MarkStudent(SystemConstant.getDbUuid(), basicExamStudent.getExamId(), basicExamStudent.getId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), markPaper.getCoursePaperId(), "A", basicExamStudent.getStudentCode(), "", basicExamStudent.getExamPlace(), basicExamStudent.getExamRoom(), basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime(), markPaper.getUserId());
             if (markStudent.getSecretNumber() == null) {
                 markStudent.randomSecretNumber();
                 while (secretNumberSet.contains(markStudent.getSecretNumber())
@@ -1682,4 +1678,22 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         lw.eq(MarkStudent::getId, student.getId());
         return this.update(lw);
     }
+
+    @Override
+    public MarkStudentVo getMarkStudentVoByStudentId(Long studentId) {
+        MarkStudentQuery markStudentQuery = new MarkStudentQuery();
+        markStudentQuery.setId(studentId);
+        List<MarkStudentVo> markStudentVoList = this.baseMapper.listMarkStudentVo(markStudentQuery);
+        return CollectionUtils.isNotEmpty(markStudentVoList) ? markStudentVoList.get(0) : null;
+    }
+
+    @Override
+    public List<MarkStudentVo> listMarkStudentVo(MarkStudentQuery markStudentQuery) {
+        return this.baseMapper.listMarkStudentVo(markStudentQuery);
+    }
+
+    @Override
+    public IPage<MarkStudentVo> pageMarkStudentVo(Page<MarkStudentVo> page, MarkStudentQuery markStudentQuery) {
+        return this.baseMapper.listMarkStudentVo(page, markStudentQuery);
+    }
 }

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

@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -387,7 +388,7 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
 
     @Override
     public ScanOmrStudent getTask(Long studentId) {
-        MarkStudent student = studentService.getById(studentId);
+        MarkStudentVo student = studentService.getMarkStudentVoByStudentId(studentId);
         if (student == null) {
             throw ExceptionResultEnum.ERROR.exception("没有识别对照任务");
         }

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

@@ -4,6 +4,7 @@ import java.util.*;
 
 import javax.annotation.Resource;
 
+import com.qmth.teachcloud.mark.dto.mark.MarkStudentVo;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
@@ -78,7 +79,7 @@ public class TaskServiceImpl implements TaskService {
 
     @Override
     public Task build(Long studentId) {
-        MarkStudent markStudent = markStudentService.getById(studentId);
+        MarkStudentVo markStudent = markStudentService.getMarkStudentVoByStudentId(studentId);
         Task task = new Task();
         if (markStudent != null) {
             task.setStudentId(markStudent.getId());

+ 4 - 4
teachcloud-mark/src/main/resources/mapper/MarkPaperMapper.xml

@@ -139,7 +139,7 @@
     </select>
     <select id="scoreList" resultType="com.qmth.teachcloud.mark.bean.archivescore.ArchiveScoreVo">
         SELECT t.id,t.exam_id,bc.code courseCode,bc.name courseName,t.paper_number,
-        count(*) studentCount,count(distinct s.class_name) classCount,
+        count(*) studentCount,count(distinct bes.teach_class_name) classCount,
         sum(case when s.is_absent =1 or s.omr_absent =1 then 1 else 0 end) absentCount,
         avg(case when s.is_absent !=1 then ifnull(s.objective_score,0)+ifnull(s.subjective_score,0) else null end) avgScore,
         max(case when s.is_absent !=1 then ifnull(s.objective_score,0)+ifnull(s.subjective_score,0) else null end) maxScore,
@@ -151,6 +151,7 @@
         FROM
         mark_paper t
         left join mark_student s on t.exam_id=s.exam_id and t.course_paper_id=s.course_paper_id
+        left join (select * from basic_exam_student where exam_id = #{req.examId}) bes on s.basic_student_id = bes.id
         left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
         WHERE
         t.exam_id = #{req.examId}
@@ -242,10 +243,10 @@
     </select>
 
     <select id="documentList" resultType="com.qmth.teachcloud.mark.bean.document.ArchivePaperVo">
-        SELECT t.id,t.exam_id,t.course_code,t.course_name,t.paper_number
+        SELECT t.id,t.exam_id,bc.code courseCode,bc.name courseName,t.paper_number
         FROM
         mark_paper t
-        left join mark_student s on t.exam_id=s.exam_id and t.course_paper_id=s.course_paper_id
+            left join basic_course bc on t.course_id = bc.id
         left join sys_user su on t.user_id = su.id
         WHERE
         t.exam_id = #{req.examId}
@@ -267,7 +268,6 @@
                 </foreach>
             </if>
         </if>
-        group by t.id,t.exam_id,t.course_code,t.course_name,t.paper_number
         ORDER BY t.id desc
     </select>
 </mapper>

+ 177 - 68
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -48,15 +48,16 @@
         SELECT
         ms.id studentId,
         ms.exam_id examId,
-        ms.course_code courseCode,
-        ms.course_name courseName,
+        bc.code courseCode,
+        bc.name courseName,
         ms.paper_number paperNumber,
-        ms.student_name studentName,
-        ms.student_code studentCode,
+        bes.student_name studentName,
+        bes.student_code studentCode,
         ms.secret_number secretNumber,
-        ms.college,
-        ms.major_name majorName,
-        ms.class_name className,
+        bes.college_name college,
+        bes.major_name majorName,
+        bes.teach_class_name teachClassName,
+        bes.class_name className,
         ms.objective_score objectiveScore,
         ms.subjective_score subjectiveScore,
         ifnull(ms.objective_score, 0) + ifnull(ms.subjective_score, 0) totalScore,
@@ -73,23 +74,34 @@
         ms.subjective_status subjectiveStatus,
         ms.is_absent absent,
         ms.omr_absent omrAbsent,
-        ms.is_upload upload
+        ms.is_upload upload,
+        bes.status studentStatus
         FROM
         mark_student ms
-        left join sys_user su on ms.check_user_id = su.id
+        LEFT JOIN
+        basic_exam_student bes ON ms.basic_student_id = bes.id
+        LEFT JOIN
+        basic_course bc ON ms.course_id = bc.id
+        LEFT JOIN
+        sys_user su ON ms.check_user_id = su.id
+        LEFT JOIN
+        sys_user su1 ON bes.teacher_id = su1.id
         where ms.exam_id = #{examId}
         AND ms.paper_number = #{paperNumber}
         <if test="college != null and college != ''">
-            AND ms.college LIKE CONCAT('%', #{college}, '%')
+            AND bes.college_name LIKE CONCAT('%', #{college}, '%')
         </if>
         <if test="majorName != null and majorName != ''">
-            AND ms.major_name LIKE CONCAT('%', #{majorName}, '%')
+            AND bes.major_name LIKE CONCAT('%', #{majorName}, '%')
+        </if>
+        <if test="teachClassName != null and teachClassName != ''">
+            AND bes.teach_class_name LIKE CONCAT('%', #{teachClassName}, '%')
         </if>
         <if test="className != null and className != ''">
-            AND ms.class_name LIKE CONCAT('%', #{className}, '%')
+            AND bes.class_name LIKE CONCAT('%', #{className}, '%')
         </if>
         <if test="teacher != null and teacher != ''">
-            AND ms.teacher LIKE CONCAT('%', #{teacher},'%')
+            AND su1.real_name LIKE CONCAT('%', #{teacher},'%')
         </if>
         <if test="filter != null">
             <choose>
@@ -138,13 +150,13 @@
             <choose>
                 <when test="subjectiveStartScore == 0">
                     AND (ms.is_absent = 1 OR ms.is_breach = 1
-                             OR ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
-                             AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
+                    OR ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
+                    AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
                 </when>
                 <otherwise>
                     AND (ms.is_absent = 0 AND ms.is_breach = 0
-                             AND ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
-                            AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
+                    AND ((ifnull(ms.subjective_score, 0) &gt;= #{subjectiveStartScore}
+                    AND ifnull(ms.subjective_score, 0) &lt;= #{subjectiveEndScore})))
                 </otherwise>
             </choose>
         </if>
@@ -152,13 +164,13 @@
             <choose>
                 <when test="objectiveStartScore == 0">
                     AND (ms.is_absent = 1 OR ms.is_breach = 1
-                        OR ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
-                        AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
+                    OR ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
+                    AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
                 </when>
                 <otherwise>
                     AND (ms.is_absent = 0 AND ms.is_breach = 0
-                        AND ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
-                        AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
+                    AND ((ifnull(ms.objective_score, 0) &gt;= #{objectiveStartScore}
+                    AND ifnull(ms.objective_score, 0) &lt;= #{objectiveEndScore})))
                 </otherwise>
             </choose>
         </if>
@@ -170,10 +182,10 @@
             AND ms.objective_score &lt; #{objectiveScoreLt}
         </if>
         <if test="studentName != null and studentName != ''">
-            AND ms.student_name like concat(#{studentName}, '%')
+            AND bes.student_name like concat('%',#{studentName}, '%')
         </if>
         <if test="studentCode != null and studentCode != ''">
-            AND ms.student_code = #{studentCode}
+            AND bes.student_code = #{studentCode}
         </if>
         <if test="orderType != null and orderType != '' and orderField != null and orderField != ''">
             <choose>
@@ -191,7 +203,7 @@
             </choose>
         </if>
         <if test="orderType == null or orderType == '' or orderField == null or orderField == ''">
-            order by ms.student_code
+            order by bes.student_code
         </if>
     </select>
     <select id="listAbsentOrBreachMarkTaskStudent" resultMap="BaseResultMap">
@@ -206,7 +218,7 @@
                      WHERE ms.id = mt.student_id)
     </select>
     <select id="listUnMarkTaskStudent" resultMap="BaseResultMap">
-        SELECT *
+        SELECT ms.*
         FROM mark_student ms
         WHERE ms.exam_id = #{examId}
           AND ms.paper_number = #{paperNumber}
@@ -328,13 +340,26 @@
     </select>
     <select id="studentList"
             resultType="com.qmth.teachcloud.mark.bean.archivescore.ArchiveStudentVo">
-        select s.*,s.id studentId, ifnull(s.objective_score,0)+ifnull(s.subjective_score,0) totalScore
-        from mark_student s left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+        select s.*,
+               s.id studentId,
+               bes.student_code studentCode,
+               bes.student_name studentName,
+               bes.college_name collegeName,
+               bes.major_name majorName,
+               bes.class_name className,
+               bes.teach_class_name teachClassName,
+               bc.code courseCode,
+               bc.name courseName,
+               bes.status,
+               ifnull(s.objective_score,0)+ifnull(s.subjective_score,0) totalScore
+        from mark_student s
+            left join basic_exam_student bes on s.basic_student_id = bes.id
+            left join sys_user su on bes.teacher_id = su.id
+            left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
         <include refid="archiveQuery"/>
         <if test="dpr != null">
             <if test="dpr.requestUserId != null">
-                AND s.teacher_id = #{dpr.requestUserId}
+                AND bes.teacher_id = #{dpr.requestUserId}
             </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                 AND bc.teaching_room_id IN
@@ -359,31 +384,34 @@
             </choose>
         </if>
         <if test="req.orderType == null or req.orderType == '' or req.orderField == null or req.orderField == ''">
-            order by s.student_code
+            order by bes.student_code
         </if>
     </select>
     <sql id="archiveQuery">
         where s.exam_id=#{req.examId} and s.paper_number=#{req.paperNumber}
         <if test="req.studentCode != null and req.studentCode !=''">
-            and s.student_code=#{req.studentCode}
+            and bes.student_code=#{req.studentCode}
         </if>
         <if test="req.startStudentCode != null and req.startStudentCode !=''">
-            and s.student_code &gt;= #{req.startStudentCode}
+            and bes.student_code &gt;= #{req.startStudentCode}
         </if>
         <if test="req.endStudentCode != null and req.endStudentCode !=''">
-            and s.student_code &lt;= #{req.endStudentCode}
+            and bes.student_code &lt;= #{req.endStudentCode}
         </if>
         <if test="req.studentName != null and req.studentName !=''">
-            and s.student_name=#{req.studentName}
+            and bes.student_name=#{req.studentName}
         </if>
         <if test="req.college != null and req.college !=''">
-            and s.college like concat(#{req.college}, '%')
+            and bes.college_name like concat(#{req.college}, '%')
         </if>
         <if test="req.majorName != null and req.majorName !=''">
-            and s.major_name like concat(#{req.majorName}, '%')
+            and bes.major_name like concat(#{req.majorName}, '%')
+        </if>
+        <if test="req.teachClassName != null and req.teachClassName !=''">
+            and bes.teach_class_name like concat(#{req.teachClassName}, '%')
         </if>
         <if test="req.className != null and req.className !=''">
-            and s.class_name like concat(#{req.className}, '%')
+            and bes.class_name like concat(#{req.className}, '%')
         </if>
         <if test="req.startScore != null and req.startScore !=''">
             and (ifnull(s.objective_score,0)+ifnull(s.subjective_score,0)) &gt;= #{req.startScore}
@@ -405,7 +433,7 @@
         </if>
         <if test="dpr != null">
             <if test="dpr.requestUserId != null">
-                AND s.teacher_id = #{dpr.requestUserId}
+                AND bes.teacher_id = #{dpr.requestUserId}
             </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                 AND bc.teaching_room_id IN
@@ -432,11 +460,12 @@
                        when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
+            left join (select * from basic_exam_student where exam_id=#{req.examId}) bes on s.basic_student_id = bes.id
                  left join mark_paper t on s.exam_id = t.exam_id
             and s.paper_number = t.paper_number
             and s.paper_type = t.paper_type
-        left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+        left join sys_user su on bes.teacher_id = su.id
+        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
         <include refid="archiveQuery"/>
     </select>
     <select id="getCountByScoreRange" resultType="int">
@@ -448,7 +477,7 @@
           and s.objective_score+s.subjective_score&lt;=#{end}
     </select>
     <select id="college" resultType="com.qmth.teachcloud.mark.bean.archivescore.CollegeVo">
-        SELECT s.college,
+        SELECT bes.college_name college,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
                avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
@@ -464,14 +493,15 @@
                  left join mark_paper t on s.exam_id = t.exam_id
             and s.paper_number = t.paper_number
             and s.paper_type = t.paper_type
-        left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+            left join (select * from basic_exam_student where exam_id=#{req.examId}) bes on s.basic_student_id = bes.id
+        left join sys_user su on bes.teacher_id = su.id
+        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
             <include refid="archiveQuery"/>
-            and s.college is not null
-        group by s.college
+            and bes.college_name is not null
+        group by bes.college_name
     </select>
     <select id="classData" resultType="com.qmth.teachcloud.mark.bean.archivescore.ClassVo">
-        SELECT s.class_name,
+        SELECT bes.teach_class_name className,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
                avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
@@ -487,14 +517,16 @@
                  left join mark_paper t on s.exam_id = t.exam_id
             and s.paper_number = t.paper_number
             and s.paper_type = t.paper_type
-        left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+            left join (select * from basic_exam_student where exam_id=#{req.examId}) bes on s.basic_student_id = bes.id
+        left join sys_user su on bes.teacher_id = su.id
+        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
             <include refid="archiveQuery"/>
-            and s.class_name is not null
-        group by s.class_name
+            and bes.teach_class_name is not null
+        group by bes.teach_class_name
     </select>
     <select id="teacher" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherVo">
-        SELECT s.teacher,
+        SELECT su.real_name teacher,
+               bes.teacher_id,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
                avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
@@ -510,19 +542,31 @@
                  left join mark_paper t on s.exam_id = t.exam_id
             and s.paper_number = t.paper_number
             and s.paper_type = t.paper_type
-        left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+            left join (select * from basic_exam_student where exam_id=#{req.examId}) bes on s.basic_student_id = bes.id
+        left join sys_user su on bes.teacher_id = su.id
+        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
             <include refid="archiveQuery"/>
-            and s.teacher is not null
-        group by s.teacher
+            and su.real_name is not null
+        group by bes.teacher_id, su.real_name
     </select>
     <select id="findOne" resultType="com.qmth.teachcloud.mark.bean.student.StudentVo"
             parameterType="com.qmth.teachcloud.mark.bean.student.StudentQuery">
-        select *
-        from mark_student
-        where exam_id = #{query.examId}
-          and course_paper_id = #{query.coursePaperId}
-          and student_code = #{query.studentCode}
+        select ms.id,
+               bes.student_code studentCode,
+               bes.student_name studentName,
+               bc.code courseCode,
+               bc.name courseName,
+               ms.course_paper_id coursePaperId,
+               ms.paper_number coursePaperNumber,
+               ms.package_code packageCode,
+               bes.site_number siteNumber,
+               ms.exam_room examRoom,
+               ms.scan_status status
+        from mark_student ms join basic_exam_student bes on ms.basic_student_id = bes.id
+        left join basic_course bc on ms.course_id = bc.id
+        where ms.exam_id = #{query.examId}
+          and ms.course_paper_id = #{query.coursePaperId}
+          and bes.student_code = #{query.studentCode}
     </select>
     <select id="listUnexistStudentByExamIdAndCoursePaperId"
             resultType="com.qmth.teachcloud.mark.dto.UnexistStudentDto">
@@ -564,8 +608,9 @@
         order by t.student_code
     </select>
     <select id="teacherClass" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherClassVo">
-        SELECT s.teacher,
-               s.class_name,
+        SELECT bes.teacher_id,
+               su.real_name teacher,
+               bes.teach_class_name className,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
                avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
@@ -581,11 +626,12 @@
                  left join mark_paper t on s.exam_id = t.exam_id
             and s.paper_number = t.paper_number
             and s.paper_type = t.paper_type
-        left join sys_user su on s.teacher_id = su.id
-        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_code = bc.code
+            left join (select * from basic_exam_student where exam_id=#{req.examId}) bes on s.basic_student_id = bes.id
+        left join sys_user su on bes.teacher_id = su.id
+        left join (select * from basic_course where school_id = #{schoolId}) bc on s.course_id = bc.id
             <include refid="archiveQuery"/>
-            and s.class_name is not null
-        group by s.teacher, s.class_name
+            and bes.teach_class_name is not null
+        group by bes.teacher_id, su.real_name, bes.teach_class_name
     </select>
     <select id="selectCountByQuery" resultType="java.lang.Integer">
         select count(1) from mark_student ms left join sys_user su on ms.create_id = su.id
@@ -643,8 +689,8 @@
         LEFT JOIN sys_user su ON ms.create_id = su.id
         <where>
             ms.exam_id = #{markStudent.examId}
-            <if test="markStudent.courseCode != null">
-                AND ms.course_code = #{markStudent.courseCode}
+            <if test="markStudent.courseId != null">
+                AND ms.course_id = #{markStudent.courseId}
             </if>
             <if test="markStudent.coursePaperId != null">
                 AND ms.course_paper_id = #{markStudent.coursePaperId}
@@ -711,5 +757,68 @@
     <select id="maxCardNumber" resultType="java.lang.Integer">
         select max(card_number) from mark_student where exam_id = #{examId} and paper_number = #{paperNumber} and paper_type = #{paperType} and card_number is not null
     </select>
+    <select id="selectByExamIdAndCoursePaperIdAndStudentCode"
+            resultType="com.qmth.teachcloud.mark.entity.MarkStudent">
+        select ms.id,
+               bes.student_code,
+               bes.student_name,
+               bc.code courseCode,
+               bc.name courseName,
+               ms.paper_number,
+               ms.course_paper_id,
+               ms.exam_id,
+               ms.exam_place,
+               ms.exam_room
+               from mark_student ms
+            LEFT JOIN
+            basic_exam_student bes on ms.basic_student_id = bes.id
+               left join
+            basic_course bc on bc.id = bes.course_id
+        where ms.exam_id = #{examId} and ms.course_paper_id = #{coursePaperId} and bes.student_code = #{studentCode}
+    </select>
+    <select id="listMarkStudentVo" resultType="com.qmth.teachcloud.mark.dto.mark.MarkStudentVo">
+        SELECT
+        ms.*,
+        bes.student_name,
+        bc.code courseCode,
+        bc.name courseName,
+        bes.college_name,
+        bes.major_name,
+        bes.teach_class_name,
+        bes.class_name,
+        su.real_name teacher,
+        bes.teacher_id
+        FROM
+        mark_student ms
+        LEFT JOIN
+        basic_exam_student bes ON ms.basic_student_id = bes.id
+        LEFT JOIN
+        basic_course bc ON ms.course_id = bc.id
+        LEFT JOIN
+        sys_user su ON bes.teacher_id = su.id
+        <where>
+            <if test="markStudentQuery.id != null">
+                and ms.id = #{markStudentQuery.id}
+            </if>
+            <if test="markStudentQuery.examId != null">
+                and ms.exam_id = #{markStudentQuery.examId}
+            </if>
+            <if test="markStudentQuery.paperNumber != null">
+                and ms.paper_number = #{markStudentQuery.paperNumber}
+            </if>
+            <if test="markStudentQuery.upload != null">
+                and ms.is_upload = #{markStudentQuery.upload}
+            </if>
+            <if test="markStudentQuery.absent != null">
+                and ms.is_absent = #{markStudentQuery.absent}
+            </if>
+            <if test="markStudentQuery.breach != null">
+                and ms.is_breach = #{markStudentQuery.breach}
+            </if>
+            <if test="markStudentQuery.omrAbsent != null">
+                and ms.omr_absent = #{markStudentQuery.omrAbsent}
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 4 - 2
teachcloud-mark/src/main/resources/mapper/MarkUserGroupMapper.xml

@@ -24,8 +24,8 @@
         SELECT
             mg.exam_id examId,
             mg.number groupNumber,
-            mg.course_code courseCode,
-            mg.course_name courseName,
+            bc.code courseCode,
+            bc.name courseName,
             mg.paper_number paperNumber,
             ifnull(mg.task_count, 0) taskCount,
             ifnull(mg.marked_count, 0) markedCount
@@ -35,6 +35,8 @@
             mark_group mg ON mug.exam_id = mg.exam_id
                 AND mug.paper_number = mg.paper_number
                 AND mug.group_number = mg.number
+                LEFT JOIN
+            basic_course bc ON mg.course_id = bc.id
         <where>
             mg.exam_id = #{examId}
             <if test="courseId != null">

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

@@ -28,9 +28,10 @@
     
 	<select id="cardList"
             resultType="com.qmth.teachcloud.mark.bean.answercard.AnswerCardVo">
-        select t.*,t.paper_number coursePaperNumber,f.course_code,f.course_name
+        select t.*,t.paper_number coursePaperNumber,bc.code courseCode,bc.name courseName
         from scan_answer_card t
         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 basic_course bc on f.course_id = bc.id
         left join sys_user su on f.user_id = su.id
         where t.exam_id=#{examId}
         <if test="coursePaperId != null and coursePaperId !=''">
@@ -51,9 +52,10 @@
     </select>
     <select id="cardGet"
             resultType="com.qmth.teachcloud.mark.bean.answercard.AnswerCardVo">
-        select t.*,t.paper_number coursePaperNumber,f.course_code,f.course_name
+        select t.*,t.paper_number coursePaperNumber,bc.code courseCode,bc.name courseName
         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 basic_course bc on f.course_id = bc.id
         where t.exam_id=#{examId} and t.number=#{number}
     </select>
     

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

@@ -117,7 +117,7 @@ public class PrintFinishServiceImpl implements PrintFinishService {
                     if (markStudent != null) {
                         continue;
                     }
-                    MarkStudent student = new MarkStudent(examStudent.getId(), dto.getExamId(), dto.getCourseId(), dto.getPaperNumber(), dto.getCoursePaperId(), paperType, examStudent.getStudentCode(), examStudent.getStudentName(), initExamDetailDto.getPackageCode(), initExamDetailDto.getExamPlace(), initExamDetailDto.getExamRoom(), examStudent.getCollegeName(), examStudent.getMajorName(), examStudent.getTeachClazzName(), examStudent.getTeacherId(), examStudent.getTeacherName(), dto.getExamStartTime(), dto.getExamEndTime(), dto.getCreateId());
+                    MarkStudent student = new MarkStudent(examStudent.getId(), dto.getExamId(), examStudent.getBasicStudentId(), dto.getCourseId(), dto.getPaperNumber(), dto.getCoursePaperId(), paperType, examStudent.getStudentCode(), initExamDetailDto.getPackageCode(), initExamDetailDto.getExamPlace(), initExamDetailDto.getExamRoom(), dto.getExamStartTime(), dto.getExamEndTime(), dto.getCreateId());
                     if (student.getSecretNumber() == null) {
                         student.randomSecretNumber();
                         while (secretNumberSet.contains(student.getSecretNumber())