测试计划接口调整
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.test.domain.TestPlanDefect;
|
||||
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.service.ITestPlanDefectService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
@@ -65,10 +66,11 @@ public class TestPlanDefectController extends BaseController
|
||||
* 新增测试计划测试缺陷关联
|
||||
*/
|
||||
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TestPlanDefect testPlanDefect)
|
||||
@PostMapping(value = "/addRelDefect")
|
||||
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)
|
||||
@PostMapping("/{ids}")
|
||||
@PostMapping("/delRelDefect/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] 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 结果
|
||||
*/
|
||||
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.qo.TestPlanDefectQO;
|
||||
import com.test.test.domain.qo.TestPlanDefectRelQO;
|
||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,10 +34,10 @@ public interface ITestPlanDefectService
|
||||
/**
|
||||
* 新增测试计划测试缺陷关联
|
||||
*
|
||||
* @param testPlanDefect 测试计划测试缺陷关联
|
||||
* @param qo 测试计划测试缺陷关联
|
||||
* @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.test.domain.TestPlanDefect;
|
||||
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.mapper.TestPlanDefectMapper;
|
||||
import com.test.test.service.ITestPlanDefectService;
|
||||
@@ -10,6 +11,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 测试计划测试缺陷关联Service业务层处理
|
||||
@@ -50,14 +52,34 @@ public class TestPlanDefectServiceImpl implements ITestPlanDefectService
|
||||
/**
|
||||
* 新增测试计划测试缺陷关联
|
||||
*
|
||||
* @param testPlanDefect 测试计划测试缺陷关联
|
||||
* @param testPlanDefectRelQO 测试计划测试缺陷关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTestPlanDefect(TestPlanDefect testPlanDefect)
|
||||
public void insertTestPlanDefect(TestPlanDefectRelQO testPlanDefectRelQO)
|
||||
{
|
||||
testPlanDefect.setCreateTime(DateUtils.getNowDate());
|
||||
return testPlanDefectMapper.insertTestPlanDefect(testPlanDefect);
|
||||
List<Long> defectIdList = testPlanDefectRelQO.getDefectIdList();
|
||||
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}
|
||||
</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 into test_plan_defect
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -96,7 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<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=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const api = {
|
||||
delRelDefect: 'testPlan/defect/list',
|
||||
delRelDefect: 'testPlan/defect/delRelDefect/',
|
||||
getDefectList: 'testPlan/defect/list',
|
||||
addRelDefect: 'testPlan/defect/addRelDefect',
|
||||
}
|
||||
|
||||
export function delRelDefect(data) {
|
||||
export function delRelDefect(id) {
|
||||
return request({
|
||||
url: api.delRelDefect,
|
||||
url: api.delRelDefect + id,
|
||||
method: 'post',
|
||||
data
|
||||
data: {id}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,3 +21,11 @@ export function getDefectList(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function addRelDefect(data) {
|
||||
return request({
|
||||
url: api.addRelDefect,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
size="medium"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>批量删除</el-button>
|
||||
>缺陷取消关联</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
</el-col>
|
||||
@@ -55,12 +55,10 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人">
|
||||
<el-select v-model="queryParams.manager" placeholder="请选择" clearable filterable>
|
||||
<simple-options :options="managerList"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级">
|
||||
<el-select v-model="queryParams.priority" placeholder="请选择" clearable filterable>
|
||||
<simple-options :options="dict.type.priority_level"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -80,7 +78,7 @@
|
||||
<el-tab-pane :label="'准生产验证'" name="3"></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 prop="serialNumber" label="ID" align="center"/>
|
||||
<el-table-column prop="summary" label="概要" align="center"/>
|
||||
@@ -140,11 +138,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {saveRelate} from "@/api/test/planCase";
|
||||
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
||||
import RelateCase from "@/views/test/testplan/execute/relateCase.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";
|
||||
|
||||
export default {
|
||||
@@ -163,6 +160,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
select: '1',
|
||||
query: '',
|
||||
activeTab: '0',
|
||||
@@ -172,9 +171,8 @@ export default {
|
||||
title: '',
|
||||
// 选中数组
|
||||
ids: [],
|
||||
idList: [],
|
||||
isExecuteVisible: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
relLoading: false,
|
||||
@@ -183,7 +181,6 @@ export default {
|
||||
open: false,
|
||||
selectedRows: [],
|
||||
selectedData: [],
|
||||
managerList: [],
|
||||
queryParams: {
|
||||
serialNumber: '',
|
||||
outline: '',
|
||||
@@ -206,18 +203,31 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleAdvancedSearch() {
|
||||
// 高级筛选条件搜索
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetAdvancedFilter() {
|
||||
// 重置高级筛选条件
|
||||
this.resetForm('queryFrom')
|
||||
this.handleAdvancedSearch()
|
||||
},
|
||||
// 展开/折叠
|
||||
handleCollapse(val) {
|
||||
this.activeNames = val ? ['1'] : [];
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.selectedRows = selection;
|
||||
this.ids = selection.map(item => item.id)
|
||||
},
|
||||
handleSelection(selection) {
|
||||
this.selectedRows = selection;
|
||||
this.idList = selection.map(item => item.id)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleTabClick(tab) {
|
||||
this.ids = [];
|
||||
this.multiple = false;
|
||||
this.idList = [];
|
||||
this.activeTab = tab.name;
|
||||
this.queryParams.type = parseInt(this.activeTab, 10);
|
||||
this.getList();
|
||||
@@ -266,15 +276,15 @@ export default {
|
||||
reset() {
|
||||
this.selectedRows = [];
|
||||
this.ids = [];
|
||||
this.multiple = false;
|
||||
this.idList = [];
|
||||
},
|
||||
submitForm() {
|
||||
const form = {
|
||||
...this.queryParams,
|
||||
testCaseIdList: this.$refs.relateCase.getSelectedCaseIds()
|
||||
defectIdList: this.ids
|
||||
}
|
||||
this.submitLoading = true
|
||||
saveRelate(form)
|
||||
addRelDefect(form)
|
||||
.then(() => {
|
||||
this.$message.success('关联成功')
|
||||
this.open = false
|
||||
@@ -290,7 +300,7 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
const ids = row.id || this.idList;
|
||||
this.$modal.confirm('是否确认删除关联缺陷?').then(function () {
|
||||
return delRelDefect(ids);
|
||||
}).then(() => {
|
||||
|
||||
@@ -112,7 +112,6 @@ export default {
|
||||
this.editForm = res.data
|
||||
})
|
||||
this.planId = this.$route.query.id;
|
||||
console.log(this.planId)
|
||||
this.testTitle = this.$route.query.name
|
||||
this.testStatus = this.$route.query.testStatus
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<span>当前测试计划已经开始 3 天,距离截止时间还有 52 天</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span>负责人:{{ manager }}</span>
|
||||
<span>负责人:{{ }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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