wangliang 4 лет назад
Родитель
Сommit
9e9325acdd

+ 6 - 6
themis-business/src/main/java/com/qmth/themis/business/dto/response/TBTaskDto.java

@@ -18,8 +18,8 @@ public class TBTaskDto implements Serializable {
     private String status;//状态
     private String summary;//任务状态,init:未开始,running:开始执行,finish:执行结束
     private Double progress;//进度
-    private String hasResultFile;//结果文件路径
-    private String hasErrorFile;//错误文件路径
+    private String hasResultFile;//导出文件路径
+    private String hasReportFile;//报告路径
     private Date createTime;//创建时间
     private Date startTime;//开始时间
     private Date finishTime;//结束时间
@@ -100,12 +100,12 @@ public class TBTaskDto implements Serializable {
         this.hasResultFile = hasResultFile;
     }
 
-    public String getHasErrorFile() {
-        return hasErrorFile;
+    public String getHasReportFile() {
+        return hasReportFile;
     }
 
-    public void setHasErrorFile(String hasErrorFile) {
-        this.hasErrorFile = hasErrorFile;
+    public void setHasReportFile(String hasReportFile) {
+        this.hasReportFile = hasReportFile;
     }
 
     public Date getCreateTime() {

+ 19 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEExamCourseDto.java

@@ -1,6 +1,7 @@
 package com.qmth.themis.business.dto.response;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * @Description: 科目dto
@@ -21,6 +22,24 @@ public class TEExamCourseDto implements Serializable {
     private Integer audioPlayCount;//音频播放次数
     private Integer hasAudio;//题干包含音频,0:不包含,1:包含
     private Integer hasPaper;//是否绑定试卷,0:没绑定,1:绑定
+    private Date updateTime;//更新时间
+    private String updateName;//更新人
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
 
     public Long getId() {
         return id;

+ 2 - 15
themis-business/src/main/java/com/qmth/themis/business/entity/TEExamCourse.java

@@ -2,6 +2,7 @@ package com.qmth.themis.business.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.qmth.themis.business.base.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -15,13 +16,9 @@ import java.io.Serializable;
  * @Date: 2020/6/25
  */
 @ApiModel(value = "t_e_exam_course", description = "考试科目")
-public class TEExamCourse implements Serializable {
+public class TEExamCourse extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    @ApiModelProperty(value = "主键")
-    @TableId(value = "id")
-    private Long id;
-
     @ApiModelProperty(value = "考试ID")
     @TableField(value = "exam_id")
     private Long examId;
@@ -62,14 +59,6 @@ public class TEExamCourse implements Serializable {
         return serialVersionUID;
     }
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
     public Long getExamId() {
         return examId;
     }
@@ -141,6 +130,4 @@ public class TEExamCourse implements Serializable {
 	public void setHasAudio(Integer hasAudio) {
 		this.hasAudio = hasAudio;
 	}
-    
-    
 }

+ 8 - 4
themis-business/src/main/resources/db/init.sql

@@ -865,6 +865,10 @@ CREATE TABLE `t_e_exam_course` (
   `has_answer` tinyint DEFAULT NULL COMMENT '是否已补齐标答,0:否,1:是',
   `audio_play_count` int DEFAULT NULL COMMENT '音频播放次数',
   `has_audio` varchar(30) DEFAULT NULL COMMENT '是否包含音频题目,0:不包含,1:包含',
+  `create_id` bigint DEFAULT NULL COMMENT '创建人id',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_id` bigint DEFAULT NULL COMMENT '更新人id',
+  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`id`),
   UNIQUE KEY `t_e_exam_course_examId_courseCode_Idx` (`exam_id`,`course_code`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试科目';
@@ -873,10 +877,10 @@ CREATE TABLE `t_e_exam_course` (
 -- Records of t_e_exam_course
 -- ----------------------------
 BEGIN;
-INSERT INTO `t_e_exam_course` VALUES (18741288576745472, 18738036992901120, 'YW001', '大学语文', 1, 1, 2, 1, 5, NULL);
-INSERT INTO `t_e_exam_course` VALUES (18741587748061184, 18738036992901120, 'YY001', '大学英语', 1, 1, 2, 1, 5, NULL);
-INSERT INTO `t_e_exam_course` VALUES (18743613794025472, 18738491387019264, 'YW002', '大学语文', 1, 1, 3, 1, 5, NULL);
-INSERT INTO `t_e_exam_course` VALUES (18743690130358272, 18738491387019264, 'YY002', '大学英语', 1, 1, 3, 1, 5, NULL);
+INSERT INTO `t_e_exam_course` VALUES (18741288576745472, 18738036992901120, 'YW001', '大学语文', 1, 1, 2, 1, 5, '1', 1, '2020-07-22 16:58:17', 2, '2020-07-23 16:58:17');
+INSERT INTO `t_e_exam_course` VALUES (18741587748061184, 18738036992901120, 'YY001', '大学英语', 1, 1, 2, 1, 5, '1', 1, '2020-07-22 16:58:17', 3, '2020-07-24 16:58:17');
+INSERT INTO `t_e_exam_course` VALUES (18743613794025472, 18738491387019264, 'YW002', '大学语文', 1, 1, 3, 1, 5, '1', 1, '2020-07-22 16:58:17', 2, '2020-07-25 16:58:17');
+INSERT INTO `t_e_exam_course` VALUES (18743690130358272, 18738491387019264, 'YY002', '大学英语', 1, 1, 3, 1, 5, '1', 1, '2020-07-22 16:58:17', 4, '2020-07-26 16:58:17');
 COMMIT;
 
 -- ----------------------------

+ 2 - 2
themis-business/src/main/resources/mapper/TBTaskHistoryMapper.xml

@@ -10,8 +10,8 @@
             tbth.status,
             tbth.summary,
             tbth.progress,
-            ISNULL(tbth.result_file_path) as hasResultFile,
-            ISNULL(tbth.error_file_path) as hasErrorFile,
+            if(ISNULL(tbth.result_file_path),0,1) as hasResultFile,
+            if(ISNULL(tbth.report_file_path),0,1) as hasReportFile,
             tbth.create_time as createTime,
             tbth.start_time as startTime,
             tbth.finish_time as finishTime,

+ 34 - 11
themis-business/src/main/resources/mapper/TEExamCourseMapper.xml

@@ -5,17 +5,39 @@
 
 	<select id="examCourseQuery" resultType="com.qmth.themis.business.dto.response.TEExamCourseDto">
 		select
-			teec.course_code as courseCode,
-			teec.course_name as courseName,
-			teec.paper_count as paperCount,
-			if(teec.paper_count > 0,1,0) as hasPaper,
-			teec.objective_shuffle as objectiveShuffle,
-			teec.option_shuffle as optionShuffle,
-			teec.audio_play_count as audioPlayCount,
-			teec.has_answer as hasAnswer,
-			teec.has_audio as hasAudio
-			from
-			t_e_exam_course teec
+		t.id,
+		t.courseCode,
+		t.courseName,
+		t.paperCount,
+		t.hasPaper,
+		t.objectiveShuffle,
+		t.optionShuffle,
+		t.audioPlayCount,
+		t.hasAnswer,
+		t.hasAudio,
+		if(t.updateName is not null, t.updateName, t.createName) as updateName,
+		if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime
+		from
+		(
+		select
+		teec.id,teec.course_code as courseCode, teec.course_name as courseName, teec.paper_count as paperCount,
+		if(teec.paper_count > 0, 1, 0) as hasPaper, teec.objective_shuffle as objectiveShuffle, teec.option_shuffle as
+		optionShuffle, teec.audio_play_count as audioPlayCount, teec.has_answer as hasAnswer, teec.has_audio as
+		hasAudio, teec.create_time as createTime, teec.update_time as updateTime, (
+		select
+		t.name
+		from
+		t_b_user t
+		where
+		t.id = teec.create_id) as createName, (
+		select
+		t.name
+		from
+		t_b_user t
+		where
+		t.id = teec.update_id) as updateName
+		from
+		t_e_exam_course teec
 		left join t_e_exam tee on teec.exam_id = tee.id
 		<where>
 			<if test="examId != null and examId != ''">
@@ -38,6 +60,7 @@
 				</choose>
 			</if>
 		</where>
+		) t order by t.courseCode
 	</select>
 
 	<select id="findByCode"