1、测试计划关联需求列表查询
2、测试计划关联报告列表查询
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
import com.test.test.domain.qo.IDQO;
|
||||
import com.test.test.domain.vo.TestPlanProjectVo;
|
||||
import com.test.test.service.ITestPlanProjectService;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 测试计划需求关联Controller
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/test/testPlanProject")
|
||||
public class TestPlanProjectController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ITestPlanProjectService testPlanProjectService;
|
||||
|
||||
/**
|
||||
* 查询测试计划需求关联列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(@RequestBody IDQO qo) {
|
||||
startPage();
|
||||
List<TestPlanProjectVo> list = testPlanProjectService.selectTestPlanProjectList(qo.getId());
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import com.test.common.core.controller.BaseController;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
import com.test.test.domain.qo.IDQO;
|
||||
import com.test.test.domain.vo.TestReportVo;
|
||||
import com.test.test.service.ITestReportService;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 测试报告Controller
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/test/report")
|
||||
public class TestReportController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ITestReportService testReportService;
|
||||
|
||||
/**
|
||||
* 查询测试计划关联测试报告列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(@RequestBody IDQO qo) {
|
||||
startPage();
|
||||
List<TestReportVo> list = testReportService.selectTestReportList(qo.getId());
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划测试项目关联需求表 test_plan_project
|
||||
*
|
||||
* @author test
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanProject extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 3043713502269619172L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 需求主键ID */
|
||||
@Excel(name = "需求主键ID")
|
||||
private String projectId;
|
||||
|
||||
/** 测试计划主键ID */
|
||||
@Excel(name = "测试计划主键ID")
|
||||
private String planId;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划关联测试报告表 test_plan_report
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanReport extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -1249261671553262360L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 测试计划主键ID */
|
||||
@Excel(name = "测试计划主键ID")
|
||||
private String planId;
|
||||
|
||||
/** 测试报告主键ID */
|
||||
@Excel(name = "测试报告主键ID")
|
||||
private String reportId;
|
||||
|
||||
/** 测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证) */
|
||||
@Excel(name = "测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证)")
|
||||
private Long type;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
}
|
||||
44
test-test/src/main/java/com/test/test/domain/TestReport.java
Normal file
44
test-test/src/main/java/com/test/test/domain/TestReport.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试报告表PO test_report
|
||||
*/
|
||||
@Data
|
||||
public class TestReport extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -2614255975963227103L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 测试报告编码 */
|
||||
@Excel(name = "测试报告编码")
|
||||
private String serialNumber;
|
||||
|
||||
/** 测试报告名称 */
|
||||
@Excel(name = "测试报告名称")
|
||||
private String name;
|
||||
|
||||
/** 测试结果(0,未通过,1,通过) */
|
||||
@Excel(name = "测试结果(0,未通过,1,通过)")
|
||||
private String result;
|
||||
|
||||
/** 测试报告发送状态(0,未发送,1,已发送) */
|
||||
@Excel(name = "测试报告发送状态", readConverterExp = "0=,未发送,1,已发送")
|
||||
private String status;
|
||||
|
||||
/** 测试报告(jason格式存储) */
|
||||
@Excel(name = "测试报告", readConverterExp = "jason格式存储")
|
||||
private String report;
|
||||
|
||||
/** 版本 */
|
||||
@Excel(name = "版本")
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.test.test.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 测试计划关联需求VO
|
||||
*/
|
||||
@Data
|
||||
public class TestPlanProjectVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 2482748159724585467L;
|
||||
|
||||
/** 需求编码 */
|
||||
private String serialNumber;
|
||||
|
||||
/** 需求名称 */
|
||||
private String name;
|
||||
|
||||
/** 需求概要 */
|
||||
private String outline;
|
||||
|
||||
/** 需求描述 */
|
||||
private String detail;
|
||||
|
||||
/** 优先级(p0,p1,p2,p3,p4) */
|
||||
private String priority;
|
||||
|
||||
/** 预计完成时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date estimatedTime;
|
||||
|
||||
/** 需求来源(0,产品经理,1,客户) */
|
||||
private String source;
|
||||
|
||||
/** 需求类型(0,优化,1,新功能) */
|
||||
private String type;
|
||||
|
||||
/** 状态(0,未开始,1,进行中,2,已完成,3,已终止) */
|
||||
private String status;
|
||||
|
||||
/** 负责人 */
|
||||
private String manager;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
|
||||
/** 0,正常,1,删除 */
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.test.test.domain.vo;
|
||||
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TestReportVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -4331077290310280474L;
|
||||
|
||||
/**
|
||||
* 测试报告名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/** 测试结果(0,未通过,1,通过) */
|
||||
private String result;
|
||||
|
||||
/** 测试用例类型(0,冒烟测试,1,功能测试,2,回归测试,3,准生产测试,4,生产验证) */
|
||||
private Long type;
|
||||
|
||||
/** 测试报告发送状态(0,未发送,1,已发送) */
|
||||
@Excel(name = "测试报告发送状态", readConverterExp = "0=,未发送,1,已发送")
|
||||
private String status;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.qo.TestPlanAddQO;
|
||||
import com.test.test.domain.vo.TestPlanProjectVo;
|
||||
import java.util.List;
|
||||
|
||||
public interface TestProjectPlanMapper {
|
||||
|
||||
@@ -10,4 +12,11 @@ public interface TestProjectPlanMapper {
|
||||
* @return
|
||||
*/
|
||||
int insertTestProjectPlan(TestPlanAddQO testPlanAddQO);
|
||||
|
||||
/**
|
||||
* 查询测试计划关联需求列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<TestPlanProjectVo> selectTestPlanProjectList(Long planId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import com.test.test.domain.vo.TestReportVo;
|
||||
import java.util.List;
|
||||
|
||||
public interface TestReportMapper {
|
||||
|
||||
/**
|
||||
* 查询测试报告列表
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<TestReportVo> selectTestReportList(Long planId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.test.test.service;
|
||||
|
||||
import com.test.test.domain.vo.TestPlanProjectVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试计划需求关联Service接口
|
||||
*/
|
||||
public interface ITestPlanProjectService {
|
||||
|
||||
/**
|
||||
* 查询测试计划需求关联列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<TestPlanProjectVo> selectTestPlanProjectList(Long planId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.test.test.service;
|
||||
|
||||
import com.test.test.domain.vo.TestReportVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试报告Service接口
|
||||
*/
|
||||
public interface ITestReportService {
|
||||
|
||||
/**
|
||||
* 查询测试报告列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<TestReportVo> selectTestReportList(Long planId);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import com.test.test.domain.vo.TestPlanProjectVo;
|
||||
import com.test.test.mapper.TestProjectPlanMapper;
|
||||
import com.test.test.service.ITestPlanProjectService;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 测试计划需求关联Service业务实现类
|
||||
*
|
||||
* @author pfl
|
||||
*/
|
||||
@Service
|
||||
public class TestPlanProjectServiceImpl implements ITestPlanProjectService {
|
||||
|
||||
@Resource
|
||||
private TestProjectPlanMapper testProjectPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询测试计划需求关联列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TestPlanProjectVo> selectTestPlanProjectList(Long planId) {
|
||||
return testProjectPlanMapper.selectTestPlanProjectList(planId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import com.test.test.domain.vo.TestReportVo;
|
||||
import com.test.test.mapper.TestReportMapper;
|
||||
import com.test.test.service.ITestReportService;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 测试报告Service业务层实现
|
||||
*
|
||||
* @author test
|
||||
* @date 2025-04-25
|
||||
*/
|
||||
@Service
|
||||
public class TestReportServiceImpl implements ITestReportService {
|
||||
|
||||
@Resource
|
||||
private TestReportMapper testReportMapper;
|
||||
|
||||
/**
|
||||
* 查询测试报告列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TestReportVo> selectTestReportList(Long planId) {
|
||||
return testReportMapper.selectTestReportList(planId);
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,26 @@
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectTestPlanProjectList" parameterType="Long" resultType="TestPlanProjectVo">
|
||||
SELECT
|
||||
tp.serial_number AS serialNumber,
|
||||
tp.name ,
|
||||
tp.outline,
|
||||
tp.detail,
|
||||
tp.priority,
|
||||
tp.estimated_time AS estimatedTime,
|
||||
tp.source,
|
||||
tp.type,
|
||||
tp.status,
|
||||
su.user_name AS manager,
|
||||
tp.create_time AS createTime,
|
||||
tp.version,
|
||||
tp.del_flag
|
||||
FROM test_project_plan tpp
|
||||
LEFT JOIN test_project tp ON tp.id = tpp.project_id
|
||||
LEFT JOIN sys_user su ON su.user_id = tp.manager
|
||||
WHERE tpp.plan_id = #{planId}
|
||||
AND tpp.del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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.TestReportMapper">
|
||||
|
||||
<select id="selectTestReportList" parameterType="Long" resultType="TestReportVo">
|
||||
SELECT
|
||||
tr.name AS name,
|
||||
tr.result AS result,
|
||||
tr.status AS status,
|
||||
tpr.type AS type,
|
||||
tr.create_time AS createTime,
|
||||
tr.update_by AS updateBy
|
||||
FROM test_plan_report tpr
|
||||
LEFT JOIN test_report tr ON tr.id = tpr.report_id
|
||||
WHERE tpr.plan_id = #{planId}
|
||||
AND tpr.del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user