From b680339e6a7dd3f1c17195212df2ced4ccca9d0d Mon Sep 17 00:00:00 2001 From: pfl <14579250+shadowman1@user.noreply.gitee.com> Date: Sun, 27 Apr 2025 19:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/test/domain/vo/TestPlanListVO.java | 30 ++++ .../resources/mapper/test/TestPlanMapper.xml | 75 ++++++++++ test-ui/src/views/test/testplan/index.vue | 140 +++++++++++++++++- 3 files changed, 239 insertions(+), 6 deletions(-) diff --git a/test-test/src/main/java/com/test/test/domain/vo/TestPlanListVO.java b/test-test/src/main/java/com/test/test/domain/vo/TestPlanListVO.java index ac3d557..ef2bdc7 100644 --- a/test-test/src/main/java/com/test/test/domain/vo/TestPlanListVO.java +++ b/test-test/src/main/java/com/test/test/domain/vo/TestPlanListVO.java @@ -22,6 +22,36 @@ public class TestPlanListVO extends BaseEntity { @Excel(name = "测试计划名称") private String name; + /** 0 冒烟测试 */ + private String smokeTest; + + /** 1 功能测试 */ + private String functionTest; + + /** 2 回归测试 */ + private String regressionTest; + + /** 3 准生产测试 */ + private String preProductionTest; + + /** 4 生产测试 */ + private String productionTest; + + /** 冒烟测试通过数 */ + private String smokeTestPassNum; + + /** 功能测试通过数 */ + private String functionTestPassNum; + + /** 回归测试通过数 */ + private String regressionTestPassNum; + + /** 准生产测试通过数 */ + private String preProductionTestPassNum; + + /** 生产测试通过数 */ + private String productionTestPassNum; + /** 状态(0,未开始,1,进行中,2,已完成,3,已终止) */ @Excel(name = "状态(0,未开始,1,进行中,2,已完成,3,已终止)") private String status; diff --git a/test-test/src/main/resources/mapper/test/TestPlanMapper.xml b/test-test/src/main/resources/mapper/test/TestPlanMapper.xml index c4e2287..3d553b7 100644 --- a/test-test/src/main/resources/mapper/test/TestPlanMapper.xml +++ b/test-test/src/main/resources/mapper/test/TestPlanMapper.xml @@ -87,6 +87,81 @@ su.user_name AS manager, tp.start_time AS startTime, tp.end_time AS endTime, + ( + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.execute_result = '1' + AND tpc.type = '0') / + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '0') * 100 + ) AS smokeTest, + ( + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.execute_result = '1' + AND tpc.type = '1') / + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '1') * 100 + ) AS functionTest, + ( + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.execute_result = '1' + AND tpc.type = '2') / + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '2') * 100 + ) AS regressionTest, + ( + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.execute_result = '1' + AND tpc.type = '3') / + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '3') * 100 + ) AS preProductionTest, + ( + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.execute_result = '1' + AND tpc.type = '4') / + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '4') * 100 + ) AS productionTest, + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '0') AS smokeTestPassNum, + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '1') AS functionTestPassNum, + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '2') AS regressionTestPassNum, + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '3') AS preProductionTestPassNum, + (SELECT COUNT(1) FROM test_plan_case tpc + WHERE tpc.plan_id = tp.id + AND tpc.del_flag = '0' + AND tpc.type = '4') AS productionTestPassNum, tp.version, ( SELECT COUNT(1) FROM test_plan_defect tpd diff --git a/test-ui/src/views/test/testplan/index.vue b/test-ui/src/views/test/testplan/index.vue index 4f06495..affb466 100644 --- a/test-ui/src/views/test/testplan/index.vue +++ b/test-ui/src/views/test/testplan/index.vue @@ -93,34 +93,143 @@ - + 暂无关联用例 + + + + + + 通过 + + + + + {{ scope.row.smokeTestPassNum }} + + + {{ Number(scope.row.smokeTest).toFixed(0) + '%' }} + + + + 功能测试 - + + 暂无关联用例 + + + + + + 通过 + + + + + {{ scope.row.functionTestPassNum }} + + + {{ Number(scope.row.functionTest).toFixed(0) + '%' }} + + + + + 回归测试 - + + 暂无关联用例 + + + + + + 通过 + + + + + {{ scope.row.regressionTestPassNum }} + + + {{ Number(scope.row.regressionTest).toFixed(0) + '%' }} + + + + + 准生产验证 - + + 暂无关联用例 + + + + + + 通过 + + + + + {{ scope.row.preProductionTestPassNum }} + + + {{ Number(scope.row.preProductionTest).toFixed(0) + '%' }} + + + + + 生产验证 - + + 暂无关联用例 + + + + + + 通过 + + + + + {{ scope.row.productionTestPassNum }} + + + {{ Number(scope.row.productionTest).toFixed(0) + '%' }} + + + + + @@ -457,4 +566,23 @@ export default { display: flex; align-items: center; } + +.custom-content { + width: 200px; + padding: 10px; + .el-row { + align-items: center; + } + .el-col { + display: flex; + align-items: center; + } + .el-icon-check { + color: #67C23A; + margin-right: 5px; + } + span { + font-size: 14px; + } +}