Commit 1fb3b15e authored by wdy's avatar wdy

调用第三方url

parent c07ce22a
......@@ -50,4 +50,7 @@ public class TestRecords {
@ApiModelProperty("修复建议")
private String remediation;
@ApiModelProperty("测试详情")
private String testDetails;
}
......@@ -59,6 +59,12 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
for (TestRecords records : recordsList) {
if (Objects.equals(caseResultVO.getId(), records.getUsecaseId())) {
exists = true;
if (!Objects.equals(caseResultVO.getStatus(), records.getTestResult())) {
records.setTestResult(caseResultVO.getStatus());
records.setRemediation(caseResultVO.getRemediation());
testRecordsService.updateById(records);
}
break;
}
}
......@@ -80,12 +86,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (stepResultVOS != null && stepResultVOS.size() != 0) {
List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
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);
......@@ -141,12 +159,24 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (stepResultVOS != null && stepResultVOS.size() != 0) {
List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
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);
......
......@@ -16,9 +16,10 @@
<result property="testMethod" column="test_method" jdbcType="LONGNVARCHAR"/>
<result property="testResult" column="test_result" jdbcType="VARCHAR"/>
<result property="remediation" column="remediation" jdbcType="VARCHAR"/>
<result property="testDetails" column="test_details" jdbcType="LONGNVARCHAR"/>
</resultMap>
<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
WHERE project_id = #{id}
</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