Commit cbf37545 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

调用第三方url

See merge request !231
parents 2f682d97 07ec99a8
...@@ -50,4 +50,7 @@ public class TestRecords { ...@@ -50,4 +50,7 @@ public class TestRecords {
@ApiModelProperty("修复建议") @ApiModelProperty("修复建议")
private String remediation; private String remediation;
@ApiModelProperty("测试详情")
private String testDetails;
} }
...@@ -59,6 +59,12 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -59,6 +59,12 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
for (TestRecords records : recordsList) { for (TestRecords records : recordsList) {
if (Objects.equals(caseResultVO.getId(), records.getUsecaseId())) { if (Objects.equals(caseResultVO.getId(), records.getUsecaseId())) {
exists = true; exists = true;
if (!Objects.equals(caseResultVO.getStatus(), records.getTestResult())) {
records.setTestResult(caseResultVO.getStatus());
records.setRemediation(caseResultVO.getRemediation());
testRecordsService.updateById(records);
}
break; break;
} }
} }
...@@ -80,12 +86,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -80,12 +86,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (stepResultVOS != null && stepResultVOS.size() != 0) { if (stepResultVOS != null && stepResultVOS.size() != 0) {
List<String> stepList = new ArrayList<>(); List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
for (StepResultVO stepResultVO :stepResultVOS) { for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
String stepName = stepResultVO.getName(); String stepName = stepResultVO.getName();
stepList.add(stepName); // 给每个元素加上序号
String stepWithIndex = index + "." + stepName;
stepList.add(stepWithIndex);
index++;
// 测试详情
String testDetails = stepResultVO.getDescription();
testDetailsList.add(testDetails);
} }
testRecords.setTestMethod(StringUtils.join(stepList,",")); testRecords.setTestMethod(StringUtils.join(stepList,"`"));
testRecords.setTestDetails(StringUtils.join(testDetailsList,"\n"));
} }
list.add(testRecords); list.add(testRecords);
...@@ -141,12 +159,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -141,12 +159,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (stepResultVOS != null && stepResultVOS.size() != 0) { if (stepResultVOS != null && stepResultVOS.size() != 0) {
List<String> stepList = new ArrayList<>(); List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
for (StepResultVO stepResultVO :stepResultVOS) { for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
String stepName = stepResultVO.getName(); String stepName = stepResultVO.getName();
stepList.add(stepName); // 给每个元素加上序号
String stepWithIndex = index + "." + stepName;
stepList.add(stepWithIndex);
index++;
// 测试详情
String testDetails = stepResultVO.getDescription();
testDetailsList.add(testDetails);
} }
testRecords.setTestMethod(StringUtils.join(stepList,",")); testRecords.setTestMethod(StringUtils.join(stepList,"`"));
testRecords.setTestDetails(StringUtils.join(testDetailsList,"\n"));
} }
list.add(testRecords); list.add(testRecords);
......
...@@ -16,12 +16,13 @@ ...@@ -16,12 +16,13 @@
<result property="testMethod" column="test_method" jdbcType="LONGNVARCHAR"/> <result property="testMethod" column="test_method" jdbcType="LONGNVARCHAR"/>
<result property="testResult" column="test_result" jdbcType="VARCHAR"/> <result property="testResult" column="test_result" jdbcType="VARCHAR"/>
<result property="remediation" column="remediation" jdbcType="VARCHAR"/> <result property="remediation" column="remediation" jdbcType="VARCHAR"/>
<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 SELECT id, project_id, task_id, usecase, 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>
</mapper> </mapper>
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