Commit 37d73e77 authored by wdy's avatar wdy

定时任务增加测试时间、测试编号

parent e3e3d842
...@@ -30,11 +30,14 @@ public class TestRecords { ...@@ -30,11 +30,14 @@ public class TestRecords {
@ApiModelProperty("用例名称") @ApiModelProperty("用例名称")
private String usecase; private String usecase;
@ApiModelProperty("用例编号")
private String usecaseNo;
@ApiModelProperty("用例id") @ApiModelProperty("用例id")
private String usecaseId; private String usecaseId;
@ApiModelProperty("测试时间") @ApiModelProperty("测试时间")
private Date testTime; private String testTime;
@ApiModelProperty("用例简述") @ApiModelProperty("用例简述")
private String description; private String description;
......
...@@ -28,6 +28,12 @@ public class CaseResultVO { ...@@ -28,6 +28,12 @@ public class CaseResultVO {
@ApiModelProperty("用例检测状态枚举 UNPROCESSED: 未处理 PASSED: 通过 FAILED: 失败 PROCESSING: 处理中 IGNORED: 已忽略") @ApiModelProperty("用例检测状态枚举 UNPROCESSED: 未处理 PASSED: 通过 FAILED: 失败 PROCESSING: 处理中 IGNORED: 已忽略")
private String status; private String status;
@ApiModelProperty("用例编号")
private String serial_number;
@ApiModelProperty("用例开始时间")
private Integer start_time;
@ApiModelProperty("用例步骤结果列表") @ApiModelProperty("用例步骤结果列表")
List<StepResultVO> step_result_list; List<StepResultVO> step_result_list;
} }
...@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -85,6 +86,14 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -85,6 +86,14 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
testRecords.setRiskLevel(caseResultVO.getRisk_level()); testRecords.setRiskLevel(caseResultVO.getRisk_level());
testRecords.setTestResult(caseResultVO.getStatus()); testRecords.setTestResult(caseResultVO.getStatus());
testRecords.setRemediation(caseResultVO.getRemediation()); testRecords.setRemediation(caseResultVO.getRemediation());
testRecords.setUsecaseNo(caseResultVO.getSerial_number());
//测试开始时间
if (caseResultVO.getStart_time() != null) {
Date date = new Date(caseResultVO.getStart_time());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
String testTime = sdf.format(date);
testRecords.setTestTime(testTime);
}
// 用例步骤 // 用例步骤
List<StepResultVO> stepResultVOS = caseResultVO.getStep_result_list(); List<StepResultVO> stepResultVOS = caseResultVO.getStep_result_list();
...@@ -163,6 +172,14 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -163,6 +172,14 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
testRecords.setRiskLevel(caseResultVO.getRisk_level()); testRecords.setRiskLevel(caseResultVO.getRisk_level());
testRecords.setTestResult(caseResultVO.getStatus()); testRecords.setTestResult(caseResultVO.getStatus());
testRecords.setRemediation(caseResultVO.getRemediation()); testRecords.setRemediation(caseResultVO.getRemediation());
testRecords.setUsecaseNo(caseResultVO.getSerial_number());
//测试开始时间
if (caseResultVO.getStart_time() != null) {
Date date = new Date(caseResultVO.getStart_time());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
String testTime = sdf.format(date);
testRecords.setTestTime(testTime);
}
// 用例步骤 // 用例步骤
List<StepResultVO> stepResultVOS = caseResultVO.getStep_result_list(); List<StepResultVO> stepResultVOS = caseResultVO.getStep_result_list();
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
<result property="projectId" column="project_id" jdbcType="VARCHAR"/> <result property="projectId" column="project_id" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="BIGINT"/> <result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="usecase" column="usecase" jdbcType="VARCHAR"/> <result property="usecase" column="usecase" jdbcType="VARCHAR"/>
<result property="usecaseNo" column="usecase_no" jdbcType="VARCHAR"/>
<result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/> <result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/>
<result property="testTime" column="test_time" jdbcType="TIMESTAMP"/> <result property="testTime" column="test_time" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="LONGNVARCHAR"/> <result property="description" column="description" jdbcType="LONGNVARCHAR"/>
<result property="riskLevel" column="risk_level" jdbcType="VARCHAR"/> <result property="riskLevel" column="risk_level" jdbcType="VARCHAR"/>
<result property="testMethod" column="test_method" jdbcType="LONGNVARCHAR"/> <result property="testMethod" column="test_method" jdbcType="LONGNVARCHAR"/>
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<result property="testDetails" column="test_details" jdbcType="LONGNVARCHAR"/> <result property="testDetails" column="test_details" jdbcType="LONGNVARCHAR"/>
</resultMap> </resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.TestRecords"> <select id="findByTaskId" resultType="com.ruoyi.domain.TestRecords">
SELECT id, project_id, task_id, usecase, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details SELECT id, project_id, task_id, usecase, usecase_no, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details
FROM t_test_records FROM t_test_records
WHERE project_id = #{id} WHERE project_id = #{id}
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment