Browse Source

3.4.0 update

xiaofei 1 year ago
parent
commit
10a1801c52
79 changed files with 781 additions and 971 deletions
  1. 0 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ClientExamStudentDto.java
  2. 9 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/client/PrintSingleDto.java
  3. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/BasicExamStudentResult.java
  4. 11 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamCard.java
  5. 11 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java
  6. 0 11
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TeachCourse.java
  7. 7 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ClientMapper.java
  8. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPrintPlanMapper.java
  9. 5 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java
  10. 0 20
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicMessageService.java
  11. 10 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ClientService.java
  12. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamCardService.java
  13. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  14. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPrintPlanService.java
  15. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  16. 1 62
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java
  17. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TeachCourseService.java
  18. 16 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  19. 0 55
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicMessageServiceImpl.java
  20. 28 28
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  21. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientStatusServiceImpl.java
  22. 9 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/CourseDimensionServiceImpl.java
  23. 4 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java
  24. 7 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java
  25. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  26. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  27. 4 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java
  28. 5 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  29. 21 31
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  30. 0 320
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  31. 4 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TPMatrixServiceImpl.java
  32. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TeachClazzServiceImpl.java
  33. 5 25
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TeachCourseServiceImpl.java
  34. 174 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentTeacherImportService.java
  35. 5 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/ImportLogicService.java
  36. 122 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  37. 35 26
      distributed-print-business/src/main/resources/mapper/ClientMapper.xml
  38. 7 7
      distributed-print-business/src/main/resources/mapper/ExamPrintPlanMapper.xml
  39. 2 0
      distributed-print/install/mysql/upgrade/3.4.0.sql
  40. 25 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicExamStudentController.java
  41. 11 12
      distributed-print/src/main/java/com/qmth/distributed/print/api/CourseTargetController.java
  42. 11 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamCardController.java
  43. 18 68
      distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java
  44. 20 20
      distributed-print/src/main/java/com/qmth/distributed/print/api/client/PrintController.java
  45. 4 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanExamController.java
  46. 10 5
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java
  47. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java
  48. 9 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/CoursePaperNumberDto.java
  49. 12 23
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicExamStudent.java
  50. 1 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/TaskTypeEnum.java
  51. 0 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/BasicCourseMapper.java
  52. 0 7
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java
  53. 0 15
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java
  54. 0 10
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/RedisUtil.java
  55. 0 17
      teachcloud-common/src/main/resources/mapper/BasicCourseMapper.xml
  56. 8 5
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryDomain.java
  57. 5 5
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scanpackage/ScanPackageQuery.java
  58. 13 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/UnexistStudentDto.java
  59. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkPaperMapper.java
  60. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkPaperPackageMapper.java
  61. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkStudentMapper.java
  62. 12 9
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanOmrTaskMapper.java
  63. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/ScanPackageMapper.java
  64. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkPaperPackageService.java
  65. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkPaperService.java
  66. 4 4
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkStudentService.java
  67. 4 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanOmrTaskService.java
  68. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/ScanPackageService.java
  69. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperPackageServiceImpl.java
  70. 6 6
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java
  71. 27 38
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  72. 13 4
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanConditionServiceImpl.java
  73. 10 7
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java
  74. 2 2
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanPackageServiceImpl.java
  75. 4 4
      teachcloud-mark/src/main/resources/mapper/MarkPaperMapper.xml
  76. 2 2
      teachcloud-mark/src/main/resources/mapper/MarkPaperPackageMapper.xml
  77. 9 6
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml
  78. 4 4
      teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml
  79. 4 4
      teachcloud-mark/src/main/resources/mapper/ScanPackageMapper.xml

+ 0 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ClientExamStudentDto.java

@@ -10,7 +10,6 @@ public class ClientExamStudentDto {
     private String courseName;
     private String courseName;
     private String paperNumber;
     private String paperNumber;
     private String studentCode;
     private String studentCode;
-    private String ticketNumber;
     private String studentName;
     private String studentName;
     private String siteNumber;
     private String siteNumber;
 
 
@@ -54,14 +53,6 @@ public class ClientExamStudentDto {
         this.studentCode = studentCode;
         this.studentCode = studentCode;
     }
     }
 
 
-    public String getTicketNumber() {
-        return ticketNumber;
-    }
-
-    public void setTicketNumber(String ticketNumber) {
-        this.ticketNumber = ticketNumber;
-    }
-
     public String getStudentName() {
     public String getStudentName() {
         return studentName;
         return studentName;
     }
     }

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/client/PrintSingleDto.java

@@ -8,6 +8,7 @@ public class PrintSingleDto {
     private String examName;
     private String examName;
     private Long printPlanId;
     private Long printPlanId;
     private String printPlanName;
     private String printPlanName;
+    private Long courseId;
     private String courseCode;
     private String courseCode;
     private String courseName;
     private String courseName;
     private String paperNumber;
     private String paperNumber;
@@ -51,6 +52,14 @@ public class PrintSingleDto {
         this.printPlanName = printPlanName;
         this.printPlanName = printPlanName;
     }
     }
 
 
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
     public String getCourseCode() {
     public String getCourseCode() {
         return courseCode;
         return courseCode;
     }
     }

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/BasicExamStudentResult.java

@@ -59,12 +59,10 @@ public class BasicExamStudentResult extends BasicExamStudent {
         this.courseName = courseName;
         this.courseName = courseName;
     }
     }
 
 
-    @Override
     public String getCourseCode() {
     public String getCourseCode() {
         return courseCode;
         return courseCode;
     }
     }
 
 
-    @Override
     public void setCourseCode(String courseCode) {
     public void setCourseCode(String courseCode) {
         this.courseCode = courseCode;
         this.courseCode = courseCode;
     }
     }

+ 11 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamCard.java

@@ -113,6 +113,9 @@ public class ExamCard extends BaseEntity implements Serializable {
     @TableField(value = "paper_id")
     @TableField(value = "paper_id")
     private Long paperId;
     private Long paperId;
 
 
+    @TableField(value = "copy_card_id")
+    private Long copyCardId;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private List<SysOrg> orgs;
     private List<SysOrg> orgs;
     @TableField(exist = false)
     @TableField(exist = false)
@@ -306,6 +309,14 @@ public class ExamCard extends BaseEntity implements Serializable {
         this.paperId = paperId;
         this.paperId = paperId;
     }
     }
 
 
+    public Long getCopyCardId() {
+        return copyCardId;
+    }
+
+    public void setCopyCardId(Long copyCardId) {
+        this.copyCardId = copyCardId;
+    }
+
     public List<String> getImageUrls() {
     public List<String> getImageUrls() {
         return imageUrls;
         return imageUrls;
     }
     }

+ 11 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java

