测试计划接口调整
This commit is contained in:
@@ -8,6 +8,7 @@ import com.test.common.enums.BusinessType;
|
|||||||
import com.test.common.utils.poi.ExcelUtil;
|
import com.test.common.utils.poi.ExcelUtil;
|
||||||
import com.test.test.domain.TestPlanDefect;
|
import com.test.test.domain.TestPlanDefect;
|
||||||
import com.test.test.domain.qo.TestPlanDefectQO;
|
import com.test.test.domain.qo.TestPlanDefectQO;
|
||||||
|
import com.test.test.domain.qo.TestPlanDefectRelQO;
|
||||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||||
import com.test.test.service.ITestPlanDefectService;
|
import com.test.test.service.ITestPlanDefectService;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
@@ -65,10 +66,11 @@ public class TestPlanDefectController extends BaseController
|
|||||||
* 新增测试计划测试缺陷关联
|
* 新增测试计划测试缺陷关联
|
||||||
*/
|
*/
|
||||||
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.INSERT)
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping(value = "/addRelDefect")
|
||||||
public AjaxResult add(@RequestBody TestPlanDefect testPlanDefect)
|
public AjaxResult add(@RequestBody TestPlanDefectRelQO qo)
|
||||||
{
|
{
|
||||||
return toAjax(testPlanDefectService.insertTestPlanDefect(testPlanDefect));
|
testPlanDefectService.insertTestPlanDefect(qo);
|
||||||
|
return success(qo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +87,7 @@ public class TestPlanDefectController extends BaseController
|
|||||||
* 删除测试计划测试缺陷关联
|
* 删除测试计划测试缺陷关联
|
||||||
*/
|
*/
|
||||||
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.DELETE)
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/{ids}")
|
@PostMapping("/delRelDefect/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
return toAjax(testPlanDefectService.deleteTestPlanDefectByIds(ids));
|
return toAjax(testPlanDefectService.deleteTestPlanDefectByIds(ids));
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.test.test.domain.qo;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划缺陷关联
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TestPlanDefectRelQO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4779866915656657001L;
|
||||||
|
|
||||||
|
private Long planId;
|
||||||
|
private Integer type;
|
||||||
|
private List<Long> defectIdList;
|
||||||
|
}
|
||||||
@@ -60,4 +60,11 @@ public interface TestPlanDefectMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTestPlanDefectByIds(Long[] ids);
|
public int deleteTestPlanDefectByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询关联列表
|
||||||
|
* @param testPlanDefect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TestPlanDefect> selectRelList(TestPlanDefect testPlanDefect);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.test.test.service;
|
|||||||
import com.test.test.domain.TestPlanDefect;
|
import com.test.test.domain.TestPlanDefect;
|
||||||
|
|
||||||
import com.test.test.domain.qo.TestPlanDefectQO;
|
import com.test.test.domain.qo.TestPlanDefectQO;
|
||||||
|
import com.test.test.domain.qo.TestPlanDefectRelQO;
|
||||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -33,10 +34,10 @@ public interface ITestPlanDefectService
|
|||||||
/**
|
/**
|
||||||
* 新增测试计划测试缺陷关联
|
* 新增测试计划测试缺陷关联
|
||||||
*
|
*
|
||||||
* @param testPlanDefect 测试计划测试缺陷关联
|
* @param qo 测试计划测试缺陷关联
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertTestPlanDefect(TestPlanDefect testPlanDefect);
|
public void insertTestPlanDefect(TestPlanDefectRelQO qo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改测试计划测试缺陷关联
|
* 修改测试计划测试缺陷关联
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.test.test.service.impl;
|
|||||||
import com.test.common.utils.DateUtils;
|
import com.test.common.utils.DateUtils;
|
||||||
import com.test.test.domain.TestPlanDefect;
|
import com.test.test.domain.TestPlanDefect;
|
||||||
import com.test.test.domain.qo.TestPlanDefectQO;
|
import com.test.test.domain.qo.TestPlanDefectQO;
|
||||||
|
import com.test.test.domain.qo.TestPlanDefectRelQO;
|
||||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||||
import com.test.test.mapper.TestPlanDefectMapper;
|
import com.test.test.mapper.TestPlanDefectMapper;
|
||||||
import com.test.test.service.ITestPlanDefectService;
|
import com.test.test.service.ITestPlanDefectService;
|
||||||
@@ -10,6 +11,7 @@ import jakarta.annotation.Resource;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试计划测试缺陷关联Service业务层处理
|
* 测试计划测试缺陷关联Service业务层处理
|
||||||
@@ -50,14 +52,34 @@ public class TestPlanDefectServiceImpl implements ITestPlanDefectService
|
|||||||
/**
|
/**
|
||||||
* 新增测试计划测试缺陷关联
|
* 新增测试计划测试缺陷关联
|
||||||
*
|
*
|
||||||
* @param testPlanDefect 测试计划测试缺陷关联
|
* @param testPlanDefectRelQO 测试计划测试缺陷关联
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertTestPlanDefect(TestPlanDefect testPlanDefect)
|
public void insertTestPlanDefect(TestPlanDefectRelQO testPlanDefectRelQO)
|
||||||
{
|
{
|
||||||
testPlanDefect.setCreateTime(DateUtils.getNowDate());
|
List<Long> defectIdList = testPlanDefectRelQO.getDefectIdList();
|
||||||
return testPlanDefectMapper.insertTestPlanDefect(testPlanDefect);
|
for (Long defectId : defectIdList) {
|
||||||
|
TestPlanDefect testPlanDefect = new TestPlanDefect();
|
||||||
|
testPlanDefect.setPlanId(String.valueOf(testPlanDefectRelQO.getPlanId()));
|
||||||
|
testPlanDefect.setDefectId(String.valueOf(defectId));
|
||||||
|
testPlanDefect.setType(String.valueOf(testPlanDefectRelQO.getType()));
|
||||||
|
List<TestPlanDefect> testPlanDefectList = selectRelList(testPlanDefect);
|
||||||
|
if (!CollectionUtils.isEmpty(testPlanDefectList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
testPlanDefect.setCreateTime(DateUtils.getNowDate());
|
||||||
|
testPlanDefectMapper.insertTestPlanDefect(testPlanDefect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已存在的关联列表
|
||||||
|
* @param testPlanDefect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<TestPlanDefect> selectRelList(TestPlanDefect testPlanDefect) {
|
||||||
|
return testPlanDefectMapper.selectRelList(testPlanDefect);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,6 +53,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRelList" resultType="TestPlanDefect">
|
||||||
|
SELECT
|
||||||
|
tpd.id,
|
||||||
|
tpd.defect_id AS defectId,
|
||||||
|
tpd.plan_id AS planId,
|
||||||
|
tpd.type,
|
||||||
|
tpd.create_time
|
||||||
|
FROM test_plan_defect tpd
|
||||||
|
where 1=1
|
||||||
|
AND tpd.del_flag = '0'
|
||||||
|
<if test="planId != null">
|
||||||
|
AND tpd.plan_id = #{planId}
|
||||||
|
</if>
|
||||||
|
<if test="defectId != null">
|
||||||
|
AND tpd.defect_id = #{defectId}
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
AND tpd.type = #{type}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertTestPlanDefect" parameterType="TestPlanDefect">
|
<insert id="insertTestPlanDefect" parameterType="TestPlanDefect">
|
||||||
insert into test_plan_defect
|
insert into test_plan_defect
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -96,7 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteTestPlanDefectByIds" parameterType="String">
|
<delete id="deleteTestPlanDefectByIds" parameterType="String">
|
||||||
delete from test_plan_defect where id in
|
UPDATE test_plan_defect
|
||||||
|
SET del_flag = '1'
|
||||||
|
WHERE id IN
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
const api = {
|
const api = {
|
||||||
delRelDefect: 'testPlan/defect/list',
|
delRelDefect: 'testPlan/defect/delRelDefect/',
|
||||||
getDefectList: 'testPlan/defect/list',
|
getDefectList: 'testPlan/defect/list',
|
||||||
|
addRelDefect: 'testPlan/defect/addRelDefect',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function delRelDefect(data) {
|
export function delRelDefect(id) {
|
||||||
return request({
|
return request({
|
||||||
url: api.delRelDefect,
|
url: api.delRelDefect + id,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data: {id}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,3 +21,11 @@ export function getDefectList(data) {
|
|||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function addRelDefect(data) {
|
||||||
|
return request({
|
||||||
|
url: api.addRelDefect,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
size="medium"
|
size="medium"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
>批量删除</el-button>
|
>缺陷取消关联</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -55,12 +55,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人">
|
<el-form-item label="负责人">
|
||||||
<el-select v-model="queryParams.manager" placeholder="请选择" clearable filterable>
|
<el-select v-model="queryParams.manager" placeholder="请选择" clearable filterable>
|
||||||
<simple-options :options="managerList"/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优先级">
|
<el-form-item label="优先级">
|
||||||
<el-select v-model="queryParams.priority" placeholder="请选择" clearable filterable>
|
<el-select v-model="queryParams.priority" placeholder="请选择" clearable filterable>
|
||||||
<simple-options :options="dict.type.priority_level"/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -80,7 +78,7 @@
|
|||||||
<el-tab-pane :label="'准生产验证'" name="3"></el-tab-pane>
|
<el-tab-pane :label="'准生产验证'" name="3"></el-tab-pane>
|
||||||
<el-tab-pane :label="'生产验证'" name="4"></el-tab-pane>
|
<el-tab-pane :label="'生产验证'" name="4"></el-tab-pane>
|
||||||
|
|
||||||
<el-Table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
|
<el-Table v-loading="loading" :data="list" @selection-change="handleSelection">
|
||||||
<el-table-column type="selection"/>
|
<el-table-column type="selection"/>
|
||||||
<el-table-column prop="serialNumber" label="ID" align="center"/>
|
<el-table-column prop="serialNumber" label="ID" align="center"/>
|
||||||
<el-table-column prop="summary" label="概要" align="center"/>
|
<el-table-column prop="summary" label="概要" align="center"/>
|
||||||
@@ -140,11 +138,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {saveRelate} from "@/api/test/planCase";
|
|
||||||
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
||||||
import RelateCase from "@/views/test/testplan/execute/relateCase.vue";
|
import RelateCase from "@/views/test/testplan/execute/relateCase.vue";
|
||||||
import page1 from "../../case/detail/page1.vue";
|
import page1 from "../../case/detail/page1.vue";
|
||||||
import {delRelDefect, getDefectList} from "@/api/test/planDefect";
|
import {addRelDefect, delRelDefect, getDefectList} from "@/api/test/planDefect";
|
||||||
import {getBugList} from "@/api/test/bug";
|
import {getBugList} from "@/api/test/bug";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -163,6 +160,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
select: '1',
|
select: '1',
|
||||||
query: '',
|
query: '',
|
||||||
activeTab: '0',
|
activeTab: '0',
|
||||||
@@ -172,9 +171,8 @@ export default {
|
|||||||
title: '',
|
title: '',
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
|
idList: [],
|
||||||
isExecuteVisible: true,
|
isExecuteVisible: true,
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: false,
|
loading: false,
|
||||||
relLoading: false,
|
relLoading: false,
|
||||||
@@ -183,7 +181,6 @@ export default {
|
|||||||
open: false,
|
open: false,
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
selectedData: [],
|
selectedData: [],
|
||||||
managerList: [],
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
outline: '',
|
outline: '',
|
||||||
@@ -206,18 +203,31 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleAdvancedSearch() {
|
||||||
|
// 高级筛选条件搜索
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetAdvancedFilter() {
|
||||||
|
// 重置高级筛选条件
|
||||||
|
this.resetForm('queryFrom')
|
||||||
|
this.handleAdvancedSearch()
|
||||||
|
},
|
||||||
// 展开/折叠
|
// 展开/折叠
|
||||||
handleCollapse(val) {
|
handleCollapse(val) {
|
||||||
this.activeNames = val ? ['1'] : [];
|
this.activeNames = val ? ['1'] : [];
|
||||||
},
|
},
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.selectedRows = selection;
|
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
|
},
|
||||||
|
handleSelection(selection) {
|
||||||
|
this.selectedRows = selection;
|
||||||
|
this.idList = selection.map(item => item.id)
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
handleTabClick(tab) {
|
handleTabClick(tab) {
|
||||||
this.ids = [];
|
this.ids = [];
|
||||||
this.multiple = false;
|
this.idList = [];
|
||||||
this.activeTab = tab.name;
|
this.activeTab = tab.name;
|
||||||
this.queryParams.type = parseInt(this.activeTab, 10);
|
this.queryParams.type = parseInt(this.activeTab, 10);
|
||||||
this.getList();
|
this.getList();
|
||||||
@@ -266,15 +276,15 @@ export default {
|
|||||||
reset() {
|
reset() {
|
||||||
this.selectedRows = [];
|
this.selectedRows = [];
|
||||||
this.ids = [];
|
this.ids = [];
|
||||||
this.multiple = false;
|
this.idList = [];
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
const form = {
|
const form = {
|
||||||
...this.queryParams,
|
...this.queryParams,
|
||||||
testCaseIdList: this.$refs.relateCase.getSelectedCaseIds()
|
defectIdList: this.ids
|
||||||
}
|
}
|
||||||
this.submitLoading = true
|
this.submitLoading = true
|
||||||
saveRelate(form)
|
addRelDefect(form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$message.success('关联成功')
|
this.$message.success('关联成功')
|
||||||
this.open = false
|
this.open = false
|
||||||
@@ -290,7 +300,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.idList;
|
||||||
this.$modal.confirm('是否确认删除关联缺陷?').then(function () {
|
this.$modal.confirm('是否确认删除关联缺陷?').then(function () {
|
||||||
return delRelDefect(ids);
|
return delRelDefect(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ export default {
|
|||||||
this.editForm = res.data
|
this.editForm = res.data
|
||||||
})
|
})
|
||||||
this.planId = this.$route.query.id;
|
this.planId = this.$route.query.id;
|
||||||
console.log(this.planId)
|
|
||||||
this.testTitle = this.$route.query.name
|
this.testTitle = this.$route.query.name
|
||||||
this.testStatus = this.$route.query.testStatus
|
this.testStatus = this.$route.query.testStatus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<span>当前测试计划已经开始 3 天,距离截止时间还有 52 天</span>
|
<span>当前测试计划已经开始 3 天,距离截止时间还有 52 天</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<span>负责人:{{ manager }}</span>
|
<span>负责人:{{ }}</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
设置
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'testSetting'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user