测试计划关联测试缺陷完善
This commit is contained in:
@@ -7,6 +7,8 @@ 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.domain.qo.TestPlanDefectQO;
|
||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||
import com.test.test.service.ITestPlanDefectService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -31,10 +33,10 @@ public class TestPlanDefectController extends BaseController
|
||||
* 查询测试计划测试缺陷关联列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TestPlanDefect testPlanDefect)
|
||||
public TableDataInfo list(TestPlanDefectQO testPlanDefect)
|
||||
{
|
||||
startPage();
|
||||
List<TestPlanDefect> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||
List<TestPlanDefectVo> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -43,10 +45,10 @@ public class TestPlanDefectController extends BaseController
|
||||
*/
|
||||
@Log(title = "测试计划测试缺陷关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TestPlanDefect testPlanDefect)
|
||||
public void export(HttpServletResponse response, TestPlanDefectQO testPlanDefect)
|
||||
{
|
||||
List<TestPlanDefect> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||
ExcelUtil<TestPlanDefect> util = new ExcelUtil<TestPlanDefect>(TestPlanDefect.class);
|
||||
List<TestPlanDefectVo> list = testPlanDefectService.selectTestPlanDefectList(testPlanDefect);
|
||||
ExcelUtil<TestPlanDefectVo> util = new ExcelUtil<TestPlanDefectVo>(TestPlanDefectVo.class);
|
||||
util.exportExcel(response, list, "测试计划测试缺陷关联数据");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.test.test.domain.qo;
|
||||
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划测试缺陷关联请求QO
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanDefectQO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 3754531916096288164L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 测试计划主键ID */
|
||||
private String planId;
|
||||
|
||||
/** 测试缺陷主键ID */
|
||||
private String defectId;
|
||||
|
||||
/**
|
||||
* 缺陷编码
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 缺陷概要
|
||||
*/
|
||||
private String outline;
|
||||
|
||||
/** 测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证) */
|
||||
private String type;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.test.test.domain.vo;
|
||||
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划测试缺陷关联返回Vo
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanDefectVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -4826790211276641073L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷ID
|
||||
*/
|
||||
private String defectId;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷ID
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷概要
|
||||
*/
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷经办人
|
||||
*/
|
||||
private String manager;
|
||||
|
||||
/**
|
||||
* 测试计划关联缺陷严重程度
|
||||
*/
|
||||
private String level;
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.TestPlanDefect;
|
||||
|
||||
import com.test.test.domain.qo.TestPlanDefectQO;
|
||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ public interface TestPlanDefectMapper
|
||||
* @param testPlanDefect 测试计划测试缺陷关联
|
||||
* @return 测试计划测试缺陷关联集合
|
||||
*/
|
||||
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect);
|
||||
public List<TestPlanDefectVo> selectTestPlanDefectList(TestPlanDefectQO testPlanDefect);
|
||||
|
||||
/**
|
||||
* 新增测试计划测试缺陷关联
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.test.test.service;
|
||||
|
||||
import com.test.test.domain.TestPlanDefect;
|
||||
|
||||
import com.test.test.domain.qo.TestPlanDefectQO;
|
||||
import com.test.test.domain.vo.TestPlanDefectVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -26,7 +28,7 @@ public interface ITestPlanDefectService
|
||||
* @param testPlanDefect 测试计划测试缺陷关联
|
||||
* @return 测试计划测试缺陷关联集合
|
||||
*/
|
||||
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect);
|
||||
public List<TestPlanDefectVo> selectTestPlanDefectList(TestPlanDefectQO testPlanDefect);
|
||||
|
||||
/**
|
||||
* 新增测试计划测试缺陷关联
|
||||
|
||||
@@ -2,6 +2,8 @@ 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.vo.TestPlanDefectVo;
|
||||
import com.test.test.mapper.TestPlanDefectMapper;
|
||||
import com.test.test.service.ITestPlanDefectService;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -40,7 +42,7 @@ public class TestPlanDefectServiceImpl implements ITestPlanDefectService
|
||||
* @return 测试计划测试缺陷关联
|
||||
*/
|
||||
@Override
|
||||
public List<TestPlanDefect> selectTestPlanDefectList(TestPlanDefect testPlanDefect)
|
||||
public List<TestPlanDefectVo> selectTestPlanDefectList(TestPlanDefectQO testPlanDefect)
|
||||
{
|
||||
return testPlanDefectMapper.selectTestPlanDefectList(testPlanDefect);
|
||||
}
|
||||
|
||||
@@ -19,14 +19,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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 id="selectTestPlanDefectList" parameterType="TestPlanDefectQO" resultType="TestPlanDefectVo">
|
||||
SELECT
|
||||
tpd.id,
|
||||
tpd.defect_id AS defectId,
|
||||
td.serial_number AS serialNumber,
|
||||
td.outline AS summary,
|
||||
td.create_time AS createTime,
|
||||
td.status,
|
||||
su.user_name AS manager,
|
||||
td.level
|
||||
FROM test_plan_defect tpd
|
||||
LEFT JOIN test_defect td ON td.id = tpd.defect_id
|
||||
LEFT JOIN sys_user su ON su.user_id = td.manager
|
||||
where 1=1
|
||||
AND tpd.del_flag = '0'
|
||||
<if test="serialNumber != null and serialNumber != ''">
|
||||
AND td.serial_number LIKE concat('%', #{serialNumber}, '%')
|
||||
</if>
|
||||
<if test="outline != null and outline != ''">
|
||||
AND td.outline LIKE concat('%', #{outline}, '%')
|
||||
</if>
|
||||
<if test="planId != null and planId != ''">
|
||||
AND tpd.plan_id = #{planId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND tpd.type = #{type}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectTestPlanDefectById" parameterType="Long" resultMap="TestPlanDefectResult">
|
||||
|
||||
Reference in New Issue
Block a user