@@ -47,16 +47,6 @@ public class ExamTask extends BaseEntity implements Serializable {
     @TableField(value = "course_id", updateStrategy = FieldStrategy.IGNORED)
     @TableField(value = "course_id", updateStrategy = FieldStrategy.IGNORED)
     private Long courseId;
     private Long courseId;
 
 
-    /**
-     * 课程代码
-     */
-    @TableField("course_code")
-    private String courseCode;
-    /**
-     * 课程名称
-     */
-    @TableField("course_name")
-    private String courseName;
     /**
     /**
      * 试卷编号
      * 试卷编号
      */
      */
@@ -154,6 +144,17 @@ public class ExamTask extends BaseEntity implements Serializable {
     @TableField(exist = false)
     @TableField(exist = false)
     private Long examEndTime;
     private Long examEndTime;
 
 
+    /**
+     * 课程代码
+     */
+    @TableField(exist = false)
+    private String courseCode;
+    /**
+     * 课程名称
+     */
+    @TableField(exist = false)
+    private String courseName;
+
     public Long getExamId() {
     public Long getExamId() {
         return examId;
         return examId;
     }
     }

+ 0 - 11
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TeachCourse.java

@@ -31,9 +31,6 @@ public class TeachCourse extends BaseEntity implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long courseId;
     private Long courseId;
 
 
-    @ApiModelProperty(value = "课程编号")
-    private String courseCode;
-
     @ApiModelProperty(value = "创建此教学课程的用户id")
     @ApiModelProperty(value = "创建此教学课程的用户id")
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long userId;
     private Long userId;
@@ -84,14 +81,6 @@ public class TeachCourse extends BaseEntity implements Serializable {
         this.courseId = courseId;
         this.courseId = courseId;
     }
     }
 
 
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
     public Long getUserId() {
     public Long getUserId() {
         return userId;
         return userId;
     }
     }

+ 7 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ClientMapper.java

@@ -12,15 +12,15 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 import java.util.List;
 
 
 public interface ClientMapper {
 public interface ClientMapper {
-    IPage<ClientExamTaskDto> pageTryTask(@Param("page") Page<ClientExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
-    List<ClientExamTaskDto> pageTryTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
+    IPage<ClientExamTaskDto> pageTryTask(@Param("page") Page<ClientExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
+    List<ClientExamTaskDto> pageTryTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
 
 
-    IPage<ClientPrintTaskDto> listClientPrintTask(@Param("page") Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
-    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    IPage<ClientPrintTaskDto> listClientPrintTask(@Param("page") Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
 
 
-    ClientPrintTaskTotalDto clientTaskTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    ClientPrintTaskTotalDto clientTaskTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
 
 
-    IPage<ClientExamStudentDto> listClientExamStudentPage(@Param("page") Page<ClientExamStudentDto> page, @Param("schoolId") Long schoolId, @Param("examDetailId") Long examDetailId, @Param("studentCode") String studentCode, @Param("studentName") String studentName, @Param("courseCode") String courseCode);
+    IPage<ClientExamStudentDto> listClientExamStudentPage(@Param("page") Page<ClientExamStudentDto> page, @Param("schoolId") Long schoolId, @Param("examDetailId") Long examDetailId, @Param("studentCode") String studentCode, @Param("studentName") String studentName, @Param("courseId") Long courseId);
 
 
-    IPage<PrintSingleDto> pagePrintSingleData(@Param("page") Page<PrintSingleDto> page, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") Long printPlanId, @Param("courseCode") Long courseCode, @Param("paperNumber") Long paperNumber, @Param("examDetailStatus") String[] examDetailStatus);
+    IPage<PrintSingleDto> pagePrintSingleData(@Param("page") Page<PrintSingleDto> page, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") Long printPlanId, @Param("courseId") Long courseId, @Param("paperNumber") Long paperNumber, @Param("examDetailStatus") String[] examDetailStatus);
 }
 }

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

@@ -35,9 +35,9 @@ public interface ExamPrintPlanMapper extends BaseMapper<ExamPrintPlan> {
 
 
     List<PrintPlanBrief> list(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("dpr") DataPermissionRule dpr);
     List<PrintPlanBrief> list(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("dpr") DataPermissionRule dpr);
 
 
-    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") String printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") String printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
 
 
-    ClientPrintStatisticsTotalDto clientStatisticsTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") Long printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    ClientPrintStatisticsTotalDto clientStatisticsTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") Long printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseId") Long courseId, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
 
 
     List<PrintPlanBrief> listToClient(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("orgId") Long orgId);
     List<PrintPlanBrief> listToClient(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("orgId") Long orgId);
 }
 }

+ 5 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java

@@ -8,6 +8,7 @@ import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
@@ -95,4 +96,8 @@ public interface BasicExamStudentService extends IService<BasicExamStudent> {
     List<BasicExamStudent> listByExamIdAndPaperNumber(Long examId, String paperNumber);
     List<BasicExamStudent> listByExamIdAndPaperNumber(Long examId, String paperNumber);
 
 
     List<BasicExamStudentResult> listByParams(BasicExamStudentQuery basicExamStudentQuery);
     List<BasicExamStudentResult> listByParams(BasicExamStudentQuery basicExamStudentQuery);
+
+    boolean updateStatus(Long id, BasicExamStudentStatusEnum status);
+
+    void updateTeacherIdById(List<BasicExamStudent> basicExamStudentList);
 }
 }

+ 0 - 20
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicMessageService.java

@@ -18,15 +18,6 @@ import java.util.List;
  */
  */
 public interface BasicMessageService extends IService<BasicMessage> {
 public interface BasicMessageService extends IService<BasicMessage> {
 
 
-    /**
-     * 命题任务审核消息处理
-     *
-     * @param examTaskIdList 命题任务主键集合
-     * @param messageType    消息类型枚举
-     * @param sysUser        发送信息的用户
-     */
-    void noticeOfExamTaskAudit(List<Long> examTaskIdList, MessageEnum messageType, SysUser sysUser);
-
     /**
     /**
      * 发送给命题老师-命题待办提醒
      * 发送给命题老师-命题待办提醒
      *
      *
@@ -74,17 +65,6 @@ public interface BasicMessageService extends IService<BasicMessage> {
      */
      */
     void sendNoticeAuditCopyUser(ExamTask examTask, List<ApproveUserResult> users, String auditUserNames, MessageEnum messageType);
     void sendNoticeAuditCopyUser(ExamTask examTask, List<ApproveUserResult> users, String auditUserNames, MessageEnum messageType);
 
 
-    /**
-     * 发送给命题老师-试卷结构标答上传通知
-     *
-     * @param paperNumber 试卷编号
-     * @param courseCode  课程代码
-     * @param userId      命题老师ID
-     * @param messageType 短信类型
-     * @param sysUser
-     */
-    void sendNoticeUploadStructure(String paperNumber, String courseCode, String courseName, Long userId, MessageEnum messageType, SysUser sysUser);
-
     /**
     /**
      * 查询
      * 查询
      *
      *

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

@@ -12,7 +12,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 
 
 public interface ClientService {
 public interface ClientService {
-    IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);
+    IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, Long courseId, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);
 
 
     List<Map<String, Object>> getPaperUrl(List<JSONObject> objects);
     List<Map<String, Object>> getPaperUrl(List<JSONObject> objects);
 
 
@@ -20,15 +20,15 @@ public interface ClientService {
 
 
     Boolean updatePrintProgress(Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint);
     Boolean updatePrintProgress(Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint);
 
 
-    IPage<ClientExamStudentDto> listStudent(Long examDetailId, String studentCode, String studentName, String courseCode, Integer pageNumber, Integer pageSize);
+    IPage<ClientExamStudentDto> listStudent(Long examDetailId, String studentCode, String studentName, Long courseId, Integer pageNumber, Integer pageSize);
 
 
     Map<String, Object> getReprintData(Long examDetailId, String studentCode, String type);
     Map<String, Object> getReprintData(Long examDetailId, String studentCode, String type);
 
 
-    IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);
+    IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);
 
 
     List<Map<String, Object>> getPrintData(String examDetailId, String machineCode, Boolean isPrint, String printUser);
     List<Map<String, Object>> getPrintData(String examDetailId, String machineCode, Boolean isPrint, String printUser);
 
 
-    List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);
+    List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);
 
 
     Map<String, Object> getUrlByExamDetailId(Long examDetailId);
     Map<String, Object> getUrlByExamDetailId(Long examDetailId);
 
 
@@ -36,15 +36,15 @@ public interface ClientService {
 
 
     Boolean validateData(Long examDetailId, String packageCode, String lastCode);
     Boolean validateData(Long examDetailId, String packageCode, String lastCode);
 
 
-    List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass);
+    List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, Long courseId, String paperNumber, Boolean isTry, Boolean isPass);
 
 
-    void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception;
+    void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception;
 
 
-    ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode);
+    ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode);
 
 
-    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);
+    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber, Integer pageNumber, Integer pageSize);
 
 
-    ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);
+    ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber);
 
 
     boolean updatePassword(Long userId, String password);
     boolean updatePassword(Long userId, String password);
 
 
@@ -54,5 +54,5 @@ public interface ClientService {
 
 
     Set<String> getRoleByUserId(Long id);
     Set<String> getRoleByUserId(Long id);
 
 
-    IPage<PrintSingleDto> getSingleData(Long semesterId, Long examId, Long printPlanId, Long courseCode, Long paperNumber, Integer pageNumber, Integer pageSize);
+    IPage<PrintSingleDto> getSingleData(Long semesterId, Long examId, Long printPlanId, Long courseId, Long paperNumber, Integer pageNumber, Integer pageSize);
 }
 }

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

@@ -45,4 +45,6 @@ public interface ExamCardService extends IService<ExamCard> {
     ExamCard createJpgImage(ExamCard examCard);
     ExamCard createJpgImage(ExamCard examCard);
 
 
     void downloadCardJson(HttpServletResponse response, String id);
     void downloadCardJson(HttpServletResponse response, String id);
+
+    boolean enable(Long id, Boolean enable);
 }
 }

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

@@ -28,7 +28,7 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
 
 
     List<BasicCourse> listCoursesByPrintPlanId(String param, List<Long> printPlanIdList);
     List<BasicCourse> listCoursesByPrintPlanId(String param, List<Long> printPlanIdList);
 
 
-    List<ExamDetailCourse> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber);
+    List<ExamDetailCourse> listByPrintPlanIdAndCourseIdAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber);
 
 
     List<ExamDetailCourse> listExamDetailByExamIdAndPaperNumber(Long schoolId, Long examId, String paperNumber);
     List<ExamDetailCourse> listExamDetailByExamIdAndPaperNumber(Long schoolId, Long examId, String paperNumber);
 
 

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

@@ -78,9 +78,9 @@ public interface ExamPrintPlanService extends IService<ExamPrintPlan> {
 
 
     List<Map<String, String>> tempalteView(Long printPlanId);
     List<Map<String, String>> tempalteView(Long printPlanId);
 
 
-    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Long orgId);
+    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber, Long orgId);
 
 
-    ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);
+    ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber);
 
 
     /**
     /**
      * 根据考场详情表查找印刷计划
      * 根据考场详情表查找印刷计划

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

@@ -187,4 +187,6 @@ public interface ExamTaskService extends IService<ExamTask> {
     List<ExamDetail> matchBasicExamStudent(BasicExam basicExam, ExamTask examTask, ExamTaskDetail examTaskDetail, SysUser user);
     List<ExamDetail> matchBasicExamStudent(BasicExam basicExam, ExamTask examTask, ExamTaskDetail examTaskDetail, SysUser user);
 
 
     List<TaskPrintHouseDto> listPrintHouse();
     List<TaskPrintHouseDto> listPrintHouse();
+
+    ExamTask getByIdIncludeCourse(Long examTaskId);
 }
 }

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

@@ -1,23 +1,17 @@
 package com.qmth.distributed.print.business.service;
 package com.qmth.distributed.print.business.service;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.itextpdf.text.DocumentException;
 import com.qmth.distributed.print.business.bean.dto.PdfDto;
 import com.qmth.distributed.print.business.bean.dto.PdfDto;
 import com.qmth.distributed.print.business.bean.dto.PdfPackageDto;
 import com.qmth.distributed.print.business.bean.dto.PdfPackageDto;
 import com.qmth.distributed.print.business.bean.dto.PdfSignDto;
 import com.qmth.distributed.print.business.bean.dto.PdfSignDto;
 import com.qmth.distributed.print.business.bean.excel.ExcelField;
 import com.qmth.distributed.print.business.bean.excel.ExcelField;
-import com.qmth.distributed.print.business.bean.params.ExamTaskStudentObjectParam;
 import com.qmth.distributed.print.business.bean.result.ScoreResult;
 import com.qmth.distributed.print.business.bean.result.ScoreResult;
 import com.qmth.distributed.print.business.entity.BasicTemplate;
 import com.qmth.distributed.print.business.entity.BasicTemplate;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamDetail;
-import com.qmth.distributed.print.business.entity.ExamStudent;
-import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicCourse;
-import com.qmth.teachcloud.common.entity.SysOrg;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import com.qmth.teachcloud.common.enums.PageSizeEnum;
 import com.qmth.teachcloud.common.enums.PageSizeEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
@@ -37,40 +31,8 @@ import java.util.Map;
  */
  */
 public interface PrintCommonService {
 public interface PrintCommonService {
 
 
-    /**
-     * 保存附件
-     *
-     * @param classifyEnum
-     * @param examDetail
-     * @param basicAttachment
-     * @param pdfList
-     * @param printCount
-     * @param sequence
-     * @return
-     * @throws IOException
-     */
-    BasicAttachment saveAttachmentPdf(ClassifyEnum classifyEnum, ExamDetail examDetail, BasicAttachment basicAttachment,
-                                      List<PdfDto> pdfList, Integer printCount, Integer sequence) throws IOException, DocumentException;
-
-    void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, List<PdfDto> pdfList, Integer printCount,
-                               List<File> fileTempList, BasicTemplate basicTemplate);
-
     void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, Integer printCount, BasicTemplate basicTemplate);
     void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, Integer printCount, BasicTemplate basicTemplate);
 
 
-    /**
-     * 保存html附件
-     *
-     * @param fileName
-     * @param htmlContent
-     * @param userId
-     * @param localFileList
-     * @param fileTempList
-     * @return
-     * @throws IOException
-     */
-    BasicAttachment saveAttachmentHtml(String fileName, String htmlContent, Long userId, List<PdfDto> localFileList,
-                                       List<File> fileTempList) throws IOException;
-
     BasicAttachment saveAttachmentPdfFromHtml(String fileName, String htmlContent, Long userId, List<PdfDto> localFileList, List<File> fileTempList) throws IOException;
     BasicAttachment saveAttachmentPdfFromHtml(String fileName, String htmlContent, Long userId, List<PdfDto> localFileList, List<File> fileTempList) throws IOException;
 
 
     BasicAttachment saveAttachmentPdfFromHtml(String fileName, File file, Long userId, List<PdfDto> localFileList, List<File> fileTempList, PageSizeEnum pageSizeEnum) throws IOException;
     BasicAttachment saveAttachmentPdfFromHtml(String fileName, File file, Long userId, List<PdfDto> localFileList, List<File> fileTempList, PageSizeEnum pageSizeEnum) throws IOException;
@@ -106,17 +68,6 @@ public interface PrintCommonService {
      */
      */
     BasicAttachment saveAttachment(MultipartFile file, String md5, UploadFileEnum type);
     BasicAttachment saveAttachment(MultipartFile file, String md5, UploadFileEnum type);
 
 
-    /**
-     * 分页查询
-     *
-     * @param code
-     * @param name
-     * @param pageNumber
-     * @param pageSize
-     * @return
-     */
-    IPage<BasicCourse> list(String code, String name, Integer pageNumber, Integer pageSize);
-
     /**
     /**
      * 科目查询
      * 科目查询
      *
      *
@@ -177,7 +128,7 @@ public interface PrintCommonService {
      * @param schoolId
      * @param schoolId
      * @param printPlanId
      * @param printPlanId
      * @param examId
      * @param examId
-     * @param courseCode
+     * @param courseId
      * @param paperNumber
      * @param paperNumber
      * @return
      * @return
      */
      */
@@ -207,15 +158,6 @@ public interface PrintCommonService {
      */
      */
     String saveTaskAttachment(ByteArrayOutputStream fos, boolean oss) throws IOException;
     String saveTaskAttachment(ByteArrayOutputStream fos, boolean oss) throws IOException;
 
 
-    /**
-     * 生成任务序号
-     *
-     * @param schoolId   学校ID
-     * @param courseCode 课程代码
-     * @return
-     */
-    String createCourseSequence(Long schoolId, String courseCode);
-
     /**
     /**
      * 提交初始化数据后更新批次状态
      * 提交初始化数据后更新批次状态
      *
      *
@@ -226,9 +168,6 @@ public interface PrintCommonService {
      */
      */
     public void updateGradeBatchStatus(Long schoolId, Long examId, String paperNumber, String paperType);
     public void updateGradeBatchStatus(Long schoolId, Long examId, String paperNumber, String paperType);
 
 
-    void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, List<PdfDto> variablePdfList,
-                                  Integer printCount, List<File> fileTempList);
-
     void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, Integer printCount);
     void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, Integer printCount);
 
 
     String parseAttachmentPath(String attachmentPath, PrintPathVo printPathVo);
     String parseAttachmentPath(String attachmentPath, PrintPathVo printPathVo);

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

@@ -57,12 +57,12 @@ public interface TeachCourseService extends IService<TeachCourse> {
     /**
     /**
      * 根据考试id,课程编号,教师id查询教学课程
      * 根据考试id,课程编号,教师id查询教学课程
      *
      *
-     * @param examId     考试id
-     * @param courseCode 课程编号
-     * @param userId     教师id
+     * @param examId   考试id
+     * @param courseId 课程编号
+     * @param userId   教师id
      * @return 教学课程
      * @return 教学课程
      */
      */
-    TeachCourse findByExamIdCourseCodeAndUserId(Long examId, String courseCode, Long userId);
+    TeachCourse findByExamIdCourseIdAndUserId(Long examId, Long courseId, Long userId);
 
 
     /**
     /**
      * 清除课程目标、评价、权重设置
      * 清除课程目标、评价、权重设置

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

@@ -1,6 +1,7 @@
 package com.qmth.distributed.print.business.service.impl;
 package com.qmth.distributed.print.business.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,6 +16,7 @@ import com.qmth.distributed.print.business.service.BasicTeachClazzService;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.entity.*;
+import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 import com.qmth.teachcloud.common.enums.ExamModelEnum;
 import com.qmth.teachcloud.common.enums.ExamModelEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.BasicCourseService;
@@ -148,7 +150,6 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             markPaper = markPaperService.getByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber());
             markPaper = markPaperService.getByExamIdAndPaperNumber(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber());
             if (markPaper == null) {
             if (markPaper == null) {
                 // 模式4,不存在试卷,则创建
                 // 模式4,不存在试卷,则创建
-                BasicCourse basicCourse = basicCourseService.getByCode(basicExamStudent.getCourseCode());
                 markPaper = new MarkPaper(basicExamStudent.getExamId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), String.valueOf(System.currentTimeMillis()), requestUser.getId(), SystemConstant.DEFAULT_PAPER_TYPE_A);
                 markPaper = new MarkPaper(basicExamStudent.getExamId(), basicExamStudent.getCourseId(), basicExamStudent.getPaperNumber(), String.valueOf(System.currentTimeMillis()), requestUser.getId(), SystemConstant.DEFAULT_PAPER_TYPE_A);
                 markPaperService.save(markPaper);
                 markPaperService.save(markPaper);
             }
             }
@@ -205,7 +206,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                     StringJoiner stringJoiner = new StringJoiner(";");
                     StringJoiner stringJoiner = new StringJoiner(";");
                     for (MarkStudent markStudent : markStudentList) {
                     for (MarkStudent markStudent : markStudentList) {
                         if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
                         if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
-                            stringJoiner.add("课程代码[" + basicExamStudent.getCourseCode() + "],学号[" + basicExamStudent.getStudentCode() + "]考生已开始评卷,无法删除");
+                            BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
+                            stringJoiner.add("课程代码[" + basicCourse.getCode() + "],学号[" + basicExamStudent.getStudentCode() + "]考生已开始评卷,无法删除");
                         }
                         }
                     }
                     }
                     if (stringJoiner.toString().length() > 0) {
                     if (stringJoiner.toString().length() > 0) {
@@ -322,4 +324,16 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         return this.baseMapper.listByParams(basicExamStudentQuery);
         return this.baseMapper.listByParams(basicExamStudentQuery);
     }
     }
 
 
+    @Override
+    public boolean updateStatus(Long id, BasicExamStudentStatusEnum status) {
+        return this.update(new UpdateWrapper<BasicExamStudent>().lambda().set(BasicExamStudent::getStatus, status).eq(BasicExamStudent::getId, id));
+    }
+
+    @Transactional
+    @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()));
+        }
+    }
 }
 }

+ 0 - 55
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicMessageServiceImpl.java

@@ -227,39 +227,6 @@ public class BasicMessageServiceImpl extends ServiceImpl<BasicMessageMapper, Bas
     }
     }
 
 
 
 
-    @Override
-    public void noticeOfExamTaskAudit(List<Long> examTaskIdList, MessageEnum messageType, SysUser sysUser) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        ExamTaskService examTaskService = SpringContextHolder.getBean(ExamTaskService.class);
-        for (Long examTaskId : examTaskIdList) {
-            ExamTask examTask = examTaskService.getById(examTaskId);
-            if (Objects.nonNull(examTask)) {
-                String courseCode = examTask.getCourseCode();
-                String courseName = examTask.getCourseName();
-                String paperNumber = examTask.getPaperNumber();
-                // 获取短信接收对象的信息
-                Long userId = examTask.getUserId();
-                SysUser user = commonCacheService.userCache(userId);
-                if (Objects.nonNull(user)) {
-                    String userName = user.getRealName();
-                    String mobileNumber = user.getMobileNumber();
-
-                    Map<String, String> jsonMap = new HashMap<>();
-                    jsonMap.put("userName", userName);
-                    jsonMap.put("courseName", courseName);
-                    jsonMap.put("paperNumber", paperNumber);
-                    String variableParams = JSON.toJSONString(jsonMap);
-                    String remark = String.format("命题任务ID:%s", examTaskId);
-                    this.saveMessageSendLog(schoolId, userId, userName, mobileNumber, paperNumber, courseCode, variableParams, messageType, sysUser.getId(), remark);
-                } else {
-                    String remark = String.format("命题任务ID:%s,用户不存在", examTaskId);
-                    this.saveMessageSendLog(schoolId, userId, null, null, paperNumber, courseCode, null, messageType, sysUser.getId(), remark);
-                }
-            }
-        }
-
-    }
-
     /**
     /**
      * 发送给命题老师-待办提醒
      * 发送给命题老师-待办提醒
      *
      *
@@ -403,26 +370,4 @@ public class BasicMessageServiceImpl extends ServiceImpl<BasicMessageMapper, Bas
             this.saveMessageSendLog(schoolId, user.getId(), userName, mobileNumber, paperNumber, courseCode, variableParams, messageType, sysUser.getId(), remark);
             this.saveMessageSendLog(schoolId, user.getId(), userName, mobileNumber, paperNumber, courseCode, variableParams, messageType, sysUser.getId(), remark);
         }
         }
     }
     }
-
-    @Override
-    public void sendNoticeUploadStructure(String paperNumber, String courseCode, String courseName, Long userId, MessageEnum messageType, SysUser sysUser) {
-        QueryWrapper<BasicMessage> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(BasicMessage::getPaperNumber, paperNumber).eq(BasicMessage::getCourseCode, courseCode).eq(BasicMessage::getUserId, userId).eq(BasicMessage::getMessageType, messageType);
-        List<BasicMessage> list = this.list(queryWrapper);
-        if (!CollectionUtils.isEmpty(list)) {
-            return;
-        }
-        SysUser user = commonCacheService.userCache(userId);
-        if (Objects.nonNull(user)) {
-            String userName = user.getRealName();
-            String mobileNumber = user.getMobileNumber();
-
-            Map<String, Object> jsonMap = new HashMap<>();
-            jsonMap.put("userName", userName);
-            StringJoiner sj = new StringJoiner(SystemConstant.PAUSE_SIGN).add(courseName).add(paperNumber);
-            jsonMap.put("courseName", sj.toString());
-            String variableParams = JSON.toJSONString(jsonMap);
-            this.saveMessageSendLog(sysUser.getSchoolId(), userId, userName, mobileNumber, paperNumber, courseCode, variableParams, messageType, sysUser.getId(), null);
-        }
-    }
 }
 }

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

@@ -18,10 +18,7 @@ import com.qmth.teachcloud.common.bean.vo.FilePathVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicAttachment;
-import com.qmth.teachcloud.common.entity.BasicSchool;
-import com.qmth.teachcloud.common.entity.SysPrivilege;
-import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
@@ -46,6 +43,8 @@ import java.util.stream.Collectors;
 @Service
 @Service
 public class ClientServiceImpl implements ClientService {
 public class ClientServiceImpl implements ClientService {
 
 
+    @Resource
+    private BasicCourseService basicCourseService;
     @Resource
     @Resource
     private ExamTaskService examTaskService;
     private ExamTaskService examTaskService;
     @Resource
     @Resource
@@ -78,12 +77,12 @@ public class ClientServiceImpl implements ClientService {
     private ClientMapper clientMapper;
     private ClientMapper clientMapper;
 
 
     @Override
     @Override
-    public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
+    public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, Long courseId, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<ClientExamTaskDto> page = new Page<>(pageNumber, pageSize);
         Page<ClientExamTaskDto> page = new Page<>(pageNumber, pageSize);
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        return clientMapper.pageTryTask(page, schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
+        return clientMapper.pageTryTask(page, schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseId, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
     }
     }
 
 
     @Override
     @Override
@@ -94,10 +93,11 @@ public class ClientServiceImpl implements ClientService {
             Long printPlanId = object.getLong("printPlanId");
             Long printPlanId = object.getLong("printPlanId");
             Long examTaskId = object.getLong("examTaskId");
             Long examTaskId = object.getLong("examTaskId");
             ExamTask examTask = examTaskService.getById(examTaskId);
             ExamTask examTask = examTaskService.getById(examTaskId);
+            BasicCourse basicCourse = basicCourseService.getById(examTask.getCourseId());
             Map<String, Object> map = new HashMap<>();
             Map<String, Object> map = new HashMap<>();
             map.put("printPlanId", printPlanId);
             map.put("printPlanId", printPlanId);
-            map.put("courseCode", examTask.getCourseCode());
-            map.put("courseName", examTask.getCourseName());
+            map.put("courseCode", basicCourse.getCode());
+            map.put("courseName", basicCourse.getName());
             map.put("paperNumber", examTask.getPaperNumber());
             map.put("paperNumber", examTask.getPaperNumber());
             List<Map<String, String>> mapList = this.getPaperUrl(schoolId, printPlanId, examTaskId);
             List<Map<String, String>> mapList = this.getPaperUrl(schoolId, printPlanId, examTaskId);
             map.put("list", mapList);
             map.put("list", mapList);
@@ -154,7 +154,7 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public IPage<ClientExamStudentDto> listStudent(Long examDetailId, String studentCode, String studentName, String courseCode, Integer pageNumber, Integer pageSize) {
+    public IPage<ClientExamStudentDto> listStudent(Long examDetailId, String studentCode, String studentName, Long courseId, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         // 撤回提示
         // 撤回提示
         ExamDetail examDetail = examDetailService.getById(examDetailId);
         ExamDetail examDetail = examDetailService.getById(examDetailId);
@@ -163,7 +163,7 @@ public class ClientServiceImpl implements ClientService {
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
         }
         }
         Page<ClientExamStudentDto> page = new Page<>(pageNumber, pageSize);
         Page<ClientExamStudentDto> page = new Page<>(pageNumber, pageSize);
-        return clientMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(studentCode), SystemConstant.translateSpecificSign(studentName), courseCode);
+        return clientMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(studentCode), SystemConstant.translateSpecificSign(studentName), courseId);
     }
     }
 
 
 
 
@@ -217,12 +217,12 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize) {
+    public IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<ClientPrintTaskDto> page = new Page<>(pageNumber, pageSize);
         Page<ClientPrintTaskDto> page = new Page<>(pageNumber, pageSize);
         // 以下状态考场状态不可查询
         // 以下状态考场状态不可查询
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        IPage<ClientPrintTaskDto> clientPrintTaskDtoIPage = clientMapper.listClientPrintTask(page, schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
+        IPage<ClientPrintTaskDto> clientPrintTaskDtoIPage = clientMapper.listClientPrintTask(page, schoolId, semesterId, examId, machineCode, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
         for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
         for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
             // 试卷、题卡
             // 试卷、题卡
             String printContent = record.getPrintContent();
             String printContent = record.getPrintContent();
@@ -454,12 +454,12 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) {
+    public List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
 //        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
 //        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         // 以下状态考场状态不可查询
         // 以下状态考场状态不可查询
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        List<ClientPrintTaskDto> pirntTaskDtoList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
+        List<ClientPrintTaskDto> pirntTaskDtoList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
         // 撤回
         // 撤回
         long count = pirntTaskDtoList.stream().map(m -> {
         long count = pirntTaskDtoList.stream().map(m -> {
             ExamDetail examDetail = examDetailService.getById(m.getExamDetailId());
             ExamDetail examDetail = examDetailService.getById(m.getExamDetailId());
@@ -641,11 +641,11 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass) {
+    public List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, Long courseId, String paperNumber, Boolean isTry, Boolean isPass) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        List<ClientExamTaskDto> clientExamTaskDtos = clientMapper.pageTryTask(schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
+        List<ClientExamTaskDto> clientExamTaskDtos = clientMapper.pageTryTask(schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseId, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
         List<Map<String, Object>> list = new ArrayList<>();
         List<Map<String, Object>> list = new ArrayList<>();
         for (ClientExamTaskDto clientExamTaskDto : clientExamTaskDtos) {
         for (ClientExamTaskDto clientExamTaskDto : clientExamTaskDtos) {
             Map<String, Object> map = new HashMap<>();
             Map<String, Object> map = new HashMap<>();
@@ -661,11 +661,11 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception {
+    public void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         // 以下状态考场状态不可查询
         // 以下状态考场状态不可查询
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        List<ClientPrintTaskDto> printTaskDtoIList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
+        List<ClientPrintTaskDto> printTaskDtoIList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         printTaskDtoIList = printTaskDtoIList.stream().map(m -> {
         printTaskDtoIList = printTaskDtoIList.stream().map(m -> {
             if (m.getExamStartTime() != null) {
             if (m.getExamStartTime() != null) {
@@ -693,10 +693,10 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode) {
+    public ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, Long courseId, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientMapper.clientTaskTotalData(schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode, orgId, examDetailStatus);
+        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientMapper.clientTaskTotalData(schoolId, semesterId, examId, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode, orgId, examDetailStatus);
         if (clientPrintTaskTotalDto != null) {
         if (clientPrintTaskTotalDto != null) {
             // 累计a3,a4
             // 累计a3,a4
             List<ClientPrintData> list = clientPrintDataService.listBySchoolIdAndMachineCode(schoolId, machineCode);
             List<ClientPrintData> list = clientPrintDataService.listBySchoolIdAndMachineCode(schoolId, machineCode);
@@ -722,15 +722,15 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
+    public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<ClientPrintStatisticsDto> page = new Page<>(pageNumber, pageSize);
         Page<ClientPrintStatisticsDto> page = new Page<>(pageNumber, pageSize);
-        return examPrintPlanService.listClientPrintStatistics(page, schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, orgId);
+        return examPrintPlanService.listClientPrintStatistics(page, schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber, orgId);
     }
     }
 
 
     @Override
     @Override
-    public ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber) {
-        return examPrintPlanService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
+    public ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber) {
+        return examPrintPlanService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber);
     }
     }
 
 
     @Override
     @Override
@@ -769,12 +769,12 @@ public class ClientServiceImpl implements ClientService {
     }
     }
 
 
     @Override
     @Override
-    public IPage<PrintSingleDto> getSingleData(Long semesterId, Long examId, Long printPlanId, Long courseCode, Long paperNumber, Integer pageNumber, Integer pageSize) {
+    public IPage<PrintSingleDto> getSingleData(Long semesterId, Long examId, Long printPlanId, Long courseId, Long paperNumber, Integer pageNumber, Integer pageSize) {
         Page<PrintSingleDto> page = new Page<>(pageNumber, pageSize);
         Page<PrintSingleDto> page = new Page<>(pageNumber, pageSize);
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
         String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        IPage<PrintSingleDto> clientExamTaskDtoList = clientMapper.pagePrintSingleData(page, semesterId, examId, printPlanId, courseCode, paperNumber, examDetailStatus);
+        IPage<PrintSingleDto> clientExamTaskDtoList = clientMapper.pagePrintSingleData(page, semesterId, examId, printPlanId, courseId, paperNumber, examDetailStatus);
         for (PrintSingleDto record : clientExamTaskDtoList.getRecords()) {
         for (PrintSingleDto record : clientExamTaskDtoList.getRecords()) {
-            ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamIdAndCourseCodeAndPaperNumber(record.getExamId(), record.getCourseCode(), record.getPaperNumber());
+            ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamIdAndCourseIdAndPaperNumber(record.getExamId(), record.getCourseId(), record.getPaperNumber());
             List<PaperInfoVo> paperInfoVoList = examTaskDetail.getPaperInfoVoList(record.getPaperType());
             List<PaperInfoVo> paperInfoVoList = examTaskDetail.getPaperInfoVoList(record.getPaperType());
             // 试卷
             // 试卷
             List<UrlMd5Dto> paperList = new ArrayList<>();
             List<UrlMd5Dto> paperList = new ArrayList<>();
@@ -957,7 +957,7 @@ public class ClientServiceImpl implements ClientService {
     @Override
     @Override
     public List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId) {
     public List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId) {
         ExamTask examTask = examTaskService.getById(examTaskId);
         ExamTask examTask = examTaskService.getById(examTaskId);
-        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, examTask.getCourseId(), examTask.getPaperNumber());
+        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseIdAndPaperNumber(schoolId, printPlanId, examTask.getCourseId(), examTask.getPaperNumber());
         if (CollectionUtils.isNotEmpty(examDetailCourses)) {
         if (CollectionUtils.isNotEmpty(examDetailCourses)) {
             Set<String> relatePaperTypes = examDetailCourses.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).map(m -> m.getPaperType()).collect(Collectors.toSet());
             Set<String> relatePaperTypes = examDetailCourses.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).map(m -> m.getPaperType()).collect(Collectors.toSet());
             List<Map<String, String>> paperList = new ArrayList<>();
             List<Map<String, String>> paperList = new ArrayList<>();

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

@@ -25,7 +25,7 @@ public class ClientStatusServiceImpl extends ServiceImpl<ClientStatusMapper, Cli
 
 
     @Override
     @Override
     public Boolean tagPass(Long schoolId, Long printPlanId, Long courseId, String courseName, String paperNumber, String machineCode, Boolean isPass, Long userId) {
     public Boolean tagPass(Long schoolId, Long printPlanId, Long courseId, String courseName, String paperNumber, String machineCode, Boolean isPass, Long userId) {
-        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
+        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseIdAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
         long currentTime = System.currentTimeMillis();
         long currentTime = System.currentTimeMillis();
         for (ExamDetailCourse examDetailCours : examDetailCourses) {
         for (ExamDetailCourse examDetailCours : examDetailCourses) {
             QueryWrapper<ClientStatus> queryWrapper = new QueryWrapper<>();
             QueryWrapper<ClientStatus> queryWrapper = new QueryWrapper<>();

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

@@ -17,10 +17,12 @@ import com.qmth.distributed.print.business.service.TeachCourseService;
 import com.qmth.teachcloud.common.bean.result.ExcelResult;
 import com.qmth.teachcloud.common.bean.result.ExcelResult;
 import com.qmth.teachcloud.common.bean.tiku.TikuCourseProperty;
 import com.qmth.teachcloud.common.bean.tiku.TikuCourseProperty;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.kit.TikuUtils;
 import com.qmth.teachcloud.common.kit.TikuUtils;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.util.ConvertUtil;
 import com.qmth.teachcloud.common.util.ConvertUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.codec.digest.DigestUtils;
@@ -48,13 +50,13 @@ import java.util.stream.Stream;
 public class CourseDimensionServiceImpl extends ServiceImpl<CourseDimensionMapper, CourseDimension> implements CourseDimensionService {
 public class CourseDimensionServiceImpl extends ServiceImpl<CourseDimensionMapper, CourseDimension> implements CourseDimensionService {
 
 
     @Resource
     @Resource
-    TeachCourseService teachCourseService;
-
+    private TeachCourseService teachCourseService;
     @Resource
     @Resource
-    BasicExamService basicExamService;
-
+    private BasicExamService basicExamService;
+    @Resource
+    private BasicCourseService basicCourseService;
     @Resource
     @Resource
-    TikuUtils tikuUtils;
+    private TikuUtils tikuUtils;
 
 
     @Transactional
     @Transactional
     @Override
     @Override
@@ -167,7 +169,8 @@ public class CourseDimensionServiceImpl extends ServiceImpl<CourseDimensionMappe
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
         }
         }
         Long examId = teachCourse.getExamId();
         Long examId = teachCourse.getExamId();
-        String courseCode = teachCourse.getCourseCode();
+        BasicCourse basicCourse = basicCourseService.getById(teachCourse.getCourseId());
+        String courseCode = basicCourse.getCode();
         Long schoolId = teachCourse.getSchoolId();
         Long schoolId = teachCourse.getSchoolId();
         BasicExam basicExam = basicExamService.getById(examId);
         BasicExam basicExam = basicExamService.getById(examId);
         if (Objects.isNull(basicExam)) {
         if (Objects.isNull(basicExam)) {

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

@@ -11,6 +11,7 @@ import com.qmth.distributed.print.business.mapper.ExamCardMapper;
 import com.qmth.distributed.print.business.mapper.ExamTaskDetailMapper;
 import com.qmth.distributed.print.business.mapper.ExamTaskDetailMapper;
 import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
 import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
 import com.qmth.distributed.print.business.service.DownloadService;
 import com.qmth.distributed.print.business.service.DownloadService;
+import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
@@ -50,6 +51,8 @@ public class DownloadServiceImpl implements DownloadService {
 
 
     @Resource
     @Resource
     BasicAttachmentMapper basicAttachmentMapper;
     BasicAttachmentMapper basicAttachmentMapper;
+    @Resource
+    ExamTaskService examTaskService;
 
 
     @Resource
     @Resource
     ExamCardMapper examCardMapper;
     ExamCardMapper examCardMapper;
@@ -71,7 +74,7 @@ public class DownloadServiceImpl implements DownloadService {
 
 
     @Override
     @Override
     public void paperDownload(HttpServletResponse response, Long id) throws Exception {
     public void paperDownload(HttpServletResponse response, Long id) throws Exception {
-        ExamTask examTask = examTaskMapper.selectById(id);
+        ExamTask examTask = examTaskService.getByIdIncludeCourse(id);
         QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
         QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, id);
         queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, id);
         ExamTaskDetail examTaskDetail = examTaskDetailMapper.selectOne(queryWrapper);
         ExamTaskDetail examTaskDetail = examTaskDetailMapper.selectOne(queryWrapper);

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

@@ -106,7 +106,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
                     .eq(ExamCard::getTitle, title);
                     .eq(ExamCard::getTitle, title);
             List<ExamCard> examCardList = this.list(queryWrapper);
             List<ExamCard> examCardList = this.list(queryWrapper);
             if (!examCardList.isEmpty()) {
             if (!examCardList.isEmpty()) {
-                throw ExceptionResultEnum.ERROR.exception("课程下已存在相同的题卡名称["+title+"]");
+                throw ExceptionResultEnum.ERROR.exception("课程下已存在相同的题卡名称[" + title + "]");
             }
             }
 
 
             examCard = new ExamCard();
             examCard = new ExamCard();
@@ -378,7 +378,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             copyExamCard.setCreateMethod(null);
             copyExamCard.setCreateMethod(null);
             copyExamCard.setType(CardTypeEnum.CUSTOM);
             copyExamCard.setType(CardTypeEnum.CUSTOM);
         }
         }
-        copyExamCard.setRemark(String.format("来源题卡:%s(%s)", id, examCard.getTitle()));
+        copyExamCard.setCopyCardId(id);
         copyExamCard.setUsed(false);
         copyExamCard.setUsed(false);
         // 生成图片
         // 生成图片
         createJpgImage(copyExamCard);
         createJpgImage(copyExamCard);
@@ -623,4 +623,9 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             }
             }
         }
         }
     }
     }
+
+    @Override
+    public boolean enable(Long id, Boolean enable) {
+        return this.update(new UpdateWrapper<ExamCard>().lambda().eq(ExamCard::getId, id).set(ExamCard::getEnable, enable));
+    }
 }
 }

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

@@ -60,7 +60,7 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
     }
     }
 
 
     @Override
     @Override
-    public List<ExamDetailCourse> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber) {
+    public List<ExamDetailCourse> listByPrintPlanIdAndCourseIdAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber) {
         return this.baseMapper.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
         return this.baseMapper.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
     }
     }
 
 

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

@@ -770,7 +770,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
 
 
     @Override
     @Override
     public List<ExamDetail> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber) {
     public List<ExamDetail> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber) {
-        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
+        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseIdAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
         if (examDetailCourses != null && examDetailCourses.size() > 0) {
         if (examDetailCourses != null && examDetailCourses.size() > 0) {
             Set<Long> examDetailIds = examDetailCourses.stream().map(ExamDetailCourse::getExamDetailId).collect(Collectors.toSet());
             Set<Long> examDetailIds = examDetailCourses.stream().map(ExamDetailCourse::getExamDetailId).collect(Collectors.toSet());
             return this.listByIds(examDetailIds);
             return this.listByIds(examDetailIds);

+ 4 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -289,19 +289,18 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
     }
     }
 
 
     @Override
     @Override
-    public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Long orgId) {
+    public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber, Long orgId) {
         // 以下状态考场状态不可查询
         // 以下状态考场状态不可查询
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), PrintPlanStatusEnum.READY.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), PrintPlanStatusEnum.READY.name()};
-        return this.baseMapper.listClientPrintStatistics(page, schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, orgId, examDetailStatus);
+        return this.baseMapper.listClientPrintStatistics(page, schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber, orgId, examDetailStatus);
     }
     }
 
 
     @Override
     @Override
-    public ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber) {
+    public ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, Long courseId, String paperNumber) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-//        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         // 以下考场状态不可查询
         // 以下考场状态不可查询
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), PrintPlanStatusEnum.READY.name()};
         String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), PrintPlanStatusEnum.READY.name()};
-        ClientPrintStatisticsTotalDto clientPrintStatisticsTotalDto = this.baseMapper.clientStatisticsTotalData(schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, orgId, examDetailStatus);
+        ClientPrintStatisticsTotalDto clientPrintStatisticsTotalDto = this.baseMapper.clientStatisticsTotalData(schoolId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber, orgId, examDetailStatus);
 
 
         if (clientPrintStatisticsTotalDto != null) {
         if (clientPrintStatisticsTotalDto != null) {
             String paperNumberStrs = clientPrintStatisticsTotalDto.getPaperNumberAndType();
             String paperNumberStrs = clientPrintStatisticsTotalDto.getPaperNumberAndType();

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

@@ -124,7 +124,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
                             .in(ExamDetail::getId, examDetailIds);
                             .in(ExamDetail::getId, examDetailIds);
                     examDetailService.update(examDetailUpdateWrapper);
                     examDetailService.update(examDetailUpdateWrapper);
                     // 更新绑定关系
                     // 更新绑定关系
-                    List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(examTask.getSchoolId(), listEntry.getKey(), examTask.getCourseId(), examTask.getPaperNumber());
+                    List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseIdAndPaperNumber(examTask.getSchoolId(), listEntry.getKey(), examTask.getCourseId(), examTask.getPaperNumber());
                     List<Long> examDetailCourseIds = examDetailCourses.stream().map(m -> m.getId()).collect(Collectors.toList());
                     List<Long> examDetailCourseIds = examDetailCourses.stream().map(m -> m.getId()).collect(Collectors.toList());
                     UpdateWrapper<ExamDetailCourse> examDetailCourseUpdateWrapper = new UpdateWrapper<>();
                     UpdateWrapper<ExamDetailCourse> examDetailCourseUpdateWrapper = new UpdateWrapper<>();
                     examDetailCourseUpdateWrapper.lambda()
                     examDetailCourseUpdateWrapper.lambda()
@@ -150,7 +150,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     @Transactional
     @Transactional
     @Override
     @Override
     public boolean updatePaper(RelatePaperParam paperParam) {
     public boolean updatePaper(RelatePaperParam paperParam) {
-        ExamTask examTask = examTaskService.getById(paperParam.getExamTaskId());
+        ExamTask examTask = examTaskService.getByIdIncludeCourse(paperParam.getExamTaskId());
         // 提交印刷的考场,不允许修改关联试卷
         // 提交印刷的考场,不允许修改关联试卷
         List<ExamDetail> examDetails = examDetailService.listByPrintPlanIdAndCourseCodeAndPaperNumber(examTask.getSchoolId(), paperParam.getPrintPlanId(), examTask.getCourseId(), examTask.getPaperNumber());
         List<ExamDetail> examDetails = examDetailService.listByPrintPlanIdAndCourseCodeAndPaperNumber(examTask.getSchoolId(), paperParam.getPrintPlanId(), examTask.getCourseId(), examTask.getPaperNumber());
         List<ExamDetail> examDetailsPrint = examDetails.stream().filter(m -> !ExamDetailStatusEnum.NEW.equals(m.getStatus()) && !ExamDetailStatusEnum.READY.equals(m.getStatus())).collect(Collectors.toList());
         List<ExamDetail> examDetailsPrint = examDetails.stream().filter(m -> !ExamDetailStatusEnum.NEW.equals(m.getStatus()) && !ExamDetailStatusEnum.READY.equals(m.getStatus())).collect(Collectors.toList());
@@ -173,7 +173,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         }
         }
 
 
         // 更新命题任务中关联卷型
         // 更新命题任务中关联卷型
-        ExamTask newExamTask = examTaskService.getByExamIdAndCourseCodeAndPaperNumber(examTask.getExamId(), examTask.getCourseCode(), paperParam.getPaperNumber());
+        ExamTask newExamTask = examTaskService.getByExamIdAndCourseIdAndPaperNumber(examTask.getExamId(), examTask.getCourseId(), paperParam.getPaperNumber());
         UpdateWrapper<ExamTaskDetail> updateWrapper = new UpdateWrapper<>();
         UpdateWrapper<ExamTaskDetail> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().set(ExamTaskDetail::getRelatePaperType, paperParam.getRelatePaperType()).eq(ExamTaskDetail::getExamTaskId, newExamTask.getId());
         updateWrapper.lambda().set(ExamTaskDetail::getRelatePaperType, paperParam.getRelatePaperType()).eq(ExamTaskDetail::getExamTaskId, newExamTask.getId());
         this.update(updateWrapper);
         this.update(updateWrapper);
@@ -312,7 +312,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
             stringJoiner.add(String.valueOf(examDetails.get(0).getSchoolId()))
             stringJoiner.add(String.valueOf(examDetails.get(0).getSchoolId()))
                     .add(String.valueOf(examDetails.get(0).getExamStartTime()))
                     .add(String.valueOf(examDetails.get(0).getExamStartTime()))
                     .add(String.valueOf(examDetails.get(0).getExamEndTime()))
                     .add(String.valueOf(examDetails.get(0).getExamEndTime()))
-                    .add(examTask.getCourseCode())
+                    .add(String.valueOf(examTask.getCourseId()))
                     .add(examTask.getPaperNumber());
                     .add(examTask.getPaperNumber());
             String key = stringJoiner.toString();
             String key = stringJoiner.toString();
             CreatePdfCacheUtil.deletePaperType(key);
             CreatePdfCacheUtil.deletePaperType(key);
@@ -505,7 +505,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
 
 
     @Override
     @Override
     public ExamTaskDetail getByExamTaskId(Long examTaskId) {
     public ExamTaskDetail getByExamTaskId(Long examTaskId) {
-        ExamTask examTask = examTaskService.getById(examTaskId);
+        ExamTask examTask = examTaskService.getByIdIncludeCourse(examTaskId);
         if (examTask == null) {
         if (examTask == null) {
             throw ExceptionResultEnum.ERROR.exception("命题任务不存在");
             throw ExceptionResultEnum.ERROR.exception("命题任务不存在");
         }
         }

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

@@ -309,9 +309,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 examTask.setPaperNumber(paperNumber);
                 examTask.setPaperNumber(paperNumber);
             }
             }
 
 
-            String sequence = printCommonService.createCourseSequence(schoolId, examTask.getCourseCode());
-            examTask.setSequence(sequence);
-
             examTask.insertInfo(sysUser.getId());
             examTask.insertInfo(sysUser.getId());
             examTask.updateInfo(sysUser.getId());
             examTask.updateInfo(sysUser.getId());
 
 
@@ -571,15 +568,11 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
 
             ExamTask examTask = new ExamTask();
             ExamTask examTask = new ExamTask();
             examTask.setSchoolId(task.getSchoolId());
             examTask.setSchoolId(task.getSchoolId());
-            examTask.setOrgId(basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, courseCode));
             examTask.setCourseCode(userMap.get("courseCode"));
             examTask.setCourseCode(userMap.get("courseCode"));
             examTask.setCourseName(userMap.get("courseName"));
             examTask.setCourseName(userMap.get("courseName"));
             examTask.setExamId(examId);
             examTask.setExamId(examId);
             examTask.setCardRuleId(cardRuleId);
             examTask.setCardRuleId(cardRuleId);
 
 
-            String sequence = printCommonService.createCourseSequence(schoolId, examTask.getCourseCode());
-            examTask.setSequence(sequence);
-
             String paperNumber = userMap.get("paperNumber");
             String paperNumber = userMap.get("paperNumber");
             if (StringUtils.isNotBlank(paperNumber)) {
             if (StringUtils.isNotBlank(paperNumber)) {
                 QueryWrapper<ExamTask> taskQueryWrapper = new QueryWrapper<>();
                 QueryWrapper<ExamTask> taskQueryWrapper = new QueryWrapper<>();
@@ -602,9 +595,8 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             examTask.insertInfo(sysUser.getId());
             examTask.insertInfo(sysUser.getId());
 
 
             // 取课程所在机构
             // 取课程所在机构
-            Long teachingRoomId = basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, examTask.getCourseCode());
-            examTask.setOrgId(teachingRoomId);
-            examTask.setTeachingRoomId(teachingRoomId);
+            BasicCourse basicCourse = basicCourseService.getById(examTask.getCourseId());
+            examTask.setTeachingRoomId(basicCourse.getTeachingRoomId());
 
 
             String userId = userMap.get("userId");
             String userId = userMap.get("userId");
             if (userId != null && userId.length() > 0 && !userId.equals("null")) {
             if (userId != null && userId.length() > 0 && !userId.equals("null")) {
@@ -1941,58 +1933,43 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             //组装exam_detail_course数据
             //组装exam_detail_course数据
             List<Map<String, Object>> examDetailCourseKeyList = examDetailStudentList.stream().flatMap(e -> {
             List<Map<String, Object>> examDetailCourseKeyList = examDetailStudentList.stream().flatMap(e -> {
                 Map<String, Object> examDetailCourseMap = new HashMap<>();
                 Map<String, Object> examDetailCourseMap = new HashMap<>();
-                examDetailCourseMap.put("courseCode", e.getCourseCode());
+                examDetailCourseMap.put("courseId", e.getCourseId());
                 examDetailCourseMap.put("paperNumber", e.getPaperNumber());
                 examDetailCourseMap.put("paperNumber", e.getPaperNumber());
                 return Stream.of(examDetailCourseMap);
                 return Stream.of(examDetailCourseMap);
             }).distinct().collect(Collectors.toList());
             }).distinct().collect(Collectors.toList());
 
 
 
 
             for (Map<String, Object> examDetailCourseMap : examDetailCourseKeyList) {
             for (Map<String, Object> examDetailCourseMap : examDetailCourseKeyList) {
-                String courseCode = String.valueOf(examDetailCourseMap.get("courseCode"));
+                Long courseId = Long.valueOf(String.valueOf(examDetailCourseMap.get("courseId")));
                 String paperNumber = String.valueOf(examDetailCourseMap.get("paperNumber"));
                 String paperNumber = String.valueOf(examDetailCourseMap.get("paperNumber"));
 
 
                 // 获取该科目下的考生人数
                 // 获取该科目下的考生人数
-                List<BasicExamStudent> examDetailCourseStudentList = examDetailStudentList.stream().filter(e -> e.getCourseCode().equals(courseCode) &&
+                List<BasicExamStudent> examDetailCourseStudentList = examDetailStudentList.stream().filter(e -> e.getCourseId().equals(courseId) &&
                         e.getPaperNumber().equals(paperNumber)).collect(Collectors.toList());
                         e.getPaperNumber().equals(paperNumber)).collect(Collectors.toList());
 
 
                 ExamDetailCourse examDetailCourse = new ExamDetailCourse();
                 ExamDetailCourse examDetailCourse = new ExamDetailCourse();
                 examDetailCourse.setId(SystemConstant.getDbUuid());
                 examDetailCourse.setId(SystemConstant.getDbUuid());
                 examDetailCourse.setSchoolId(schoolId);
                 examDetailCourse.setSchoolId(schoolId);
                 examDetailCourse.setExamDetailId(examDetail.getId());
                 examDetailCourse.setExamDetailId(examDetail.getId());
-                examDetailCourse.setCourseCode(courseCode);
+                examDetailCourse.setCourseId(courseId);
                 examDetailCourse.setCourseName(examTask.getCourseName());
                 examDetailCourse.setCourseName(examTask.getCourseName());
                 examDetailCourse.setPaperNumber(paperNumber);
                 examDetailCourse.setPaperNumber(paperNumber);
-                examDetailCourse.setCoursePaperId(courseCode.concat(examTask.getSequence()));
+                examDetailCourse.setCoursePaperId(String.valueOf(examTask.getId()));
                 examDetailCourse.setTotalSubjects(examDetailCourseStudentList.size());
                 examDetailCourse.setTotalSubjects(examDetailCourseStudentList.size());
                 examDetailCourse.setCreateId(sysUser.getId());
                 examDetailCourse.setCreateId(sysUser.getId());
-                Set<Long> teachClazzIds = examDetailCourseStudentList.stream().filter(m -> m.getClazzId() != null).map(BasicExamStudent::getClazzId).collect(Collectors.toSet());
-                List<BasicTeachClazz> basicTeachClazzes = basicTeachClazzService.listByIds(teachClazzIds);
-                if (CollectionUtils.isNotEmpty(basicTeachClazzes)) {
-                    examDetailCourse.setClazzName(basicTeachClazzes.stream().map(BasicTeachClazz::getClazzName).collect(Collectors.joining(",")));
-                }
                 examDetailCourseService.save(examDetailCourse);
                 examDetailCourseService.save(examDetailCourse);
 
 
                 //组装exam_student数据
                 //组装exam_student数据
                 List<ExamStudent> examStudentList = new ArrayList<>();
                 List<ExamStudent> examStudentList = new ArrayList<>();
-                AtomicInteger atomicInteger = new AtomicInteger(1);
                 for (BasicExamStudent basicExamStudent : examDetailCourseStudentList) {
                 for (BasicExamStudent basicExamStudent : examDetailCourseStudentList) {
                     ExamStudent examStudent = new ExamStudent();
                     ExamStudent examStudent = new ExamStudent();
                     examStudent.setId(SystemConstant.getDbUuid());
                     examStudent.setId(SystemConstant.getDbUuid());
                     examStudent.setSchoolId(schoolId);
                     examStudent.setSchoolId(schoolId);
-                    examStudent.setOrgId(sysUser.getOrgId());
                     examStudent.setExamId(examTask.getExamId());
                     examStudent.setExamId(examTask.getExamId());
+                    examStudent.setStudentId(basicExamStudent.getId());
                     examStudent.setExamDetailCourseId(examDetailCourse.getId());
                     examStudent.setExamDetailCourseId(examDetailCourse.getId());
                     examStudent.setPaperNumber(paperNumber);
                     examStudent.setPaperNumber(paperNumber);
                     examStudent.setCoursePaperId(examDetailCourse.getCoursePaperId());
                     examStudent.setCoursePaperId(examDetailCourse.getCoursePaperId());
-                    examStudent.setStudentCode(basicExamStudent.getStudentCode());
-                    examStudent.setStudentName(basicExamStudent.getStudentName());
-                    examStudent.setSiteNumber(String.valueOf(atomicInteger.getAndIncrement()));
-                    examStudent.setCollegeName(basicExamStudent.getCollegeName());
-                    examStudent.setMajorName(basicExamStudent.getMajorName());
-                    examStudent.setTeacherId(basicExamStudent.getTeacherId());
-                    BasicTeachClazz basicTeachClazz = basicTeachClazzService.getById(basicExamStudent.getClazzId());
-                    examStudent.setTeachClazzId(basicExamStudent.getClazzId());
-                    examStudent.setTeachClazzName(basicTeachClazz != null ? basicTeachClazz.getClazzName() : null);
                     examStudent.setCreateId(sysUser.getId());
                     examStudent.setCreateId(sysUser.getId());
                     examStudentList.add(examStudent);
                     examStudentList.add(examStudent);
                 }
                 }
@@ -2018,6 +1995,19 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
     }
     }
 
 
+    @Override
+    public ExamTask getByIdIncludeCourse(Long examTaskId) {
+        ExamTask examTask = this.getById(examTaskId);
+        if(examTask != null && examTask.getCourseId() != null){
+            BasicCourse basicCourse = basicCourseService.getById(examTask.getCourseId());
+            if(basicCourse != null){
+                examTask.setCourseCode(basicCourse.getCode());
+                examTask.setCourseName(basicCourse.getName());
+            }
+        }
+        return examTask;
+    }
+
     private ExamTaskPaperData saveTikuPaperData(Long examId, Long paperId, String uuid, File zipFile) {
     private ExamTaskPaperData saveTikuPaperData(Long examId, Long paperId, String uuid, File zipFile) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         String zipDestPath = null;
         String zipDestPath = null;

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

@@ -140,143 +140,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
     @Lazy
     @Lazy
     private TCPaperStructService tcPaperStructService;
     private TCPaperStructService tcPaperStructService;
 
 
-    /**
-     * 保存附件
-     *
-     * @param classifyEnum
-     * @param examDetail
-     * @param basicAttachment
-     * @param pdfList
-     * @param printCount
-     * @param sequence
-     * @return
-     */
-    @Override
-    @Transactional
-    public BasicAttachment saveAttachmentPdf(ClassifyEnum classifyEnum, ExamDetail examDetail, BasicAttachment basicAttachment, List<PdfDto> pdfList, Integer printCount, Integer sequence) {
-        File htmlFileTemp = null;
-        try {
-            boolean oss = dictionaryConfig.sysDomain().isOss();
-            JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
-            String type = basicAttachment.getType(), filePath = null, url = null, ossStr = null;
-            File htmlFile = null;
-
-            StringJoiner pdfStringJoiner = new StringJoiner("");
-            if (Objects.nonNull(type) && Objects.equals(type, SystemConstant.HTML_PREFIX)) {
-                filePath = (String) jsonObject.get(SystemConstant.PATH);
-                UploadFileEnum uploadType = Enum.valueOf(UploadFileEnum.class, (String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
-                if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                    ossStr = oss ? SystemConstant.OSS : SystemConstant.LOCAL;
-                    htmlFileTemp = SystemConstant.getFileTempVar(SystemConstant.HTML_PREFIX);
-
-                    htmlFile = fileStoreUtil.ossDownload(filePath, htmlFileTemp, uploadType.getFssType());
-                } else {
-                    ossStr = SystemConstant.LOCAL;
-                    if (Objects.nonNull(dictionaryConfig.fssPublicDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPublicDomain().getConfig()) && filePath.contains(dictionaryConfig.fssPublicDomain().getConfig())) {
-                        htmlFile = new File(filePath);
-                    } else {
-                        htmlFileTemp = SystemConstant.getFileTempVar(SystemConstant.HTML_PREFIX);
-                        htmlFile = fileStoreUtil.ossDownload(filePath, htmlFileTemp, uploadType.getFssType());
-                    }
-                    if (Objects.nonNull(dictionaryConfig.fssPrivateDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPrivateDomain().getConfig()) && !dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT)) {
-                        pdfStringJoiner.add(dictionaryConfig.fssPrivateDomain().getConfig()).add(File.separator);
-                    }
-                }
-            }
-
-            pdfStringJoiner = SystemConstant.getDirName(pdfStringJoiner, UploadFileEnum.PDF, true);
-            pdfStringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.PDF_PREFIX);
-            String pdfDirName = pdfStringJoiner.toString();
-            File pdfFileTemp = SystemConstant.getFileTempVar(SystemConstant.PDF_PREFIX);
-            HtmlToPdfUtil.convert(htmlFile.getPath(), pdfFileTemp.getPath(), PageSizeEnum.A4);
-
-            String htmlFileMd5 = DigestUtils.md5Hex(new FileInputStream(htmlFile));
-            String pdfFileMd5 = DigestUtils.md5Hex(new FileInputStream(pdfFileTemp));
-            if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                fileStoreUtil.ossUpload(pdfDirName, pdfFileTemp, pdfFileMd5, fileStoreUtil.getUploadEnumByPath(pdfDirName).getFssType());
-            } else {
-                fileStoreUtil.localUpload(pdfDirName, new FileInputStream(pdfFileTemp), pdfFileMd5, LocalCatalogEnum.LOCAL_PDF);
-            }
-
-            PdfDto pdfDto = PdfUtil.addPdfPage(pdfFileTemp);
-            PrintPathVo printPathVo = new PrintPathVo(classifyEnum, UploadFileEnum.PDF, ossStr, pdfDirName, pdfFileMd5, filePath, htmlFileMd5);
-            examDetail.setAttachmentPath(parseAttachmentPath(examDetail.getAttachmentPath(), printPathVo));
-            basicAttachment.setPages(pdfDto.getActualPageCount());
-            for (int i = 0; i < printCount; i++) {
-                pdfList.add(new PdfDto(pdfFileTemp.getPath(), PageSizeEnum.A4, pdfDto.getPageCount(), sequence));
-            }
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        } finally {
-            if (htmlFileTemp != null) {
-                FileUtil.deleteFile(htmlFileTemp);
-            }
-        }
-        return basicAttachment;
-    }
-
-    /**
-     * 保存附件
-     *
-     * @param examDetail
-     * @param pdfList
-     * @param printCount
-     * @param fileTempList
-     */
-    @Override
-    @Transactional
-    public void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, List<PdfDto> pdfList, Integer printCount, List<File> fileTempList, BasicTemplate basicTemplate) {
-        try {
-            boolean oss = dictionaryConfig.sysDomain().isOss();
-            StringJoiner pdfStringJoiner = new StringJoiner("");
-            String ossStr = null;
-            if (!oss && Objects.nonNull(dictionaryConfig.fssPrivateDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPrivateDomain().getConfig()) && !dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT)) {
-                pdfStringJoiner.add(dictionaryConfig.fssPrivateDomain().getConfig()).add(File.separator);
-            }
-            pdfStringJoiner = SystemConstant.getDirName(pdfStringJoiner, UploadFileEnum.PDF, true);
-            pdfStringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.PDF_PREFIX);
-
-            File pdfFileTemp = SystemConstant.getFileTempVar(SystemConstant.PDF_PREFIX);
-            fileTempList.add(pdfFileTemp);
-            pdfFileTemp = createPrintPdfUtil.createSignPdf(pdfFillDto, pdfFileTemp.getPath(), basicTemplate);
-            // 校验签到表是否自动分页。2页及以上的pdf,每页后面都需要补一个空白页
-            // 补空白页
-            if (basicTemplate != null && basicTemplate.getAddBlankPage()) {
-                // 补空白页
-                PdfUtil.addPdfEmptyPage(pdfFileTemp);
-            }
-
-            String pdfDirName = FileUtil.replaceSplit(pdfStringJoiner.toString());
-            //pdf生成和上传
-            String pdfFileMd5 = DigestUtils.md5Hex(new FileInputStream(pdfFileTemp));
-            if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                ossStr = oss ? SystemConstant.OSS : SystemConstant.LOCAL;
-                fileStoreUtil.ossUpload(pdfDirName, pdfFileTemp, pdfFileMd5, fileStoreUtil.getUploadEnumByPath(pdfDirName).getFssType());
-            } else {
-                ossStr = SystemConstant.LOCAL;
-                fileStoreUtil.localUpload(pdfDirName, new FileInputStream(pdfFileTemp), pdfFileMd5, LocalCatalogEnum.LOCAL_PDF);
-            }
-            PdfDto pdfDto = PdfUtil.addPdfPage(pdfFileTemp);
-            PrintPathVo printPathVo = new PrintPathVo(ClassifyEnum.SIGN, UploadFileEnum.PDF, ossStr, pdfDirName, pdfFileMd5, null, null);
-            examDetail.setAttachmentPath(parseAttachmentPath(examDetail.getAttachmentPath(), printPathVo));
-            for (int i = 0; i < printCount; i++) {
-                pdfList.add(new PdfDto(pdfFileTemp.getPath(), PageSizeEnum.A4, pdfDto.getPageCount(), 2));
-            }
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-    }
-
     @Override
     @Override
     @Transactional
     @Transactional
     public void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, Integer printCount, BasicTemplate basicTemplate) {
     public void saveAttachmentSignPdf(PdfSignDto pdfFillDto, ExamDetail examDetail, Integer printCount, BasicTemplate basicTemplate) {
@@ -524,93 +387,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         tcPaperStructService.getPaperStructImportLock(examId, courseCode, paperNumber, teachCourseId);
         tcPaperStructService.getPaperStructImportLock(examId, courseCode, paperNumber, teachCourseId);
     }
     }
 
 
