From 536d16991f848549f2922bada0c93fe48d4e300d Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 26 Mar 2020 16:54:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=A0=91=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/base/domain/TestCaseNode.java | 18 +- .../base/domain/TestCaseNodeExample.java | 78 +++--- .../base/mapper/TestCaseNodeMapper.xml | 60 ++--- .../controller/TestCaseNodeController.java | 40 +++ .../io/metersphere/dto/TestCaseNodeDTO.java | 27 ++ .../service/TestCaseNodeService.java | 96 +++++++ .../resources/db/migration/V5__init_track.sql | 5 +- .../src/main/resources/generatorConfig.xml | 10 +- .../io/metersphere/service/TestCaseTest.java | 31 +++ .../components/common/head/HeaderMenus.vue | 10 +- .../components/track/case/TestCase.vue | 78 +++++- .../track/case/components/NodeTree.vue | 236 +++++++++--------- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + 14 files changed, 466 insertions(+), 225 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java create mode 100644 backend/src/main/java/io/metersphere/dto/TestCaseNodeDTO.java create mode 100644 backend/src/main/java/io/metersphere/service/TestCaseNodeService.java create mode 100644 backend/src/test/java/io/metersphere/service/TestCaseTest.java 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 13a861b431..1c4b370325 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java @@ -9,9 +9,9 @@ public class TestCaseNode implements Serializable { private String name; - private String pId; + private Integer pId; - private Long order; + private Integer level; private Long createTime; @@ -43,20 +43,20 @@ public class TestCaseNode implements Serializable { this.name = name == null ? null : name.trim(); } - public String getpId() { + public Integer getpId() { return pId; } - public void setpId(String pId) { - this.pId = pId == null ? null : pId.trim(); + public void setpId(Integer pId) { + this.pId = pId; } - public Long getOrder() { - return order; + public Integer getLevel() { + return level; } - public void setOrder(Long order) { - this.order = order; + public void setLevel(Integer level) { + this.level = level; } public Long getCreateTime() { 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 b310940490..03a36188b1 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseNodeExample.java @@ -314,123 +314,113 @@ public class TestCaseNodeExample { return (Criteria) this; } - public Criteria andPIdEqualTo(String value) { + public Criteria andPIdEqualTo(Integer value) { addCriterion("p_id =", value, "pId"); return (Criteria) this; } - public Criteria andPIdNotEqualTo(String value) { + public Criteria andPIdNotEqualTo(Integer value) { addCriterion("p_id <>", value, "pId"); return (Criteria) this; } - public Criteria andPIdGreaterThan(String value) { + public Criteria andPIdGreaterThan(Integer value) { addCriterion("p_id >", value, "pId"); return (Criteria) this; } - public Criteria andPIdGreaterThanOrEqualTo(String value) { + public Criteria andPIdGreaterThanOrEqualTo(Integer value) { addCriterion("p_id >=", value, "pId"); return (Criteria) this; } - public Criteria andPIdLessThan(String value) { + public Criteria andPIdLessThan(Integer value) { addCriterion("p_id <", value, "pId"); return (Criteria) this; } - public Criteria andPIdLessThanOrEqualTo(String value) { + public Criteria andPIdLessThanOrEqualTo(Integer value) { addCriterion("p_id <=", value, "pId"); return (Criteria) this; } - public Criteria andPIdLike(String value) { - addCriterion("p_id like", value, "pId"); - return (Criteria) this; - } - - public Criteria andPIdNotLike(String value) { - addCriterion("p_id not like", value, "pId"); - return (Criteria) this; - } - - public Criteria andPIdIn(List values) { + public Criteria andPIdIn(List values) { addCriterion("p_id in", values, "pId"); return (Criteria) this; } - public Criteria andPIdNotIn(List values) { + public Criteria andPIdNotIn(List values) { addCriterion("p_id not in", values, "pId"); return (Criteria) this; } - public Criteria andPIdBetween(String value1, String value2) { + public Criteria andPIdBetween(Integer value1, Integer value2) { addCriterion("p_id between", value1, value2, "pId"); return (Criteria) this; } - public Criteria andPIdNotBetween(String value1, String value2) { + public Criteria andPIdNotBetween(Integer value1, Integer value2) { addCriterion("p_id not between", value1, value2, "pId"); return (Criteria) this; } - public Criteria andOrderIsNull() { - addCriterion("order is null"); + public Criteria andLevelIsNull() { + addCriterion("level is null"); return (Criteria) this; } - public Criteria andOrderIsNotNull() { - addCriterion("order is not null"); + public Criteria andLevelIsNotNull() { + addCriterion("level is not null"); return (Criteria) this; } - public Criteria andOrderEqualTo(Long value) { - addCriterion("order =", value, "order"); + public Criteria andLevelEqualTo(Integer value) { + addCriterion("level =", value, "level"); return (Criteria) this; } - public Criteria andOrderNotEqualTo(Long value) { - addCriterion("order <>", value, "order"); + public Criteria andLevelNotEqualTo(Integer value) { + addCriterion("level <>", value, "level"); return (Criteria) this; } - public Criteria andOrderGreaterThan(Long value) { - addCriterion("order >", value, "order"); + public Criteria andLevelGreaterThan(Integer value) { + addCriterion("level >", value, "level"); return (Criteria) this; } - public Criteria andOrderGreaterThanOrEqualTo(Long value) { - addCriterion("order >=", value, "order"); + public Criteria andLevelGreaterThanOrEqualTo(Integer value) { + addCriterion("level >=", value, "level"); return (Criteria) this; } - public Criteria andOrderLessThan(Long value) { - addCriterion("order <", value, "order"); + public Criteria andLevelLessThan(Integer value) { + addCriterion("level <", value, "level"); return (Criteria) this; } - public Criteria andOrderLessThanOrEqualTo(Long value) { - addCriterion("order <=", value, "order"); + public Criteria andLevelLessThanOrEqualTo(Integer value) { + addCriterion("level <=", value, "level"); return (Criteria) this; } - public Criteria andOrderIn(List values) { - addCriterion("order in", values, "order"); + public Criteria andLevelIn(List values) { + addCriterion("level in", values, "level"); return (Criteria) this; } - public Criteria andOrderNotIn(List values) { - addCriterion("order not in", values, "order"); + public Criteria andLevelNotIn(List values) { + addCriterion("level not in", values, "level"); return (Criteria) this; } - public Criteria andOrderBetween(Long value1, Long value2) { - addCriterion("order between", value1, value2, "order"); + public Criteria andLevelBetween(Integer value1, Integer value2) { + addCriterion("level between", value1, value2, "level"); return (Criteria) this; } - public Criteria andOrderNotBetween(Long value1, Long value2) { - addCriterion("order not between", value1, value2, "order"); + public Criteria andLevelNotBetween(Integer value1, Integer value2) { + addCriterion("level not between", value1, value2, "level"); return (Criteria) this; } 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 86f87887e0..23b4d55cab 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml @@ -5,8 +5,8 @@ - - + + @@ -69,7 +69,7 @@ - id, project_id, name, p_id, order, create_time, update_time + id, project_id, name, p_id, level, create_time, update_time