Ver código fonte

Merge branch 'dev'
1

wangliang 4 anos atrás
pai
commit
1ceb45e18d

+ 3 - 3
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -353,7 +353,7 @@ public class TEExamStudentController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
-        commonMarkResult(examId);
+//        commonMarkResult(examId);
         return ResultUtil.ok(teExamStudentService.markResultQuery(new Page<>(pageNumber, pageSize), examId, activityId, identity, name, courseCode));
     }
 
@@ -371,7 +371,7 @@ public class TEExamStudentController {
         }
         TBTaskHistory tbTaskHistory = null;
         try {
-            commonMarkResult(examId);
+//            commonMarkResult(examId);
             Map transMap = new HashMap();
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
             //往任务表里插一条数据
@@ -414,7 +414,7 @@ public class TEExamStudentController {
         }
         TBTaskHistory tbTaskHistory = null;
         try {
-            commonMarkResult(examId);
+//            commonMarkResult(examId);
             Map transMap = new HashMap();
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
             //往任务表里插一条数据

+ 36 - 21
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 = "批次名称")
@@ -33,7 +37,7 @@ public class MarkResultSimpleExportDto {
     private String courseName;
 
     @ExcelNote(value = "考场代码")
-    private String roomCode; //考场代码
+    private String roomCode;
 
     @ExcelNote(value = "考场名称")
     private String roomName; //考场名称
@@ -48,27 +52,38 @@ public class MarkResultSimpleExportDto {
 
     @ApiModelProperty(value = "是否缺考")
     @ExcelNote(value = "是否缺考")
-    private Boolean examAbsent;
+    private String examAbsent;
 
     @ApiModelProperty(value = "违纪次数")
     @ExcelNote(value = "违纪次数")
-    private Integer breachCount;
+    private String breachCount;
 
     @ApiModelProperty(value = "考试次数")
-    @ExcelNote(value = "examCount")
-    private Integer examCount;
+    @ExcelNote(value = "考试次数")
+    private String examCount;
 
     @ApiModelProperty(value = "客观分")
     @ExcelNote(value = "客观分")
-    private Double objectiveScore;
+    private String objectiveScore;
 
     @ApiModelProperty(value = "主观分")
     @ExcelNote(value = "主观分")
-    private Double subjectiveScore;
+    private String subjectiveScore;
 
     @ApiModelProperty(value = "总分")
     @ExcelNote(value = "总分")
-    private Double sumScore;
+    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;
@@ -142,51 +157,51 @@ public class MarkResultSimpleExportDto {
         this.classNo = classNo;
     }
 
-    public Boolean getExamAbsent() {
+    public String getExamAbsent() {
         return examAbsent;
     }
 
-    public void setExamAbsent(Boolean examAbsent) {
+    public void setExamAbsent(String examAbsent) {
         this.examAbsent = examAbsent;
     }
 
-    public Integer getBreachCount() {
+    public String getBreachCount() {
         return breachCount;
     }
 
-    public void setBreachCount(Integer breachCount) {
+    public void setBreachCount(String breachCount) {
         this.breachCount = breachCount;
     }
 
-    public Integer getExamCount() {
+    public String getExamCount() {
         return examCount;
     }
 
-    public void setExamCount(Integer examCount) {
+    public void setExamCount(String examCount) {
         this.examCount = examCount;
     }
 
-    public Double getObjectiveScore() {
+    public String getObjectiveScore() {
         return objectiveScore;
     }
 
-    public void setObjectiveScore(Double objectiveScore) {
+    public void setObjectiveScore(String objectiveScore) {
         this.objectiveScore = objectiveScore;
     }
 
-    public Double getSubjectiveScore() {
+    public String getSubjectiveScore() {
         return subjectiveScore;
     }
 
-    public void setSubjectiveScore(Double subjectiveScore) {
+    public void setSubjectiveScore(String subjectiveScore) {
         this.subjectiveScore = subjectiveScore;
     }
 
-    public Double getSumScore() {
+    public String getSumScore() {
         return sumScore;
     }
 
-    public void setSumScore(Double sumScore) {
+    public void setSumScore(String sumScore) {
         this.sumScore = sumScore;
     }
 }

+ 15 - 3
themis-business/src/main/java/com/qmth/themis/business/dto/response/MarkResultDto.java

@@ -43,7 +43,7 @@ public class MarkResultDto implements Serializable {
     private String classNo;
 
     @ApiModelProperty(value = "缺考")
-    private Boolean examAbsent;
+    private String examAbsent;
 
     @ApiModelProperty(value = "违纪次数")
     private Integer breachCount;
@@ -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;
     }
@@ -167,11 +179,11 @@ public class MarkResultDto implements Serializable {
         this.classNo = classNo;
     }
 
-    public Boolean getExamAbsent() {
+    public String getExamAbsent() {
         return examAbsent;
     }
 
-    public void setExamAbsent(Boolean examAbsent) {
+    public void setExamAbsent(String examAbsent) {
         this.examAbsent = examAbsent;
     }
 

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

@@ -85,7 +85,7 @@ public class TaskMarkResultSimpleExportTemplete implements TaskExportTemplete {
             }
             //创建excel
             wb = new SXSSFWorkbook();
-            Sheet sheet = wb.createSheet("成绩简版导出");
+            Sheet sheet = wb.createSheet("成绩统计简版");
             CellStyle style = wb.createCellStyle();
             style.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
             style.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中

+ 2 - 1
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) {
@@ -86,7 +87,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
             }
             //创建excel
             wb = new SXSSFWorkbook();
-            Sheet sheet = wb.createSheet("成绩标准版导出");
+            Sheet sheet = wb.createSheet("成绩统计标准版");
             CellStyle style = wb.createCellStyle();
             style.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
             style.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中

+ 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

+ 14 - 5
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -291,7 +291,7 @@
 		t.roomName,
 		t.grade,
 		t.classNo,
-		if(t.examCount <![CDATA[ <= ]]> 0,true,false) as examAbsent,
+		if(t.examCount <![CDATA[ <= ]]> 0,'是','否') as examAbsent,
 		t.examCount,
 		t.examName,
 		if(t.breachCount is null,0,t.breachCount) as breachCount,
@@ -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