缺陷管理
This commit is contained in:
@@ -0,0 +1,109 @@
|
|||||||
|
package com.test.test.controller;
|
||||||
|
|
||||||
|
import com.test.common.annotation.Log;
|
||||||
|
import com.test.common.core.controller.BaseController;
|
||||||
|
import com.test.common.core.domain.AjaxResult;
|
||||||
|
import com.test.common.core.page.TableDataInfo;
|
||||||
|
import com.test.common.enums.BusinessType;
|
||||||
|
import com.test.common.utils.poi.ExcelUtil;
|
||||||
|
import com.test.test.domain.TestDefect;
|
||||||
|
import com.test.test.domain.qo.IDQO;
|
||||||
|
import com.test.test.domain.qo.TestDefectListQO;
|
||||||
|
import com.test.test.service.ITestDefectService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试缺陷Controller
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/test/defect")
|
||||||
|
public class TestDefectController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ITestDefectService testDefectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TestDefectListQO qo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TestDefect> list = testDefectService.selectTestDefectList(qo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出测试缺陷列表
|
||||||
|
*/
|
||||||
|
@Log(title = "测试缺陷", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/exportBug")
|
||||||
|
public void export(HttpServletResponse response,
|
||||||
|
@RequestBody TestDefectListQO qo) {
|
||||||
|
List<TestDefect> list = testDefectService.selectTestDefectList(qo);
|
||||||
|
ExcelUtil<TestDefect> util = new ExcelUtil<TestDefect>(TestDefect.class);
|
||||||
|
util.exportExcel(response, list, "缺陷数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量导出测试缺陷列表
|
||||||
|
*/
|
||||||
|
@Log(title = "测试缺陷", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/batchExportBug")
|
||||||
|
public void batchExport(HttpServletResponse response,
|
||||||
|
@RequestBody List<TestDefect> list) {
|
||||||
|
ExcelUtil<TestDefect> util = new ExcelUtil<TestDefect>(TestDefect.class);
|
||||||
|
util.exportExcel(response, list, "缺陷数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取测试缺陷详细信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/bugDetail")
|
||||||
|
public AjaxResult getInfo(@RequestBody IDQO qo)
|
||||||
|
{
|
||||||
|
return success(testDefectService.selectTestDefectById(qo.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试缺陷
|
||||||
|
*/
|
||||||
|
@Log(title = "测试缺陷", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/addBug")
|
||||||
|
public AjaxResult add(@RequestBody TestDefect testDefect)
|
||||||
|
{
|
||||||
|
return toAjax(testDefectService.insertTestDefect(testDefect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试缺陷
|
||||||
|
*/
|
||||||
|
@Log(title = "测试缺陷", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/editBug")
|
||||||
|
public AjaxResult edit(@RequestBody TestDefect testDefect)
|
||||||
|
{
|
||||||
|
return toAjax(testDefectService.updateTestDefect(testDefect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试缺陷
|
||||||
|
*/
|
||||||
|
@Log(title = "测试缺陷", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/delBug")
|
||||||
|
public AjaxResult remove(@RequestBody IDQO qo)
|
||||||
|
{
|
||||||
|
TestDefect testDefect = testDefectService.selectTestDefectById(qo.getId());
|
||||||
|
testDefect.setUpdateBy(getUsername());
|
||||||
|
testDefect.setUpdateTime(new Date());
|
||||||
|
testDefect.setDelFlag("1");
|
||||||
|
return toAjax(testDefectService.updateTestDefect(testDefect));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.test.test.controller;
|
||||||
|
|
||||||
|
import com.test.common.annotation.Log;
|
||||||
|
import com.test.common.core.controller.BaseController;
|
||||||
|
import com.test.common.core.domain.AjaxResult;
|
||||||
|
import com.test.common.core.page.TableDataInfo;
|
||||||
|
import com.test.common.enums.BusinessType;
|
||||||
|
import com.test.common.utils.poi.ExcelUtil;
|
||||||
|
import com.test.test.domain.TestPlanDefect;
|
||||||
|
import com.test.test.service.ITestPlanDefectService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划测试缺陷关联Controller
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/testPlan/defect")
|
||||||
|
public class TestPlanDefectController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ITestPlanDefectService testPlanDefectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TestPlanDefect> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出测试计划测试缺陷关联列表
|
||||||
|
*/
|
||||||
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
List<TestPlanDefect> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||||
|
ExcelUtil<TestPlanDefect> util = new ExcelUtil<TestPlanDefect>(TestPlanDefect.class);
|
||||||
|
util.exportExcel(response, list, "测试计划测试缺陷关联数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取测试计划测试缺陷关联详细信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(testPlanDefectService.selectTestPlanDefectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
return toAjax(testPlanDefectService.insertTestPlanDefect(testPlanDefect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
return toAjax(testPlanDefectService.updateTestPlanDefect(testPlanDefect));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(testPlanDefectService.deleteTestPlanDefectByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
234
test-test/src/main/java/com/test/test/domain/TestDefect.java
Normal file
234
test-test/src/main/java/com/test/test/domain/TestDefect.java
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
package com.test.test.domain;
|
||||||
|
|
||||||
|
import com.test.common.annotation.Excel;
|
||||||
|
import com.test.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试缺陷对象 test_defect
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public class TestDefect extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 测试缺陷编码 */
|
||||||
|
@Excel(name = "缺陷编码")
|
||||||
|
private String serialNumber;
|
||||||
|
|
||||||
|
/** 测试缺陷名称 */
|
||||||
|
// @Excel(name = "测试缺陷名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 缺陷概要 */
|
||||||
|
@Excel(name = "缺陷概要")
|
||||||
|
private String outline;
|
||||||
|
|
||||||
|
/** 缺陷描述 */
|
||||||
|
// @Excel(name = "缺陷描述")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
/** 状态(0,待确认,1,修复中,2,已完成,3,无效缺陷,4,挂起,5,待验证) */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 经办人 */
|
||||||
|
@Excel(name = "经办人")
|
||||||
|
private String manager;
|
||||||
|
|
||||||
|
/** 开发人员 */
|
||||||
|
// @Excel(name = "开发人员")
|
||||||
|
private String dev;
|
||||||
|
|
||||||
|
/** 严重程度(0,无效,1,轻微,2,一般,3,严重,4,致命) */
|
||||||
|
@Excel(name = "严重程度")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/** 缺陷类型(0,功能逻辑,1,UI交互,2,性能问题,3,兼容性问题,4,配置错误,5,安全问题,6,安装部署,7,其他) */
|
||||||
|
// @Excel(name = "缺陷类型", readConverterExp = "0=,功能逻辑,1,UI交互,2,性能问题,3,兼容性问题,4,配置错误,5,安全问题,6,安装部署,7,其他")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/** 是否复现(0,必然复现,1,偶发复现) */
|
||||||
|
// @Excel(name = "是否复现", readConverterExp = "0=,必然复现,1,偶发复现")
|
||||||
|
private String reappearance;
|
||||||
|
|
||||||
|
/** 测试人员 */
|
||||||
|
// @Excel(name = "测试人员")
|
||||||
|
private String test;
|
||||||
|
|
||||||
|
/** 是否开启邮件通知(0,不开启,1,开启) */
|
||||||
|
// @Excel(name = "是否开启邮件通知", readConverterExp = "0=,不开启,1,开启")
|
||||||
|
private String mail = "0";
|
||||||
|
|
||||||
|
/** 版本 */
|
||||||
|
// @Excel(name = "版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/** 0,正常,1,删除 */
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setSerialNumber(String serialNumber)
|
||||||
|
{
|
||||||
|
this.serialNumber = serialNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerialNumber()
|
||||||
|
{
|
||||||
|
return serialNumber;
|
||||||
|
}
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setOutline(String outline)
|
||||||
|
{
|
||||||
|
this.outline = outline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOutline()
|
||||||
|
{
|
||||||
|
return outline;
|
||||||
|
}
|
||||||
|
public void setDetail(String detail)
|
||||||
|
{
|
||||||
|
this.detail = detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetail()
|
||||||
|
{
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
public void setStatus(String status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setManager(String manager)
|
||||||
|
{
|
||||||
|
this.manager = manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManager()
|
||||||
|
{
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
public void setDev(String dev)
|
||||||
|
{
|
||||||
|
this.dev = dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDev()
|
||||||
|
{
|
||||||
|
return dev;
|
||||||
|
}
|
||||||
|
public void setLevel(String level)
|
||||||
|
{
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLevel()
|
||||||
|
{
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
public void setType(String type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
public void setReappearance(String reappearance)
|
||||||
|
{
|
||||||
|
this.reappearance = reappearance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReappearance()
|
||||||
|
{
|
||||||
|
return reappearance;
|
||||||
|
}
|
||||||
|
public void setTest(String test)
|
||||||
|
{
|
||||||
|
this.test = test;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTest()
|
||||||
|
{
|
||||||
|
return test;
|
||||||
|
}
|
||||||
|
public void setMail(String mail)
|
||||||
|
{
|
||||||
|
this.mail = mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMail()
|
||||||
|
{
|
||||||
|
return mail;
|
||||||
|
}
|
||||||
|
public void setVersion(String version)
|
||||||
|
{
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion()
|
||||||
|
{
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
public void setDelFlag(String delFlag)
|
||||||
|
{
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelFlag()
|
||||||
|
{
|
||||||
|
return delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("serialNumber", getSerialNumber())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("outline", getOutline())
|
||||||
|
.append("detail", getDetail())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("manager", getManager())
|
||||||
|
.append("dev", getDev())
|
||||||
|
.append("level", getLevel())
|
||||||
|
.append("type", getType())
|
||||||
|
.append("reappearance", getReappearance())
|
||||||
|
.append("test", getTest())
|
||||||
|
.append("mail", getMail())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("version", getVersion())
|
||||||
|
.append("delFlag", getDelFlag())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
108
test-test/src/main/java/com/test/test/domain/TestPlanDefect.java
Normal file
108
test-test/src/main/java/com/test/test/domain/TestPlanDefect.java
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.test.test.domain;
|
||||||
|
|
||||||
|
import com.test.common.annotation.Excel;
|
||||||
|
import com.test.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划测试缺陷关联对象 test_plan_defect
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public class TestPlanDefect extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 测试计划主键ID */
|
||||||
|
@Excel(name = "测试计划主键ID")
|
||||||
|
private String planId;
|
||||||
|
|
||||||
|
/** 测试缺陷主键ID */
|
||||||
|
@Excel(name = "测试缺陷主键ID")
|
||||||
|
private String defectId;
|
||||||
|
|
||||||
|
/** 测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证) */
|
||||||
|
@Excel(name = "测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证)")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/** 版本 */
|
||||||
|
@Excel(name = "版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/** 0,正常,1,删除 */
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setPlanId(String planId)
|
||||||
|
{
|
||||||
|
this.planId = planId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlanId()
|
||||||
|
{
|
||||||
|
return planId;
|
||||||
|
}
|
||||||
|
public void setDefectId(String defectId)
|
||||||
|
{
|
||||||
|
this.defectId = defectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefectId()
|
||||||
|
{
|
||||||
|
return defectId;
|
||||||
|
}
|
||||||
|
public void setType(String type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
public void setVersion(String version)
|
||||||
|
{
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion()
|
||||||
|
{
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
public void setDelFlag(String delFlag)
|
||||||
|
{
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDelFlag()
|
||||||
|
{
|
||||||
|
return delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("planId", getPlanId())
|
||||||
|
.append("defectId", getDefectId())
|
||||||
|
.append("type", getType())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("version", getVersion())
|
||||||
|
.append("delFlag", getDelFlag())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.test.test.domain.qo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author liangdaliang
|
||||||
|
* @Description:查询缺陷列表请求参数qo
|
||||||
|
* @date 2025-04-22 23:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TestDefectListQO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4632212018365973101L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缺陷编码
|
||||||
|
*/
|
||||||
|
private String serialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缺陷概要
|
||||||
|
*/
|
||||||
|
private String outline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始创建时间
|
||||||
|
*/
|
||||||
|
private Date startCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束创建时间
|
||||||
|
*/
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经办人
|
||||||
|
*/
|
||||||
|
private String manager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 严重程度(0,无效,1,轻微,2,一般,3,严重,4,致命)
|
||||||
|
*/
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0,待确认,1,修复中,2,已完成,3,无效缺陷,4,挂起,5,待验证)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.test.test.mapper;
|
||||||
|
|
||||||
|
import com.test.test.domain.TestDefect;
|
||||||
|
import com.test.test.domain.qo.TestDefectListQO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试缺陷Mapper接口
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public interface TestDefectMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 测试缺陷
|
||||||
|
*/
|
||||||
|
public TestDefect selectTestDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷列表
|
||||||
|
*
|
||||||
|
* @param qo 测试缺陷
|
||||||
|
* @return 测试缺陷集合
|
||||||
|
*/
|
||||||
|
public List<TestDefect> selectTestDefectList(TestDefectListQO qo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTestDefect(TestDefect testDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTestDefect(TestDefect testDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试缺陷
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试缺陷
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestDefectByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.test.test.mapper;
|
||||||
|
|
||||||
|
import com.test.test.domain.TestPlanDefect;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划测试缺陷关联Mapper接口
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public interface TestPlanDefectMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
public TestPlanDefect selectTestPlanDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联列表
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 测试计划测试缺陷关联集合
|
||||||
|
*/
|
||||||
|
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTestPlanDefect(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTestPlanDefect(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestPlanDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestPlanDefectByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.test.test.service;
|
||||||
|
|
||||||
|
import com.test.test.domain.TestDefect;
|
||||||
|
import com.test.test.domain.qo.TestDefectListQO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试缺陷Service接口
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public interface ITestDefectService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 测试缺陷
|
||||||
|
*/
|
||||||
|
public TestDefect selectTestDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷列表
|
||||||
|
*
|
||||||
|
* @param qo 测试缺陷
|
||||||
|
* @return 测试缺陷集合
|
||||||
|
*/
|
||||||
|
public List<TestDefect> selectTestDefectList(TestDefectListQO qo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTestDefect(TestDefect testDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTestDefect(TestDefect testDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试缺陷
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的测试缺陷主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestDefectByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试缺陷信息
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestDefectById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.test.test.service;
|
||||||
|
|
||||||
|
import com.test.test.domain.TestPlanDefect;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划测试缺陷关联Service接口
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
public interface ITestPlanDefectService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
public TestPlanDefect selectTestPlanDefectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联列表
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 测试计划测试缺陷关联集合
|
||||||
|
*/
|
||||||
|
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTestPlanDefect(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTestPlanDefect(TestPlanDefect testPlanDefect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的测试计划测试缺陷关联主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestPlanDefectByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试计划测试缺陷关联信息
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTestPlanDefectById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.test.test.service.impl;
|
||||||
|
|
||||||
|
import com.test.common.utils.DateUtils;
|
||||||
|
import com.test.test.domain.TestDefect;
|
||||||
|
import com.test.test.domain.qo.TestDefectListQO;
|
||||||
|
import com.test.test.mapper.TestDefectMapper;
|
||||||
|
import com.test.test.service.ITestDefectService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试缺陷Service业务层处理
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TestDefectServiceImpl implements ITestDefectService
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private TestDefectMapper testDefectMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 测试缺陷
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TestDefect selectTestDefectById(Long id)
|
||||||
|
{
|
||||||
|
return testDefectMapper.selectTestDefectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试缺陷列表
|
||||||
|
*
|
||||||
|
* @param qo 测试缺陷
|
||||||
|
* @return 测试缺陷
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TestDefect> selectTestDefectList(TestDefectListQO qo)
|
||||||
|
{
|
||||||
|
return testDefectMapper.selectTestDefectList(qo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTestDefect(TestDefect testDefect)
|
||||||
|
{
|
||||||
|
testDefect.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return testDefectMapper.insertTestDefect(testDefect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试缺陷
|
||||||
|
*
|
||||||
|
* @param testDefect 测试缺陷
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTestDefect(TestDefect testDefect)
|
||||||
|
{
|
||||||
|
testDefect.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return testDefectMapper.updateTestDefect(testDefect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试缺陷
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的测试缺陷主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTestDefectByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return testDefectMapper.deleteTestDefectByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试缺陷信息
|
||||||
|
*
|
||||||
|
* @param id 测试缺陷主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTestDefectById(Long id)
|
||||||
|
{
|
||||||
|
return testDefectMapper.deleteTestDefectById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.test.test.service.impl;
|
||||||
|
|
||||||
|
import com.test.common.utils.DateUtils;
|
||||||
|
import com.test.test.domain.TestPlanDefect;
|
||||||
|
import com.test.test.mapper.TestPlanDefectMapper;
|
||||||
|
import com.test.test.service.ITestPlanDefectService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试计划测试缺陷关联Service业务层处理
|
||||||
|
*
|
||||||
|
* @author test
|
||||||
|
* @date 2025-04-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TestPlanDefectServiceImpl implements ITestPlanDefectService
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private TestPlanDefectMapper testPlanDefectMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TestPlanDefect selectTestPlanDefectById(Long id)
|
||||||
|
{
|
||||||
|
return testPlanDefectMapper.selectTestPlanDefectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询测试计划测试缺陷关联列表
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 测试计划测试缺陷关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
return testPlanDefectMapper.selectTestPlanDefectList(testPlanDefect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTestPlanDefect(TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
testPlanDefect.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return testPlanDefectMapper.insertTestPlanDefect(testPlanDefect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param testPlanDefect 测试计划测试缺陷关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTestPlanDefect(TestPlanDefect testPlanDefect)
|
||||||
|
{
|
||||||
|
testPlanDefect.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return testPlanDefectMapper.updateTestPlanDefect(testPlanDefect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除测试计划测试缺陷关联
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的测试计划测试缺陷关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTestPlanDefectByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return testPlanDefectMapper.deleteTestPlanDefectByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除测试计划测试缺陷关联信息
|
||||||
|
*
|
||||||
|
* @param id 测试计划测试缺陷关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTestPlanDefectById(Long id)
|
||||||
|
{
|
||||||
|
return testPlanDefectMapper.deleteTestPlanDefectById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
151
test-test/src/main/resources/mapper/test/TestDefectMapper.xml
Normal file
151
test-test/src/main/resources/mapper/test/TestDefectMapper.xml
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.test.test.mapper.TestDefectMapper">
|
||||||
|
|
||||||
|
<resultMap type="TestDefect" id="TestDefectResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="serialNumber" column="serial_number" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="outline" column="outline" />
|
||||||
|
<result property="detail" column="detail" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="manager" column="manager" />
|
||||||
|
<result property="dev" column="dev" />
|
||||||
|
<result property="level" column="level" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="reappearance" column="reappearance" />
|
||||||
|
<result property="test" column="test" />
|
||||||
|
<result property="mail" column="mail" />
|
||||||
|
<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="selectTestDefectVo">
|
||||||
|
select id, serial_number, name, outline, detail, status, manager, dev, level, type, reappearance, test, mail, create_time, update_time, version, del_flag from test_defect
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTestDefectList" parameterType="TestDefectListQO" resultMap="TestDefectResult">
|
||||||
|
SELECT
|
||||||
|
tp.id,
|
||||||
|
tp.serial_number,
|
||||||
|
tp.name ,
|
||||||
|
tp.outline,
|
||||||
|
tp.level,
|
||||||
|
tp.type,
|
||||||
|
tp.status,
|
||||||
|
su.user_name AS manager,
|
||||||
|
tp.create_time,
|
||||||
|
tp.reappearance,
|
||||||
|
tp.version,
|
||||||
|
tp.test
|
||||||
|
FROM test_defect tp
|
||||||
|
LEFT JOIN sys_user su ON su.user_id = tp.manager
|
||||||
|
where tp.del_flag = '0'
|
||||||
|
<if test="serialNumber != null and serialNumber != ''">
|
||||||
|
AND serial_number LIKE concat('%', #{serialNumber}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="outline != null and outline != ''">
|
||||||
|
AND outline LIKE concat('%', #{outline}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="startCreateTime != null">
|
||||||
|
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ >= ]]> DATE_FORMAT(#{startCreateTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="endCreateTime != null">
|
||||||
|
AND DATE_FORMAT(IFNULL(tp.create_time,''),'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(#{endCreateTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="manager != null and manager != ''">
|
||||||
|
AND manager = #{manager}
|
||||||
|
</if>
|
||||||
|
<if test="level != null and level != ''">
|
||||||
|
AND level = #{level}
|
||||||
|
</if>
|
||||||
|
<if test="status !=null and status != ''">
|
||||||
|
AND tp.status = #{status}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTestDefectById" parameterType="Long" resultMap="TestDefectResult">
|
||||||
|
<include refid="selectTestDefectVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTestDefect" parameterType="TestDefect">
|
||||||
|
insert into test_defect
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
||||||
|
<if test="name != null and name != ''">name,</if>
|
||||||
|
<if test="outline != null and outline != ''">outline,</if>
|
||||||
|
<if test="detail != null">detail,</if>
|
||||||
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
<if test="manager != null and manager != ''">manager,</if>
|
||||||
|
<if test="dev != null and dev != ''">dev,</if>
|
||||||
|
<if test="level != null and level != ''">level,</if>
|
||||||
|
<if test="type != null and type != ''">type,</if>
|
||||||
|
<if test="reappearance != null and reappearance != ''">reappearance,</if>
|
||||||
|
<if test="test != null and test != ''">test,</if>
|
||||||
|
<if test="mail != null">mail,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="version != null">version,</if>
|
||||||
|
<if test="delFlag != null">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
|
||||||
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
|
<if test="outline != null and outline != ''">#{outline},</if>
|
||||||
|
<if test="detail != null">#{detail},</if>
|
||||||
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
<if test="manager != null and manager != ''">#{manager},</if>
|
||||||
|
<if test="dev != null and dev != ''">#{dev},</if>
|
||||||
|
<if test="level != null and level != ''">#{level},</if>
|
||||||
|
<if test="type != null and type != ''">#{type},</if>
|
||||||
|
<if test="reappearance != null and reappearance != ''">#{reappearance},</if>
|
||||||
|
<if test="test != null and test != ''">#{test},</if>
|
||||||
|
<if test="mail != null">#{mail},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="version != null">#{version},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTestDefect" parameterType="TestDefect">
|
||||||
|
update test_defect
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
|
||||||
|
<if test="name != null and name != ''">name = #{name},</if>
|
||||||
|
<if test="outline != null and outline != ''">outline = #{outline},</if>
|
||||||
|
<if test="detail != null">detail = #{detail},</if>
|
||||||
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
<if test="manager != null and manager != ''">manager = #{manager},</if>
|
||||||
|
<if test="dev != null and dev != ''">dev = #{dev},</if>
|
||||||
|
<if test="level != null and level != ''">level = #{level},</if>
|
||||||
|
<if test="type != null and type != ''">type = #{type},</if>
|
||||||
|
<if test="reappearance != null and reappearance != ''">reappearance = #{reappearance},</if>
|
||||||
|
<if test="test != null and test != ''">test = #{test},</if>
|
||||||
|
<if test="mail != null">mail = #{mail},</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>
|
||||||
|
|
||||||
|
<delete id="deleteTestDefectById" parameterType="Long">
|
||||||
|
delete from test_defect where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTestDefectByIds" parameterType="String">
|
||||||
|
delete from test_defect where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.test.test.mapper.TestPlanDefectMapper">
|
||||||
|
|
||||||
|
<resultMap type="TestPlanDefect" id="TestPlanDefectResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="planId" column="plan_id" />
|
||||||
|
<result property="defectId" column="defect_id" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<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="selectTestPlanDefectVo">
|
||||||
|
select id, plan_id, defect_id, type, create_time, update_time, version, del_flag from test_plan_defect
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTestPlanDefectList" parameterType="TestPlanDefect" resultMap="TestPlanDefectResult">
|
||||||
|
<include refid="selectTestPlanDefectVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="planId != null and planId != ''"> and plan_id = #{planId}</if>
|
||||||
|
<if test="defectId != null and defectId != ''"> and defect_id = #{defectId}</if>
|
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
|
<if test="version != null and version != ''"> and version = #{version}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTestPlanDefectById" parameterType="Long" resultMap="TestPlanDefectResult">
|
||||||
|
<include refid="selectTestPlanDefectVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTestPlanDefect" parameterType="TestPlanDefect">
|
||||||
|
insert into test_plan_defect
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="planId != null and planId != ''">plan_id,</if>
|
||||||
|
<if test="defectId != null and defectId != ''">defect_id,</if>
|
||||||
|
<if test="type != null and type != ''">type,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="version != null">version,</if>
|
||||||
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="planId != null and planId != ''">#{planId},</if>
|
||||||
|
<if test="defectId != null and defectId != ''">#{defectId},</if>
|
||||||
|
<if test="type != null and type != ''">#{type},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="version != null">#{version},</if>
|
||||||
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTestPlanDefect" parameterType="TestPlanDefect">
|
||||||
|
update test_plan_defect
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="planId != null and planId != ''">plan_id = #{planId},</if>
|
||||||
|
<if test="defectId != null and defectId != ''">defect_id = #{defectId},</if>
|
||||||
|
<if test="type != null and type != ''">type = #{type},</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 and delFlag != ''">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteTestPlanDefectById" parameterType="Long">
|
||||||
|
delete from test_plan_defect where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTestPlanDefectByIds" parameterType="String">
|
||||||
|
delete from test_plan_defect where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
51
test-ui/src/api/test/bug.js
Normal file
51
test-ui/src/api/test/bug.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
const api = {
|
||||||
|
bugList: 'test/defect/list',
|
||||||
|
addBug: 'test/defect/addBug',
|
||||||
|
delBug: 'test/defect/delBug',
|
||||||
|
getBugDetail: 'test/defect/bugDetail',
|
||||||
|
updateBug: 'test/defect/editBug'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBugList(data) {
|
||||||
|
return request({
|
||||||
|
url: api.bugList,
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addBug(data) {
|
||||||
|
return request({
|
||||||
|
url: api.addBug,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delBug(id) {
|
||||||
|
return request({
|
||||||
|
url: api.delBug,
|
||||||
|
method: 'post',
|
||||||
|
data: {id}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getBugDetail(id) {
|
||||||
|
return request({
|
||||||
|
url: api.getBugDetail,
|
||||||
|
method: 'post',
|
||||||
|
data: {id}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateBug(data) {
|
||||||
|
return request({
|
||||||
|
url: api.updateBug,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
551
test-ui/src/views/test/bug/index.vue
Normal file
551
test-ui/src/views/test/bug/index.vue
Normal file
@@ -0,0 +1,551 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 顶部导航 -->
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-header class="header">
|
||||||
|
<div class="head1">
|
||||||
|
<span style="font-size: 18px; font-weight: bold; margin-right: 20px;">缺陷列表</span>
|
||||||
|
</div>
|
||||||
|
<div class="head2">
|
||||||
|
<el-input :placeholder="placeholderText" v-model="query" class="input-with-select" clearable>
|
||||||
|
<el-select v-model="select" slot="prepend" placeholder="请选择" style="width: 80px;">
|
||||||
|
<el-option label="概要" value="1"></el-option>
|
||||||
|
<el-option label="ID" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||||
|
</el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="medium"
|
||||||
|
style="margin-right: 10px;"
|
||||||
|
@click="handleCollapse(!activeNames.includes('1'))"
|
||||||
|
>高级筛选
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="el-icon-plus" type="primary" size="medium" style="margin-left: 10px;" @click="addBugVue">新建缺陷</el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-collapse v-model="activeNames">
|
||||||
|
<el-collapse-item class="collapse-search" name="1">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" label-width="110px">
|
||||||
|
<el-row :gutter="10" class="high-search">
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
></el-date-picker>
|
||||||
|
</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.level" placeholder="请选择" clearable filterable>
|
||||||
|
<simple-options :options="dict.type.severity_level"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" size="mini" icon="el-icon-search" @click="handleAdvancedSearch">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetAdvancedFilter">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
|
||||||
|
<!-- 标签页 -->
|
||||||
|
<el-Table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection"/>
|
||||||
|
<el-table-column prop="serialNumber" label="ID" align="center"/>
|
||||||
|
<el-table-column prop="outline" label="概要" align="center"/>
|
||||||
|
<el-table-column prop="status" label="状态" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="dict.type.status" :value="row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="manager" label="经办人" align="center"/>
|
||||||
|
<el-table-column prop="level" label="严重程度" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="severityColor[scope.row.level]">{{ scope.row.level }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="创建时间" align="center"/>
|
||||||
|
<el-table-column label="操作" align="left" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row.id)">编辑</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click.native.stop="handleDelete(scope.row.id)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-Table>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<div style="margin-top: 10px; display: flex; justify-content: space-between; align-items: center;">
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" @click="handleExport">全部导出</el-button>
|
||||||
|
<el-button size="small" @click="handleSelectExport">批量导出</el-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog title="新建缺陷" :visible.sync="addOpen" width="90%">
|
||||||
|
<el-form ref="form" :rules="rules" :model="form" label-width="110px" label-position="right">
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form-item label="缺陷概要" prop="outline">
|
||||||
|
<el-input v-model="form.outline" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 描述 -->
|
||||||
|
<el-form-item label="描述" prop="detail">
|
||||||
|
<el-input type="textarea" v-model="form.detail" :rows="22"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-main>
|
||||||
|
<el-aside width="450px" class="basic-information">
|
||||||
|
<h3>基础信息</h3>
|
||||||
|
<el-form-item label="缺陷ID" prop="serialNumber">
|
||||||
|
<el-input v-model="form.serialNumber" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经办人" prop="manager">
|
||||||
|
<el-select v-model="form.manager" placeholder="请选择经办人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="严重程度" prop="level">
|
||||||
|
<el-select v-model="form.level" placeholder="未设置" clearable filterable>
|
||||||
|
<simple-options :options="dict.type.severity_level"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷类型" prop="type">
|
||||||
|
<el-select v-model="form.type" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="dict.type.bug_type"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷状态" prop="status">
|
||||||
|
<el-select v-model="form.status" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="dict.type.bug_status"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="能否复现" prop="reappearance">
|
||||||
|
<el-select v-model="form.reappearance" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="reappearanceOptions"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开发人" prop="dev">
|
||||||
|
<el-select v-model="form.dev" placeholder="请选择开发人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测试人" prop="test">
|
||||||
|
<el-select v-model="form.test" placeholder="请选择测试人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本" prop="version">
|
||||||
|
<el-input v-model="form.version" placeholder="请输入版本"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="addOpen = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="编辑缺陷" :visible.sync="editOpen" width="90%">
|
||||||
|
<el-form ref="editForm" :rules="rules" :model="editForm" label-width="110px" label-position="right">
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form-item label="缺陷概要" prop="outline">
|
||||||
|
<el-input v-model="editForm.outline" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 描述 -->
|
||||||
|
<el-form-item label="描述" prop="detail">
|
||||||
|
<el-input type="textarea" v-model="editForm.detail" :rows="22"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-main>
|
||||||
|
<el-aside width="450px" class="basic-information">
|
||||||
|
<h3>基础信息</h3>
|
||||||
|
<el-form-item label="缺陷ID" prop="serialNumber">
|
||||||
|
<el-input v-model="editForm.serialNumber" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷名称" prop="name">
|
||||||
|
<el-input v-model="editForm.name" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经办人" prop="manager">
|
||||||
|
<el-select v-model="editForm.manager" placeholder="请选择经办人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="严重程度" prop="level">
|
||||||
|
<el-select v-model="editForm.level" placeholder="未设置" clearable filterable>
|
||||||
|
<simple-options :options="dict.type.severity_level"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷类型" prop="type">
|
||||||
|
<el-select v-model="editForm.type" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="dict.type.bug_type"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺陷状态" prop="status">
|
||||||
|
<el-select v-model="editForm.status" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="dict.type.bug_status"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="能否复现" prop="reappearance">
|
||||||
|
<el-select v-model="editForm.reappearance" placeholder="未设置" clearable>
|
||||||
|
<simple-options :options="reappearanceOptions"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开发人" prop="dev">
|
||||||
|
<el-select v-model="editForm.dev" placeholder="请选择开发人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="测试人" prop="test">
|
||||||
|
<el-select v-model="editForm.test" placeholder="请选择测试人" clearable>
|
||||||
|
<Simple-options :options="managerList"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本" prop="version">
|
||||||
|
<el-input v-model="editForm.version" placeholder="请输入版本"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="editOpen = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="editSubmitForm">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {managerList} from "@/api/test/project";
|
||||||
|
import {addBug, delBug, getBugDetail, getBugList, updateBug} from "@/api/test/bug";
|
||||||
|
import SimpleOptions from "@/components/FormItem/option/SimpleOptions.vue";
|
||||||
|
import {requestDownload} from "@/utils/request";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'defect',
|
||||||
|
components: {SimpleOptions},
|
||||||
|
dicts: ['severity_level', 'bug_type', 'bug_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
reappearanceOptions: [{
|
||||||
|
value: '0',
|
||||||
|
label: '必然复现'
|
||||||
|
}, {
|
||||||
|
value: '1',
|
||||||
|
label: '偶发复现'
|
||||||
|
}],
|
||||||
|
severityColor: {
|
||||||
|
P0: 'info',
|
||||||
|
P1: 'warning',
|
||||||
|
P2: 'warning',
|
||||||
|
P3: 'danger',
|
||||||
|
p4: 'danger'
|
||||||
|
},
|
||||||
|
query: '',
|
||||||
|
rules: {
|
||||||
|
serialNumber: [{required: true, message: '请输入缺陷ID', trigger: 'blur'}],
|
||||||
|
detail: [{required: true, message: '请输入缺陷描述', trigger: 'blur'}],
|
||||||
|
name: [{required: true, message: '请输入缺陷名称', trigger: 'blur'}],
|
||||||
|
outline: [{required: true, message: '请输入缺陷概要', trigger: 'blur'}],
|
||||||
|
manager: [{required: true, message: '请选择经办人', trigger: 'blur'}],
|
||||||
|
dev: [{required: true, message: '请选择开发人员', trigger: 'blur'}],
|
||||||
|
test: [{required: true, message: '请选择测试人员', trigger: 'blur'}],
|
||||||
|
level: [{required: true, message: '请选择严重程度', trigger: 'blur'}],
|
||||||
|
status: [{required: true, message: '请选择缺陷状态', trigger: 'blur'}],
|
||||||
|
reappearance: [{required: true, message: '请选择是否复现', trigger: 'blur'}],
|
||||||
|
type: [{required: true, message: '请选择缺陷类型', trigger: 'blur'}],
|
||||||
|
version: [{required: true, message: '请输入版本', trigger: 'blur'}],
|
||||||
|
},
|
||||||
|
select: '1',
|
||||||
|
searchKeyword: '',
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
title: '',
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
editSubmitLoading: false,
|
||||||
|
submitLoading: false,
|
||||||
|
//新增弹窗
|
||||||
|
addOpen: false,
|
||||||
|
//编辑弹窗
|
||||||
|
editOpen: false,
|
||||||
|
selectedRows: [],
|
||||||
|
selectedData: [],
|
||||||
|
managerList: [],
|
||||||
|
queryParams: {
|
||||||
|
serialNumber: '',
|
||||||
|
outline: '',
|
||||||
|
manager: '',
|
||||||
|
level: '',
|
||||||
|
createTime: [],
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
activeNames: [], // 控制 collapse 的展开状态
|
||||||
|
form: {
|
||||||
|
serialNumber: '',
|
||||||
|
name: '',
|
||||||
|
outline: '',
|
||||||
|
detail: '',
|
||||||
|
status: '',
|
||||||
|
manager: '',
|
||||||
|
dev: '',
|
||||||
|
test: '',
|
||||||
|
level: '',
|
||||||
|
type: '',
|
||||||
|
reappearance: '',
|
||||||
|
version: ''
|
||||||
|
},
|
||||||
|
editForm: {
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getManagerList();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
placeholderText() {
|
||||||
|
return this.select === '1' ? '请输入需求概要搜索' : '请输入需求ID搜索';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.selectedRows = selection;
|
||||||
|
},
|
||||||
|
// 获取负责人列表
|
||||||
|
getManagerList() {
|
||||||
|
managerList()
|
||||||
|
.then((list) => {
|
||||||
|
this.managerList = (list.rows || []).map((e) => ({value: e.userId, label: e.userName}))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 搜索
|
||||||
|
handleQuery() {
|
||||||
|
if (this.select === '1') {
|
||||||
|
this.queryParams.outline = this.query;
|
||||||
|
this.queryParams.serialNumber = '';
|
||||||
|
} else if (this.select === '2') {
|
||||||
|
this.queryParams.serialNumber = this.query;
|
||||||
|
this.queryParams.outline = '';
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
addBugVue() {
|
||||||
|
this.addOpen = true;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
const [startCreateTime, endCreateTime] = this.queryParams.createTime || []
|
||||||
|
const queryParams = {
|
||||||
|
...this.queryParams,
|
||||||
|
startCreateTime,
|
||||||
|
endCreateTime
|
||||||
|
}
|
||||||
|
getBugList(queryParams).then(list => {
|
||||||
|
this.list = list.rows;
|
||||||
|
this.total = list.total;
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
const form = {}
|
||||||
|
Object.keys(this.form).forEach((key) => {
|
||||||
|
form[key] = ''
|
||||||
|
})
|
||||||
|
this.form = form
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
// 展开/折叠
|
||||||
|
handleCollapse(val) {
|
||||||
|
this.activeNames = val ? ['1'] : [];
|
||||||
|
},
|
||||||
|
handleAdvancedSearch() {
|
||||||
|
// 高级筛选条件搜索
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetAdvancedFilter() {
|
||||||
|
// 重置高级筛选条件
|
||||||
|
this.resetForm('queryFrom')
|
||||||
|
this.handleAdvancedSearch()
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
const form = {
|
||||||
|
...this.form,
|
||||||
|
}
|
||||||
|
console.log('submit', form)
|
||||||
|
this.$refs?.form.validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.submitLoading = true
|
||||||
|
addBug(form)
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('添加成功')
|
||||||
|
this.addOpen = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error('添加失败')
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.submitLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$modal.confirm('是否确认删除缺陷?').then(function () {
|
||||||
|
return delBug(id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEdit(id) {
|
||||||
|
this.title = '编辑缺陷'
|
||||||
|
getBugDetail(id).then((res) => {
|
||||||
|
this.editForm = res.data
|
||||||
|
this.editForm.manager = parseInt(res.data.manager, 10);
|
||||||
|
this.editOpen = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
editSubmitForm() {
|
||||||
|
const form = {
|
||||||
|
...this.editForm,
|
||||||
|
}
|
||||||
|
this.$refs?.editForm.validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.editSubmitLoading = true
|
||||||
|
updateBug(form)
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('编辑成功')
|
||||||
|
this.editSubmitLoading = false
|
||||||
|
this.editOpen = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error('编辑失败')
|
||||||
|
this.editSubmitLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 全部导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
const [startCreateTime, endCreateTime] = this.queryParams.createTime || []
|
||||||
|
this.queryParams.startCreateTime = startCreateTime
|
||||||
|
this.queryParams.endCreateTime = endCreateTime
|
||||||
|
const {pageNum, pageSize, ...rest} = this.queryParams
|
||||||
|
requestDownload({
|
||||||
|
url: '/test/defect/exportBug',
|
||||||
|
fileName: `缺陷列表信息_${new Date().getTime()}.xlsx`,
|
||||||
|
data: rest,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 批量导出按钮操作 */
|
||||||
|
handleSelectExport() {
|
||||||
|
this.selectedData = this.selectedRows.map(row => ({
|
||||||
|
serialNumber: row.serialNumber,
|
||||||
|
outline: row.outline,
|
||||||
|
manager: row.manager,
|
||||||
|
level: row.level,
|
||||||
|
createTime: row.createTime,
|
||||||
|
status: row.status
|
||||||
|
}));
|
||||||
|
console.log('selectedData', this.selectedData)
|
||||||
|
requestDownload({
|
||||||
|
url: '/test/defect/batchExportBug',
|
||||||
|
fileName: `缺陷列表信息_${new Date().getTime()}.xlsx`,
|
||||||
|
data: this.selectedData,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #ffffff;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-search {
|
||||||
|
::v-deep .el-collapse-item__header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.high-search {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: rgb(248, 248, 249);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head1 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head2 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
justify-content: flex-end;
|
||||||
|
column-gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog .el-form {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog .el-form-item {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog .el-textarea {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.basic-information {
|
||||||
|
background-color: rgb(248, 248, 249) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user