wangliang 4 лет назад
Родитель
Сommit
05c6e57620

+ 16 - 1
themis-business/src/main/java/com/qmth/themis/business/dto/MarkResultSimpleExportDto.java

@@ -1,8 +1,12 @@
 package com.qmth.themis.business.dto;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.themis.business.annotation.ExcelNote;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.io.Serializable;
+
 /**
  * @Description: 考场导出 dto
  * @Param:
@@ -10,7 +14,7 @@ import io.swagger.annotations.ApiModelProperty;
  * @Author: wangliang
  * @Date: 2020/7/20
  */
-public class MarkResultSimpleExportDto {
+public class MarkResultSimpleExportDto implements Serializable {
 
     @ApiModelProperty(value = "批次名称")
     @ExcelNote(value = "批次名称")
@@ -70,6 +74,17 @@ public class MarkResultSimpleExportDto {
     @ExcelNote(value = "总分")
     private String sumScore;
 
+    @ApiModelProperty(value = "试卷ID")
+    private String paperId;
+
+    public String getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(String paperId) {
+        this.paperId = paperId;
+    }
+
     public String getRoomCode() {
         return roomCode;
     }

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/MarkResultDto.java

@@ -71,6 +71,18 @@ public class MarkResultDto implements Serializable {
     @ApiModelProperty(value = "批次名称")
     private String examName;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "试卷ID")
+    private Long paperId;
+
+    public Long getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(Long paperId) {
+        this.paperId = paperId;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 1 - 0
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskMarkResultStandardExportTemplete.java

@@ -70,6 +70,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
             String name = (String) map.get("name");
             String courseCode = (String) map.get("courseCode");
             List<MarkResultSimpleExportDto> markResultSimpleExportDtoList = teExamStudentService.markResultQueryExport(examId, activityId, identity, name, courseCode);
+
             boolean oss = (boolean) taskExportCommon.getOssEnv().get(SystemConstant.OSS);
             StringJoiner stringJoiner = new StringJoiner("");
             if (!oss) {

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamReexamMapper.xml

@@ -14,7 +14,7 @@
             tees.course_name as courseName,
             tees.exam_id as examId,
             tee.exam_count - tees.already_exam_count as examCount,
-            (select count(1) from t_oe_exam_record toer where (toer.status <![CDATA[ <> ]]> 'FINISHED' and toer.status <![CDATA[ <> ]]> 'PERSISTED')) as statusCount
+            (select count(1) from t_oe_exam_record toer where (toer.status <![CDATA[ <> ]]> 'FINISHED' and toer.status <![CDATA[ <> ]]> 'PERSISTED') and toer.exam_student_id = tees.id) as statusCount
         from
             t_e_exam_student tees
             left join t_e_exam tee on

+ 13 - 4
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -299,11 +299,11 @@
 		ifnull(t.objectiveScore,0) as sumScore,
 		t.examId,
 		t.examActivityId,
+		t.paperId,
 		0 as subjectiveScore
 		from
 		(
-		select
-		tee.id as examId,tee.name as examName,teea.id as examActivityId, teea.code as examActivityCode, tes.name, tes.`identity`, tees.course_code as courseCode, tees.course_name as courseName, tees.room_code as roomCode, tees.room_name as roomName, tees.grade, tees.class_no as classNo, (
+		select tee.id as examId,tee.name as examName,teea.id as examActivityId, teea.code as examActivityCode, tes.name, tes.`identity`, tees.course_code as courseCode, tees.course_name as courseName, tees.room_code as roomCode, tees.room_name as roomName, tees.grade, tees.class_no as classNo, (
 		select
 		count(1)
 		from
@@ -312,12 +312,21 @@
 		toer.exam_student_id = tees.id) as examCount,
 		(select sum(toer.breach_status) from t_oe_exam_record toer
 		where toer.exam_student_id = tees.id and toer.breach_status = 0) as breachCount,
-		(select max(toer.objective_score) from t_oe_exam_record toer
-		where toer.exam_student_id = tees.id and (toer.breach_status = 1 or breach_status is null) and (toer.status = 'FINISHED' or toer.status = 'PERSISTED')) as objectiveScore
+		temp.objective_score as objectiveScore,
+		temp.paper_id as paperId
 		from
 		t_e_student tes
 		left join t_e_exam_student tees on
 		tees.student_id = tes.id
+		left join (select
+			max(toer.objective_score) as objective_score,toer.paper_id,toer.exam_student_id
+			from
+			t_oe_exam_record toer
+			where
+			(toer.breach_status = 1
+			or breach_status is null)
+			and (toer.status = 'FINISHED'
+			or toer.status = 'PERSISTED') group by paper_id,exam_student_id) temp on temp.exam_student_id = tees.id
 		left join t_e_exam tee on
 		tee.id = tees.exam_id
 		left join t_e_exam_activity teea on