-    /**
-     * 保存html附件
-     *
-     * @param fileName
-     * @param htmlContent
-     * @param userId
-     * @param localFileList
-     * @param fileTempList
-     * @return
-     * @throws IOException
-     */
-    @Override
-    @Transactional
-    public BasicAttachment saveAttachmentHtml(String fileName, String htmlContent, Long userId, List<PdfDto> localFileList, List<File> fileTempList) throws IOException {
-        BasicAttachment basicAttachment = null;
-        PdfDto pdfDto = null;
-        try {
-            File htmlFileTemp = SystemConstant.getFileTempVar(SystemConstant.HTML_PREFIX);
-            File pdfFileTemp = SystemConstant.getFileTempVar(SystemConstant.PDF_PREFIX);
-            fileTempList.add(htmlFileTemp);
-            fileTempList.add(pdfFileTemp);
-
-            FileCopyUtils.copy(htmlContent.getBytes(StandardCharsets.UTF_8), htmlFileTemp);
-            boolean oss = dictionaryConfig.sysDomain().isOss();
-            StringJoiner stringJoiner = new StringJoiner("");
-            StringJoiner pdfStringJoiner = new StringJoiner("");
-            if (!oss && Objects.nonNull(dictionaryConfig.fssPublicDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPublicDomain().getConfig()) && !dictionaryConfig.fssPublicDomain().getConfig().startsWith(SystemConstant.START_PARENT)) {
-                stringJoiner.add(dictionaryConfig.fssPublicDomain().getConfig()).add(File.separator);
-            }
-            if (!oss && Objects.nonNull(dictionaryConfig.fssPrivateDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPrivateDomain().getConfig()) && !dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT)) {
-                pdfStringJoiner.add(dictionaryConfig.fssPrivateDomain().getConfig()).add(File.separator);
-            }
-            stringJoiner = SystemConstant.getDirName(stringJoiner, UploadFileEnum.HTML, true);
-            stringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.HTML_PREFIX);
-
-            pdfStringJoiner = SystemConstant.getDirName(pdfStringJoiner, UploadFileEnum.PDF, true);
-            pdfStringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.PDF_PREFIX);
-
-            JSONObject jsonObject = new JSONObject();
-            String htmlDirName = FileUtil.replaceSplit(stringJoiner.toString());
-            String pdfDirName = FileUtil.replaceSplit(pdfStringJoiner.toString());
-
-            //html生成和上传
-            String htmlFileMd5 = DigestUtils.md5Hex(new FileInputStream(htmlFileTemp));
-            if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                jsonObject.put(SystemConstant.TYPE, oss ? SystemConstant.OSS : SystemConstant.LOCAL);
-                fileStoreUtil.ossUpload(htmlDirName, htmlFileTemp, htmlFileMd5, fileStoreUtil.getUploadEnumByPath(htmlDirName).getFssType());
-            } else {
-                fileStoreUtil.localUpload(htmlDirName, new FileInputStream(htmlFileTemp), htmlFileMd5, LocalCatalogEnum.LOCAL_FILE);
-                jsonObject.put(SystemConstant.TYPE, SystemConstant.LOCAL);
-            }
-            jsonObject.put(SystemConstant.HTML_PATH, htmlDirName);
-
-            HtmlToPdfUtil.convert(htmlFileTemp.getPath(), pdfFileTemp.getPath(), PageSizeEnum.A3);
-
-            //pdf生成和上传
-            String pdfFileMd5 = DigestUtils.md5Hex(new FileInputStream(pdfFileTemp));
-            if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                fileStoreUtil.ossUpload(pdfDirName, pdfFileTemp, pdfFileMd5, fileStoreUtil.getUploadEnumByPath(pdfDirName).getFssType());
-            } else {
-                fileStoreUtil.localUpload(pdfDirName, new FileInputStream(pdfFileTemp), pdfFileMd5, LocalCatalogEnum.LOCAL_PDF);
-            }
-
-            pdfDto = PdfUtil.addPdfPage(pdfFileTemp);
-            localFileList.add(new PdfDto(pdfFileTemp.getPath(), PageSizeEnum.A3, pdfDto.getPageCount()));
-            jsonObject.put(SystemConstant.PATH, pdfDirName);
-            jsonObject.put("htmlMd5", htmlFileMd5);
-            jsonObject.put("pdfMd5", pdfFileMd5);
-
-            jsonObject.put(SystemConstant.UPLOAD_TYPE, new UploadFileEnum[]{
-                    UploadFileEnum.HTML, UploadFileEnum.PDF
-            });
-            basicAttachment = new BasicAttachment(jsonObject.toJSONString(), fileName, SystemConstant.HTML_PREFIX, new BigDecimal(htmlContent.getBytes(StandardCharsets.UTF_8).length), htmlFileMd5, userId);
-            basicAttachment.setPages(pdfDto.getActualPageCount());
-            basicAttachmentService.save(basicAttachment);
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            basicAttachmentService.deleteAttachment(basicAttachment);
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-        return basicAttachment;
-    }
-
     /**
     /**
      * 保存html附件
      * 保存html附件
      *
      *
@@ -883,25 +659,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         return saveAttachmentCommon(file, md5, type, null);
         return saveAttachmentCommon(file, md5, type, null);
     }
     }
 
 
-    /**
-     * 分页查询
-     *
-     * @param code
-     * @param name
-     * @param pageNumber
-     * @param pageSize
-     * @return
-     */
-    @Override
-    public IPage<BasicCourse> list(String code, String name, Integer pageNumber, Integer pageSize) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        code = SystemConstant.translateSpecificSign(code);
-        name = SystemConstant.translateSpecificSign(name);
-        Page<BasicCourse> page = new Page<>(pageNumber, pageSize);
-        IPage<BasicCourse> courseIPage = basicCourseMapper.listPage(page, schoolId, SystemConstant.translateSpecificSign(code), SystemConstant.translateSpecificSign(name));
-        return courseIPage;
-    }
-
     /**
     /**
      * 科目查询
      * 科目查询
      *
      *
@@ -1288,31 +1045,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         return Objects.nonNull(jsonObject) ? jsonObject.toJSONString() : null;
         return Objects.nonNull(jsonObject) ? jsonObject.toJSONString() : null;
     }
     }
 
 
-    @Override
-    public String createCourseSequence(Long schoolId, String courseCode) {
-        boolean lock = redisUtil.lock(SystemConstant.REDIS_LOCK_COURSE_CODE_SEQUENCE_PREFIX + schoolId + "-" + courseCode, SystemConstant.REDIS_LOCK_PAPER_NUMBER_TIME_OUT);
-        if (!lock) {
-            throw ExceptionResultEnum.ERROR.exception("正在生成课程编号中,请稍候再试!");
-        }
-        try {
-            String sequence = commonCacheService.addExamTaskSequence(schoolId, courseCode);
-            if ("0".equals(sequence)) {
-                QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
-                queryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getCourseCode, courseCode);
-                List<ExamTask> examTasks = examTaskService.list(queryWrapper);
-                if (examTasks != null && examTasks.size() > 0) {
-                    String maxSequence = examTasks.stream().max(Comparator.comparing(ExamTask::getSequence)).get().getSequence();
-                    if (StringUtils.isNotBlank(maxSequence)) {
-                        sequence = maxSequence;
-                    }
-                }
-            }
-            return commonCacheService.updateExamTaskSequence(schoolId, courseCode, sequence);
-        } finally {
-            redisUtil.releaseCourseSequenceLock(SystemConstant.REDIS_LOCK_COURSE_CODE_SEQUENCE_PREFIX + schoolId + "-" + courseCode);
-        }
-    }
-
     @Override
     @Override
     public void updateGradeBatchStatus(Long schoolId, Long examId, String paperNumber, String paperType) {
     public void updateGradeBatchStatus(Long schoolId, Long examId, String paperNumber, String paperType) {
         QueryWrapper<GradeBatchPaper> gradeBatchPaperQueryWrapper = new QueryWrapper<>();
         QueryWrapper<GradeBatchPaper> gradeBatchPaperQueryWrapper = new QueryWrapper<>();
@@ -1339,58 +1071,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         }
         }
     }
     }
 
 
-    /**
-     * 生成卷袋贴
-     *
-     * @param pdfPackageDto
-     * @param examDetail
-     * @param pdfList
-     * @param printCount
-     * @param fileTempList
-     */
-    @Override
-    public void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, List<PdfDto> pdfList, Integer printCount, List<File> fileTempList) {
-        try {
-            boolean oss = dictionaryConfig.sysDomain().isOss();
-            StringJoiner pdfStringJoiner = new StringJoiner("");
-            String ossStr = null;
-            if (!oss && Objects.nonNull(dictionaryConfig.fssPrivateDomain()) && !StringUtils.isBlank(dictionaryConfig.fssPrivateDomain().getConfig()) && !dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT)) {
-                pdfStringJoiner.add(dictionaryConfig.fssPrivateDomain().getConfig()).add(File.separator);
-            }
-            pdfStringJoiner = SystemConstant.getDirName(pdfStringJoiner, UploadFileEnum.PDF, true);
-            pdfStringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.PDF_PREFIX);
-
-            String pdfDirName = FileUtil.replaceSplit(pdfStringJoiner.toString());
-            File pdfFileTemp = SystemConstant.getFileTempVar(SystemConstant.PDF_PREFIX);
-            fileTempList.add(pdfFileTemp);
-            createPrintPdfUtil.createPackagePdf(pdfPackageDto, pdfFileTemp.getPath());
-            //pdf生成和上传
-            String pdfFileMd5 = DigestUtils.md5Hex(new FileInputStream(pdfFileTemp));
-            if (oss || (!oss && dictionaryConfig.fssPrivateDomain().getConfig().startsWith(SystemConstant.START_PARENT))) {
-                ossStr = oss ? SystemConstant.OSS : SystemConstant.LOCAL;
-                fileStoreUtil.ossUpload(pdfDirName, pdfFileTemp, pdfFileMd5, fileStoreUtil.getUploadEnumByPath(pdfDirName).getFssType());
-            } else {
-                ossStr = SystemConstant.LOCAL;
-                fileStoreUtil.localUpload(pdfDirName, new FileInputStream(pdfFileTemp), pdfFileMd5, LocalCatalogEnum.LOCAL_PDF);
-            }
-
-            PdfDto pdfDto = PdfUtil.addPdfPage(pdfFileTemp);
-            PrintPathVo printPathVo = new PrintPathVo(ClassifyEnum.PACKAGE, UploadFileEnum.PDF, ossStr, pdfDirName, pdfFileMd5, null, null);
-            examDetail.setAttachmentPath(parseAttachmentPath(examDetail.getAttachmentPath(), printPathVo));
-
-            for (int i = 0; i < printCount; i++) {
-                pdfList.add(new PdfDto(pdfFileTemp.getPath(), PageSizeEnum.A4, pdfDto.getPageCount(), 2));
-            }
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-    }
-
     @Override
     @Override
     public void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, Integer printCount) {
     public void saveAttachmentPackagePdf(PdfPackageDto pdfPackageDto, ExamDetail examDetail, Integer printCount) {
         File pdfFileTemp = null;
         File pdfFileTemp = null;

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

@@ -68,11 +68,11 @@ public class TPMatrixServiceImpl extends ServiceImpl<TPMatrixMapper, TPMatrix> i
         if (CollectionUtils.isNotEmpty(tpMatrixList)) {
         if (CollectionUtils.isNotEmpty(tpMatrixList)) {
             List<SysPrivilege> sysPrivileges = sysPrivilegeService.getClientUrlByUserId(sysUser.getId());
             List<SysPrivilege> sysPrivileges = sysPrivilegeService.getClientUrlByUserId(sysUser.getId());
             boolean canEditCourse = sysPrivileges.stream().filter(m -> m.getId() == 2056L && "canEditCourse".equals(m.getUrl())).count() > 0;
             boolean canEditCourse = sysPrivileges.stream().filter(m -> m.getId() == 2056L && "canEditCourse".equals(m.getUrl())).count() > 0;
-            List<String> codeList = new ArrayList<>();
+            List<Long> codeList = new ArrayList<>();
             if (!canEditCourse) {
             if (!canEditCourse) {
                 List<TeachCourse> teachCourseList = teachCourseService.list(new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getUserId, sysUser.getId()));
                 List<TeachCourse> teachCourseList = teachCourseService.list(new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getUserId, sysUser.getId()));
                 if (CollectionUtils.isNotEmpty(teachCourseList)) {
                 if (CollectionUtils.isNotEmpty(teachCourseList)) {
-                    codeList = teachCourseList.stream().map(TeachCourse::getCourseCode).distinct().collect(Collectors.toList());
+                    codeList = teachCourseList.stream().map(TeachCourse::getCourseId).distinct().collect(Collectors.toList());
                 }
                 }
             }
             }
 
 
@@ -81,13 +81,13 @@ public class TPMatrixServiceImpl extends ServiceImpl<TPMatrixMapper, TPMatrix> i
             for (TPMatrix tpMatrix : tpMatrixList) {
             for (TPMatrix tpMatrix : tpMatrixList) {
                 courseMap.add(tpMatrix.getCourseId(), tpMatrix);
                 courseMap.add(tpMatrix.getCourseId(), tpMatrix);
             }
             }
-            List<String> finalCodeList = codeList;
+            List<Long> finalCodeList = codeList;
             courseMap.entrySet().stream().forEach(entry -> {
             courseMap.entrySet().stream().forEach(entry -> {
                 TPCourse tpCourse = tpCourseService.getById(entry.getKey());
                 TPCourse tpCourse = tpCourseService.getById(entry.getKey());
                 MatrixDto matrixDto = new MatrixDto();
                 MatrixDto matrixDto = new MatrixDto();
                 matrixDto.setCourseCode(tpCourse.getCourseCode());
                 matrixDto.setCourseCode(tpCourse.getCourseCode());
                 matrixDto.setCourseName(tpCourse.getCourseName());
                 matrixDto.setCourseName(tpCourse.getCourseName());
-                matrixDto.setCanEdit(canEditCourse || finalCodeList.contains(tpCourse.getCourseCode()));
+                matrixDto.setCanEdit(canEditCourse || finalCodeList.contains(tpCourse.getCourseId()));
                 List<MatrixRequirementDto> matrixRequirementDtoList = new ArrayList<>();
                 List<MatrixRequirementDto> matrixRequirementDtoList = new ArrayList<>();
                 LinkedMultiValueMap<Long, TPMatrix> requirementMap = new LinkedMultiValueMap<>();
                 LinkedMultiValueMap<Long, TPMatrix> requirementMap = new LinkedMultiValueMap<>();
                 for (TPMatrix tpMatrix : entry.getValue()) {
                 for (TPMatrix tpMatrix : entry.getValue()) {

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

@@ -56,10 +56,10 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
         }
         }
         Long examId = teachCourse.getExamId();
         Long examId = teachCourse.getExamId();
-        String courseCode = teachCourse.getCourseCode();
+        Long courseId = teachCourse.getCourseId();
 
 
         Long leaderId = teachCourse.getCreateId();
         Long leaderId = teachCourse.getCreateId();
-        TeachCourse leaderTeachCourse = teachCourseService.findByExamIdCourseCodeAndUserId(examId, courseCode, leaderId);
+        TeachCourse leaderTeachCourse = teachCourseService.findByExamIdCourseIdAndUserId(examId, courseId, leaderId);
         Long leaderTeachCourseId = leaderTeachCourse.getId();
         Long leaderTeachCourseId = leaderTeachCourse.getId();
 
 
         teachClazzName = SystemConstant.translateSpecificSign(teachClazzName);
         teachClazzName = SystemConstant.translateSpecificSign(teachClazzName);

+ 5 - 25
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TeachCourseServiceImpl.java

@@ -141,26 +141,6 @@ public class TeachCourseServiceImpl extends ServiceImpl<TeachCourseMapper, Teach
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         Long requestUserId = requestUser.getId();
         Long requestUserId = requestUser.getId();
         List<TeachCourse> teachCourseList = this.listByIds(idList);
         List<TeachCourse> teachCourseList = this.listByIds(idList);
-        List<String> cantDeleteCourseCodeList = teachCourseList.stream().filter(e -> !e.getCreateId().equals(requestUserId)).map(TeachCourse::getCourseCode)
-                .collect(Collectors.toList());
-        if (CollectionUtils.isNotEmpty(cantDeleteCourseCodeList)) {
-            throw ExceptionResultEnum.ERROR.exception(
-                    String.format("[%s]课程非本人创建,无法删除", String.join(",", cantDeleteCourseCodeList)));
-        }
-        List<TeachCourse> mainTeachCourseList = teachCourseList.stream().filter(e -> e.getCreateId().equals(e.getUserId())).collect(Collectors.toList());
-        if (mainTeachCourseList.size() > 0) {
-            for (TeachCourse mainTeachCourse : mainTeachCourseList) {
-                List<TeachCourse> teamList = this.list(
-                        new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getExamId, mainTeachCourse.getExamId())
-                                .eq(TeachCourse::getCourseCode, mainTeachCourse.getCourseCode())
-                                .eq(TeachCourse::getCreateId, requestUserId).ne(TeachCourse::getUserId, requestUserId));
-                if (CollectionUtils.isNotEmpty(teamList)) {
-                    throw ExceptionResultEnum.ERROR.exception(
-                            String.format("请先删除课程(编号)[%s]下的教师团队,再删除课程", mainTeachCourse.getCourseCode()));
-                }
-            }
-        }
-
         for (Long teachCourseId : idList) {
         for (Long teachCourseId : idList) {
             // 删除知识点
             // 删除知识点
             courseDimensionService.remove(
             courseDimensionService.remove(
@@ -189,9 +169,9 @@ public class TeachCourseServiceImpl extends ServiceImpl<TeachCourseMapper, Teach
     }
     }
 
 
     @Override
     @Override
-    public TeachCourse findByExamIdCourseCodeAndUserId(Long examId, String courseCode, Long userId) {
+    public TeachCourse findByExamIdCourseIdAndUserId(Long examId, Long courseId, Long userId) {
         TeachCourse teachCourse = this.getOne(
         TeachCourse teachCourse = this.getOne(
-                new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getExamId, examId).eq(TeachCourse::getCourseCode, courseCode).eq(TeachCourse::getUserId, userId)
+                new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getExamId, examId).eq(TeachCourse::getCourseId, courseId).eq(TeachCourse::getUserId, userId)
                         .last(SystemConstant.LIMIT1));
                         .last(SystemConstant.LIMIT1));
         if (Objects.isNull(teachCourse)) {
         if (Objects.isNull(teachCourse)) {
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
             throw ExceptionResultEnum.ERROR.exception("教学课程不存在");
@@ -249,10 +229,10 @@ public class TeachCourseServiceImpl extends ServiceImpl<TeachCourseMapper, Teach
         if (Objects.isNull(sysUser)) {
         if (Objects.isNull(sysUser)) {
             throw ExceptionResultEnum.ERROR.exception("用户不存在");
             throw ExceptionResultEnum.ERROR.exception("用户不存在");
         }
         }
-        List<String> courseCodeList = this.list(
-                new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getUserId, userId)).stream().map(TeachCourse::getCourseCode).distinct().collect(Collectors.toList());
+        List<Long> courseCodeList = this.list(
+                new QueryWrapper<TeachCourse>().lambda().eq(TeachCourse::getUserId, userId)).stream().map(TeachCourse::getCourseId).distinct().collect(Collectors.toList());
         return courseCodeList.stream().flatMap(e -> {
         return courseCodeList.stream().flatMap(e -> {
-            BasicCourse basicCourse = basicCourseService.findByCourseCode(e, sysUser.getSchoolId());
+            BasicCourse basicCourse = basicCourseService.getById(e);
             DictionaryResult dictionaryResult = new DictionaryResult();
             DictionaryResult dictionaryResult = new DictionaryResult();
             dictionaryResult.setCode(basicCourse.getCode());
             dictionaryResult.setCode(basicCourse.getCode());
             dictionaryResult.setName(basicCourse.getName());
             dictionaryResult.setName(basicCourse.getName());

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

@@ -0,0 +1,174 @@
+package com.qmth.distributed.print.business.templete.execute;
+
+import cn.hutool.core.date.DateUtil;
+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.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.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.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;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.mark.service.MarkPaperService;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.*;
+
+/**
+ * @Description: 考生字典导入同步任务
+ * @Author: CaoZixuan
+ * @Date: 2024-02-26
+ */
+@Service
+public class AsyncBasicExamStudentTeacherImportService extends SyncImportTaskTemplate {
+
+    private final static Logger log = LoggerFactory.getLogger(AsyncBasicExamStudentTeacherImportService.class);
+
+    public static final String BEGIN_TITLE = "->开始处理导入文件";
+    public static final String EXCEPTION_TITLE = "->数据处理发生异常!";
+    public static final String EXCEPTION_DATA = "错误信息:";
+    public static final String FINISH_TITLE = "->数据处理结束,共处理了";
+    public static final String FINISH_TOTAL_SIZE = "条数据,成功";
+    public static final String FINISH_SUCCESS_SIZE = "条数据,失败";
+    public static final String FINISH_ERROR_SIZE = "条数据";
+
+    @Resource
+    private BasicExamService basicExamService;
+    @Resource
+    private BasicExamStudentService basicExamStudentService;
+    @Resource
+    private MarkPaperService markPaperService;
+    @Resource
+    private FileUploadService fileUploadService;
+
+    @Override
+    public Result importTask(Map<String, Object> map) throws Exception {
+        TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
+        InputStream inputStream = super.getUploadFileInputStream(tbTask);
+        map.put("inputStream", inputStream);
+
+        StringJoiner stringJoinerSummary = new StringJoiner("\n");
+        SystemConstant.addSummary(stringJoinerSummary, BEGIN_TITLE);
+        tbTask.setStatus(TaskStatusEnum.RUNNING);
+        TBTaskService tbTaskService = SpringContextHolder.getBean(TBTaskService.class);
+        tbTaskService.updateById(tbTask);
+        int dataCount = 0;
+        int successCount = 0;
+        int errorCount = 0;
+        boolean hasError;
+        List<BasicExamStudentImport> errorDataList;
+
+        try {
+            ImportLogicService importLogicService = SpringContextHolder.getBean(ImportLogicService.class);
+
+            // 执行导入考务数据
+            Map<String, Object> result = importLogicService.executeImportBasicExamStudentTeacherLogic(map, stringJoinerSummary);
+            dataCount = Integer.parseInt(String.valueOf(result.get(SystemConstant.DATA_COUNT)));
+            successCount = Integer.parseInt(String.valueOf(result.get(SystemConstant.SUCCESS_DATA_COUNT)));
+            errorCount = Integer.parseInt(String.valueOf(result.get(SystemConstant.ERROR_DATA_COUNT)));
+            hasError = Boolean.parseBoolean(String.valueOf(result.get(SystemConstant.HAS_ERROR_DATA)));
+
+            if (hasError) {
+                SystemConstant.addSummary(stringJoinerSummary, "有异常数据,开始生成错误文件");
+                tbTask.setResult(TaskResultEnum.ERROR);
+                // 有异常数据
+                errorDataList = JSON.parseArray(JSON.toJSONString(result.get(SystemConstant.ERROR_DATA_LIST)),
+                        BasicExamStudentImport.class);
+                try {
+                    String[] columnNames = (String[]) result.get(SystemConstant.COLUMN_NAMES);
+                    File excelFileTemp = SystemConstant.getFileTempVar(SystemConstant.EXCEL_PREFIX);
+                    this.createErrorExcelFile(columnNames, errorDataList, excelFileTemp);
+                    String fileName = SystemConstant.getNanoId() + SystemConstant.EXCEL_PREFIX;
+                    FilePathVo filePathVo = fileUploadService.uploadFile(excelFileTemp, UploadFileEnum.FILE, fileName);
+                    tbTask.setErrorFilePath(JSON.toJSONString(filePathVo));
+                    SystemConstant.addSummary(stringJoinerSummary, "错误文件生成生成,请到\"导入结果查询\"中,下载错误文件");
+                } catch (Exception e) {
+                    SystemConstant.addSummary(stringJoinerSummary, "错误文件生成失败," + e.getMessage());
+                }
+            } else {
+                List<BasicExamStudent> basicExamStudentList = JSON.parseArray(JSON.toJSONString(result.get(SystemConstant.DATASOURCE)), BasicExamStudent.class);
+                basicExamStudentService.updateTeacherIdById(basicExamStudentList);
+                //
+                tbTask.setResult(TaskResultEnum.SUCCESS);
+            }
+        } catch (Exception e) {
+            tbTask.setResult(TaskResultEnum.ERROR);
+            stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
+        } finally {//生成文件
+            stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}{4}{5}{6}{7}",
+                    DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, dataCount,
+                    FINISH_TOTAL_SIZE, successCount, FINISH_SUCCESS_SIZE, errorCount, FINISH_ERROR_SIZE));
+            tbTask.setStatus(TaskStatusEnum.FINISH);
+            tbTask.setSummary(stringJoinerSummary.toString());
+            tbTaskService.updateById(tbTask);
+        }
+        return ResultUtil.ok();
+    }
+
+    private void createErrorExcelFile(String[] columnName, List<BasicExamStudentImport> basicExamStudentDtoList, File excelFileTemp) {
+        try {
+            List<String> columnNameList = new ArrayList<>(Arrays.asList(columnName));
+            columnNameList.add("错误信息");
+            String[] columnNames = columnNameList.toArray(new String[0]);
+            List<String[]> columnValues = new ArrayList<>();
+            for (BasicExamStudentImport basicExamStudentImport : basicExamStudentDtoList) {
+                List<String> valueList = new ArrayList<>();
+                for (String title : columnNameList) {
+                    if (title.equals("错误信息")) {
+                        valueList.add(basicExamStudentImport.getErrorMsg());
+                        continue;
+                    }
+                    String value = "";
+                    for (CodeNameEnableValue codeNameEnableValue : basicExamStudentImport.getRequiredFieldList()) {
+                        if (codeNameEnableValue.getName().equals(title)) {
+                            value = codeNameEnableValue.getValue();
+                        }
+                    }
+                    if (StringUtils.isBlank(value)) {
+                        for (CodeNameEnableValue codeNameEnableValue : basicExamStudentImport.getExtendFieldList()) {
+                            if (codeNameEnableValue.getName().equals(title)) {
+                                value = codeNameEnableValue.getValue();
+                            }
+                        }
+                    }
+                    valueList.add(value);
+                }
+                // 错误信息
+                String[] columnValue = valueList.toArray(new String[valueList.size()]);
+                columnValues.add(columnValue);
+            }
+
+            FileOutputStream outputStream = new FileOutputStream(excelFileTemp);
+            ExcelWriter writer = ExcelWriter.create(ExcelType.XLSX);
+            writer.writeDataArrays("考生数据", null, columnNames, columnValues.listIterator());
+            writer.output(outputStream);
+            outputStream.flush();
+            outputStream.close();
+        } catch (Exception e) {
+
+        }
+    }
+}

+ 5 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/ImportLogicService.java

@@ -21,13 +21,14 @@ public interface ImportLogicService {
 
 
     /**
     /**
      * 处理考生字典导入
      * 处理考生字典导入
-     *
-     * @param map 数据源
-     * @return 结果
-     * @throws Exception 异常
      */
      */
     Map<String, Object> executeImportBasicExamStudentLogic(Map<String, Object> map, StringJoiner stringJoinerSummary);
     Map<String, Object> executeImportBasicExamStudentLogic(Map<String, Object> map, StringJoiner stringJoinerSummary);
 
 
+    /**
+     * 处理考生任课老师导入
+     */
+    Map<String, Object> executeImportBasicExamStudentTeacherLogic(Map<String, Object> map, StringJoiner stringJoinerSummary);
+
     /**
     /**
      * 保存阅卷数据
      * 保存阅卷数据
      *
      *

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

@@ -302,7 +302,6 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             BasicExamStudent basicExamStudent = entry.getValue().get(0);
             BasicExamStudent basicExamStudent = entry.getValue().get(0);
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, entry.getKey());
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, entry.getKey());
             if (markPaper == null) {
             if (markPaper == null) {
-                BasicCourse basicCourse = basicCourseService.getByCode(basicExamStudent.getCourseCode());
                 markPaper = new MarkPaper(examId, basicExamStudent.getCourseId(), entry.getKey(), String.valueOf(System.currentTimeMillis()), requestUserId, SystemConstant.DEFAULT_PAPER_TYPE_A);
                 markPaper = new MarkPaper(examId, basicExamStudent.getCourseId(), entry.getKey(), String.valueOf(System.currentTimeMillis()), requestUserId, SystemConstant.DEFAULT_PAPER_TYPE_A);
                 markPaperService.save(markPaper);
                 markPaperService.save(markPaper);
             }
             }
@@ -761,4 +760,126 @@ public class ImportLogicServiceImpl implements ImportLogicService {
         }
         }
         return map;
         return map;
     }
     }
+
+    @Transactional
+    @Override
+    public Map<String, Object> executeImportBasicExamStudentTeacherLogic(Map<String, Object> map, StringJoiner stringJoinerSummary) {
+        SysUser requestUser = (SysUser) map.get(SystemConstant.USER);
+        InputStream inputStream = (InputStream) map.get("inputStream");
+        Long examId = SystemConstant.convertIdToLong(String.valueOf(map.get("examId")));
+        Long schoolId = requestUser.getSchoolId();
+        BasicExam basicExam = basicExamService.getById(examId);
+        if (Objects.isNull(basicExam)) {
+            throw ExceptionResultEnum.ERROR.exception("考试不存在");
+        }
+        Long semesterId = SystemConstant.convertIdToLong(basicExam.getSemesterId());
+
+        SystemConstant.addSummary(stringJoinerSummary, "开始解析文件内容");
+        BasicExamStudentParseDto basicExamStudentParseDto;
+        try {
+            basicExamStudentParseDto = this.parseBasicExamStudent(schoolId, inputStream);
+        } catch (Exception e) {
+            SystemConstant.addSummary(stringJoinerSummary, "解析文件内容结束,解析失败。" + e.getMessage());
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
+        }
+        SystemConstant.addSummary(stringJoinerSummary, "解析文件内容结束,开始进行数据校验");
+
+        List<BasicExamStudentImport> basicExamStudentImportList = basicExamStudentParseDto.getBasicExamStudentImportList();
+        if (CollectionUtils.isEmpty(basicExamStudentImportList)) {
+            throw ExceptionResultEnum.ERROR.exception("没有可导入数据");
+        }
+
+        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));
+
+        BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
+        boolean needPaperNumber = (basicSchool.getHasPaperNumber() != null && basicSchool.getHasPaperNumber()) || ExamModelEnum.MODEL4.equals(basicExam.getExamModel());
+
+        Map<String, Long> basicCourseIdMap = new HashMap<>();
+        // 是否有错误提示
+        boolean hasError = false;
+
+        // 必填字段为课程代码、开课学院、学号、任课老师工号、任课老师
+        List<String> requiredCodes = Arrays.asList(RequiredFieldsEnum.STUDENT_CODE.getCode(), RequiredFieldsEnum.COURSE_CODE.getCode(), RequiredFieldsEnum.TEACHING_ROOM_NAME.getCode(), RequiredFieldsEnum.TEACHER_NAME.getCode(), RequiredFieldsEnum.TEACHER_CODE.getCode());
+
+        List<BasicExamStudent> basicExamStudents = new ArrayList<>();
+        for (BasicExamStudentImport basicExamStudentImport : basicExamStudentImportList) {
+            BasicExamStudent basicExamStudent = new BasicExamStudent();
+            StringJoiner stringJoiner = new StringJoiner(";");
+
+            // 校验excel内容
+            basicExamStudentImport.getRequiredFieldList().forEach(m -> {
+                if (requiredCodes.contains(m.getCode()) && StringUtils.isBlank(m.getValue())) {
+                    stringJoiner.add(m.getName() + "必填");
+                }
+            });
+
+            // 校验课程
+            String key = basicExamStudentImport.getCourseCode() + SystemConstant.HYPHEN + basicExamStudentImport.getTeachingRoomName();
+            if (!basicCourseIdMap.containsKey(key)) {
+                List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, basicExamStudentImport.getTeachingRoomName());
+                if (CollectionUtils.isEmpty(sysOrgList)) {
+                    stringJoiner.add("开课学院[" + basicExamStudentImport.getTeachingRoomName() + "]在学院层级不存在");
+                } else {
+                    SysOrg sysOrg = sysOrgList.get(0);
+                    // 校验课程代码和开课学院
+                    BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrg.getId(), basicExamStudentImport.getCourseCode());
+                    if (Objects.isNull(basicCourse)) {
+                        stringJoiner.add("课程代码[" + basicExamStudentImport.getCourseCode() + "]在开课学院[" + basicExamStudentImport.getTeachingRoomName() + "]不存在");
+                    } else {
+                        basicExamStudent.setCourseId(basicCourse.getId());
+                        basicCourseIdMap.put(key, basicCourse.getId());
+                    }
+                }
+            } else {
+                basicExamStudent.setCourseId(basicCourseIdMap.get(key));
+            }
+
+            //校验任课老师
+            SysUser sysUser = sysUserService.getByLoginName(schoolId, basicExamStudentImport.getTeacherCode());
+            if (sysUser == null) {
+                stringJoiner.add("任课老师工号[" + basicExamStudentImport.getTeacherCode() + "]不存在");
+            } else {
+                if (!sysUser.getEnable()) {
+                    stringJoiner.add("任课老师工号[" + basicExamStudentImport.getTeacherCode() + "]已禁用");
+                } else if (!sysUser.getRealName().equals(basicExamStudentImport.getTeacherName())) {
+                    stringJoiner.add("任课老师[" + basicExamStudentImport.getTeacherName() + "]与用户管理中姓名[" + sysUser.getRealName() + "]不一致");
+                } else {
+                    basicExamStudent.setTeacherId(sysUser.getId());
+                }
+            }
+
+            if (basicExamStudent.getCourseId() != null) {
+                if (courseIdStudentCodeMap.containsKey(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode())) {
+                    basicExamStudent.setId(courseIdStudentCodeMap.get(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode()));
+                } else {
+                    stringJoiner.add(String.format("课程代码[%s],开课学院[%s],学号[%s]考生管理中不存在", basicExamStudentImport.getCourseCode(), basicExamStudentImport.getTeachingRoomName(), basicExamStudentImport.getStudentCode()));
+                }
+            }
+
+            if (stringJoiner.toString().length() > 0) {
+                basicExamStudentImport.setErrorMsg(stringJoiner.toString());
+            }
+
+            if (!hasError && stringJoiner.toString().length() > 0) {
+                hasError = true;
+            }
+
+            if (stringJoiner.toString().length() == 0) {
+                basicExamStudents.add(basicExamStudent);
+            }
+
+            map.put(SystemConstant.ERROR_DATA_LIST, basicExamStudentImportList);
+            map.put(SystemConstant.DATASOURCE, basicExamStudents);
+            map.put(SystemConstant.DATA_COUNT, basicExamStudentImportList.size());
+            map.put(SystemConstant.SUCCESS_DATA_COUNT, basicExamStudents.size());
+            map.put(SystemConstant.ERROR_DATA_COUNT, basicExamStudentImportList.size() - basicExamStudents.size());
+            map.put(SystemConstant.HAS_ERROR_DATA, hasError);
+            map.put(SystemConstant.COLUMN_NAMES, basicExamStudentParseDto.getColumnNames());
+        }
+
+        return map;
+    }
 }
 }

+ 35 - 26
distributed-print-business/src/main/resources/mapper/ClientMapper.xml

@@ -7,8 +7,8 @@
             a.exam_id examId,
             a.exam_id examId,
             a.id printPlanId,
             a.id printPlanId,
             a.name printPlanName,
             a.name printPlanName,
-            c.course_code courseCode,
-            c.course_name courseName,
+            bc.code courseCode,
+            bc.name courseName,
             c.paper_number paperNumber,
             c.paper_number paperNumber,
             d.id examTaskId,
             d.id examTaskId,
             d.specialty,
             d.specialty,
@@ -35,16 +35,17 @@
             exam_detail b ON a.id = b.print_plan_id
             exam_detail b ON a.id = b.print_plan_id
         JOIN
         JOIN
             exam_detail_course c ON b.id = c.exam_detail_id
             exam_detail_course c ON b.id = c.exam_detail_id
+        JOIN basic_course bc ON c.course_id = bc.id
         JOIN
         JOIN
             exam_task d ON d.school_id = c.school_id
             exam_task d ON d.school_id = c.school_id
             AND d.exam_id = b.exam_id
             AND d.exam_id = b.exam_id
-            AND d.course_code = c.course_code
+            AND d.course_id = c.course_id
             AND d.paper_number = c.paper_number
             AND d.paper_number = c.paper_number
         LEFT JOIN
         LEFT JOIN
             client_status e ON e.school_id = d.school_id
             client_status e ON e.school_id = d.school_id
             AND b.id = e.exam_detail_id
             AND b.id = e.exam_detail_id
             AND a.id = e.print_plan_id
             AND a.id = e.print_plan_id
-            AND e.course_code = d.course_code
+            AND e.course_id = d.course_id
             AND e.paper_number = d.paper_number
             AND e.paper_number = d.paper_number
             and e.machine_code = #{machineCode}
             and e.machine_code = #{machineCode}
         LEFT JOIN
         LEFT JOIN
@@ -57,8 +58,8 @@
             <if test="printPlanId != null and printPlanId != ''">
             <if test="printPlanId != null and printPlanId != ''">
                 and a.id = #{printPlanId}
                 and a.id = #{printPlanId}
             </if>
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                and c.course_code = #{courseCode}
+            <if test="courseId != null">
+                and c.course_id = #{courseId}
             </if>
             </if>
             <if test="paperNumber != null and paperNumber != ''">
             <if test="paperNumber != null and paperNumber != ''">
                 and c.paper_number = #{paperNumber}
                 and c.paper_number = #{paperNumber}
@@ -179,7 +180,8 @@
         JOIN
         JOIN
         (SELECT
         (SELECT
         a.exam_detail_id,
         a.exam_detail_id,
-        GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
+        GROUP_CONCAT(CONCAT(bc.name, '(', bc.code, ')')) courseNameCode,
+        GROUP_CONCAT(distinct a.course_id) courseIds,
         GROUP_CONCAT(a.paper_number) paperNumber,
         GROUP_CONCAT(a.paper_number) paperNumber,
         GROUP_CONCAT(a.clazz_id) classId,
         GROUP_CONCAT(a.clazz_id) classId,
         GROUP_CONCAT(a.clazz_name) className,
         GROUP_CONCAT(a.clazz_name) className,
@@ -198,15 +200,16 @@
         END) isPass
         END) isPass
         FROM
         FROM
         exam_detail_course a
         exam_detail_course a
+        left join basic_course bc on a.course_id = bc.id
         LEFT JOIN client_status b ON a.school_id = b.school_id
         LEFT JOIN client_status b ON a.school_id = b.school_id
         AND a.exam_detail_id = b.exam_detail_id
         AND a.exam_detail_id = b.exam_detail_id
-        AND a.course_code = b.course_code
+        AND a.course_id = b.course_id
         AND a.paper_number = b.paper_number
         AND a.paper_number = b.paper_number
         AND b.machine_code = #{machineCode}
         AND b.machine_code = #{machineCode}
         GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
         GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
         <where>
         <where>
-            <if test="courseCode != null and courseCode != ''">
-                and c.courseNameCode like concat('%',#{courseCode},'%')
+            <if test="courseId != null">
+                and c.courseIds like concat('%',#{courseId},'%')
             </if>
             </if>
             <if test="paperNumber != null and paperNumber != ''">
             <if test="paperNumber != null and paperNumber != ''">
                 and c.paperNumber like concat('%',#{paperNumber},'%')
                 and c.paperNumber like concat('%',#{paperNumber},'%')
@@ -285,9 +288,9 @@
         JOIN
         JOIN
         (SELECT
         (SELECT
         a.exam_detail_id,
         a.exam_detail_id,
-        GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
+        GROUP_CONCAT(distinct a.course_id) courseIds,
         GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paperType,
         GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paperType,
-        GROUP_CONCAT(a.paper_number) paperNumber,
+        GROUP_CONCAT(distinct a.paper_number) paperNumber,
         GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
         GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
         SUM(CASE b.is_download
         SUM(CASE b.is_download
         WHEN true THEN 0
         WHEN true THEN 0
@@ -305,13 +308,13 @@
         exam_detail_course a
         exam_detail_course a
         LEFT JOIN client_status b ON a.school_id = b.school_id
         LEFT JOIN client_status b ON a.school_id = b.school_id
         AND a.exam_detail_id = b.exam_detail_id
         AND a.exam_detail_id = b.exam_detail_id
-        AND a.course_code = b.course_code
+        AND a.course_id = b.course_id
         AND a.paper_number = b.paper_number
         AND a.paper_number = b.paper_number
         AND b.machine_code = #{machineCode}
         AND b.machine_code = #{machineCode}
         GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
         GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
         <where>
         <where>
-            <if test="courseCode != null and courseCode != ''">
-                and c.courseNameCode like concat('%',#{courseCode},'%')
+            <if test="courseId != null">
+                and c.courseIds like concat('%',#{courseId},'%')
             </if>
             </if>
             <if test="paperNumber != null and paperNumber != ''">
             <if test="paperNumber != null and paperNumber != ''">
                 and c.paperNumber like concat('%',#{paperNumber},'%')
                 and c.paperNumber like concat('%',#{paperNumber},'%')
@@ -330,19 +333,22 @@
             resultType="com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto">
             resultType="com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto">
         SELECT
         SELECT
             a.id examDetailId,
             a.id examDetailId,
-            b.course_code courseCode,
-            b.course_name courseName,
+            bc.code courseCode,
+            bc.name courseName,
             b.paper_number paperNumber,
             b.paper_number paperNumber,
-            c.student_code studentCode,
-            c.ticket_number ticketNumber,
-            c.student_name studentName,
-            c.site_number siteNumber
+            bes.student_code studentCode,
+            bes.student_name studentName,
+            bes.site_number siteNumber
         FROM
         FROM
         exam_detail a
         exam_detail a
         JOIN
         JOIN
         exam_detail_course b ON a.id = b.exam_detail_id
         exam_detail_course b ON a.id = b.exam_detail_id
         JOIN
         JOIN
         exam_student c ON b.id = c.exam_detail_course_id
         exam_student c ON b.id = c.exam_detail_course_id
+        JOIN
+            basic_exam_student bes ON c.student_id = bes.id
+        LEFT JOIN
+            basic_course bc ON b.course_id = bc.id
         <where>
         <where>
             and a.school_id = #{schoolId}
             and a.school_id = #{schoolId}
             and a.id = #{examDetailId}
             and a.id = #{examDetailId}
@@ -352,7 +358,7 @@
             <if test="studentName != null and studentName != ''">
             <if test="studentName != null and studentName != ''">
                 and c.student_name like concat('%', #{studentName}, '%')
                 and c.student_name like concat('%', #{studentName}, '%')
             </if>
             </if>
-            <if test="courseCode != null and courseCode != ''">
+            <if test="courseId != null">
                 and b.course_code = #{courseCode}
                 and b.course_code = #{courseCode}
             </if>
             </if>
         </where>
         </where>
@@ -364,8 +370,9 @@
             be.name examName,
             be.name examName,
             epp.id printPlanId,
             epp.id printPlanId,
             epp.name printPlanName,
             epp.name printPlanName,
-            c.course_code courseCode,
-            c.course_name courseName,
+            c.course_id courseId,
+            bc.code courseCode,
+            bc.name courseName,
             c.paper_number paperNumber,
             c.paper_number paperNumber,
             group_concat(c.paper_type) paperType,
             group_concat(c.paper_type) paperType,
             group_concat(b.id) examDetailIds
             group_concat(b.id) examDetailIds
@@ -377,6 +384,8 @@
             exam_print_plan epp ON b.print_plan_id = epp.id
             exam_print_plan epp ON b.print_plan_id = epp.id
                 LEFT JOIN
                 LEFT JOIN
             basic_exam be on b.exam_id = be.id
             basic_exam be on b.exam_id = be.id
+                LEFT JOIN
+            basic_course bc ON c.course_id = bc.id
         <where>
         <where>
             <if test="semesterId != null">
             <if test="semesterId != null">
                 and be.semester_id = #{semesterId}
                 and be.semester_id = #{semesterId}
@@ -387,8 +396,8 @@
             <if test="printPlanId != null">
             <if test="printPlanId != null">
                 and epp.id = #{printPlanId}
                 and epp.id = #{printPlanId}
             </if>
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                and c.course_code = #{courseCode}
+            <if test="courseId != null">
+                and c.course_id = #{courseId}
             </if>
             </if>
             <if test="paperNumber != null and paperNumber != ''">
             <if test="paperNumber != null and paperNumber != ''">
                 and c.paper_number = #{paperNumber}
                 and c.paper_number = #{paperNumber}

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

@@ -194,13 +194,14 @@
                 JOIN
                 JOIN
             (SELECT
             (SELECT
                 exam_detail_id,
                 exam_detail_id,
-                    GROUP_CONCAT(distinct CONCAT(a.course_name, '(', a.course_code, ')')) course_name_code,
+                    GROUP_CONCAT(distinct CONCAT(bc.name, '(', bc.code, ')')) course_name_code,
                     GROUP_CONCAT(distinct a.paper_number) paper_number
                     GROUP_CONCAT(distinct a.paper_number) paper_number
                 FROM
                 FROM
                     exam_detail_course a
                     exam_detail_course a
+                    left join basic_course bc on a.course_id = bc.id
                     <where>
                     <where>
-                        <if test="courseCode != null and courseCode != ''">
-                            and a.course_code = #{courseCode}
+                        <if test="courseId != null">
+                            and a.course_id = #{courseId}
                         </if>
                         </if>
                         <if test="paperNumber != null and paperNumber != ''">
                         <if test="paperNumber != null and paperNumber != ''">
                             and a.paper_number = #{paperNumber}
                             and a.paper_number = #{paperNumber}
@@ -269,13 +270,12 @@
         (SELECT
         (SELECT
             exam_detail_id,
             exam_detail_id,
                 GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paper_type,
                 GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paper_type,
-                GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) course_name_code,
-                GROUP_CONCAT(a.paper_number) paper_number
+                GROUP_CONCAT(distinct a.paper_number) paper_number
         FROM
         FROM
             exam_detail_course a
             exam_detail_course a
         <where>
         <where>
-            <if test="courseCode != null and courseCode != ''">
-                and a.course_code = #{courseCode}
+            <if test="courseId != null">
+                and a.course_id = #{courseId}
             </if>
             </if>
             <if test="paperNumber != null and paperNumber != ''">
             <if test="paperNumber != null and paperNumber != ''">
                 and a.paper_number = #{paperNumber}
                 and a.paper_number = #{paperNumber}

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

@@ -109,6 +109,8 @@ ALTER TABLE `basic_exam_student`
     ADD COLUMN `status` VARCHAR(1) NULL DEFAULT 'N' COMMENT '状态,默认N-正常,D-缓考,F-免考,M-缺考,B-违纪' AFTER `class_name`,
     ADD COLUMN `status` VARCHAR(1) NULL DEFAULT 'N' COMMENT '状态,默认N-正常,D-缓考,F-免考,M-缺考,B-违纪' AFTER `class_name`,
 ADD COLUMN `required_fields` MEDIUMTEXT NULL COMMENT '基础字段' AFTER `exam_room`;
 ADD COLUMN `required_fields` MEDIUMTEXT NULL COMMENT '基础字段' AFTER `exam_room`;
 
 
+ALTER TABLE `exam_card` ADD COLUMN `copy_card_id` BIGINT(20) NULL COMMENT '复制源题卡ID' AFTER `paper_id`;
+
 
 
 -- drop table if exists exam_detail_course_paper_type;
 -- drop table if exists exam_detail_course_paper_type;
 -- drop table if exists basic_template_org;
 -- drop table if exists basic_template_org;

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

@@ -5,10 +5,12 @@ import com.qmth.distributed.print.business.bean.params.BasicExamStudentParam;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
 import com.qmth.distributed.print.business.service.BasicExamStudentService;
 import com.qmth.distributed.print.business.service.PrintCommonService;
 import com.qmth.distributed.print.business.service.PrintCommonService;
+import com.qmth.distributed.print.business.templete.execute.AsyncBasicExamStudentTeacherImportService;
 import com.qmth.distributed.print.business.templete.execute.SyncBasicExamStudentImportService;
 import com.qmth.distributed.print.business.templete.execute.SyncBasicExamStudentImportService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
 import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
@@ -27,7 +29,6 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.Min;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -50,6 +51,8 @@ public class BasicExamStudentController {
 
 
     @Resource
     @Resource
     private SyncBasicExamStudentImportService syncBasicExamStudentImportService;
     private SyncBasicExamStudentImportService syncBasicExamStudentImportService;
+    @Resource
+    private AsyncBasicExamStudentTeacherImportService asyncBasicExamStudentTeacherImportService;
 
 
     @ApiOperation(value = "分页查询")
     @ApiOperation(value = "分页查询")
     @RequestMapping(value = "/page", method = RequestMethod.POST)
     @RequestMapping(value = "/page", method = RequestMethod.POST)
@@ -87,10 +90,19 @@ public class BasicExamStudentController {
         return ResultUtil.ok(basicExamStudentService.save(basicExamStudentParam, sysUser));
         return ResultUtil.ok(basicExamStudentService.save(basicExamStudentParam, sysUser));
     }
     }
 
 
+    @ApiOperation(value = "状态更新")
+    @RequestMapping(value = "/status", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
+    @OperationLogDetail(operationType = OperationTypeEnum.UPDATE, detail = "状态更新操作,id:{{id}}、状态:{{status}}")
+    public Result status(@ApiParam(value = "考生ID", required = true) @RequestParam Long id,
+                         @ApiParam(value = "状态", required = true) @RequestParam BasicExamStudentStatusEnum status) {
+        return ResultUtil.ok(basicExamStudentService.updateStatus(id, status));
+    }
+
     @ApiOperation(value = "导入")
     @ApiOperation(value = "导入")
     @RequestMapping(value = "/import", method = RequestMethod.POST)
     @RequestMapping(value = "/import", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})
-    @OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
+    @OperationLogDetail(operationType = OperationTypeEnum.IMPORT, detail = "导入考生操作")
     public Result basicExamStudentImportSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
     public Result basicExamStudentImportSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
                                              @ApiParam(value = "考试id", required = true) @RequestParam String examId) throws Exception {
                                              @ApiParam(value = "考试id", required = true) @RequestParam String examId) throws Exception {
         Map<String, Object> map = printCommonService.saveTask(file, SystemConstant.convertIdToLong(examId), TaskTypeEnum.BASIC_EXAM_STUDENT_IMPORT);
         Map<String, Object> map = printCommonService.saveTask(file, SystemConstant.convertIdToLong(examId), TaskTypeEnum.BASIC_EXAM_STUDENT_IMPORT);
@@ -98,6 +110,17 @@ public class BasicExamStudentController {
         return syncBasicExamStudentImportService.importTask(map);
         return syncBasicExamStudentImportService.importTask(map);
     }
     }
 
 
+    @ApiOperation(value = "任课老师导入")
+    @RequestMapping(value = "/import_teacher", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})
+    @OperationLogDetail(operationType = OperationTypeEnum.IMPORT, detail = "任课老师导入操作")
+    public Result importTeacher(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
+                                @ApiParam(value = "考试id", required = true) @RequestParam String examId) throws Exception {
+        Map<String, Object> map = printCommonService.saveTask(file, SystemConstant.convertIdToLong(examId), TaskTypeEnum.BASIC_EXAM_STUDENT_TEACHER_IMPORT);
+        map.put("examId", SystemConstant.convertIdToLong(examId));
+        return asyncBasicExamStudentTeacherImportService.importTask(map);
+    }
+
     @ApiOperation(value = "导出")
     @ApiOperation(value = "导出")
     @RequestMapping(value = "/export", method = RequestMethod.POST)
     @RequestMapping(value = "/export", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})

+ 11 - 12
distributed-print/src/main/java/com/qmth/distributed/print/api/CourseTargetController.java

@@ -51,25 +51,24 @@ public class CourseTargetController {
 
 
     @ApiOperation(value = "课程目标管理-列表查询")
     @ApiOperation(value = "课程目标管理-列表查询")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = CourseTargetResult.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = CourseTargetResult.class)})
     public Result findCourseTargetList(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId,
     public Result findCourseTargetList(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId,
-            @ApiParam(value = "考试id") @RequestParam(required = false) String examId,
-            @ApiParam(value = "课程编号") @RequestParam(required = false) String courseCode) {
-        if (SystemConstant.strNotNull(examId) && SystemConstant.strNotNull(courseCode)) {
+                                       @ApiParam(value = "考试id") @RequestParam(required = false) Long examId,
+                                       @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId) {
+        if (examId != null && courseId != null) {
             if (SystemConstant.strNotNull(teachCourseId)) {
             if (SystemConstant.strNotNull(teachCourseId)) {
                 // 要么传examId和courseCode 要么传teachCourseId
                 // 要么传examId和courseCode 要么传teachCourseId
                 throw ExceptionResultEnum.ERROR.exception("参数错误");
                 throw ExceptionResultEnum.ERROR.exception("参数错误");
             }
             }
             SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
             SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
-            teachCourseId = String.valueOf(teachCourseService.findByExamIdCourseCodeAndUserId(SystemConstant.convertIdToLong(examId),
-                    courseCode, requestUser.getId()).getId());
+            teachCourseId = String.valueOf(teachCourseService.findByExamIdCourseIdAndUserId(examId, courseId, requestUser.getId()).getId());
         }
         }
         return ResultUtil.ok(courseTargetService.findCourseTargetList(SystemConstant.convertIdToLong(teachCourseId)));
         return ResultUtil.ok(courseTargetService.findCourseTargetList(SystemConstant.convertIdToLong(teachCourseId)));
     }
     }
 
 
     @ApiOperation(value = "课程目标管理-同步题库知识点")
     @ApiOperation(value = "课程目标管理-同步题库知识点")
     @RequestMapping(value = "/dimension_sync_tiku", method = RequestMethod.POST)
     @RequestMapping(value = "/dimension_sync_tiku", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = Result.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
     public Result syncTikuDimension(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) {
     public Result syncTikuDimension(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) {
         courseDimensionService.syncTikuCourseProperties(SystemConstant.convertIdToLong(teachCourseId));
         courseDimensionService.syncTikuCourseProperties(SystemConstant.convertIdToLong(teachCourseId));
         return ResultUtil.ok();
         return ResultUtil.ok();
@@ -77,10 +76,10 @@ public class CourseTargetController {
 
 
     @ApiOperation(value = "课程目标管理-导入课程知识点")
     @ApiOperation(value = "课程目标管理-导入课程知识点")
     @RequestMapping(value = "/dimension_import", method = RequestMethod.POST)
     @RequestMapping(value = "/dimension_import", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Result.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Result.class)})
     @OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
     @OperationLogDetail(operationType = OperationTypeEnum.IMPORT)
     public Result courseDimensionImportSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
     public Result courseDimensionImportSync(@ApiParam(value = "上传文件", required = true) @RequestParam MultipartFile file,
-            @ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) throws Exception {
+                                            @ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) throws Exception {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         courseDimensionService.importCourseDimension(requestUser, file, SystemConstant.convertIdToLong(teachCourseId));
         courseDimensionService.importCourseDimension(requestUser, file, SystemConstant.convertIdToLong(teachCourseId));
         return ResultUtil.ok();
         return ResultUtil.ok();
@@ -88,7 +87,7 @@ public class CourseTargetController {
 
 
     @ApiOperation(value = "课程目标管理-课程知识点树查询")
     @ApiOperation(value = "课程目标管理-课程知识点树查询")
     @RequestMapping(value = "/dimension_tree", method = RequestMethod.POST)
     @RequestMapping(value = "/dimension_tree", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "查询成功", response = CourseDimensionTree.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = CourseDimensionTree.class)})
     public Result findDimensionTree(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) {
     public Result findDimensionTree(@ApiParam(value = "教学课程id") @RequestParam(required = false) String teachCourseId) {
         try {
         try {
             courseDimensionService.syncTikuCourseProperties(SystemConstant.convertIdToLong(teachCourseId));
             courseDimensionService.syncTikuCourseProperties(SystemConstant.convertIdToLong(teachCourseId));
@@ -101,7 +100,7 @@ public class CourseTargetController {
 
 
     @ApiOperation(value = "课程目标管理-新增/编辑")
     @ApiOperation(value = "课程目标管理-新增/编辑")
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @RequestMapping(value = "/save", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "更新成功", response = Result.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "更新成功", response = Result.class)})
     @OperationLogDetail(operationType = OperationTypeEnum.SAVE)
     @OperationLogDetail(operationType = OperationTypeEnum.SAVE)
     public Result saveCourseTarget(@Valid @RequestBody CourseTargetParam courseTargetParam, BindingResult bindingResult) {
     public Result saveCourseTarget(@Valid @RequestBody CourseTargetParam courseTargetParam, BindingResult bindingResult) {
         if (bindingResult.hasErrors()) {
         if (bindingResult.hasErrors()) {
@@ -114,7 +113,7 @@ public class CourseTargetController {
 
 
     @ApiOperation(value = "课程目标管理-删除")
     @ApiOperation(value = "课程目标管理-删除")
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "删除成功", response = Result.class) })
+    @ApiResponses({@ApiResponse(code = 200, message = "删除成功", response = Result.class)})
     @OperationLogDetail(operationType = OperationTypeEnum.DELETE)
     @OperationLogDetail(operationType = OperationTypeEnum.DELETE)
     public Result deleteCourseTarget(@ApiParam(value = "选择要删除的课程目标id", required = true) @RequestParam String id) {
     public Result deleteCourseTarget(@ApiParam(value = "选择要删除的课程目标id", required = true) @RequestParam String id) {
         courseTargetService.deleteCourseTarget(SystemConstant.convertIdToLong(id));
         courseTargetService.deleteCourseTarget(SystemConstant.convertIdToLong(id));

+ 11 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamCardController.java

@@ -77,6 +77,17 @@ public class ExamCardController {
         return ResultUtil.ok(map);
         return ResultUtil.ok(map);
     }
     }
 
 
+    /**
+     * 题卡管理(通卡管理)-启用/禁用
+     */
+    @ApiOperation(value = "启用/禁用")
+    @RequestMapping(value = "/enable", method = RequestMethod.POST)
+    @OperationLogDetail(operationType = OperationTypeEnum.ENABLE, detail = "启用/禁用操作,题卡ID:{{id}}、状态:{{enable}}")
+    public Result enable(@ApiParam(value = "题卡ID", required = true) @RequestParam Long id,
+                         @ApiParam(value = "状态", required = true) @RequestParam Boolean enable) {
+        return ResultUtil.ok(examCardService.enable(id, enable));
+    }
+
     /**
     /**
      * 题卡管理(通卡管理)-删除
      * 题卡管理(通卡管理)-删除
      *
      *

+ 18 - 68
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -675,56 +675,6 @@ public class SysController {
                     return dictionaryResult;
                     return dictionaryResult;
                 }).collect(Collectors.toList());
                 }).collect(Collectors.toList());
                 break;
                 break;
-            //            case COLLEGE:
-            //                if (Objects.nonNull(semesterId)) {
-            //                    QueryWrapper<BasicExam> basicExamQueryWrapper = new QueryWrapper<>();
-            //                    basicExamQueryWrapper.lambda().eq(BasicExam::getSemesterId, SystemConstant.convertIdToLong(semesterId));
-            //                    List<BasicExam> basicExamList = basicExamService.list(basicExamQueryWrapper);
-            //                    if (Objects.nonNull(basicExamList) && basicExamList.size() > 0) {
-            //                        List<Long> examIdList = basicExamList.stream().map(BaseEntity::getId).collect(Collectors.toList());
-            //                        QueryWrapper<ExamPrintPlan> examPrintPlanQueryWrapper = new QueryWrapper<>();
-            //                        examPrintPlanQueryWrapper.lambda().in(ExamPrintPlan::getExamId, examIdList);
-            //                        List<ExamPrintPlan> examPrintPlanList = examPrintPlanService.list(examPrintPlanQueryWrapper);
-            //                        if (Objects.nonNull(examPrintPlanList) && examPrintPlanList.size() > 0) {
-            //                            Set<Long> orgIdSet = examPrintPlanList.stream().map(ExamPrintPlan::getOrgId).collect(Collectors.toSet());
-            //                            QueryWrapper<SysOrg> sysOrgQueryWrapper = new QueryWrapper<>();
-            //                            sysOrgQueryWrapper.lambda().in(SysOrg::getId, orgIdSet);
-            //                            List<SysOrg> sysOrgList = sysOrgService.list(sysOrgQueryWrapper);
-            //                            List<SysOrg> newSysOrgList = new ArrayList<>(sysOrgList);
-            //                            for (SysOrg s : sysOrgList) {
-            //                                if (s.getType() == OrgTypeEnum.SCHOOL) {
-            //                                    newSysOrgList.addAll(sysOrgService.findByConnectByRootOrgId(s.getId()));
-            //                                } else if (s.getType() == OrgTypeEnum.TEACHING_ROOM || s.getType() == OrgTypeEnum.FACULTY || s.getType() == OrgTypeEnum.PRINTING_HOUSE) {
-            //                                    newSysOrgList.addAll(sysOrgService.findByConnectByParentId(s.getId(), true, false));
-            //                                }
-            //                            }
-            //                            Map<Long, SysOrg> sysOrgMap = new LinkedHashMap<>();
-            //                            for (SysOrg s : newSysOrgList) {
-            //                                if (s.getType() == OrgTypeEnum.COLLEGE) {
-            //                                    sysOrgMap.put(s.getId(), s);
-            //                                }
-            //                            }
-            //                            List<DictionaryResult> finalDictionaryResultList = dictionaryResultList;
-            //                            sysOrgMap.forEach((k, v) -> {
-            //                                DictionaryResult dictionaryResult = new DictionaryResult();
-            //                                dictionaryResult.setId(v.getId());
-            //                                dictionaryResult.setCode(v.getCode());
-            //                                dictionaryResult.setName(v.getName());
-            //                                finalDictionaryResultList.add(dictionaryResult);
-            //                            });
-            //                        }
-            //                    }
-            //                } else {
-            //                    List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true));
-            //                    dictionaryResultList = sysOrgList.stream().map(e -> {
-            //                        DictionaryResult dictionaryResult = new DictionaryResult();
-            //                        dictionaryResult.setId(e.getId());
-            //                        dictionaryResult.setCode(e.getCode());
-            //                        dictionaryResult.setName(e.getName());
-            //                        return dictionaryResult;
-            //                    }).collect(Collectors.toList());
-            //                }
-            //                break;
             case CLAZZ:
             case CLAZZ:
                 QueryWrapper<BasicTeachClazz> clazzQueryWrapper = new QueryWrapper<>();
                 QueryWrapper<BasicTeachClazz> clazzQueryWrapper = new QueryWrapper<>();
                 clazzQueryWrapper.lambda().eq(BasicTeachClazz::getSchoolId, schoolId).eq(BasicTeachClazz::getExamId, examId);
                 clazzQueryWrapper.lambda().eq(BasicTeachClazz::getSchoolId, schoolId).eq(BasicTeachClazz::getExamId, examId);
@@ -749,24 +699,24 @@ public class SysController {
                     return Stream.of(dictionaryResult);
                     return Stream.of(dictionaryResult);
                 }).collect(Collectors.toList());
                 }).collect(Collectors.toList());
                 break;
                 break;
-            case STUDENT:
-                QueryWrapper<BasicExamStudent> studentQueryWrapper = new QueryWrapper<>();
-                studentQueryWrapper.lambda().eq(BasicExamStudent::getSchoolId, schoolId);
-                if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(clazzId))) {
-                    studentQueryWrapper.lambda().eq(BasicExamStudent::getClazzId, clazzId);
-                }
-                if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(studentId))) {
-                    studentQueryWrapper.lambda().eq(BasicExamStudent::getId, studentId);
-                }
-                List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(studentQueryWrapper);
-                dictionaryResultList = basicExamStudentList.stream().map(e -> {
-                    DictionaryResult dictionaryResult = new DictionaryResult();
-                    dictionaryResult.setId(e.getId());
-                    dictionaryResult.setCode(e.getStudentCode());
-                    dictionaryResult.setName(e.getStudentName());
-                    return dictionaryResult;
-                }).collect(Collectors.toList());
-                break;
+//            case STUDENT:
+//                QueryWrapper<BasicExamStudent> studentQueryWrapper = new QueryWrapper<>();
+//                studentQueryWrapper.lambda().eq(BasicExamStudent::getSchoolId, schoolId);
+//                if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(clazzId))) {
+//                    studentQueryWrapper.lambda().eq(BasicExamStudent::getClazzId, clazzId);
+//                }
+//                if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(studentId))) {
+//                    studentQueryWrapper.lambda().eq(BasicExamStudent::getId, studentId);
+//                }
+//                List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(studentQueryWrapper);
+//                dictionaryResultList = basicExamStudentList.stream().map(e -> {
+//                    DictionaryResult dictionaryResult = new DictionaryResult();
+//                    dictionaryResult.setId(e.getId());
+//                    dictionaryResult.setCode(e.getStudentCode());
+//                    dictionaryResult.setName(e.getStudentName());
+//                    return dictionaryResult;
+//                }).collect(Collectors.toList());
+//                break;
             default:
             default:
                 break;
                 break;
         }
         }

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

@@ -44,13 +44,13 @@ public class PrintController {
                                @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
                                @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
                                @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
                                @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                               @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                               @ApiParam(value = "课程Id") @RequestParam(value = "courseId", required = false) Long courseId,
                                @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
                                @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
                                @ApiParam(value = "是否合格") @RequestParam(value = "isPass", required = false) Boolean isPass,
                                @ApiParam(value = "是否合格") @RequestParam(value = "isPass", required = false) Boolean isPass,
                                @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
                                @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
                                @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
                                @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
-        IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
+        IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(machineCode, orgId, semesterId, examId, printPlanId, courseId, paperNumber, isTry, isPass, pageNumber, pageSize);
         return ResultUtil.ok(examTasks);
         return ResultUtil.ok(examTasks);
     }
     }
 
 
@@ -69,11 +69,11 @@ public class PrintController {
                              @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
                              @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
                              @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                              @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                              @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
                              @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                             @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                             @ApiParam(value = "课程Id") @RequestParam(value = "courseId", required = false) Long courseId,
                              @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                              @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                              @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
                              @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
                              @ApiParam(value = "是否通过") @RequestParam(value = "isPass", required = false) Boolean isPass) {
                              @ApiParam(value = "是否通过") @RequestParam(value = "isPass", required = false) Boolean isPass) {
-        List<Map<String, Object>> urls = clientService.getBatchUrl(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass);
+        List<Map<String, Object>> urls = clientService.getBatchUrl(machineCode, orgId, semesterId, examId, printPlanId, courseId, paperNumber, isTry, isPass);
         return ResultUtil.ok(urls);
         return ResultUtil.ok(urls);
     }
     }
 
 
@@ -98,7 +98,7 @@ public class PrintController {
                                 @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                 @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                 @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                 @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                 @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
                                 @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
-                                @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                 @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                 @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                 @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                 @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                 @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
                                 @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
@@ -108,7 +108,7 @@ public class PrintController {
                                 @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate,
                                 @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate,
                                 @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
                                 @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
                                 @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
                                 @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
-        IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
+        IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(machineCode, orgId, semesterId, examId, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
         return ResultUtil.ok(printTaskDtoIPage);
         return ResultUtil.ok(printTaskDtoIPage);
     }
     }
 
 
@@ -121,7 +121,7 @@ public class PrintController {
                                     @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                     @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                     @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                     @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                     @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
                                     @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
-                                    @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                    @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                     @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                     @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                     @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                     @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                     @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
                                     @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
@@ -129,7 +129,7 @@ public class PrintController {
                                     @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                     @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                     @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                     @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                     @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) throws Exception {
                                     @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) throws Exception {
-        clientService.exportClientPrintTask(response, machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+        clientService.exportClientPrintTask(response, machineCode, orgId, semesterId, examId, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
     }
     }
 
 
     @ApiOperation(value = "印刷管理-汇总数据查询")
     @ApiOperation(value = "印刷管理-汇总数据查询")
@@ -140,7 +140,7 @@ public class PrintController {
                                      @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                      @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                      @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                      @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                      @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
                                      @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
-                                     @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                     @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                      @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                      @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                      @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                      @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                      @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
                                      @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
@@ -148,7 +148,7 @@ public class PrintController {
                                      @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                      @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                      @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                      @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                      @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
                                      @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
-        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientService.taskTotalData(semesterId, examId, printPlanId, orgId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
+        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientService.taskTotalData(semesterId, examId, printPlanId, orgId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
         return ResultUtil.ok(clientPrintTaskTotalDto);
         return ResultUtil.ok(clientPrintTaskTotalDto);
     }
     }
 
 
@@ -177,7 +177,7 @@ public class PrintController {
                                          @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                          @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
                                          @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                          @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
                                          @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
                                          @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
-                                         @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                         @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                          @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                          @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                          @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                          @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                          @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
                                          @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
@@ -185,7 +185,7 @@ public class PrintController {
                                          @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                          @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                          @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                          @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                          @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
                                          @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
-        List<Map<String, Object>> list = clientService.getPrintDataBatch(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+        List<Map<String, Object>> list = clientService.getPrintDataBatch(machineCode, orgId, semesterId, examId, printPlanId, status, courseId, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
         return ResultUtil.ok(list);
         return ResultUtil.ok(list);
     }
     }
 
 
@@ -222,10 +222,10 @@ public class PrintController {
     public Result listStudent(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
     public Result listStudent(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
                               @ApiParam(value = "学号") @RequestParam(value = "studentCode", required = false) String studentCode,
                               @ApiParam(value = "学号") @RequestParam(value = "studentCode", required = false) String studentCode,
                               @ApiParam(value = "学生姓名") @RequestParam(value = "studentName", required = false) String studentName,
                               @ApiParam(value = "学生姓名") @RequestParam(value = "studentName", required = false) String studentName,
-                              @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                              @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                               @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                               @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                               @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
                               @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
-        IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(examDetailId, studentCode, studentName, courseCode, pageNumber, pageSize);
+        IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(examDetailId, studentCode, studentName, courseId, pageNumber, pageSize);
         return ResultUtil.ok(examStudentDtoIPage);
         return ResultUtil.ok(examStudentDtoIPage);
     }
     }
 
 
@@ -247,11 +247,11 @@ public class PrintController {
                                       @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                       @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                       @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                       @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                       @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                       @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
-                                      @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                      @ApiParam(value = "课程ID") @RequestParam(value = "courseId", required = false) Long courseId,
                                       @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                       @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                       @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                                       @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                                       @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
                                       @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
-        IPage<ClientPrintStatisticsDto> statisticsDtoIPage = clientService.listClientPrintStatistics(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, pageNumber, pageSize);
+        IPage<ClientPrintStatisticsDto> statisticsDtoIPage = clientService.listClientPrintStatistics(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber, pageNumber, pageSize);
         return ResultUtil.ok(statisticsDtoIPage);
         return ResultUtil.ok(statisticsDtoIPage);
     }
     }
 
 
@@ -264,9 +264,9 @@ public class PrintController {
                                            @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                            @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
                                            @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                            @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                            @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                            @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
-                                           @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                           @ApiParam(value = "课程Id") @RequestParam(value = "courseId", required = false) Long courseId,
                                            @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber) {
                                            @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber) {
-        ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
+        ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseId, paperNumber);
         return ResultUtil.ok(statisticsTotalDto);
         return ResultUtil.ok(statisticsTotalDto);
     }
     }
 
 
@@ -301,11 +301,11 @@ public class PrintController {
     public Result printSingleFile(@ApiParam(value = "学期ID", required = true) @RequestParam("semesterId") Long semesterId,
     public Result printSingleFile(@ApiParam(value = "学期ID", required = true) @RequestParam("semesterId") Long semesterId,
                                   @ApiParam(value = "考试ID", required = true) @RequestParam("examId") Long examId,
                                   @ApiParam(value = "考试ID", required = true) @RequestParam("examId") Long examId,
                                   @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
                                   @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                                  @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) Long courseCode,
+                                  @ApiParam(value = "课程Id") @RequestParam(value = "courseId", required = false) Long courseId,
                                   @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) Long paperNumber,
                                   @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) Long paperNumber,
                                   @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                                   @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
                                   @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
                                   @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
-        IPage<PrintSingleDto> printSingleDtoIPage = clientService.getSingleData(semesterId, examId, printPlanId, courseCode, paperNumber, pageNumber, pageSize);
+        IPage<PrintSingleDto> printSingleDtoIPage = clientService.getSingleData(semesterId, examId, printPlanId, courseId, paperNumber, pageNumber, pageSize);
         return ResultUtil.ok(printSingleDtoIPage);
         return ResultUtil.ok(printSingleDtoIPage);
     }
     }
 }
 }

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

@@ -29,18 +29,18 @@ public class ScanExamController {
     @ApiOperation(value = "扫描汇总-答题卡扫描、签到表扫描")
     @ApiOperation(value = "扫描汇总-答题卡扫描、签到表扫描")
     @RequestMapping(value = "card/info", method = RequestMethod.POST)
     @RequestMapping(value = "card/info", method = RequestMethod.POST)
     public Result cardInfo(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public Result cardInfo(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                           @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                           @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                            @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId) {
                            @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId) {
         BasicExam exam = basicExamService.getById(examId);
         BasicExam exam = basicExamService.getById(examId);
-        return ResultUtil.ok(markStudentService.getScanExamInfo(exam, courseCode, coursePaperId));
+        return ResultUtil.ok(markStudentService.getScanExamInfo(exam, courseId, coursePaperId));
     }
     }
 
 
     @ApiOperation(value = "扫描汇总-数据校对")
     @ApiOperation(value = "扫描汇总-数据校对")
     @RequestMapping(value = "check/info", method = RequestMethod.POST)
     @RequestMapping(value = "check/info", method = RequestMethod.POST)
     public Result checkInfo(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public Result checkInfo(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                            @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                            @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                             @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId) {
                             @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId) {
         BasicExam exam = basicExamService.getById(examId);
         BasicExam exam = basicExamService.getById(examId);
-        return ResultUtil.ok(markStudentService.checkInfo(exam, courseCode, coursePaperId));
+        return ResultUtil.ok(markStudentService.checkInfo(exam, courseId, coursePaperId));
     }
     }
 }
 }

+ 10 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanOmrTaskController.java

@@ -26,6 +26,9 @@ import com.qmth.teachcloud.mark.service.ScanOmrTaskService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 
 
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
 /**
 /**
  * <p>
  * <p>
  * 识别对照 前端控制器
  * 识别对照 前端控制器
@@ -59,9 +62,9 @@ public class ScanOmrTaskController extends BaseController {
     @ApiOperation(value = "识别对照任务状态")
     @ApiOperation(value = "识别对照任务状态")
     @RequestMapping(value = "/status", method = RequestMethod.POST)
     @RequestMapping(value = "/status", method = RequestMethod.POST)
     public Result status(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public Result status(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                         @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                         @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                          @ApiParam(value = "课程试卷编号") @RequestParam(required = false) String coursePaperId) {
                          @ApiParam(value = "课程试卷编号") @RequestParam(required = false) String coursePaperId) {
-        return ResultUtil.ok(omrTaskService.getStatus(examId, courseCode, coursePaperId));
+        return ResultUtil.ok(omrTaskService.getStatus(examId, courseId, coursePaperId));
     }
     }
 
 
 //    @ApiOperation(value = "识别对照任务状态")
 //    @ApiOperation(value = "识别对照任务状态")
@@ -75,9 +78,11 @@ public class ScanOmrTaskController extends BaseController {
     @ApiOperation(value = "识别对照任务列表")
     @ApiOperation(value = "识别对照任务列表")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                       @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                       @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                        @ApiParam(value = "课程试卷编号") @RequestParam(required = false) String coursePaperId,
                        @ApiParam(value = "课程试卷编号") @RequestParam(required = false) String coursePaperId,
-                       @ApiParam(value = "状态") @RequestParam OmrTaskStatus status) {
-        return ResultUtil.ok(omrTaskService.list(examId, courseCode, coursePaperId, status));
+                       @ApiParam(value = "状态") @RequestParam OmrTaskStatus status,
+                       @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                       @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        return ResultUtil.ok(omrTaskService.list(examId, courseId, coursePaperId, status, pageNumber, pageSize));
     }
     }
 }
 }

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

@@ -79,9 +79,9 @@ public class ScanStudentController extends BaseController {
     @ApiOperation(value = "未扫描-导出")
     @ApiOperation(value = "未扫描-导出")
     @RequestMapping(value = "/unexist/export", method = RequestMethod.POST)
     @RequestMapping(value = "/unexist/export", method = RequestMethod.POST)
     public void exportUnexist(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
     public void exportUnexist(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
-                              @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+                              @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                               @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId,
                               @ApiParam(value = "试卷编号") @RequestParam(required = false) String coursePaperId,
                               HttpServletResponse response) {
                               HttpServletResponse response) {
-        markStudentService.exportUnexist(examId, courseCode, coursePaperId, response);
+        markStudentService.exportUnexist(examId, courseId, coursePaperId, response);
     }
     }
 }
 }

+ 9 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/CoursePaperNumberDto.java

@@ -6,11 +6,20 @@ import java.util.List;
  * 课程、试卷编号
  * 课程、试卷编号
  */
  */
 public class CoursePaperNumberDto {
 public class CoursePaperNumberDto {
+    private Long id;
 
 
     private String code;
     private String code;
     private String name;
     private String name;
     private List<PaperNumberDto> paperNumberList;
     private List<PaperNumberDto> paperNumberList;
 
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
     public String getCode() {
     public String getCode() {
         return code;
         return code;
     }
     }

+ 12 - 23
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicExamStudent.java

@@ -46,13 +46,6 @@ public class BasicExamStudent extends BaseEntity {
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     private Long courseId;
     private Long courseId;
 
 
-    @ApiModelProperty(value = "课程编号")
-    private String courseCode;
-
-    @ApiModelProperty(value = "教学班id(basic_teach_clazz)")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long clazzId;
-
     @ApiModelProperty(value = "教学班")
     @ApiModelProperty(value = "教学班")
     private String teachClassName;
     private String teachClassName;
 
 
@@ -109,6 +102,10 @@ public class BasicExamStudent extends BaseEntity {
     @TableField(exist = false)
     @TableField(exist = false)
     private List<CodeNameEnableValue> extendFieldList;
     private List<CodeNameEnableValue> extendFieldList;
 
 
+    @ApiModelProperty("状态")
+    @TableField(exist = false)
+    private String statusDisplay;
+
     public Long getSchoolId() {
     public Long getSchoolId() {
         return schoolId;
         return schoolId;
     }
     }
@@ -141,22 +138,6 @@ public class BasicExamStudent extends BaseEntity {
         this.courseId = courseId;
         this.courseId = courseId;
     }
     }
 
 
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public Long getClazzId() {
-        return clazzId;
-    }
-
-    public void setClazzId(Long clazzId) {
-        this.clazzId = clazzId;
-    }
-
     public String getTeachClassName() {
     public String getTeachClassName() {
         return teachClassName;
         return teachClassName;
     }
     }
@@ -300,4 +281,12 @@ public class BasicExamStudent extends BaseEntity {
     public void setExtendFieldList(List<CodeNameEnableValue> extendFieldList) {
     public void setExtendFieldList(List<CodeNameEnableValue> extendFieldList) {
         this.extendFieldList = extendFieldList;
         this.extendFieldList = extendFieldList;
     }
     }
+
+    public String getStatusDisplay() {
+        return this.status != null ? this.status.getName() : "";
+    }
+
+    public void setStatusDisplay(String statusDisplay) {
+        this.statusDisplay = statusDisplay;
+    }
 }
 }

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/TaskTypeEnum.java

@@ -12,6 +12,7 @@ import java.util.Objects;
 public enum TaskTypeEnum {
 public enum TaskTypeEnum {
     USER_IMPORT("用户导入"),
     USER_IMPORT("用户导入"),
     BASIC_EXAM_STUDENT_IMPORT("考生导入"),
     BASIC_EXAM_STUDENT_IMPORT("考生导入"),
+    BASIC_EXAM_STUDENT_TEACHER_IMPORT("考生任课老师导入"),
     MARK_STUDENT_IMPORT("阅卷数据导入"),
     MARK_STUDENT_IMPORT("阅卷数据导入"),
     COURSE_DIMENSION_IMPORT("课程知识点导入"),
     COURSE_DIMENSION_IMPORT("课程知识点导入"),
     QUESTION_MISSION_BATCH_CREATE("批量新建命题任务"),
     QUESTION_MISSION_BATCH_CREATE("批量新建命题任务"),

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

@@ -27,8 +27,6 @@ public interface BasicCourseMapper extends BaseMapper<BasicCourse> {
 
 
     List<BasicCourse> listCoursesByUserId(Long id);
     List<BasicCourse> listCoursesByUserId(Long id);
 
 
-    IPage<BasicCourse> listPage(Page<BasicCourse> page, @Param("schoolId") Long schoolId, @Param("code") String code, @Param("name") String name);
-
     List<CourseInfoDto> findByUserLoginNameAndRealName(@Param("loginName") String loginName, @Param("realName") String realName);
     List<CourseInfoDto> findByUserLoginNameAndRealName(@Param("loginName") String loginName, @Param("realName") String realName);
 
 
     /**
     /**

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

@@ -79,13 +79,6 @@ public interface BasicCourseService extends IService<BasicCourse> {
      */
      */
     Boolean removeBasicCourseBatchByQuery(Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime);
     Boolean removeBasicCourseBatchByQuery(Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime);
 
 
-    /**
-     * @param schoolId
-     * @param courseCode
-     * @return
-     */
-    Long getOrgIdBySchoolIdAndCourseCode(Long schoolId, String courseCode);
-
     void exportData(HttpServletResponse response, Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime) throws Exception;
     void exportData(HttpServletResponse response, Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime) throws Exception;
 
 
     /**
     /**

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

@@ -218,21 +218,6 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
         return idList.size() > 0 ? this.removeBasicCourseBatch(idList) : true;
         return idList.size() > 0 ? this.removeBasicCourseBatch(idList) : true;
     }
     }
 
 
-    @Override
-    public Long getOrgIdBySchoolIdAndCourseCode(Long schoolId, String courseCode) {
-        if (Objects.isNull(schoolId)) {
-            schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        }
-        QueryWrapper<BasicCourse> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(BasicCourse::getSchoolId, schoolId).eq(BasicCourse::getCode, courseCode);
-        BasicCourse basicCourse = this.getOne(queryWrapper);
-        if (Objects.isNull(basicCourse)) {
-            throw ExceptionResultEnum.ERROR.exception("课程不存在");
-        }
-
-        return basicCourse.getTeachingRoomId();
-    }
-
     @Override
     @Override
     public void exportData(HttpServletResponse response, Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime) throws Exception {
     public void exportData(HttpServletResponse response, Long belongOrgId, String courseName, Long startCreateTime, Long endCreateTime) throws Exception {
         Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
         Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());

+ 0 - 10
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/RedisUtil.java

@@ -163,16 +163,6 @@ public class RedisUtil {
         redisTemplate.expire(key, 100, TimeUnit.MILLISECONDS);
         redisTemplate.expire(key, 100, TimeUnit.MILLISECONDS);
     }
     }
 
 
-    /**
-     * 删除锁(课程序号)
-     *
-     * @param key
-     * @return
-     */
-    public void releaseCourseSequenceLock(String key) {
-        redisTemplate.expire(key, 1, TimeUnit.MILLISECONDS);
-    }
-
     /**
     /**
      * 设置缓存
      * 设置缓存
      *
      *

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

@@ -35,23 +35,6 @@
              basic_user_course b ON a.id = b.course_id
              basic_user_course b ON a.id = b.course_id
         WHERE b.user_id = #{id}
         WHERE b.user_id = #{id}
     </select>
     </select>
-
-    <select id="listPage" resultMap="BaseResultMap">
-        <include refid="Base_Column_List"></include>
-        <where>
-            <if test="schoolId != null and schoolId != ''">
-                and school_id = #{schoolId}
-            </if>
-            <if test="code != null and code != ''">
-                and code like concat('%',#{code} ,'%')
-            </if>
-            <if test="name != null and name != ''">
-                and name like concat('%',#{name} ,'%')
-            </if>
-        </where>
-        order by create_time desc
-    </select>
-
     <select id="findByUserLoginNameAndRealName"
     <select id="findByUserLoginNameAndRealName"
             resultType="com.qmth.teachcloud.common.bean.dto.CourseInfoDto">
             resultType="com.qmth.teachcloud.common.bean.dto.CourseInfoDto">
         SELECT bc.code AS courseCode,
         SELECT bc.code AS courseCode,

+ 8 - 5
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scananswer/AnswerQueryDomain.java

@@ -24,7 +24,7 @@ public class AnswerQueryDomain extends PagerQuery {
 
 
     private String packageCode;
     private String packageCode;
 
 
-    private String courseCode;
+    private Long courseId;
 
 
     private String coursePaperId;
     private String coursePaperId;
 
 
@@ -90,12 +90,15 @@ public class AnswerQueryDomain extends PagerQuery {
 	public void setPackageCode(String packageCode) {
 	public void setPackageCode(String packageCode) {
 		this.packageCode = packageCode;
 		this.packageCode = packageCode;
 	}
 	}
-	public String getCourseCode() {
-		return courseCode;
+
+	public Long getCourseId() {
+		return courseId;
 	}
 	}
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
 	}
 	}
+
 	public String getCoursePaperId() {
 	public String getCoursePaperId() {
 		return coursePaperId;
 		return coursePaperId;
 	}
 	}

+ 5 - 5
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/scanpackage/ScanPackageQuery.java

@@ -8,7 +8,7 @@ import com.qmth.teachcloud.mark.utils.PagerQuery;
 public class ScanPackageQuery extends PagerQuery {
 public class ScanPackageQuery extends PagerQuery {
     @NotNull(message = "考试Id不能为空")
     @NotNull(message = "考试Id不能为空")
     private Long examId;
     private Long examId;
-    private String courseCode;
+    private Long courseId;
     private String coursePaperId;
     private String coursePaperId;
 
 
     private ScanStatus status;
     private ScanStatus status;
@@ -21,12 +21,12 @@ public class ScanPackageQuery extends PagerQuery {
         this.examId = examId;
         this.examId = examId;
     }
     }
 
 
-    public String getCourseCode() {
-        return courseCode;
+    public Long getCourseId() {
+        return courseId;
     }
     }
 
 
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
     }
     }
 
 
     public String getCoursePaperId() {
     public String getCoursePaperId() {

+ 13 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/UnexistStudentDto.java

@@ -12,11 +12,13 @@ public class UnexistStudentDto {
 	private String courseCode;
 	private String courseCode;
 	@ExcelProperty(name = "课程名称", width = 20, index = 2)
 	@ExcelProperty(name = "课程名称", width = 20, index = 2)
 	private String courseName;
 	private String courseName;
-	@ExcelProperty(name = "试卷编号", width = 20, index = 3)
+	@ExcelProperty(name = "开课学院", width = 20, index = 3)
+	private String teachingRoomName;
+	@ExcelProperty(name = "试卷编号", width = 20, index = 4)
 	private String paperNumber;
 	private String paperNumber;
-	@ExcelProperty(name = "学号", width = 20, index = 4)
+	@ExcelProperty(name = "学号", width = 20, index = 5)
 	private String studentCode;
 	private String studentCode;
-	@ExcelProperty(name = "姓名", width = 20, index = 5)
+	@ExcelProperty(name = "姓名", width = 20, index = 6)
 	private String studentName;
 	private String studentName;
 
 
 	public String getCourseCode() {
 	public String getCourseCode() {
@@ -35,6 +37,14 @@ public class UnexistStudentDto {
 		this.courseName = courseName;
 		this.courseName = courseName;
 	}
 	}
 
 
+	public String getTeachingRoomName() {
+		return teachingRoomName;
+	}
+
+	public void setTeachingRoomName(String teachingRoomName) {
+		this.teachingRoomName = teachingRoomName;
+	}
+
 	public String getPaperNumber() {
 	public String getPaperNumber() {
 		return paperNumber;
 		return paperNumber;
 	}
 	}

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/mapper/MarkPaperMapper.java

@@ -39,9 +39,9 @@ public interface MarkPaperMapper extends BaseMapper<MarkPaper> {
 
 
     IPage<ArchiveScoreVo> scoreList(Page<ArchiveScoreVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveScoreQuery query, @Param("dpr") DataPermissionRule dpr);
     IPage<ArchiveScoreVo> scoreList(Page<ArchiveScoreVo> page, @Param("schoolId") Long schoolId, @Param("req") ArchiveScoreQuery query, @Param("dpr") DataPermissionRule dpr);
 
 
-    int getCourseCount(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+    int getCourseCount(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 
-    int getPaperNumberCount(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+    int getPaperNumberCount(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 
     List<MarkPaper> listByExamId(@Param("examId") Long examId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
     List<MarkPaper> listByExamId(@Param("examId") Long examId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 

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

@@ -15,5 +15,5 @@ import org.apache.ibatis.annotations.Param;
  */
  */
 public interface MarkPaperPackageMapper extends MppBaseMapper<MarkPaperPackage> {
 public interface MarkPaperPackageMapper extends MppBaseMapper<MarkPaperPackage> {
 
 
-    int getPackageCountByExamId(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+    int getPackageCountByExamId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 }
 }

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

@@ -65,7 +65,7 @@ public interface MarkStudentMapper extends BaseMapper<MarkStudent> {
 
 
 	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("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId,
+	List<UnexistStudentDto> listUnexistStudentByExamIdAndCoursePaperId(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId,
 			@Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 			@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);

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

@@ -2,6 +2,8 @@ package com.qmth.teachcloud.mark.mapper;
 
 
 import java.util.List;
 import java.util.List;
 
 
+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.bean.dto.DataPermissionRule;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -20,17 +22,18 @@ import com.qmth.teachcloud.mark.enums.OmrTaskStatus;
  */
  */
 public interface ScanOmrTaskMapper extends BaseMapper<ScanOmrTask> {
 public interface ScanOmrTaskMapper extends BaseMapper<ScanOmrTask> {
 
 
-	List<ScanOmrTask> findUnMarked(@Param(value = "examId") Long examId, @Param(value = "pageNumber") int pageNumber,
-			@Param(value = "pageSize") int pageSize, @Param(value = "status") OmrTaskStatus status);
+    List<ScanOmrTask> findUnMarked(@Param(value = "examId") Long examId, @Param(value = "pageNumber") int pageNumber,
+                                   @Param(value = "pageSize") int pageSize, @Param(value = "status") OmrTaskStatus status);
 
 
-	List<ScanStudentDto> listByExamIdAndStatusAndUserId(@Param(value = "examId") Long examId,
-														@Param("courseCode") String courseCode,
-														@Param("coursePaperId") String coursePaperId,
-														@Param(value = "status") OmrTaskStatus status,
-														@Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
+    IPage<ScanStudentDto> listByExamIdAndStatusAndUserId(@Param("page") Page<ScanStudentDto> page,
+                                                         @Param(value = "examId") Long examId,
+                                                         @Param("courseId") Long courseId,
+                                                         @Param("coursePaperId") String coursePaperId,
+                                                         @Param(value = "status") OmrTaskStatus status,
+                                                         @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
 
 
-	int getStudentCountByExamAndStatusAndUserId(@Param(value = "examId") Long examId,
-												@Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param(value = "status") String status, @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
+    int getStudentCountByExamAndStatusAndUserId(@Param(value = "examId") Long examId,
+                                                @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param(value = "status") String status, @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);
 
 
     int countOmrTask(@Param("scanOmrTask") ScanOmrTask scanOmrTask, @Param("dpr") DataPermissionRule dpr);
     int countOmrTask(@Param("scanOmrTask") ScanOmrTask scanOmrTask, @Param("dpr") DataPermissionRule dpr);
 }
 }

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

@@ -23,5 +23,5 @@ public interface ScanPackageMapper extends BaseMapper<ScanPackage> {
 
 
 	IPage<ScanPackageVo> page(@Param("page") Page<ScanPackageVo> page, @Param("req")ScanPackageQuery query, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 	IPage<ScanPackageVo> page(@Param("page") Page<ScanPackageVo> page, @Param("req")ScanPackageQuery query, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 
 
-    int countPackageCode(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
+    int countPackageCode(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("coursePaperId") String coursePaperId, @Param("status") String status, @Param("dpr") DataPermissionRule dpr);
 }
 }

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

@@ -19,5 +19,5 @@ public interface MarkPaperPackageService extends IMppService<MarkPaperPackage> {
 
 
     List<MarkPaperPackage> listByExamIdAndPackageCode(Long examId, String packageCode);
     List<MarkPaperPackage> listByExamIdAndPackageCode(Long examId, String packageCode);
 
 
-    int getPackageCountByExamId(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
+    int getPackageCountByExamId(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
 }
 }

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

@@ -38,9 +38,9 @@ public interface MarkPaperService extends IService<MarkPaper> {
 
 
     List<MarkPaper> listQualityMarkPaperByStatus(MarkPaperStatus formal, int uploadCount);
     List<MarkPaper> listQualityMarkPaperByStatus(MarkPaperStatus formal, int uploadCount);
 
 
-    int getCourseCount(Long id, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
+    int getCourseCount(Long id, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
 
 
-    int getPaperNumberCount(Long id, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
+    int getPaperNumberCount(Long id, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
 
 
     IPage<CheckScoreListDto> listStudentScoreList(Long examId, Long courseId, String paperNumber, Integer pageNumber, Integer pageSize);
     IPage<CheckScoreListDto> listStudentScoreList(Long examId, Long courseId, String paperNumber, Integer pageNumber, Integer pageSize);
 
 

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

@@ -55,7 +55,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
     void updateSubjectiveStatusAndScore(Long examId, String paperNumber, SubjectiveStatus status, Double score,
     void updateSubjectiveStatusAndScore(Long examId, String paperNumber, SubjectiveStatus status, Double score,
             String scoreList);
             String scoreList);
 
 
-    ScanExamInfoVo getScanExamInfo(BasicExam exam, String courseCode, String coursePaperId);
+    ScanExamInfoVo getScanExamInfo(BasicExam exam, Long courseId, String coursePaperId);
 
 
     IPage<StudentScoreDetailDto> pageStudentScore(Long examId, String paperNumber, String college, String majorName,
     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,
             String className, String teacher, Integer filter, String status, Boolean breach, Double startScore, Double endScore,
@@ -65,7 +65,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
 
     List<SheetUrlDto> buildSheetUrls(Long studentId);
     List<SheetUrlDto> buildSheetUrls(Long studentId);
 
 
-    ScanExamCheckInfoVo checkInfo(BasicExam exam, String courseCode, String coursePaperId);
+    ScanExamCheckInfoVo checkInfo(BasicExam exam, Long courseId, String coursePaperId);
 
 
     /**
     /**
      * 根据考生当前绑定的paper刷新考生状态,需要在外部调用处对考生上锁
      * 根据考生当前绑定的paper刷新考生状态,需要在外部调用处对考生上锁
@@ -125,7 +125,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
 
     ScoreReportVo scoreReport(ArchiveStudentQuery query);
     ScoreReportVo scoreReport(ArchiveStudentQuery query);
 
 
-    void exportUnexist(Long examId, String courseCode, String coursePaperId, HttpServletResponse response);
+    void exportUnexist(Long examId, Long courseId, String coursePaperId, HttpServletResponse response);
 
 
     int countByExamIdAndPaperNumberAndMarkStatus(Long examId, String paperNumber, SubjectiveStatus status);
     int countByExamIdAndPaperNumberAndMarkStatus(Long examId, String paperNumber, SubjectiveStatus status);
 
 
@@ -145,7 +145,7 @@ public interface MarkStudentService extends IService<MarkStudent> {
 
 
     boolean updateAssignConfirm(Long studentId, boolean assignConfirm);
     boolean updateAssignConfirm(Long studentId, boolean assignConfirm);
 
 
-    int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId, MarkPaperStatus status,
+    int getAssignedCount(Long examId, Boolean checked, Long courseId, String coursePaperId, MarkPaperStatus status,
             DataPermissionRule dpr);
             DataPermissionRule dpr);
 
 
     int countAbsentByExamIdAndPaperNumber(Long examId, String paperNumber);
     int countAbsentByExamIdAndPaperNumber(Long examId, String paperNumber);

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

@@ -2,6 +2,7 @@ package com.qmth.teachcloud.mark.service;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -28,15 +29,15 @@ public interface ScanOmrTaskService extends IService<ScanOmrTask> {
 
 
 	ScanOmrTaskSaveDto submitTask(List<ScanOmrTaskResultDto> result, Long userId);
 	ScanOmrTaskSaveDto submitTask(List<ScanOmrTaskResultDto> result, Long userId);
 
 
-	ScanOmrTaskStatusDto getStatus(Long examId, String courseCode, String coursePaperId);
+	ScanOmrTaskStatusDto getStatus(Long examId, Long courseId, String coursePaperId);
 
 
-	int getFinishStudentCountByExamAndUserId(Long examId, String courseCode, String coursePaperId, String status,DataPermissionRule dpr);
+	int getFinishStudentCountByExamAndUserId(Long examId, Long courseId, String coursePaperId, String status,DataPermissionRule dpr);
 
 
 	void deleteByStudentId(Long examId, Long studentId);
 	void deleteByStudentId(Long examId, Long studentId);
 
 
 	int getCount(Long examId, OmrTaskStatus status, String courseCode, String coursePaperId, MarkPaperStatus markPaperStatus, DataPermissionRule dpr);
 	int getCount(Long examId, OmrTaskStatus status, String courseCode, String coursePaperId, MarkPaperStatus markPaperStatus, DataPermissionRule dpr);
 
 
-	List<ScanStudentDto> list(Long examId, String courseCode, String coursePaperId, OmrTaskStatus status);
+	IPage<ScanStudentDto> list(Long examId, Long courseId, String coursePaperId, OmrTaskStatus status, Integer pageNumber, Integer pageSize);
 
 
 	void saveTask(Long studentId);
 	void saveTask(Long studentId);
 
 

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

@@ -26,7 +26,7 @@ import com.qmth.teachcloud.mark.entity.ScanPackage;
  */
  */
 public interface ScanPackageService extends IService<ScanPackage> {
 public interface ScanPackageService extends IService<ScanPackage> {
 
 
-	int getCount(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
+	int getCount(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);
 
 
     List<ScanPackage> listByExamIdAndCoursePaperIdAndPackageCode(Long examId, String coursePaperId, String packageCode);
     List<ScanPackage> listByExamIdAndCoursePaperIdAndPackageCode(Long examId, String coursePaperId, String packageCode);
 
 

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

@@ -22,7 +22,7 @@ public class MarkPaperPackageServiceImpl extends MppServiceImpl<MarkPaperPackage
     }
     }
 
 
     @Override
     @Override
-    public int getPackageCountByExamId(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
-        return this.baseMapper.getPackageCountByExamId(examId, courseCode, coursePaperId, status.name(), dpr);
+    public int getPackageCountByExamId(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
+        return this.baseMapper.getPackageCountByExamId(examId, courseId, coursePaperId, status.name(), dpr);
     }
     }
 }
 }

+ 6 - 6
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkPaperServiceImpl.java

@@ -172,11 +172,11 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
                     }
                     }
                     // 人工绑定未做完,不能结束
                     // 人工绑定未做完,不能结束
-                    if (markStudentService.getAssignedCount(examId, false, markPaper.getCourseCode(), markPaper.getCoursePaperId(), MarkPaperStatus.FORMAL, null) > 0) {
+                    if (markStudentService.getAssignedCount(examId, false, markPaper.getCourseId(), markPaper.getCoursePaperId(), MarkPaperStatus.FORMAL, null) > 0) {
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
                     }
                     }
                     // 客观题检查未做完,不能结束
                     // 客观题检查未做完,不能结束
-                    if (scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, markPaper.getCourseCode(), markPaper.getCoursePaperId(), OmrTaskStatus.WAITING.name(), null) > 0) {
+                    if (scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, markPaper.getCourseId(), markPaper.getCoursePaperId(), OmrTaskStatus.WAITING.name(), null) > 0) {
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
                         throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
                     }
                     }
                 }
                 }
@@ -207,13 +207,13 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
     }
     }
 
 
     @Override
     @Override
-    public int getCourseCount(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
-        return baseMapper.getCourseCount(examId, courseCode, coursePaperId, status.name(), dpr);
+    public int getCourseCount(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
+        return baseMapper.getCourseCount(examId, courseId, coursePaperId, status.name(), dpr);
     }
     }
 
 
     @Override
     @Override
-    public int getPaperNumberCount(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
-        return baseMapper.getPaperNumberCount(examId, courseCode, coursePaperId, status.name(), dpr);
+    public int getPaperNumberCount(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
+        return baseMapper.getPaperNumberCount(examId, courseId, coursePaperId, status.name(), dpr);
     }
     }
 
 
     @Override
     @Override

+ 27 - 38
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -189,7 +189,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
     }
 
 
     @Override
     @Override
-    public ScanExamInfoVo getScanExamInfo(BasicExam exam, String courseCode, String coursePaperId) {
+    public ScanExamInfoVo getScanExamInfo(BasicExam exam, Long courseId, String coursePaperId) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
@@ -197,17 +197,17 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         vo.setId(exam.getId());
         vo.setId(exam.getId());
         vo.setName(exam.getName());
         vo.setName(exam.getName());
         vo.getAnswerScan().setCourseCount(
         vo.getAnswerScan().setCourseCount(
-                markPaperService.getCourseCount(exam.getId(), courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
-        vo.getAnswerScan().setPaperNumberCount(markPaperService.getPaperNumberCount(exam.getId(), courseCode,
+                markPaperService.getCourseCount(exam.getId(), courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+        vo.getAnswerScan().setPaperNumberCount(markPaperService.getPaperNumberCount(exam.getId(), courseId,
                 coursePaperId, MarkPaperStatus.FORMAL, dpr));
                 coursePaperId, MarkPaperStatus.FORMAL, dpr));
         vo.getAnswerScan()
         vo.getAnswerScan()
-                .setTotalCount(getCount(exam.getId(), null, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                .setTotalCount(getCount(exam.getId(), null, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         vo.getAnswerScan().setScannedCount(
         vo.getAnswerScan().setScannedCount(
-                getCount(exam.getId(), ScanStatus.SCANNED, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
-        vo.getPackageScan().setTotalCount(markPaperPackageService.getPackageCountByExamId(exam.getId(), courseCode,
+                getCount(exam.getId(), ScanStatus.SCANNED, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+        vo.getPackageScan().setTotalCount(markPaperPackageService.getPackageCountByExamId(exam.getId(), courseId,
                 coursePaperId, MarkPaperStatus.FORMAL, dpr));
                 coursePaperId, MarkPaperStatus.FORMAL, dpr));
         vo.getPackageScan().setScannedCount(
         vo.getPackageScan().setScannedCount(
-                scanPackageService.getCount(exam.getId(), courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                scanPackageService.getCount(exam.getId(), courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         return vo;
         return vo;
     }
     }
 
 
@@ -286,22 +286,22 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         return sheetUrls;
         return sheetUrls;
     }
     }
 
 
-    private int getCount(Long examId, ScanStatus status, String courseCode, String coursePaperId,
+    private int getCount(Long examId, ScanStatus status, Long courseId, String coursePaperId,
                          MarkPaperStatus markPaperStatus, DataPermissionRule dpr) {
                          MarkPaperStatus markPaperStatus, DataPermissionRule dpr) {
         MarkStudent markStudent = new MarkStudent();
         MarkStudent markStudent = new MarkStudent();
         markStudent.setExamId(examId);
         markStudent.setExamId(examId);
-        markStudent.setCourseCode(courseCode);
+        markStudent.setCourseId(courseId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setScanStatus(status);
         markStudent.setScanStatus(status);
         markStudent.setMarkPaperStatus(markPaperStatus.name());
         markStudent.setMarkPaperStatus(markPaperStatus.name());
         return baseMapper.selectCountByQuery(markStudent, dpr);
         return baseMapper.selectCountByQuery(markStudent, dpr);
     }
     }
 
 
-    private int getOmrAbsentCount(Long examId, Boolean checked, String courseCode, String coursePaperId,
+    private int getOmrAbsentCount(Long examId, Boolean checked, Long courseId, String coursePaperId,
                                   MarkPaperStatus status, DataPermissionRule dpr) {
                                   MarkPaperStatus status, DataPermissionRule dpr) {
         MarkStudent markStudent = new MarkStudent();
         MarkStudent markStudent = new MarkStudent();
         markStudent.setExamId(examId);
         markStudent.setExamId(examId);
-        markStudent.setCourseCode(courseCode);
+        markStudent.setCourseId(courseId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setOmrAbsent(true);
         markStudent.setOmrAbsent(true);
         markStudent.setOmrAbsentChecked(checked);
         markStudent.setOmrAbsentChecked(checked);
@@ -309,11 +309,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         return baseMapper.selectCountByQuery(markStudent, dpr);
         return baseMapper.selectCountByQuery(markStudent, dpr);
     }
     }
 
 
-    private int getIncompleteCount(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status,
+    private int getIncompleteCount(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status,
                                    DataPermissionRule dpr) {
                                    DataPermissionRule dpr) {
         MarkStudent markStudent = new MarkStudent();
         MarkStudent markStudent = new MarkStudent();
         markStudent.setExamId(examId);
         markStudent.setExamId(examId);
-        markStudent.setCourseCode(courseCode);
+        markStudent.setCourseId(courseId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setIncomplete(true);
         markStudent.setIncomplete(true);
         markStudent.setMarkPaperStatus(status.name());
         markStudent.setMarkPaperStatus(status.name());
@@ -321,7 +321,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
     }
 
 
     @Override
     @Override
-    public ScanExamCheckInfoVo checkInfo(BasicExam exam, String courseCode, String coursePaperId) {
+    public ScanExamCheckInfoVo checkInfo(BasicExam exam, Long courseId, String coursePaperId) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
@@ -331,21 +331,21 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         vo.setName(exam.getName());
         vo.setName(exam.getName());
         CheckTask ct = vo.getCheckTask();
         CheckTask ct = vo.getCheckTask();
         ct.setUnexistCount(
         ct.setUnexistCount(
-                getCount(examId, ScanStatus.UNEXIST, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                getCount(examId, ScanStatus.UNEXIST, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         ct.setUnexistCheckedCount(
         ct.setUnexistCheckedCount(
-                getCount(examId, ScanStatus.MANUAL_ABSENT, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
-        ct.setAssignedCount(getAssignedCount(examId, false, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                getCount(examId, ScanStatus.MANUAL_ABSENT, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+        ct.setAssignedCount(getAssignedCount(examId, false, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         ct.setAssignedCheckedCount(
         ct.setAssignedCheckedCount(
-                getAssignedCount(examId, true, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                getAssignedCount(examId, true, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         ct.setAbsentCheckCount(
         ct.setAbsentCheckCount(
-                getOmrAbsentCount(examId, false, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+                getOmrAbsentCount(examId, false, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         ct.setAbsentCheckedCount(
         ct.setAbsentCheckedCount(
-                getOmrAbsentCount(examId, true, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
-        ct.setObjectiveCheckCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseCode, coursePaperId,
+                getOmrAbsentCount(examId, true, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+        ct.setObjectiveCheckCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
                 OmrTaskStatus.WAITING.name(), dpr));
                 OmrTaskStatus.WAITING.name(), dpr));
-        ct.setObjectiveCheckedCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseCode, coursePaperId,
+        ct.setObjectiveCheckedCount(scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
                 OmrTaskStatus.PROCESSED.name(), dpr));
                 OmrTaskStatus.PROCESSED.name(), dpr));
-        ct.setIncompleteCount(getIncompleteCount(examId, courseCode, coursePaperId, MarkPaperStatus.FORMAL, dpr));
+        ct.setIncompleteCount(getIncompleteCount(examId, courseId, coursePaperId, MarkPaperStatus.FORMAL, dpr));
         return vo;
         return vo;
     }
     }
 
 
@@ -1100,13 +1100,13 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
     }
 
 
     @Override
     @Override
-    public void exportUnexist(Long examId, String courseCode, String coursePaperId, HttpServletResponse response) {
+    public void exportUnexist(Long examId, Long courseId, String coursePaperId, HttpServletResponse response) {
         try {
         try {
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
             DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
                     sysUser.getId(), ServletUtil.getRequest().getServletPath());
                     sysUser.getId(), ServletUtil.getRequest().getServletPath());
             List<UnexistStudentDto> unexistStudentDtoList = this.baseMapper.listUnexistStudentByExamIdAndCoursePaperId(
             List<UnexistStudentDto> unexistStudentDtoList = this.baseMapper.listUnexistStudentByExamIdAndCoursePaperId(
-                    examId, courseCode, coursePaperId, MarkPaperStatus.FORMAL.name(), dpr);
+                    examId, courseId, coursePaperId, MarkPaperStatus.FORMAL.name(), dpr);
             ExcelUtil.excelExport("评卷员工作量", UnexistStudentDto.class, unexistStudentDtoList, response);
             ExcelUtil.excelExport("评卷员工作量", UnexistStudentDto.class, unexistStudentDtoList, response);
         } catch (Exception e) {
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception("导出评卷员工作量失败");
             throw ExceptionResultEnum.ERROR.exception("导出评卷员工作量失败");
@@ -1350,11 +1350,11 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     }
     }
 
 
     @Override
     @Override
-    public int getAssignedCount(Long examId, Boolean checked, String courseCode, String coursePaperId,
+    public int getAssignedCount(Long examId, Boolean checked, Long courseId, String coursePaperId,
                                 MarkPaperStatus status, DataPermissionRule dpr) {
                                 MarkPaperStatus status, DataPermissionRule dpr) {
         MarkStudent markStudent = new MarkStudent();
         MarkStudent markStudent = new MarkStudent();
         markStudent.setExamId(examId);
         markStudent.setExamId(examId);
-        markStudent.setCourseCode(courseCode);
+        markStudent.setCourseId(courseId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setCoursePaperId(coursePaperId);
         markStudent.setAssigned(true);
         markStudent.setAssigned(true);
         markStudent.setAssignConfirmed(checked);
         markStudent.setAssignConfirmed(checked);
@@ -1567,8 +1567,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     @Override
     @Override
     public void updateByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet) {
     public void updateByBasicExamStudent(BasicExamStudent basicExamStudent, MarkPaper markPaper, Set<String> secretNumberSet) {
         MarkStudent markStudent = this.findByExamIdAndPaperNumberAndStudentCode(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), basicExamStudent.getStudentCode());
         MarkStudent markStudent = this.findByExamIdAndPaperNumberAndStudentCode(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), basicExamStudent.getStudentCode());
-        BasicCourse basicCourse = basicCourseService.getByCode(basicExamStudent.getCourseCode());
-        BasicTeachClazz basicTeachClazz = this.baseMapper.getBasicTeachClazzById(basicExamStudent.getClazzId());
         SysUser sysUser = sysUserService.getById(basicExamStudent.getTeacherId());
         SysUser sysUser = sysUserService.getById(basicExamStudent.getTeacherId());
         if (markStudent == null) {
         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(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());
@@ -1579,15 +1577,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                     markStudent.randomSecretNumber();
                     markStudent.randomSecretNumber();
                 }
                 }
             }
             }
-        } else {
-            markStudent.setStudentName(basicExamStudent.getStudentName());
-            markStudent.setCollege(basicExamStudent.getCollegeName());
-            markStudent.setMajorName(basicExamStudent.getMajorName());
-            markStudent.setClassName(basicTeachClazz == null ? null : basicTeachClazz.getClazzName());
-            markStudent.setExamPlace(basicExamStudent.getExamPlace());
-            markStudent.setExamRoom(basicExamStudent.getExamRoom());
-            markStudent.setTeacherId(basicExamStudent.getTeacherId());
-            markStudent.setTeacher(sysUser == null ? null : sysUser.getRealName());
         }
         }
         this.saveOrUpdate(markStudent);
         this.saveOrUpdate(markStudent);
     }
     }

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

@@ -4,10 +4,12 @@ import com.qmth.teachcloud.common.bean.dto.CampusExamRoomDto;
 import com.qmth.teachcloud.common.bean.dto.CoursePaperNumberDto;
 import com.qmth.teachcloud.common.bean.dto.CoursePaperNumberDto;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.dto.SemesterExamDto;
 import com.qmth.teachcloud.common.bean.dto.SemesterExamDto;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicSemester;
 import com.qmth.teachcloud.common.entity.BasicSemester;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
 import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
 import com.qmth.teachcloud.common.service.BasicSemesterService;
 import com.qmth.teachcloud.common.service.BasicSemesterService;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -37,6 +39,8 @@ public class ScanConditionServiceImpl implements ScanConditionService {
     @Resource
     @Resource
     private BasicSemesterService basicSemesterService;
     private BasicSemesterService basicSemesterService;
     @Resource
     @Resource
+    private BasicCourseService basicCourseService;
+    @Resource
     private MarkPaperService markPaperService;
     private MarkPaperService markPaperService;
     @Resource
     @Resource
     private MarkStudentService markStudentService;
     private MarkStudentService markStudentService;
@@ -76,12 +80,17 @@ public class ScanConditionServiceImpl implements ScanConditionService {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
         List<MarkPaper> markPaperList = markPaperService.listByExamId(examId, MarkPaperStatus.FORMAL, dpr);
         List<MarkPaper> markPaperList = markPaperService.listByExamId(examId, MarkPaperStatus.FORMAL, dpr);
-        Map<String, List<MarkPaper>> map = markPaperList.stream().collect(Collectors.groupingBy(m -> m.getCourseCode()));
+        Map<Long, List<MarkPaper>> map = markPaperList.stream().collect(Collectors.groupingBy(m -> m.getCourseId()));
         List<CoursePaperNumberDto> coursePaperNumberDtoList = new ArrayList<>();
         List<CoursePaperNumberDto> coursePaperNumberDtoList = new ArrayList<>();
-        for (Map.Entry<String, List<MarkPaper>> entry : map.entrySet()) {
+        for (Map.Entry<Long, List<MarkPaper>> entry : map.entrySet()) {
             CoursePaperNumberDto coursePaperNumberDto = new CoursePaperNumberDto();
             CoursePaperNumberDto coursePaperNumberDto = new CoursePaperNumberDto();
-            coursePaperNumberDto.setCode(entry.getKey());
-            coursePaperNumberDto.setName(entry.getValue().get(0).getCourseName());
+            BasicCourse basicCourse = basicCourseService.getById(entry.getKey());
+            if (basicCourse == null) {
+                continue;
+            }
+            coursePaperNumberDto.setId(basicCourse.getId());
+            coursePaperNumberDto.setCode(basicCourse.getCode());
+            coursePaperNumberDto.setName(basicCourse.getName());
             List<CoursePaperNumberDto.PaperNumberDto> paperNumberDtoList = new ArrayList<>();
             List<CoursePaperNumberDto.PaperNumberDto> paperNumberDtoList = new ArrayList<>();
             for (MarkPaper markPaper : entry.getValue()) {
             for (MarkPaper markPaper : entry.getValue()) {
                 CoursePaperNumberDto.PaperNumberDto paperNumberDto = new CoursePaperNumberDto.PaperNumberDto();
                 CoursePaperNumberDto.PaperNumberDto paperNumberDto = new CoursePaperNumberDto.PaperNumberDto();

+ 10 - 7
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/ScanOmrTaskServiceImpl.java

@@ -6,6 +6,9 @@ import java.util.stream.Collectors;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.NotNull;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.models.auth.In;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -598,22 +601,22 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
     }
     }
 
 
     @Override
     @Override
-    public ScanOmrTaskStatusDto getStatus(Long examId, String courseCode, String coursePaperId) {
+    public ScanOmrTaskStatusDto getStatus(Long examId, Long courseId, String coursePaperId) {
         SysUser user = (SysUser) ServletUtil.getRequestUser();
         SysUser user = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(user.getSchoolId(), user.getId(),
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(user.getSchoolId(), user.getId(),
                 ServletUtil.getRequest().getServletPath());
                 ServletUtil.getRequest().getServletPath());
         ScanOmrTaskStatusDto status = new ScanOmrTaskStatusDto();
         ScanOmrTaskStatusDto status = new ScanOmrTaskStatusDto();
-        status.setFinishCount(this.getFinishStudentCountByExamAndUserId(examId, courseCode, coursePaperId,
+        status.setFinishCount(this.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
                 OmrTaskStatus.PROCESSED.name(), dpr));
                 OmrTaskStatus.PROCESSED.name(), dpr));
-        status.setTodoCount(this.getFinishStudentCountByExamAndUserId(examId, courseCode, coursePaperId,
+        status.setTodoCount(this.getFinishStudentCountByExamAndUserId(examId, courseId, coursePaperId,
                 OmrTaskStatus.WAITING.name(), dpr));
                 OmrTaskStatus.WAITING.name(), dpr));
         return status;
         return status;
     }
     }
 
 
     @Override
     @Override
-    public int getFinishStudentCountByExamAndUserId(Long examId, String courseCode, String coursePaperId, String status,
+    public int getFinishStudentCountByExamAndUserId(Long examId, Long courseId, String coursePaperId, String status,
             DataPermissionRule dpr) {
             DataPermissionRule dpr) {
-        return this.baseMapper.getStudentCountByExamAndStatusAndUserId(examId, courseCode, coursePaperId, status,
+        return this.baseMapper.getStudentCountByExamAndStatusAndUserId(examId, courseId, coursePaperId, status,
                 MarkPaperStatus.FORMAL.name(), dpr);
                 MarkPaperStatus.FORMAL.name(), dpr);
     }
     }
 
 
@@ -650,11 +653,11 @@ public class ScanOmrTaskServiceImpl extends ServiceImpl<ScanOmrTaskMapper, ScanO
     }
     }
 
 
     @Override
     @Override
-    public List<ScanStudentDto> list(Long examId, String courseCode, String coursePaperId, OmrTaskStatus status) {
+    public IPage<ScanStudentDto> list(Long examId, Long courseId, String coursePaperId, OmrTaskStatus status, Integer pageNumber, Integer pageSize) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(),
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
                 sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        return this.baseMapper.listByExamIdAndStatusAndUserId(examId, courseCode, coursePaperId, status,
+        return this.baseMapper.listByExamIdAndStatusAndUserId(new Page<>(pageNumber, pageSize), examId, courseId, coursePaperId, status,
                 MarkPaperStatus.FORMAL.name(), dpr);
                 MarkPaperStatus.FORMAL.name(), dpr);
     }
     }
 
 

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

@@ -71,8 +71,8 @@ public class ScanPackageServiceImpl extends ServiceImpl<ScanPackageMapper, ScanP
     private FileUploadService fileUploadService;
     private FileUploadService fileUploadService;
 
 
     @Override
     @Override
-    public int getCount(Long examId, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
-        return baseMapper.countPackageCode(examId, courseCode, coursePaperId, status.name(), dpr);
+    public int getCount(Long examId, Long courseId, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr) {
+        return baseMapper.countPackageCode(examId, courseId, coursePaperId, status.name(), dpr);
     }
     }
 
 
     @Override
     @Override

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

@@ -178,8 +178,8 @@
         select count(distinct mp.course_code) from mark_paper mp left join sys_user su on mp.user_id = su.id
         select count(distinct mp.course_code) from mark_paper mp left join sys_user su on mp.user_id = su.id
         <where>
         <where>
             and mp.exam_id = #{examId} AND mp.status = #{status}
             and mp.exam_id = #{examId} AND mp.status = #{status}
-            <if test="courseCode != null and courseCode != ''">
-                AND mp.course_code = #{courseCode}
+            <if test="courseId != null">
+                AND mp.course_id = #{courseId}
             </if>
             </if>
             <if test="coursePaperId != null and coursePaperId != ''">
             <if test="coursePaperId != null and coursePaperId != ''">
                 AND mp.course_paper_id = #{coursePaperId}
                 AND mp.course_paper_id = #{coursePaperId}
@@ -201,8 +201,8 @@
         select count(distinct mp.paper_number) from mark_paper mp left join sys_user su on mp.user_id = su.id
         select count(distinct mp.paper_number) from mark_paper mp left join sys_user su on mp.user_id = su.id
         <where>
         <where>
             and mp.exam_id = #{examId} AND mp.status = #{status}
             and mp.exam_id = #{examId} AND mp.status = #{status}
-            <if test="courseCode != null and courseCode != ''">
-                AND mp.course_code = #{courseCode}
+            <if test="courseId != null">
+                AND mp.course_id = #{courseId}
             </if>
             </if>
             <if test="coursePaperId != null and coursePaperId != ''">
             <if test="coursePaperId != null and coursePaperId != ''">
                 AND mp.course_paper_id = #{coursePaperId}
                 AND mp.course_paper_id = #{coursePaperId}

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

@@ -16,8 +16,8 @@
         select count(1)
         select count(1)
         FROM mark_paper_package t
         FROM mark_paper_package t
         where t.exam_id=#{examId}
         where t.exam_id=#{examId}
-        <if test="courseCode != null and courseCode != ''">
-            and t.course_code = #{courseCode}
+        <if test="courseId != null">
+            and t.course_id = #{courseId}
         </if>
         </if>
         <if test="coursePaperId != null and coursePaperId != ''">
         <if test="coursePaperId != null and coursePaperId != ''">
             and t.course_paper_id= #{coursePaperId}
             and t.course_paper_id= #{coursePaperId}

+ 9 - 6
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -240,8 +240,8 @@
         <if test="query.packageCode != null and query.packageCode !=''">
         <if test="query.packageCode != null and query.packageCode !=''">
             and t.package_code=#{query.packageCode}
             and t.package_code=#{query.packageCode}
         </if>
         </if>
-        <if test="query.courseCode != null and query.courseCode !=''">
-            and t.course_code=#{query.courseCode}
+        <if test="query.courseId != null">
+            and t.course_id=#{query.courseId}
         </if>
         </if>
         <if test="query.coursePaperId != null and query.coursePaperId !=''">
         <if test="query.coursePaperId != null and query.coursePaperId !=''">
             and t.course_paper_id=#{query.coursePaperId}
             and t.course_paper_id=#{query.coursePaperId}
@@ -523,16 +523,19 @@
         SELECT
         SELECT
         t.course_code courseCode,
         t.course_code courseCode,
         t.course_name courseName,
         t.course_name courseName,
+        so.name teachingRoomName,
         t.paper_number paperNumber,
         t.paper_number paperNumber,
         t.student_code studentCode,
         t.student_code studentCode,
         t.student_name studentName
         t.student_name studentName
         FROM
         FROM
         mark_student t left join sys_user su on t.create_id = su.id
         mark_student t left join sys_user su on t.create_id = su.id
+        left join basic_course bc on t.course_id = bc.id
+        left join sys_org so on bc.teaching_room_id = so.id
         WHERE
         WHERE
         t.exam_id = #{examId}
         t.exam_id = #{examId}
         AND t.scan_status = 'UNEXIST'
         AND t.scan_status = 'UNEXIST'
-        <if test="courseCode != null and courseCode != ''">
-            and t.course_code = #{courseCode}
+        <if test="courseId != null">
+            and t.course_id = #{courseId}
         </if>
         </if>
         <if test="coursePaperId != null and coursePaperId != ''">
         <if test="coursePaperId != null and coursePaperId != ''">
             and t.course_paper_id = #{coursePaperId}
             and t.course_paper_id = #{coursePaperId}
@@ -582,8 +585,8 @@
         select count(1) from mark_student ms left join sys_user su on ms.create_id = su.id
         select count(1) from mark_student ms left join sys_user su on ms.create_id = su.id
         <where>
         <where>
             and ms.exam_id = #{markStudent.examId}
             and ms.exam_id = #{markStudent.examId}
-            <if test="markStudent.courseCode != null and markStudent.courseCode != ''">
-                and ms.course_code = #{markStudent.courseCode}
+            <if test="markStudent.courseId != null">
+                and ms.course_id = #{markStudent.courseId}
             </if>
             </if>
             <if test="markStudent.paperNumber != null and markStudent.paperNumber != ''">
             <if test="markStudent.paperNumber != null and markStudent.paperNumber != ''">
                 and ms.paper_number = #{markStudent.paperNumber}
                 and ms.paper_number = #{markStudent.paperNumber}

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

@@ -42,8 +42,8 @@
 				<if test="examId != null">
 				<if test="examId != null">
 					and s.exam_id = #{examId}
 					and s.exam_id = #{examId}
 				</if>
 				</if>
-				<if test="courseCode != null and courseCode != ''">
-					and s.course_code = #{courseCode}
+				<if test="courseId != null">
+					and s.course_id = #{courseId}
 				</if>
 				</if>
 				<if test="coursePaperId != null and coursePaperId != ''">
 				<if test="coursePaperId != null and coursePaperId != ''">
 					and s.course_paper_id = #{coursePaperId}
 					and s.course_paper_id = #{coursePaperId}
@@ -76,8 +76,8 @@
 			<if test="examId != null">
 			<if test="examId != null">
 				and s.exam_id = #{examId}
 				and s.exam_id = #{examId}
 			</if>
 			</if>
-			<if test="courseCode != null and courseCode != ''">
-				and s.course_code = #{courseCode}
+			<if test="courseId != null">
+				and s.course_id = #{courseId}
 			</if>
 			</if>
 			<if test="coursePaperId != null and coursePaperId != ''">
 			<if test="coursePaperId != null and coursePaperId != ''">
 				and s.course_paper_id = #{coursePaperId}
 				and s.course_paper_id = #{coursePaperId}

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

@@ -24,8 +24,8 @@
 		select t.*,t.paper_number coursePaperNumber
 		select t.*,t.paper_number coursePaperNumber
 		FROM mark_paper_package t
 		FROM mark_paper_package t
         where t.exam_id=#{req.examId}
         where t.exam_id=#{req.examId}
-        <if test="req.courseCode != null and req.courseCode != ''">
-			and t.course_code = #{req.courseCode}
+        <if test="req.courseId != null">
+			and t.course_id = #{req.courseId}
 		</if>
 		</if>
 		<if test="req.coursePaperId != null and req.coursePaperId != ''">
 		<if test="req.coursePaperId != null and req.coursePaperId != ''">
 			and t.course_paper_id= #{req.coursePaperId}
 			and t.course_paper_id= #{req.coursePaperId}
@@ -71,8 +71,8 @@
 				AND sp.package_code = mpp.package_code
 				AND sp.package_code = mpp.package_code
 		WHERE
 		WHERE
 			sp.exam_id = #{examId}
 			sp.exam_id = #{examId}
-			<if test="courseCode != null and courseCode != ''">
-				AND mpp.course_code = #{courseCode}
+			<if test="courseId != null">
+				AND mpp.course_id = #{courseId}
 			</if>
 			</if>
 			<if test="coursePaperId != null and coursePaperId != ''">
 			<if test="coursePaperId != null and coursePaperId != ''">
 				AND mpp.course_paper_id = #{coursePaperId}
 				AND mpp.course_paper_id = #{coursePaperId}