add:测试计划执行用例报告删除api
This commit is contained in:
@@ -5,6 +5,7 @@ import com.test.common.core.controller.BaseController;
|
|||||||
import com.test.common.core.domain.AjaxResult;
|
import com.test.common.core.domain.AjaxResult;
|
||||||
import com.test.common.core.page.TableDataInfo;
|
import com.test.common.core.page.TableDataInfo;
|
||||||
import com.test.common.enums.BusinessType;
|
import com.test.common.enums.BusinessType;
|
||||||
|
import com.test.test.domain.TestReport;
|
||||||
import com.test.test.domain.qo.IDQO;
|
import com.test.test.domain.qo.IDQO;
|
||||||
import com.test.test.domain.qo.TestReportAddQO;
|
import com.test.test.domain.qo.TestReportAddQO;
|
||||||
import com.test.test.domain.vo.TestReportVo;
|
import com.test.test.domain.vo.TestReportVo;
|
||||||
@@ -53,4 +54,26 @@ public class TestReportController extends BaseController {
|
|||||||
public AjaxResult addTestReport(@RequestBody TestReportAddQO testReportAddQO) {
|
public AjaxResult addTestReport(@RequestBody TestReportAddQO testReportAddQO) {
|
||||||
return toAjax(testReportService.addTestReport(testReportAddQO));
|
return toAjax(testReportService.addTestReport(testReportAddQO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划关联测试报告详情
|
||||||
|
*/
|
||||||
|
@PostMapping("/caseExecuteDetail")
|
||||||
|
public AjaxResult caseExecuteDetail(@RequestBody IDQO id) {
|
||||||
|
return success(testReportService.selectCaseTestReportById(id.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试报告
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Log(title = "测试报告", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/delExecuteCaseReport")
|
||||||
|
public AjaxResult delExecuteCaseReport(@RequestBody IDQO id) {
|
||||||
|
TestReport testReport = testReportService.selectCaseTestReportById(id.getId());
|
||||||
|
testReport.setDelFlag("1");
|
||||||
|
return toAjax(testReportService.updateExecuteCaseReport(testReport));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ public class TestReportVo extends BaseEntity {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -4331077290310280474L;
|
private static final long serialVersionUID = -4331077290310280474L;
|
||||||
|
|
||||||
|
/** 测试报告id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试报告名称
|
* 测试报告名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,4 +20,18 @@ public interface TestReportMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int addTestReport(TestReport testReport);
|
int addTestReport(TestReport testReport);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用例执行测试报告详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TestReport selectCaseTestReportById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用例执行测试报告
|
||||||
|
* @param testReport
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateExecuteCaseReport(TestReport testReport);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,18 @@ public interface ITestReportService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int addTestReport(TestReportAddQO testReportAddQO);
|
public int addTestReport(TestReportAddQO testReportAddQO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新执行用例测试报告
|
||||||
|
* @param testReport
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int updateExecuteCaseReport(TestReport testReport);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试报告详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public TestReport selectCaseTestReportById(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,27 @@ public class TestReportServiceImpl implements ITestReportService {
|
|||||||
return testPlanReportMapper.insertTestPlanReport(testReportAddQO);
|
return testPlanReportMapper.insertTestPlanReport(testReportAddQO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新执行用例报告
|
||||||
|
* @param testReport
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateExecuteCaseReport(TestReport testReport) {
|
||||||
|
testReport.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return testReportMapper.updateExecuteCaseReport(testReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询报告
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TestReport selectCaseTestReportById(Long id) {
|
||||||
|
return testReportMapper.selectCaseTestReportById(id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成随机序列号
|
* 生成随机序列号
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -31,19 +31,71 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<resultMap type="TestReport" id="TestReportResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="serialNumber" column="serial_number"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="result" column="result"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="report" column="report"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="version" column="version"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTestReportVo">
|
||||||
|
SELECT id,
|
||||||
|
serial_number,
|
||||||
|
name,
|
||||||
|
result,
|
||||||
|
status,
|
||||||
|
report,
|
||||||
|
update_by,
|
||||||
|
create_time,
|
||||||
|
update_time,
|
||||||
|
version,
|
||||||
|
del_flag
|
||||||
|
FROM test_report
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectTestReportList" parameterType="Long" resultType="TestReportVo">
|
<select id="selectTestReportList" parameterType="Long" resultType="TestReportVo">
|
||||||
SELECT
|
SELECT tr.id AS id,
|
||||||
tr.name AS name,
|
tr.name AS name,
|
||||||
tr.result AS result,
|
tr.result AS result,
|
||||||
tr.report AS report,
|
tr.report AS report,
|
||||||
tr.status AS status,
|
tr.status AS status,
|
||||||
tpr.type AS type,
|
tpr.type AS type,
|
||||||
tr.create_time AS createTime,
|
tr.create_time AS createTime,
|
||||||
tr.update_by AS updateBy
|
tr.update_by AS updateBy
|
||||||
FROM test_plan_report tpr
|
FROM test_plan_report tpr
|
||||||
LEFT JOIN test_report tr ON tr.id = tpr.report_id
|
LEFT JOIN test_report tr ON tr.id = tpr.report_id
|
||||||
WHERE tpr.plan_id = #{planId}
|
WHERE tpr.plan_id = #{planId}
|
||||||
AND tpr.del_flag = '0'
|
AND tpr.del_flag = '0'
|
||||||
|
AND tr.del_flag = '0'
|
||||||
ORDER BY tr.create_time DESC
|
ORDER BY tr.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCaseTestReportById" parameterType="Long" resultMap="TestReportResult">
|
||||||
|
<include refid="selectTestReportVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateExecuteCaseReport" parameterType="testReport">
|
||||||
|
update test_report
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="result != null">result = #{result},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="report != null">report = #{report},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="version != null">version = #{version},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -9,6 +9,7 @@ const api = {
|
|||||||
testPlanProjectList: '/test/testPlanProject/list',
|
testPlanProjectList: '/test/testPlanProject/list',
|
||||||
addTestReport: 'test/testReport/addTestReport',
|
addTestReport: 'test/testReport/addTestReport',
|
||||||
getTestReportList: 'test/testReport/reportList',
|
getTestReportList: 'test/testReport/reportList',
|
||||||
|
delExecuteCaseReport: 'test/testReport/delExecuteCaseReport',
|
||||||
getPlanOverview:'test/testPlan/planOverview',
|
getPlanOverview:'test/testPlan/planOverview',
|
||||||
getPlanCaseTrendData: 'test/testPlan/planCaseTrendData',
|
getPlanCaseTrendData: 'test/testPlan/planCaseTrendData',
|
||||||
}
|
}
|
||||||
@@ -77,6 +78,14 @@ export function getTestReportList(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function delExecuteCaseReport(id) {
|
||||||
|
return request({
|
||||||
|
url: api.delExecuteCaseReport,
|
||||||
|
method: 'post',
|
||||||
|
data: {id}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function getPlanOverview(id) {
|
export function getPlanOverview(id) {
|
||||||
return request({
|
return request({
|
||||||
url: api.getPlanOverview,
|
url: api.getPlanOverview,
|
||||||
|
|||||||
@@ -35,6 +35,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="updateBy" label="最后更新人" align="center"/>
|
<el-table-column prop="updateBy" label="最后更新人" align="center"/>
|
||||||
<el-table-column prop="updateTime" label="最后更新时间" align="center"/>
|
<el-table-column prop="updateTime" label="最后更新时间" align="center"/>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="text" size="mini" @click.native.stop="handleDel(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-Table>
|
</el-Table>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<pagination
|
<pagination
|
||||||
@@ -65,7 +70,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
||||||
import {addTestReport, getTestReportList} from "@/api/test/testPlan";
|
import {addTestReport, delExecuteCaseReport, getTestReportList} from "@/api/test/testPlan";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'caseReport',
|
name: 'caseReport',
|
||||||
@@ -115,6 +120,14 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
handleDel(id) {
|
||||||
|
this.$modal.confirm('是否确认删除测试报告?').then(function () {
|
||||||
|
return delExecuteCaseReport(id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.queryParams.id = Number(this.planId)
|
this.queryParams.id = Number(this.planId)
|
||||||
|
|||||||
Reference in New Issue
Block a user