diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCase.java b/backend/src/main/java/io/metersphere/base/domain/TestCase.java index 121b99d8ca..d9954b8ad4 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCase.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCase.java @@ -1,14 +1,13 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestCase implements Serializable { private String id; - private Integer nodeId; + private String nodeId; private String nodePath; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java index f6e7c1f7bd..0cf4adc790 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java @@ -184,52 +184,62 @@ public class TestCaseExample { return (Criteria) this; } - public Criteria andNodeIdEqualTo(Integer value) { + public Criteria andNodeIdEqualTo(String value) { addCriterion("node_id =", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdNotEqualTo(Integer value) { + public Criteria andNodeIdNotEqualTo(String value) { addCriterion("node_id <>", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdGreaterThan(Integer value) { + public Criteria andNodeIdGreaterThan(String value) { addCriterion("node_id >", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdGreaterThanOrEqualTo(Integer value) { + public Criteria andNodeIdGreaterThanOrEqualTo(String value) { addCriterion("node_id >=", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdLessThan(Integer value) { + public Criteria andNodeIdLessThan(String value) { addCriterion("node_id <", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdLessThanOrEqualTo(Integer value) { + public Criteria andNodeIdLessThanOrEqualTo(String value) { addCriterion("node_id <=", value, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdIn(List values) { + public Criteria andNodeIdLike(String value) { + addCriterion("node_id like", value, "nodeId"); + return (Criteria) this; + } + + public Criteria andNodeIdNotLike(String value) { + addCriterion("node_id not like", value, "nodeId"); + return (Criteria) this; + } + + public Criteria andNodeIdIn(List values) { addCriterion("node_id in", values, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdNotIn(List values) { + public Criteria andNodeIdNotIn(List values) { addCriterion("node_id not in", values, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdBetween(Integer value1, Integer value2) { + public Criteria andNodeIdBetween(String value1, String value2) { addCriterion("node_id between", value1, value2, "nodeId"); return (Criteria) this; } - public Criteria andNodeIdNotBetween(Integer value1, Integer value2) { + public Criteria andNodeIdNotBetween(String value1, String value2) { addCriterion("node_id not between", value1, value2, "nodeId"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java index 6237c938e4..d17174d90e 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java @@ -1,18 +1,17 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestCaseNode implements Serializable { - private Integer id; + private String id; private String projectId; private String name; - private Integer pId; + private String parentId; private Integer level; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java index 03a36188b1..9b76aaada3 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java @@ -114,52 +114,62 @@ public class TestCaseNodeExample { return (Criteria) this; } - public Criteria andIdEqualTo(Integer value) { + public Criteria andIdEqualTo(String value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Integer value) { + public Criteria andIdNotEqualTo(String value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Integer value) { + public Criteria andIdGreaterThan(String value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Integer value) { + public Criteria andIdGreaterThanOrEqualTo(String value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Integer value) { + public Criteria andIdLessThan(String value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Integer value) { + public Criteria andIdLessThanOrEqualTo(String value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List values) { + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { + public Criteria andIdNotIn(List values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Integer value1, Integer value2) { + public Criteria andIdBetween(String value1, String value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Integer value1, Integer value2) { + public Criteria andIdNotBetween(String value1, String value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } @@ -304,63 +314,73 @@ public class TestCaseNodeExample { return (Criteria) this; } - public Criteria andPIdIsNull() { - addCriterion("p_id is null"); + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); return (Criteria) this; } - public Criteria andPIdIsNotNull() { - addCriterion("p_id is not null"); + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); return (Criteria) this; } - public Criteria andPIdEqualTo(Integer value) { - addCriterion("p_id =", value, "pId"); + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); return (Criteria) this; } - public Criteria andPIdNotEqualTo(Integer value) { - addCriterion("p_id <>", value, "pId"); + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); return (Criteria) this; } - public Criteria andPIdGreaterThan(Integer value) { - addCriterion("p_id >", value, "pId"); + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); return (Criteria) this; } - public Criteria andPIdGreaterThanOrEqualTo(Integer value) { - addCriterion("p_id >=", value, "pId"); + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); return (Criteria) this; } - public Criteria andPIdLessThan(Integer value) { - addCriterion("p_id <", value, "pId"); + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); return (Criteria) this; } - public Criteria andPIdLessThanOrEqualTo(Integer value) { - addCriterion("p_id <=", value, "pId"); + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); return (Criteria) this; } - public Criteria andPIdIn(List values) { - addCriterion("p_id in", values, "pId"); + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); return (Criteria) this; } - public Criteria andPIdNotIn(List values) { - addCriterion("p_id not in", values, "pId"); + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); return (Criteria) this; } - public Criteria andPIdBetween(Integer value1, Integer value2) { - addCriterion("p_id between", value1, value2, "pId"); + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); return (Criteria) this; } - public Criteria andPIdNotBetween(Integer value1, Integer value2) { - addCriterion("p_id not between", value1, value2, "pId"); + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java index dbb9178691..455e3d1626 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class TestCaseReport implements Serializable { - private Long id; + private String id; private String name; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java index 644624f3d8..78cac17453 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java @@ -114,52 +114,62 @@ public class TestCaseReportExample { return (Criteria) this; } - public Criteria andIdEqualTo(Long value) { + public Criteria andIdEqualTo(String value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Long value) { + public Criteria andIdNotEqualTo(String value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Long value) { + public Criteria andIdGreaterThan(String value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Long value) { + public Criteria andIdGreaterThanOrEqualTo(String value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Long value) { + public Criteria andIdLessThan(String value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Long value) { + public Criteria andIdLessThanOrEqualTo(String value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List values) { + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { + public Criteria andIdNotIn(List values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Long value1, Long value2) { + public Criteria andIdBetween(String value1, String value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Long value1, Long value2) { + public Criteria andIdNotBetween(String value1, String value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java index a210ff561b..658ba6a09d 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class TestCaseReportTemplate implements Serializable { - private Long id; + private String id; private String name; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java index a0c5b96a60..2ed980e0ee 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java @@ -114,52 +114,62 @@ public class TestCaseReportTemplateExample { return (Criteria) this; } - public Criteria andIdEqualTo(Long value) { + public Criteria andIdEqualTo(String value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Long value) { + public Criteria andIdNotEqualTo(String value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Long value) { + public Criteria andIdGreaterThan(String value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Long value) { + public Criteria andIdGreaterThanOrEqualTo(String value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Long value) { + public Criteria andIdLessThan(String value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Long value) { + public Criteria andIdLessThanOrEqualTo(String value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List values) { + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { + public Criteria andIdNotIn(List values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Long value1, Long value2) { + public Criteria andIdBetween(String value1, String value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Long value1, Long value2) { + public Criteria andIdNotBetween(String value1, String value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java index a07a2e6285..8c58c01094 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java @@ -1,11 +1,10 @@ package io.metersphere.base.domain; +import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import java.io.Serializable; - @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlan.java b/backend/src/main/java/io/metersphere/base/domain/TestPlan.java index 772638740a..6fc474d077 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlan.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlan.java @@ -11,7 +11,7 @@ public class TestPlan implements Serializable { private String workspaceId; - private Long reportId; + private String reportId; private String name; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanExample.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanExample.java index 201e9701cf..3c75a52576 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanExample.java @@ -324,52 +324,62 @@ public class TestPlanExample { return (Criteria) this; } - public Criteria andReportIdEqualTo(Long value) { + public Criteria andReportIdEqualTo(String value) { addCriterion("report_id =", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdNotEqualTo(Long value) { + public Criteria andReportIdNotEqualTo(String value) { addCriterion("report_id <>", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdGreaterThan(Long value) { + public Criteria andReportIdGreaterThan(String value) { addCriterion("report_id >", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdGreaterThanOrEqualTo(Long value) { + public Criteria andReportIdGreaterThanOrEqualTo(String value) { addCriterion("report_id >=", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdLessThan(Long value) { + public Criteria andReportIdLessThan(String value) { addCriterion("report_id <", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdLessThanOrEqualTo(Long value) { + public Criteria andReportIdLessThanOrEqualTo(String value) { addCriterion("report_id <=", value, "reportId"); return (Criteria) this; } - public Criteria andReportIdIn(List values) { + public Criteria andReportIdLike(String value) { + addCriterion("report_id like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdNotLike(String value) { + addCriterion("report_id not like", value, "reportId"); + return (Criteria) this; + } + + public Criteria andReportIdIn(List values) { addCriterion("report_id in", values, "reportId"); return (Criteria) this; } - public Criteria andReportIdNotIn(List values) { + public Criteria andReportIdNotIn(List values) { addCriterion("report_id not in", values, "reportId"); return (Criteria) this; } - public Criteria andReportIdBetween(Long value1, Long value2) { + public Criteria andReportIdBetween(String value1, String value2) { addCriterion("report_id between", value1, value2, "reportId"); return (Criteria) this; } - public Criteria andReportIdNotBetween(Long value1, Long value2) { + public Criteria andReportIdNotBetween(String value1, String value2) { addCriterion("report_id not between", value1, value2, "reportId"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java index cc6851718f..f24d96a7c1 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java @@ -1,12 +1,11 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestPlanTestCase implements Serializable { - private Integer id; + private String id; private String planId; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCaseExample.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCaseExample.java index 0caea8e81d..a5136f7f26 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCaseExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCaseExample.java @@ -114,52 +114,62 @@ public class TestPlanTestCaseExample { return (Criteria) this; } - public Criteria andIdEqualTo(Integer value) { + public Criteria andIdEqualTo(String value) { addCriterion("id =", value, "id"); return (Criteria) this; } - public Criteria andIdNotEqualTo(Integer value) { + public Criteria andIdNotEqualTo(String value) { addCriterion("id <>", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThan(Integer value) { + public Criteria andIdGreaterThan(String value) { addCriterion("id >", value, "id"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(Integer value) { + public Criteria andIdGreaterThanOrEqualTo(String value) { addCriterion("id >=", value, "id"); return (Criteria) this; } - public Criteria andIdLessThan(Integer value) { + public Criteria andIdLessThan(String value) { addCriterion("id <", value, "id"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(Integer value) { + public Criteria andIdLessThanOrEqualTo(String value) { addCriterion("id <=", value, "id"); return (Criteria) this; } - public Criteria andIdIn(List values) { + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { + public Criteria andIdNotIn(List values) { addCriterion("id not in", values, "id"); return (Criteria) this; } - public Criteria andIdBetween(Integer value1, Integer value2) { + public Criteria andIdBetween(String value1, String value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } - public Criteria andIdNotBetween(Integer value1, Integer value2) { + public Criteria andIdNotBetween(String value1, String value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml index f396311bde..6fb8197aa4 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml @@ -3,7 +3,7 @@ - + @@ -138,7 +138,7 @@ maintainer, priority, method, prerequisite, create_time, update_time, remark, steps) - values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=INTEGER}, #{nodePath,jdbcType=VARCHAR}, + values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, @@ -195,7 +195,7 @@ #{id,jdbcType=VARCHAR}, - #{nodeId,jdbcType=INTEGER}, + #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ id = #{record.id,jdbcType=VARCHAR}, - node_id = #{record.nodeId,jdbcType=INTEGER}, + node_id = #{record.nodeId,jdbcType=VARCHAR}, node_path = #{record.nodePath,jdbcType=VARCHAR}, @@ -294,7 +294,7 @@ update test_case set id = #{record.id,jdbcType=VARCHAR}, - node_id = #{record.nodeId,jdbcType=INTEGER}, + node_id = #{record.nodeId,jdbcType=VARCHAR}, node_path = #{record.nodePath,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -314,7 +314,7 @@ update test_case set id = #{record.id,jdbcType=VARCHAR}, - node_id = #{record.nodeId,jdbcType=INTEGER}, + node_id = #{record.nodeId,jdbcType=VARCHAR}, node_path = #{record.nodePath,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -333,7 +333,7 @@ update test_case - node_id = #{nodeId,jdbcType=INTEGER}, + node_id = #{nodeId,jdbcType=VARCHAR}, node_path = #{nodePath,jdbcType=VARCHAR}, @@ -376,7 +376,7 @@ update test_case - set node_id = #{nodeId,jdbcType=INTEGER}, + set node_id = #{nodeId,jdbcType=VARCHAR}, node_path = #{nodePath,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, @@ -393,7 +393,7 @@ update test_case - set node_id = #{nodeId,jdbcType=INTEGER}, + set node_id = #{nodeId,jdbcType=VARCHAR}, node_path = #{nodePath,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.java index cb3d24a25c..4e88faf0e7 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.java @@ -10,7 +10,7 @@ public interface TestCaseNodeMapper { int deleteByExample(TestCaseNodeExample example); - int deleteByPrimaryKey(Integer id); + int deleteByPrimaryKey(String id); int insert(TestCaseNode record); @@ -18,7 +18,7 @@ public interface TestCaseNodeMapper { List selectByExample(TestCaseNodeExample example); - TestCaseNode selectByPrimaryKey(Integer id); + TestCaseNode selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TestCaseNode record, @Param("example") TestCaseNodeExample example); diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml index e6b29932c6..fdda8c690a 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml @@ -2,10 +2,10 @@ - + - + @@ -69,7 +69,7 @@ - id, project_id, name, p_id, level, create_time, update_time + id, project_id, name, parent_id, level, create_time, update_time - select from test_case_node - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} - + delete from test_case_node - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} delete from test_case_node @@ -103,10 +103,10 @@ insert into test_case_node (id, project_id, name, - p_id, level, create_time, + parent_id, level, create_time, update_time) - values (#{id,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{pId,jdbcType=INTEGER}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, + values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{parentId,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}) @@ -121,8 +121,8 @@ name, - - p_id, + + parent_id, level, @@ -136,7 +136,7 @@ - #{id,jdbcType=INTEGER}, + #{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, @@ -144,8 +144,8 @@ #{name,jdbcType=VARCHAR}, - - #{pId,jdbcType=INTEGER}, + + #{parentId,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, @@ -168,7 +168,7 @@ update test_case_node - id = #{record.id,jdbcType=INTEGER}, + id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, @@ -176,8 +176,8 @@ name = #{record.name,jdbcType=VARCHAR}, - - p_id = #{record.pId,jdbcType=INTEGER}, + + parent_id = #{record.parentId,jdbcType=VARCHAR}, level = #{record.level,jdbcType=INTEGER}, @@ -195,10 +195,10 @@ update test_case_node - set id = #{record.id,jdbcType=INTEGER}, + set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, - p_id = #{record.pId,jdbcType=INTEGER}, + parent_id = #{record.parentId,jdbcType=VARCHAR}, level = #{record.level,jdbcType=INTEGER}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT} @@ -215,8 +215,8 @@ name = #{name,jdbcType=VARCHAR}, - - p_id = #{pId,jdbcType=INTEGER}, + + parent_id = #{parentId,jdbcType=VARCHAR}, level = #{level,jdbcType=INTEGER}, @@ -228,16 +228,16 @@ update_time = #{updateTime,jdbcType=BIGINT}, - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} update test_case_node set project_id = #{projectId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, - p_id = #{pId,jdbcType=INTEGER}, + parent_id = #{parentId,jdbcType=VARCHAR}, level = #{level,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT} - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.java index 76a5e5cb1a..84e1f62e21 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.java @@ -10,7 +10,7 @@ public interface TestCaseReportMapper { int deleteByExample(TestCaseReportExample example); - int deleteByPrimaryKey(Long id); + int deleteByPrimaryKey(String id); int insert(TestCaseReport record); @@ -20,7 +20,7 @@ public interface TestCaseReportMapper { List selectByExample(TestCaseReportExample example); - TestCaseReport selectByPrimaryKey(Long id); + TestCaseReport selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TestCaseReport record, @Param("example") TestCaseReportExample example); diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml index f4ccf620c2..59a10f9bc0 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml @@ -2,7 +2,7 @@ - + @@ -104,17 +104,17 @@ order by ${orderByClause} - select , from test_case_report - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} - + delete from test_case_report - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} delete from test_case_report @@ -123,20 +123,17 @@ - - SELECT LAST_INSERT_ID() - - insert into test_case_report (name, start_time, end_time, - content) - values (#{name,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, - #{content,jdbcType=LONGVARCHAR}) + insert into test_case_report (id, name, start_time, + end_time, content) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, + #{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}) - - SELECT LAST_INSERT_ID() - insert into test_case_report + + id, + name, @@ -151,6 +148,9 @@ + + #{id,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, @@ -175,7 +175,7 @@ update test_case_report - id = #{record.id,jdbcType=BIGINT}, + id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -196,7 +196,7 @@ update test_case_report - set id = #{record.id,jdbcType=BIGINT}, + set id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, start_time = #{record.startTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT}, @@ -207,7 +207,7 @@ update test_case_report - set id = #{record.id,jdbcType=BIGINT}, + set id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, start_time = #{record.startTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT} @@ -231,7 +231,7 @@ content = #{content,jdbcType=LONGVARCHAR}, - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} update test_case_report @@ -239,13 +239,13 @@ start_time = #{startTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT}, content = #{content,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} update test_case_report set name = #{name,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.java index 5c589133ac..b277ef48cc 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.java @@ -10,7 +10,7 @@ public interface TestCaseReportTemplateMapper { int deleteByExample(TestCaseReportTemplateExample example); - int deleteByPrimaryKey(Long id); + int deleteByPrimaryKey(String id); int insert(TestCaseReportTemplate record); @@ -20,7 +20,7 @@ public interface TestCaseReportTemplateMapper { List selectByExample(TestCaseReportTemplateExample example); - TestCaseReportTemplate selectByPrimaryKey(Long id); + TestCaseReportTemplate selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TestCaseReportTemplate record, @Param("example") TestCaseReportTemplateExample example); diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml index 69175ac67b..1230b7db09 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml @@ -2,7 +2,7 @@ - + @@ -103,17 +103,17 @@ order by ${orderByClause} - select , from test_case_report_template - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} - + delete from test_case_report_template - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} delete from test_case_report_template @@ -122,20 +122,17 @@ - - SELECT LAST_INSERT_ID() - - insert into test_case_report_template (name, workspace_id, content - ) - values (#{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} - ) + insert into test_case_report_template (id, name, workspace_id, + content) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, + #{content,jdbcType=LONGVARCHAR}) - - SELECT LAST_INSERT_ID() - insert into test_case_report_template + + id, + name, @@ -147,6 +144,9 @@ + + #{id,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, @@ -168,7 +168,7 @@ update test_case_report_template - id = #{record.id,jdbcType=BIGINT}, + id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -186,7 +186,7 @@ update test_case_report_template - set id = #{record.id,jdbcType=BIGINT}, + set id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, content = #{record.content,jdbcType=LONGVARCHAR} @@ -196,7 +196,7 @@ update test_case_report_template - set id = #{record.id,jdbcType=BIGINT}, + set id = #{record.id,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR} @@ -216,19 +216,19 @@ content = #{content,jdbcType=LONGVARCHAR}, - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} update test_case_report_template set name = #{name,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR}, content = #{content,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} update test_case_report_template set name = #{name,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestPlanMapper.xml index d9491cf663..a8d810bf95 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanMapper.xml @@ -5,7 +5,7 @@ - + @@ -139,7 +139,7 @@ test_case_match_rule, executor_match_rule, create_time, update_time, tags) values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, - #{reportId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{reportId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{stage,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{testCaseMatchRule,jdbcType=VARCHAR}, #{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{tags,jdbcType=LONGVARCHAR}) @@ -201,7 +201,7 @@ #{workspaceId,jdbcType=VARCHAR}, - #{reportId,jdbcType=BIGINT}, + #{reportId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, @@ -254,7 +254,7 @@ workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, - report_id = #{record.reportId,jdbcType=BIGINT}, + report_id = #{record.reportId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -296,7 +296,7 @@ set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, - report_id = #{record.reportId,jdbcType=BIGINT}, + report_id = #{record.reportId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, status = #{record.status,jdbcType=VARCHAR}, @@ -316,7 +316,7 @@ set id = #{record.id,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, - report_id = #{record.reportId,jdbcType=BIGINT}, + report_id = #{record.reportId,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR}, status = #{record.status,jdbcType=VARCHAR}, @@ -340,7 +340,7 @@ workspace_id = #{workspaceId,jdbcType=VARCHAR}, - report_id = #{reportId,jdbcType=BIGINT}, + report_id = #{reportId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, @@ -379,7 +379,7 @@ update test_plan set project_id = #{projectId,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR}, - report_id = #{reportId,jdbcType=BIGINT}, + report_id = #{reportId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, status = #{status,jdbcType=VARCHAR}, @@ -396,7 +396,7 @@ update test_plan set project_id = #{projectId,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR}, - report_id = #{reportId,jdbcType=BIGINT}, + report_id = #{reportId,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, description = #{description,jdbcType=VARCHAR}, status = #{status,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.java index 6f3f6a288c..86e0f91945 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.java @@ -10,7 +10,7 @@ public interface TestPlanTestCaseMapper { int deleteByExample(TestPlanTestCaseExample example); - int deleteByPrimaryKey(Integer id); + int deleteByPrimaryKey(String id); int insert(TestPlanTestCase record); @@ -20,7 +20,7 @@ public interface TestPlanTestCaseMapper { List selectByExample(TestPlanTestCaseExample example); - TestPlanTestCase selectByPrimaryKey(Integer id); + TestPlanTestCase selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TestPlanTestCase record, @Param("example") TestPlanTestCaseExample example); diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.xml index d4428c1859..3b77bcea04 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanTestCaseMapper.xml @@ -2,7 +2,7 @@ - + @@ -108,17 +108,17 @@ order by ${orderByClause} - select , from test_plan_test_case - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} - + delete from test_plan_test_case - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} delete from test_plan_test_case @@ -131,7 +131,7 @@ executor, status, remark, create_time, update_time, results ) - values (#{id,jdbcType=INTEGER}, #{planId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, + values (#{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{executor,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{results,jdbcType=LONGVARCHAR} ) @@ -169,7 +169,7 @@ - #{id,jdbcType=INTEGER}, + #{id,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, @@ -207,7 +207,7 @@ update test_plan_test_case - id = #{record.id,jdbcType=INTEGER}, + id = #{record.id,jdbcType=VARCHAR}, plan_id = #{record.planId,jdbcType=VARCHAR}, @@ -240,7 +240,7 @@ update test_plan_test_case - set id = #{record.id,jdbcType=INTEGER}, + set id = #{record.id,jdbcType=VARCHAR}, plan_id = #{record.planId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR}, executor = #{record.executor,jdbcType=VARCHAR}, @@ -255,7 +255,7 @@ update test_plan_test_case - set id = #{record.id,jdbcType=INTEGER}, + set id = #{record.id,jdbcType=VARCHAR}, plan_id = #{record.planId,jdbcType=VARCHAR}, case_id = #{record.caseId,jdbcType=VARCHAR}, executor = #{record.executor,jdbcType=VARCHAR}, @@ -295,7 +295,7 @@ results = #{results,jdbcType=LONGVARCHAR}, - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} update test_plan_test_case @@ -307,7 +307,7 @@ create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, results = #{results,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} update test_plan_test_case @@ -318,6 +318,6 @@ remark = #{remark,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT} - where id = #{id,jdbcType=INTEGER} + where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java new file mode 100644 index 0000000000..65eac8b82c --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java @@ -0,0 +1,18 @@ +package io.metersphere.base.mapper.ext; + +import io.metersphere.base.domain.TestCase; +import io.metersphere.controller.request.testcase.QueryTestCaseRequest; +import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest; +import io.metersphere.dto.TestCaseReportMetricDTO; +import io.metersphere.dto.TestCaseReportResultDTO; +import io.metersphere.dto.TestPlanCaseDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ExtTestPlanTestCaseMapper { + + List getReportMetric(@Param("planId") String planId); + + List getExecutors(@Param("planId") String planId); +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml new file mode 100644 index 0000000000..7eae7d354c --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/controller/TestCaseController.java index 8ff1de02c4..264a8756c7 100644 --- a/backend/src/main/java/io/metersphere/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/controller/TestCaseController.java @@ -40,7 +40,7 @@ public class TestCaseController { } @PostMapping("/list") - public List getTestCaseByNodeId(@RequestBody List nodeIds){ + public List getTestCaseByNodeId(@RequestBody List nodeIds){ return testCaseService.getTestCaseByNodeId(nodeIds); } diff --git a/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java b/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java index 16fb1649c7..a76b781f56 100644 --- a/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java +++ b/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java @@ -31,7 +31,7 @@ public class TestCaseNodeController { } @PostMapping("/add") - public int addNode(@RequestBody TestCaseNode node){ + public String addNode(@RequestBody TestCaseNode node){ return testCaseNodeService.addNode(node); } @@ -41,7 +41,7 @@ public class TestCaseNodeController { } @PostMapping("/delete") - public int deleteNode(@RequestBody List nodeIds){ + public int deleteNode(@RequestBody List nodeIds){ //nodeIds 包含删除节点ID及其所有子节点ID return testCaseNodeService.deleteNode(nodeIds); } diff --git a/backend/src/main/java/io/metersphere/controller/TestCaseReportController.java b/backend/src/main/java/io/metersphere/controller/TestCaseReportController.java index bae1fbe671..d5e415a082 100644 --- a/backend/src/main/java/io/metersphere/controller/TestCaseReportController.java +++ b/backend/src/main/java/io/metersphere/controller/TestCaseReportController.java @@ -21,12 +21,12 @@ public class TestCaseReportController { } @GetMapping("/get/{id}") - public TestCaseReport get(@PathVariable Long id){ + public TestCaseReport get(@PathVariable String id){ return testCaseReportService.getTestCaseReport(id); } @PostMapping("/add") - public Long addByTemplateId(@RequestBody CreateReportRequest request){ + public String addByTemplateId(@RequestBody CreateReportRequest request){ return testCaseReportService.addTestCaseReportByTemplateId(request); } @@ -36,8 +36,12 @@ public class TestCaseReportController { } @PostMapping("/delete/{id}") - public int delete(@PathVariable Long id){ + public int delete(@PathVariable String id){ return testCaseReportService.deleteTestCaseReport(id); } + @GetMapping("/get/metric/{planId}") + public TestCaseReport getMetric(@PathVariable String planId){ + return testCaseReportService.getMetric(planId); + } } diff --git a/backend/src/main/java/io/metersphere/controller/TestCaseReportTemplateController.java b/backend/src/main/java/io/metersphere/controller/TestCaseReportTemplateController.java index 1d554f9fa5..6978d271ba 100644 --- a/backend/src/main/java/io/metersphere/controller/TestCaseReportTemplateController.java +++ b/backend/src/main/java/io/metersphere/controller/TestCaseReportTemplateController.java @@ -21,7 +21,7 @@ public class TestCaseReportTemplateController { } @GetMapping("/get/{id}") - public TestCaseReportTemplate get(@PathVariable Long id){ + public TestCaseReportTemplate get(@PathVariable String id){ return testCaseReportTemplateService.getTestCaseReportTemplate(id); } @@ -36,7 +36,7 @@ public class TestCaseReportTemplateController { } @PostMapping("/delete/{id}") - public int delete(@PathVariable Long id){ + public int delete(@PathVariable String id){ return testCaseReportTemplateService.deleteTestCaseReportTemplate(id); } diff --git a/backend/src/main/java/io/metersphere/controller/TestPlanTestCaseController.java b/backend/src/main/java/io/metersphere/controller/TestPlanTestCaseController.java index 07d0f13fdf..3f901260af 100644 --- a/backend/src/main/java/io/metersphere/controller/TestPlanTestCaseController.java +++ b/backend/src/main/java/io/metersphere/controller/TestPlanTestCaseController.java @@ -43,7 +43,7 @@ public class TestPlanTestCaseController { } @PostMapping("/delete/{id}") - public int deleteTestCase(@PathVariable Integer id){ + public int deleteTestCase(@PathVariable String id){ return testPlanTestCaseService.deleteTestCase(id); } diff --git a/backend/src/main/java/io/metersphere/controller/request/testCaseReport/CreateReportRequest.java b/backend/src/main/java/io/metersphere/controller/request/testCaseReport/CreateReportRequest.java index 507898ebce..163570003c 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testCaseReport/CreateReportRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testCaseReport/CreateReportRequest.java @@ -5,5 +5,5 @@ import lombok.Data; @Data public class CreateReportRequest { String planId; - Long templateId; + String templateId; } diff --git a/backend/src/main/java/io/metersphere/controller/request/testcase/QueryTestCaseRequest.java b/backend/src/main/java/io/metersphere/controller/request/testcase/QueryTestCaseRequest.java index 3bb1a3d5ab..27728ef715 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testcase/QueryTestCaseRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testcase/QueryTestCaseRequest.java @@ -1,38 +1,16 @@ package io.metersphere.controller.request.testcase; import io.metersphere.base.domain.TestCase; +import lombok.Data; import java.util.List; +@Data public class QueryTestCaseRequest extends TestCase { - private List nodeIds; + private List nodeIds; private String planId; private String workspaceId; - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId; - } - - public List getNodeIds() { - return nodeIds; - } - - public void setNodeIds(List nodeIds) { - this.nodeIds = nodeIds; - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } } diff --git a/backend/src/main/java/io/metersphere/controller/request/testcase/TestPlanCaseBatchRequest.java b/backend/src/main/java/io/metersphere/controller/request/testcase/TestPlanCaseBatchRequest.java index b0e0e96165..caf82aeb67 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testcase/TestPlanCaseBatchRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testcase/TestPlanCaseBatchRequest.java @@ -2,18 +2,13 @@ package io.metersphere.controller.request.testcase; import io.metersphere.base.domain.TestCase; import io.metersphere.base.domain.TestPlanTestCase; +import lombok.Data; import java.util.List; +@Data public class TestPlanCaseBatchRequest extends TestPlanTestCase { - private List ids; + private List ids; - public List getIds() { - return ids; - } - - public void setIds(List ids) { - this.ids = ids; - } } diff --git a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java index ffc91a3ebe..d2751e08b6 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java @@ -1,33 +1,9 @@ package io.metersphere.controller.request.testplan; +import lombok.Data; + +@Data public class QueryTestPlanRequest extends TestPlanRequest { - private String name; private String workspaceId; private boolean recent = false; // 表示查询最近的测试 - - @Override - public String getName() { - return name; - } - - @Override - public void setName(String name) { - this.name = name; - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } - - public boolean isRecent() { - return recent; - } - - public void setRecent(boolean recent) { - this.recent = recent; - } } diff --git a/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java index 7ac76b577a..d823c982c9 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java @@ -1,5 +1,8 @@ package io.metersphere.controller.request.testplan; +import lombok.Data; + +@Data public class TestPlanRequest { private String id; @@ -28,100 +31,4 @@ public class TestPlanRequest { private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getScenarioDefinition() { - return scenarioDefinition; - } - - public void setScenarioDefinition(String scenarioDefinition) { - this.scenarioDefinition = scenarioDefinition; - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getRuntimeConfiguration() { - return runtimeConfiguration; - } - - public void setRuntimeConfiguration(String runtimeConfiguration) { - this.runtimeConfiguration = runtimeConfiguration; - } - - public String getLoadConfiguration() { - return loadConfiguration; - } - - public void setLoadConfiguration(String loadConfiguration) { - this.loadConfiguration = loadConfiguration == null ? null : loadConfiguration.trim(); - } - - public String getAdvancedConfiguration() { - return advancedConfiguration; - } - - public void setAdvancedConfiguration(String advancedConfiguration) { - this.advancedConfiguration = advancedConfiguration == null ? null : advancedConfiguration.trim(); - } - - public String getSchedule() { - return schedule; - } - - public void setSchedule(String schedule) { - this.schedule = schedule == null ? null : schedule.trim(); - } - - public String getTestResourcePoolId() { - return testResourcePoolId; - } - - public void setTestResourcePoolId(String testResourcePoolId) { - this.testResourcePoolId = testResourcePoolId; - } } diff --git a/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java index 7acf17512d..a2273976fd 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java @@ -2,38 +2,17 @@ package io.metersphere.controller.request.testplancase; import io.metersphere.base.domain.TestCase; import io.metersphere.base.domain.TestPlanTestCase; +import lombok.Data; import java.util.List; +@Data public class QueryTestPlanCaseRequest extends TestPlanTestCase { - private List nodeIds; + private List nodeIds; private String workspaceId; private String name; - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getNodeIds() { - return nodeIds; - } - - public void setNodeIds(List nodeIds) { - this.nodeIds = nodeIds; - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } } diff --git a/backend/src/main/java/io/metersphere/dto/TestCaseReportMetricDTO.java b/backend/src/main/java/io/metersphere/dto/TestCaseReportMetricDTO.java new file mode 100644 index 0000000000..452b212d32 --- /dev/null +++ b/backend/src/main/java/io/metersphere/dto/TestCaseReportMetricDTO.java @@ -0,0 +1,18 @@ +package io.metersphere.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class TestCaseReportMetricDTO { + + private List executeResult; + private List moduleExecuteResult; + private List executors; + private String principal; + private Long startTime; + private Long endTime; + private String projectName; + +} diff --git a/backend/src/main/java/io/metersphere/dto/TestCaseReportModuleResultDTO.java b/backend/src/main/java/io/metersphere/dto/TestCaseReportModuleResultDTO.java new file mode 100644 index 0000000000..d28c83a190 --- /dev/null +++ b/backend/src/main/java/io/metersphere/dto/TestCaseReportModuleResultDTO.java @@ -0,0 +1,11 @@ +package io.metersphere.dto; + +import lombok.Data; + +@Data +public class TestCaseReportModuleResultDTO { + private String module; + private Integer caseCount; + private Integer passRate; + private Integer flawCount; +} diff --git a/backend/src/main/java/io/metersphere/dto/TestCaseReportResultDTO.java b/backend/src/main/java/io/metersphere/dto/TestCaseReportResultDTO.java new file mode 100644 index 0000000000..2878857de9 --- /dev/null +++ b/backend/src/main/java/io/metersphere/dto/TestCaseReportResultDTO.java @@ -0,0 +1,9 @@ +package io.metersphere.dto; + +import lombok.Data; + +@Data +public class TestCaseReportResultDTO { + private String status; + private String count; +} diff --git a/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java b/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java index fa00695728..a92cbd5d20 100644 --- a/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java @@ -31,13 +31,14 @@ public class TestCaseNodeService { @Resource TestPlanTestCaseMapper testPlanTestCaseMapper; - public int addNode(TestCaseNode node) { + public String addNode(TestCaseNode node) { if(node.getLevel() > TestCaseConstants.MAX_NODE_DEPTH){ throw new RuntimeException("模块树最大深度为" + TestCaseConstants.MAX_NODE_DEPTH + "层!"); } node.setCreateTime(System.currentTimeMillis()); node.setUpdateTime(System.currentTimeMillis()); + node.setId(UUID.randomUUID().toString()); testCaseNodeMapper.insertSelective(node); return node.getId(); } @@ -45,6 +46,7 @@ public class TestCaseNodeService { public List getNodeTreeByProjectId(String projectId) { TestCaseNodeExample testCaseNodeExample = new TestCaseNodeExample(); testCaseNodeExample.createCriteria().andProjectIdEqualTo(projectId); + testCaseNodeExample.setOrderByClause("create_time asc"); List nodes = testCaseNodeMapper.selectByExample(testCaseNodeExample); return getNodeTrees(nodes); } @@ -92,7 +94,7 @@ public class TestCaseNodeService { List childrens = Optional.ofNullable(nodeTree.getChildren()).orElse(new ArrayList<>()); lowerNodes.forEach(node -> { - if (node.getPId().equals(rootNode.getId())){ + if (node.getParentId() != null && node.getParentId().equals(rootNode.getId())){ childrens.add(buildNodeTree(nodeLevelMap, node)); nodeTree.setChildren(childrens); } @@ -106,7 +108,7 @@ public class TestCaseNodeService { return testCaseNodeMapper.updateByPrimaryKeySelective(node); } - public int deleteNode(List nodeIds) { + public int deleteNode(List nodeIds) { TestCaseExample testCaseExample = new TestCaseExample(); testCaseExample.createCriteria().andNodeIdIn(nodeIds); testCaseMapper.deleteByExample(testCaseExample); @@ -144,7 +146,7 @@ public class TestCaseNodeService { TestCaseExample testCaseExample = new TestCaseExample(); testCaseExample.createCriteria().andIdIn(caseIds); - List dataNodeIds = testCaseMapper.selectByExample(testCaseExample).stream() + List dataNodeIds = testCaseMapper.selectByExample(testCaseExample).stream() .map(TestCase::getNodeId) .collect(Collectors.toList()); @@ -167,7 +169,7 @@ public class TestCaseNodeService { * @param nodeIds * @return 是否剪枝 * */ - public boolean pruningTree(TestCaseNodeDTO rootNode, List nodeIds) { + public boolean pruningTree(TestCaseNodeDTO rootNode, List nodeIds) { List children = rootNode.getChildren(); @@ -200,11 +202,11 @@ public class TestCaseNodeService { return getNodeTreeByProjectId(testPlan.getProjectId()); } - public Map createNodeByTestCases(List testCases, String projectId) { + public Map createNodeByTestCases(List testCases, String projectId) { List nodeTrees = getNodeTreeByProjectId(projectId); - Map pathMap = new HashMap<>(); + Map pathMap = new HashMap<>(); List nodePaths = testCases.stream() .map(TestCase::getNodePath) @@ -256,7 +258,7 @@ public class TestCaseNodeService { * @param pathMap 记录节点路径对应的nodeId */ private void createNodeByPathIterator(Iterator pathIterator, String path, TestCaseNodeDTO treeNode, - Map pathMap, String projectId, Integer level) { + Map pathMap, String projectId, Integer level) { List children = treeNode.getChildren(); @@ -295,13 +297,13 @@ public class TestCaseNodeService { */ private void createNodeByPath(Iterator pathIterator, String nodeName, TestCaseNodeDTO pNode, String projectId, Integer level, - String rootPath, Map pathMap) { + String rootPath, Map pathMap) { StringBuilder path = new StringBuilder(rootPath); path.append("/" + nodeName); - Integer pid = null; + String pid = null; //创建过不创建 if (pathMap.get(path.toString()) != null) { pid = pathMap.get(path.toString()); @@ -324,14 +326,15 @@ public class TestCaseNodeService { } } - private Integer insertTestCaseNode(String nodeName, Integer pId, String projectId, Integer level) { + private String insertTestCaseNode(String nodeName, String pId, String projectId, Integer level) { TestCaseNode testCaseNode = new TestCaseNode(); testCaseNode.setName(nodeName.trim()); - testCaseNode.setPId(pId); + testCaseNode.setParentId(pId); testCaseNode.setProjectId(projectId); testCaseNode.setCreateTime(System.currentTimeMillis()); testCaseNode.setUpdateTime(System.currentTimeMillis()); testCaseNode.setLevel(level); + testCaseNode.setId(UUID.randomUUID().toString()); testCaseNodeMapper.insert(testCaseNode); return testCaseNode.getId(); } diff --git a/backend/src/main/java/io/metersphere/service/TestCaseReportService.java b/backend/src/main/java/io/metersphere/service/TestCaseReportService.java index ac8856b099..b9cd7baefa 100644 --- a/backend/src/main/java/io/metersphere/service/TestCaseReportService.java +++ b/backend/src/main/java/io/metersphere/service/TestCaseReportService.java @@ -1,20 +1,22 @@ package io.metersphere.service; -import io.metersphere.base.domain.TestCaseReport; -import io.metersphere.base.domain.TestCaseReportExample; -import io.metersphere.base.domain.TestCaseReportTemplate; -import io.metersphere.base.domain.TestPlan; -import io.metersphere.base.mapper.TestCaseReportMapper; -import io.metersphere.base.mapper.TestCaseReportTemplateMapper; -import io.metersphere.base.mapper.TestPlanMapper; +import io.metersphere.base.domain.*; +import io.metersphere.base.mapper.*; +import io.metersphere.base.mapper.ext.ExtTestPlanMapper; +import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper; import io.metersphere.commons.utils.BeanUtils; import io.metersphere.controller.request.testCaseReport.CreateReportRequest; +import io.metersphere.controller.request.testcase.QueryTestPlanRequest; +import io.metersphere.dto.TestCaseNodeDTO; +import io.metersphere.dto.TestCaseReportMetricDTO; +import io.metersphere.dto.TestCaseReportResultDTO; +import io.metersphere.dto.TestPlanDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.List; +import java.util.*; @Service @Transactional(rollbackFor = Exception.class) @@ -26,9 +28,24 @@ public class TestCaseReportService { @Resource TestPlanMapper testPlanMapper; + @Resource + ExtTestPlanMapper extTestPlanMapper; + @Resource TestCaseReportTemplateMapper testCaseReportTemplateMapper; + @Resource + TestCaseNodeService testCaseNodeService; + + @Resource + TestCaseNodeMapper testCaseNodeMapper; + + @Resource + ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper; + + @Resource + TestPlanTestCaseMapper testPlanTestCaseMapper; + public List listTestCaseReport(TestCaseReport request) { TestCaseReportExample example = new TestCaseReportExample(); if ( StringUtils.isNotBlank(request.getName()) ) { @@ -37,33 +54,71 @@ public class TestCaseReportService { return testCaseReportMapper.selectByExample(example); } - public TestCaseReport getTestCaseReport(Long id) { + public TestCaseReport getTestCaseReport(String id) { return testCaseReportMapper.selectByPrimaryKey(id); } - public void addTestCaseReport(TestCaseReport TestCaseReport) { - testCaseReportMapper.insert(TestCaseReport); + public void addTestCaseReport(TestCaseReport testCaseReport) { + testCaseReport.setId(UUID.randomUUID().toString()); + testCaseReportMapper.insert(testCaseReport); } public void editTestCaseReport(TestCaseReport TestCaseReport) { testCaseReportMapper.updateByPrimaryKeyWithBLOBs(TestCaseReport); } - public int deleteTestCaseReport(Long id) { + public int deleteTestCaseReport(String id) { return testCaseReportMapper.deleteByPrimaryKey(id); } - public Long addTestCaseReportByTemplateId(CreateReportRequest request) { + public String addTestCaseReportByTemplateId(CreateReportRequest request) { TestCaseReportTemplate template = testCaseReportTemplateMapper.selectByPrimaryKey(request.getTemplateId()); TestCaseReport report = new TestCaseReport(); BeanUtils.copyBean(report, template); TestPlan testPlan = testPlanMapper.selectByPrimaryKey(request.getPlanId()); report.setName(testPlan.getName()); - report.setId(null); + report.setId(UUID.randomUUID().toString()); testCaseReportMapper.insert(report); testPlan.setReportId(report.getId()); testPlanMapper.updateByPrimaryKeySelective(testPlan); return report.getId(); } + public TestCaseReport getMetric(String planId) { + TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO(); + testCaseReportMetricDTO.setExecutors(extTestPlanTestCaseMapper.getExecutors(planId)); + testCaseReportMetricDTO.setExecuteResult(extTestPlanTestCaseMapper.getReportMetric(planId)); + + QueryTestPlanRequest queryTestPlanRequest = new QueryTestPlanRequest(); + queryTestPlanRequest.setId(planId); + TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0); + testCaseReportMetricDTO.setProjectName(testPlan.getProjectName()); + testCaseReportMetricDTO.setPrincipal(testPlan.getPrincipal()); + + TestPlanTestCaseExample example = new TestPlanTestCaseExample(); + example.createCriteria().andPlanIdEqualTo(planId); + List testPlanTestCases = testPlanTestCaseMapper.selectByExample(example); + + TestCaseNodeExample testCaseNodeExample = new TestCaseNodeExample(); + testCaseNodeExample.createCriteria().andProjectIdEqualTo(testPlan.getProjectId()); + List nodes = testCaseNodeMapper.selectByExample(testCaseNodeExample); + + return null; + } + + private TestCaseReport get(List nodes) { + +// List rootNode = new ArrayList<>(); +// Map> nodeMap = new HashMap<>(); +// nodes.forEach(node -> { +// Integer level = node.getLevel(); +// if (level == 1) { +// rootNode.add(node); +// ArrayList objects = new ArrayList<>(); +// } +// }); + return null; + } + + } diff --git a/backend/src/main/java/io/metersphere/service/TestCaseReportTemplateService.java b/backend/src/main/java/io/metersphere/service/TestCaseReportTemplateService.java index bfa7a28b05..b29f250e5a 100644 --- a/backend/src/main/java/io/metersphere/service/TestCaseReportTemplateService.java +++ b/backend/src/main/java/io/metersphere/service/TestCaseReportTemplateService.java @@ -11,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; +import java.util.UUID; @Service @Transactional(rollbackFor = Exception.class) @@ -37,11 +38,12 @@ public class TestCaseReportTemplateService { return testCaseReportTemplateMapper.selectByExample(example); } - public TestCaseReportTemplate getTestCaseReportTemplate(Long id) { + public TestCaseReportTemplate getTestCaseReportTemplate(String id) { return testCaseReportTemplateMapper.selectByPrimaryKey(id); } public void addTestCaseReportTemplate(TestCaseReportTemplate testCaseReportTemplate) { + testCaseReportTemplate.setId(UUID.randomUUID().toString()); testCaseReportTemplateMapper.insert(testCaseReportTemplate); } @@ -49,7 +51,7 @@ public class TestCaseReportTemplateService { testCaseReportTemplateMapper.updateByPrimaryKeyWithBLOBs(testCaseReportTemplate); } - public int deleteTestCaseReportTemplate(Long id) { + public int deleteTestCaseReportTemplate(String id) { return testCaseReportTemplateMapper.deleteByPrimaryKey(id); } diff --git a/backend/src/main/java/io/metersphere/service/TestCaseService.java b/backend/src/main/java/io/metersphere/service/TestCaseService.java index a6479b30be..4ef7f24130 100644 --- a/backend/src/main/java/io/metersphere/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/service/TestCaseService.java @@ -79,7 +79,7 @@ public class TestCaseService { testCaseMapper.insert(testCase); } - public List getTestCaseByNodeId(List nodeIds) { + public List getTestCaseByNodeId(List nodeIds) { TestCaseExample testCaseExample = new TestCaseExample(); testCaseExample.createCriteria().andNodeIdIn(nodeIds); return testCaseMapper.selectByExample(testCaseExample); @@ -95,6 +95,9 @@ public class TestCaseService { } public int deleteTestCase(String testCaseId) { + TestPlanTestCaseExample example = new TestPlanTestCaseExample(); + example.createCriteria().andCaseIdEqualTo(testCaseId); + testPlanTestCaseMapper.deleteByExample(example); return testCaseMapper.deleteByPrimaryKey(testCaseId); } @@ -219,7 +222,7 @@ public class TestCaseService { public void saveImportData(List testCases, String projectId) { - Map nodePathMap = testCaseNodeService.createNodeByTestCases(testCases, projectId); + Map nodePathMap = testCaseNodeService.createNodeByTestCases(testCases, projectId); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); TestCaseMapper mapper = sqlSession.getMapper(TestCaseMapper.class); if (!testCases.isEmpty()) { diff --git a/backend/src/main/java/io/metersphere/service/TestPlanService.java b/backend/src/main/java/io/metersphere/service/TestPlanService.java index 957aa11002..a13f5f693c 100644 --- a/backend/src/main/java/io/metersphere/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/service/TestPlanService.java @@ -52,7 +52,6 @@ public class TestPlanService { testPlanMapper.insert(testPlan); } - public TestPlan getTestPlan(String testPlanId) { return testPlanMapper.selectByPrimaryKey(testPlanId); } @@ -99,6 +98,7 @@ public class TestPlanService { testCaseIds.forEach(caseId -> { TestCaseWithBLOBs testCase = testCaseMap.get(caseId); TestPlanTestCase testPlanTestCase = new TestPlanTestCase(); + testPlanTestCase.setId(UUID.randomUUID().toString()); testPlanTestCase.setExecutor(testCase.getMaintainer()); testPlanTestCase.setCaseId(caseId); testPlanTestCase.setCreateTime(System.currentTimeMillis()); diff --git a/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java b/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java index b6733e067b..5814a0cd5b 100644 --- a/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java +++ b/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java @@ -38,7 +38,7 @@ public class TestPlanTestCaseService { testPlanTestCaseMapper.updateByPrimaryKeySelective(testPlanTestCase); } - public int deleteTestCase(Integer id) { + public int deleteTestCase(String id) { return testPlanTestCaseMapper.deleteByPrimaryKey(id); } diff --git a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql index fb5a030e6f..fc63f8c87b 100644 --- a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql @@ -260,7 +260,7 @@ CREATE TABLE IF NOT EXISTS `test_plan` ( `id` varchar(50) NOT NULL COMMENT 'Test Plan ID', `project_id` varchar(50) NOT NULL COMMENT 'Project ID this plan belongs to', `workspace_id` varchar(50) NOT NULL COMMENT 'Workspace ID this plan belongs to', - `report_id` bigint(20) COMMENT 'Test plan report', + `report_id` varchar(50) COMMENT 'Test plan report', `name` varchar(64) NOT NULL COMMENT 'Plan name', `description` varchar(255) DEFAULT NULL COMMENT 'Plan description', `status` varchar(20) NOT NULL COMMENT 'Plan status', @@ -279,15 +279,15 @@ CREATE TABLE IF NOT EXISTS `test_plan` ( CREATE TABLE IF NOT EXISTS `test_case_node` ( - `id` int(13) PRIMARY KEY AUTO_INCREMENT COMMENT 'Test case node ID', + `id` varchar(50) NOT NULL COMMENT 'Test case node ID', `project_id` varchar(50) NOT NULL COMMENT 'Project ID this node belongs to', `name` varchar(64) NOT NULL COMMENT 'Node name', - `p_id` int(13) DEFAULT NULL COMMENT 'Parent node ID', + `parent_id` varchar(50) DEFAULT NULL COMMENT 'Parent node ID', `level` int(10) DEFAULT 1 COMMENT 'Node level', `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', - `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp' + `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp', + PRIMARY KEY (`id`) ) - AUTO_INCREMENT = 1 ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; @@ -295,7 +295,7 @@ CREATE TABLE IF NOT EXISTS `test_case_node` ( CREATE TABLE IF NOT EXISTS `test_case` ( `id` varchar(50) NOT NULL COMMENT 'Test case ID', - `node_id` int(13) NOT NULL COMMENT 'Node ID this case belongs to', + `node_id` varchar(50) NOT NULL COMMENT 'Node ID this case belongs to', `node_path` varchar(50) NOT NULL COMMENT 'Node path this case belongs to', `project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to', `name` varchar(64) NOT NULL COMMENT 'Case name', @@ -316,7 +316,7 @@ CREATE TABLE IF NOT EXISTS `test_case` ( CREATE TABLE IF NOT EXISTS `test_plan_test_case` ( - `id` int(13) PRIMARY KEY AUTO_INCREMENT COMMENT 'ID', + `id` varchar(50) NOT NULL COMMENT 'ID', `plan_id` varchar(50) NOT NULL COMMENT 'Plan ID relation to', `case_id` varchar(50) NOT NULL COMMENT 'Case ID relation to', `executor` varchar(64) NOT NULL COMMENT 'Test case executor', @@ -324,18 +324,18 @@ CREATE TABLE IF NOT EXISTS `test_plan_test_case` ( `results` longtext COMMENT 'Test case result', `remark` varchar(255) DEFAULT NULL COMMENT 'Test case remark', `create_time` bigint(13) NOT NULL COMMENT 'Create timestamp', - `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp' + `update_time` bigint(13) NOT NULL COMMENT 'Update timestamp', + PRIMARY KEY (`id`) ) - AUTO_INCREMENT = 1 ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; CREATE TABLE IF NOT EXISTS `test_case_report_template` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `name` varchar(64) NOT NULL COMMENT 'Test case report template name', + `id` varchar(50) NOT NULL, + `name` varchar(64) NOT NULL COMMENT 'Test case report template name', `workspace_id` varchar(50) DEFAULT NULL COMMENT 'Workspace ID this project belongs to', - `content` longtext COMMENT 'Template content (JSON format)', + `content` longtext COMMENT 'Template content (JSON format)', PRIMARY KEY (`id`) ) ENGINE=InnoDB @@ -343,11 +343,11 @@ CREATE TABLE IF NOT EXISTS `test_case_report_template` ( COLLATE=utf8mb4_bin; CREATE TABLE IF NOT EXISTS `test_case_report` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `name` varchar(64) NOT NULL COMMENT 'Test case report name', - `content` longtext COMMENT 'Report content (JSON format)', - `start_time` bigint(13) COMMENT 'Test start time', - `end_time` bigint(13) COMMENT 'Test end time', + `id` varchar(50) NOT NULL, + `name` varchar(64) NOT NULL COMMENT 'Test case report name', + `content` longtext COMMENT 'Report content (JSON format)', + `start_time` bigint(13) COMMENT 'Test start time', + `end_time` bigint(13) COMMENT 'Test end time', PRIMARY KEY (`id`) ) ENGINE=InnoDB diff --git a/backend/src/main/resources/db/migration/V3__init_data.sql b/backend/src/main/resources/db/migration/V3__init_data.sql index daf2460bc5..74b8460ed1 100644 --- a/backend/src/main/resources/db/migration/V3__init_data.sql +++ b/backend/src/main/resources/db/migration/V3__init_data.sql @@ -10,4 +10,4 @@ INSERT INTO role (id, name, description, type, create_time, update_time) VALUES INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_user', '测试人员', null, null, 1581576575948, 1581576575948); INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_viewer', 'Viewer', null, null, 1581576575948, 1581576575948); -INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\": [1,2,3,4,5]}"); +INSERT INTO test_case_report_template (id,name,content) VALUES (uuid(), 'default','{\"components\": [1,2,3,4,5]}'); diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 3627992fc2..4001f06770 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -60,14 +60,20 @@ +
+
+
+
+
-
- -
- - -
+ + + + + + + \ No newline at end of file diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 941743d257..4f969158f9 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -266,7 +266,9 @@ if (this.selectNode.data) { this.form.module = this.selectNode.data.id; } else { - this.form.module = this.moduleOptions[0].id; + if (this.moduleOptions.length > 0) { + this.form.module = this.moduleOptions[0].id; + } } let user = JSON.parse(localStorage.getItem(TokenKey)); this.form.priority = 'P3'; diff --git a/frontend/src/business/components/track/common/NodeEdit.vue b/frontend/src/business/components/track/common/NodeEdit.vue index 1c0de65850..46e4bd8f24 100644 --- a/frontend/src/business/components/track/common/NodeEdit.vue +++ b/frontend/src/business/components/track/common/NodeEdit.vue @@ -53,6 +53,11 @@ dialogFormVisible: false, } }, + props: { + treeNodes: { + type: Array + } + }, methods: { open(type, data) { this.type = type; @@ -64,6 +69,7 @@ if (valid) { let param = {}; let url = this.buildParam(param); + this.$post(url, param, () => { this.$success(this.$t('commons.save_success')); this.$emit('refresh'); @@ -74,19 +80,20 @@ } }); }, - buildParam(param, ) { + buildParam(param) { let url = ''; if (this.type === 'add') { url = '/case/node/add'; param.level = 1; if (this.node) { //非根节点 - param.pId = this.node.id; + param.parentId = this.node.id; param.level = this.node.level + 1; } } else if (this.type === 'edit') { url = '/case/node/edit'; - param.id = this.node.id + param.id = this.node.id; + param.level = this.node.level; } param.name = this.form.name; param.label = this.form.name; diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index d24d1d1491..450b0c7f00 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -47,7 +47,7 @@ - + @@ -92,14 +92,14 @@ let param = {}; param.id = draggingNode.data.id; if (dropType === 'inner') { - param.pId = dropNode.data.id; + param.parentId = dropNode.data.id; param.level = dropNode.data.level + 1; } else { if (dropNode.parent.id === 0) { - param.pId = 0; + param.parentId = 0; param.level = 1; } else { - param.pId = dropNode.parent.data.id; + param.parentId = dropNode.parent.data.id; param.level = dropNode.parent.data.level + 1; } } diff --git a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue index 7b1ba02def..2834e11fbd 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue @@ -1,6 +1,5 @@