diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanReport.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanReport.java index 53312b0f2d..afc6ed0945 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanReport.java @@ -35,5 +35,7 @@ public class TestPlanReport implements Serializable { private String components; + private Boolean isNew; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContent.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContent.java new file mode 100644 index 0000000000..4e1b56d8a9 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContent.java @@ -0,0 +1,25 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class TestPlanReportContent implements Serializable { + private String id; + + private String testPlanReportId; + + private Long startTime; + + private Long caseCount; + + private Long endTime; + + private Double executeRate; + + private Double passRate; + + private Boolean isThirdPartIssue; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentExample.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentExample.java new file mode 100644 index 0000000000..166969fadf --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentExample.java @@ -0,0 +1,700 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class TestPlanReportContentExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public TestPlanReportContentExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + 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) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdIsNull() { + addCriterion("test_plan_report_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdIsNotNull() { + addCriterion("test_plan_report_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdEqualTo(String value) { + addCriterion("test_plan_report_id =", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdNotEqualTo(String value) { + addCriterion("test_plan_report_id <>", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdGreaterThan(String value) { + addCriterion("test_plan_report_id >", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_report_id >=", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdLessThan(String value) { + addCriterion("test_plan_report_id <", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_report_id <=", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdLike(String value) { + addCriterion("test_plan_report_id like", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdNotLike(String value) { + addCriterion("test_plan_report_id not like", value, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdIn(List values) { + addCriterion("test_plan_report_id in", values, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdNotIn(List values) { + addCriterion("test_plan_report_id not in", values, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdBetween(String value1, String value2) { + addCriterion("test_plan_report_id between", value1, value2, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andTestPlanReportIdNotBetween(String value1, String value2) { + addCriterion("test_plan_report_id not between", value1, value2, "testPlanReportId"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andCaseCountIsNull() { + addCriterion("case_count is null"); + return (Criteria) this; + } + + public Criteria andCaseCountIsNotNull() { + addCriterion("case_count is not null"); + return (Criteria) this; + } + + public Criteria andCaseCountEqualTo(Long value) { + addCriterion("case_count =", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountNotEqualTo(Long value) { + addCriterion("case_count <>", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountGreaterThan(Long value) { + addCriterion("case_count >", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountGreaterThanOrEqualTo(Long value) { + addCriterion("case_count >=", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountLessThan(Long value) { + addCriterion("case_count <", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountLessThanOrEqualTo(Long value) { + addCriterion("case_count <=", value, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountIn(List values) { + addCriterion("case_count in", values, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountNotIn(List values) { + addCriterion("case_count not in", values, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountBetween(Long value1, Long value2) { + addCriterion("case_count between", value1, value2, "caseCount"); + return (Criteria) this; + } + + public Criteria andCaseCountNotBetween(Long value1, Long value2) { + addCriterion("case_count not between", value1, value2, "caseCount"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andExecuteRateIsNull() { + addCriterion("execute_rate is null"); + return (Criteria) this; + } + + public Criteria andExecuteRateIsNotNull() { + addCriterion("execute_rate is not null"); + return (Criteria) this; + } + + public Criteria andExecuteRateEqualTo(Double value) { + addCriterion("execute_rate =", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateNotEqualTo(Double value) { + addCriterion("execute_rate <>", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateGreaterThan(Double value) { + addCriterion("execute_rate >", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateGreaterThanOrEqualTo(Double value) { + addCriterion("execute_rate >=", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateLessThan(Double value) { + addCriterion("execute_rate <", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateLessThanOrEqualTo(Double value) { + addCriterion("execute_rate <=", value, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateIn(List values) { + addCriterion("execute_rate in", values, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateNotIn(List values) { + addCriterion("execute_rate not in", values, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateBetween(Double value1, Double value2) { + addCriterion("execute_rate between", value1, value2, "executeRate"); + return (Criteria) this; + } + + public Criteria andExecuteRateNotBetween(Double value1, Double value2) { + addCriterion("execute_rate not between", value1, value2, "executeRate"); + return (Criteria) this; + } + + public Criteria andPassRateIsNull() { + addCriterion("pass_rate is null"); + return (Criteria) this; + } + + public Criteria andPassRateIsNotNull() { + addCriterion("pass_rate is not null"); + return (Criteria) this; + } + + public Criteria andPassRateEqualTo(Double value) { + addCriterion("pass_rate =", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateNotEqualTo(Double value) { + addCriterion("pass_rate <>", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateGreaterThan(Double value) { + addCriterion("pass_rate >", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateGreaterThanOrEqualTo(Double value) { + addCriterion("pass_rate >=", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateLessThan(Double value) { + addCriterion("pass_rate <", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateLessThanOrEqualTo(Double value) { + addCriterion("pass_rate <=", value, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateIn(List values) { + addCriterion("pass_rate in", values, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateNotIn(List values) { + addCriterion("pass_rate not in", values, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateBetween(Double value1, Double value2) { + addCriterion("pass_rate between", value1, value2, "passRate"); + return (Criteria) this; + } + + public Criteria andPassRateNotBetween(Double value1, Double value2) { + addCriterion("pass_rate not between", value1, value2, "passRate"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueIsNull() { + addCriterion("is_third_part_issue is null"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueIsNotNull() { + addCriterion("is_third_part_issue is not null"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueEqualTo(Boolean value) { + addCriterion("is_third_part_issue =", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueNotEqualTo(Boolean value) { + addCriterion("is_third_part_issue <>", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueGreaterThan(Boolean value) { + addCriterion("is_third_part_issue >", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_third_part_issue >=", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueLessThan(Boolean value) { + addCriterion("is_third_part_issue <", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueLessThanOrEqualTo(Boolean value) { + addCriterion("is_third_part_issue <=", value, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueIn(List values) { + addCriterion("is_third_part_issue in", values, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueNotIn(List values) { + addCriterion("is_third_part_issue not in", values, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueBetween(Boolean value1, Boolean value2) { + addCriterion("is_third_part_issue between", value1, value2, "isThirdPartIssue"); + return (Criteria) this; + } + + public Criteria andIsThirdPartIssueNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_third_part_issue not between", value1, value2, "isThirdPartIssue"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentWithBLOBs.java new file mode 100644 index 0000000000..1851227673 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportContentWithBLOBs.java @@ -0,0 +1,41 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class TestPlanReportContentWithBLOBs extends TestPlanReportContent implements Serializable { + private String config; + + private String summary; + + private String functionResult; + + private String apiResult; + + private String loadResult; + + private String functionAllCases; + + private String functionFailureCases; + + private String issueList; + + private String apiAllCases; + + private String apiFailureCases; + + private String scenarioAllCases; + + private String scenarioFailureCases; + + private String loadAllCases; + + private String loadFailureCases; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanReportExample.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportExample.java index 3133598e3c..0c1db82e88 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanReportExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanReportExample.java @@ -774,52 +774,52 @@ public class TestPlanReportExample { return (Criteria) this; } - public Criteria andIsApiCaseExecutingEqualTo(Byte value) { + public Criteria andIsApiCaseExecutingEqualTo(Boolean value) { addCriterion("is_api_case_executing =", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingNotEqualTo(Byte value) { + public Criteria andIsApiCaseExecutingNotEqualTo(Boolean value) { addCriterion("is_api_case_executing <>", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingGreaterThan(Byte value) { + public Criteria andIsApiCaseExecutingGreaterThan(Boolean value) { addCriterion("is_api_case_executing >", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingGreaterThanOrEqualTo(Byte value) { + public Criteria andIsApiCaseExecutingGreaterThanOrEqualTo(Boolean value) { addCriterion("is_api_case_executing >=", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingLessThan(Byte value) { + public Criteria andIsApiCaseExecutingLessThan(Boolean value) { addCriterion("is_api_case_executing <", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingLessThanOrEqualTo(Byte value) { + public Criteria andIsApiCaseExecutingLessThanOrEqualTo(Boolean value) { addCriterion("is_api_case_executing <=", value, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingIn(List values) { + public Criteria andIsApiCaseExecutingIn(List values) { addCriterion("is_api_case_executing in", values, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingNotIn(List values) { + public Criteria andIsApiCaseExecutingNotIn(List values) { addCriterion("is_api_case_executing not in", values, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingBetween(Byte value1, Byte value2) { + public Criteria andIsApiCaseExecutingBetween(Boolean value1, Boolean value2) { addCriterion("is_api_case_executing between", value1, value2, "isApiCaseExecuting"); return (Criteria) this; } - public Criteria andIsApiCaseExecutingNotBetween(Byte value1, Byte value2) { + public Criteria andIsApiCaseExecutingNotBetween(Boolean value1, Boolean value2) { addCriterion("is_api_case_executing not between", value1, value2, "isApiCaseExecuting"); return (Criteria) this; } @@ -834,52 +834,52 @@ public class TestPlanReportExample { return (Criteria) this; } - public Criteria andIsScenarioExecutingEqualTo(Byte value) { + public Criteria andIsScenarioExecutingEqualTo(Boolean value) { addCriterion("is_scenario_executing =", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingNotEqualTo(Byte value) { + public Criteria andIsScenarioExecutingNotEqualTo(Boolean value) { addCriterion("is_scenario_executing <>", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingGreaterThan(Byte value) { + public Criteria andIsScenarioExecutingGreaterThan(Boolean value) { addCriterion("is_scenario_executing >", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingGreaterThanOrEqualTo(Byte value) { + public Criteria andIsScenarioExecutingGreaterThanOrEqualTo(Boolean value) { addCriterion("is_scenario_executing >=", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingLessThan(Byte value) { + public Criteria andIsScenarioExecutingLessThan(Boolean value) { addCriterion("is_scenario_executing <", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingLessThanOrEqualTo(Byte value) { + public Criteria andIsScenarioExecutingLessThanOrEqualTo(Boolean value) { addCriterion("is_scenario_executing <=", value, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingIn(List values) { + public Criteria andIsScenarioExecutingIn(List values) { addCriterion("is_scenario_executing in", values, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingNotIn(List values) { + public Criteria andIsScenarioExecutingNotIn(List values) { addCriterion("is_scenario_executing not in", values, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingBetween(Byte value1, Byte value2) { + public Criteria andIsScenarioExecutingBetween(Boolean value1, Boolean value2) { addCriterion("is_scenario_executing between", value1, value2, "isScenarioExecuting"); return (Criteria) this; } - public Criteria andIsScenarioExecutingNotBetween(Byte value1, Byte value2) { + public Criteria andIsScenarioExecutingNotBetween(Boolean value1, Boolean value2) { addCriterion("is_scenario_executing not between", value1, value2, "isScenarioExecuting"); return (Criteria) this; } @@ -894,52 +894,52 @@ public class TestPlanReportExample { return (Criteria) this; } - public Criteria andIsPerformanceExecutingEqualTo(Byte value) { + public Criteria andIsPerformanceExecutingEqualTo(Boolean value) { addCriterion("is_performance_executing =", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingNotEqualTo(Byte value) { + public Criteria andIsPerformanceExecutingNotEqualTo(Boolean value) { addCriterion("is_performance_executing <>", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingGreaterThan(Byte value) { + public Criteria andIsPerformanceExecutingGreaterThan(Boolean value) { addCriterion("is_performance_executing >", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingGreaterThanOrEqualTo(Byte value) { + public Criteria andIsPerformanceExecutingGreaterThanOrEqualTo(Boolean value) { addCriterion("is_performance_executing >=", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingLessThan(Byte value) { + public Criteria andIsPerformanceExecutingLessThan(Boolean value) { addCriterion("is_performance_executing <", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingLessThanOrEqualTo(Byte value) { + public Criteria andIsPerformanceExecutingLessThanOrEqualTo(Boolean value) { addCriterion("is_performance_executing <=", value, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingIn(List values) { + public Criteria andIsPerformanceExecutingIn(List values) { addCriterion("is_performance_executing in", values, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingNotIn(List values) { + public Criteria andIsPerformanceExecutingNotIn(List values) { addCriterion("is_performance_executing not in", values, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingBetween(Byte value1, Byte value2) { + public Criteria andIsPerformanceExecutingBetween(Boolean value1, Boolean value2) { addCriterion("is_performance_executing between", value1, value2, "isPerformanceExecuting"); return (Criteria) this; } - public Criteria andIsPerformanceExecutingNotBetween(Byte value1, Byte value2) { + public Criteria andIsPerformanceExecutingNotBetween(Boolean value1, Boolean value2) { addCriterion("is_performance_executing not between", value1, value2, "isPerformanceExecuting"); return (Criteria) this; } @@ -1083,6 +1083,66 @@ public class TestPlanReportExample { addCriterion("components not between", value1, value2, "components"); return (Criteria) this; } + + public Criteria andIsNewIsNull() { + addCriterion("is_new is null"); + return (Criteria) this; + } + + public Criteria andIsNewIsNotNull() { + addCriterion("is_new is not null"); + return (Criteria) this; + } + + public Criteria andIsNewEqualTo(Boolean value) { + addCriterion("is_new =", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewNotEqualTo(Boolean value) { + addCriterion("is_new <>", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewGreaterThan(Boolean value) { + addCriterion("is_new >", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_new >=", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewLessThan(Boolean value) { + addCriterion("is_new <", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewLessThanOrEqualTo(Boolean value) { + addCriterion("is_new <=", value, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewIn(List values) { + addCriterion("is_new in", values, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewNotIn(List values) { + addCriterion("is_new not in", values, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewBetween(Boolean value1, Boolean value2) { + addCriterion("is_new between", value1, value2, "isNew"); + return (Criteria) this; + } + + public Criteria andIsNewNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_new not between", value1, value2, "isNew"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.java new file mode 100644 index 0000000000..4217e2413e --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.java @@ -0,0 +1,37 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.TestPlanReportContent; +import io.metersphere.base.domain.TestPlanReportContentExample; +import io.metersphere.base.domain.TestPlanReportContentWithBLOBs; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface TestPlanReportContentMapper { + long countByExample(TestPlanReportContentExample example); + + int deleteByExample(TestPlanReportContentExample example); + + int deleteByPrimaryKey(String id); + + int insert(TestPlanReportContentWithBLOBs record); + + int insertSelective(TestPlanReportContentWithBLOBs record); + + List selectByExampleWithBLOBs(TestPlanReportContentExample example); + + List selectByExample(TestPlanReportContentExample example); + + TestPlanReportContentWithBLOBs selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") TestPlanReportContentWithBLOBs record, @Param("example") TestPlanReportContentExample example); + + int updateByExampleWithBLOBs(@Param("record") TestPlanReportContentWithBLOBs record, @Param("example") TestPlanReportContentExample example); + + int updateByExample(@Param("record") TestPlanReportContent record, @Param("example") TestPlanReportContentExample example); + + int updateByPrimaryKeySelective(TestPlanReportContentWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TestPlanReportContentWithBLOBs record); + + int updateByPrimaryKey(TestPlanReportContent record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.xml new file mode 100644 index 0000000000..1509bedbdd --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportContentMapper.xml @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, test_plan_report_id, start_time, case_count, end_time, execute_rate, pass_rate, + is_third_part_issue + + + config, summary, function_result, api_result, load_result, function_all_cases, function_failure_cases, + issue_list, api_all_cases, api_failure_cases, scenario_all_cases, scenario_failure_cases, + load_all_Cases, load_failure_cases + + + + + + delete from test_plan_report_content + where id = #{id,jdbcType=VARCHAR} + + + delete from test_plan_report_content + + + + + + insert into test_plan_report_content (id, test_plan_report_id, start_time, + case_count, end_time, execute_rate, + pass_rate, is_third_part_issue, config, + summary, function_result, api_result, + load_result, function_all_cases, function_failure_cases, + issue_list, api_all_cases, api_failure_cases, + scenario_all_cases, scenario_failure_cases, + load_all_Cases, load_failure_cases) + values (#{id,jdbcType=VARCHAR}, #{testPlanReportId,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, + #{caseCount,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{executeRate,jdbcType=DOUBLE}, + #{passRate,jdbcType=DOUBLE}, #{isThirdPartIssue,jdbcType=BIT}, #{config,jdbcType=LONGVARCHAR}, + #{summary,jdbcType=LONGVARCHAR}, #{functionResult,jdbcType=LONGVARCHAR}, #{apiResult,jdbcType=LONGVARCHAR}, + #{loadResult,jdbcType=LONGVARCHAR}, #{functionAllCases,jdbcType=LONGVARCHAR}, #{functionFailureCases,jdbcType=LONGVARCHAR}, + #{issueList,jdbcType=LONGVARCHAR}, #{apiAllCases,jdbcType=LONGVARCHAR}, #{apiFailureCases,jdbcType=LONGVARCHAR}, + #{scenarioAllCases,jdbcType=LONGVARCHAR}, #{scenarioFailureCases,jdbcType=LONGVARCHAR}, + #{loadAllCases,jdbcType=LONGVARCHAR}, #{loadFailureCases,jdbcType=LONGVARCHAR}) + + + insert into test_plan_report_content + + + id, + + + test_plan_report_id, + + + start_time, + + + case_count, + + + end_time, + + + execute_rate, + + + pass_rate, + + + is_third_part_issue, + + + config, + + + summary, + + + function_result, + + + api_result, + + + load_result, + + + function_all_cases, + + + function_failure_cases, + + + issue_list, + + + api_all_cases, + + + api_failure_cases, + + + scenario_all_cases, + + + scenario_failure_cases, + + + load_all_Cases, + + + load_failure_cases, + + + + + #{id,jdbcType=VARCHAR}, + + + #{testPlanReportId,jdbcType=VARCHAR}, + + + #{startTime,jdbcType=BIGINT}, + + + #{caseCount,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + + + #{executeRate,jdbcType=DOUBLE}, + + + #{passRate,jdbcType=DOUBLE}, + + + #{isThirdPartIssue,jdbcType=BIT}, + + + #{config,jdbcType=LONGVARCHAR}, + + + #{summary,jdbcType=LONGVARCHAR}, + + + #{functionResult,jdbcType=LONGVARCHAR}, + + + #{apiResult,jdbcType=LONGVARCHAR}, + + + #{loadResult,jdbcType=LONGVARCHAR}, + + + #{functionAllCases,jdbcType=LONGVARCHAR}, + + + #{functionFailureCases,jdbcType=LONGVARCHAR}, + + + #{issueList,jdbcType=LONGVARCHAR}, + + + #{apiAllCases,jdbcType=LONGVARCHAR}, + + + #{apiFailureCases,jdbcType=LONGVARCHAR}, + + + #{scenarioAllCases,jdbcType=LONGVARCHAR}, + + + #{scenarioFailureCases,jdbcType=LONGVARCHAR}, + + + #{loadAllCases,jdbcType=LONGVARCHAR}, + + + #{loadFailureCases,jdbcType=LONGVARCHAR}, + + + + + + update test_plan_report_content + + + id = #{record.id,jdbcType=VARCHAR}, + + + test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + case_count = #{record.caseCount,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + + + execute_rate = #{record.executeRate,jdbcType=DOUBLE}, + + + pass_rate = #{record.passRate,jdbcType=DOUBLE}, + + + is_third_part_issue = #{record.isThirdPartIssue,jdbcType=BIT}, + + + config = #{record.config,jdbcType=LONGVARCHAR}, + + + summary = #{record.summary,jdbcType=LONGVARCHAR}, + + + function_result = #{record.functionResult,jdbcType=LONGVARCHAR}, + + + api_result = #{record.apiResult,jdbcType=LONGVARCHAR}, + + + load_result = #{record.loadResult,jdbcType=LONGVARCHAR}, + + + function_all_cases = #{record.functionAllCases,jdbcType=LONGVARCHAR}, + + + function_failure_cases = #{record.functionFailureCases,jdbcType=LONGVARCHAR}, + + + issue_list = #{record.issueList,jdbcType=LONGVARCHAR}, + + + api_all_cases = #{record.apiAllCases,jdbcType=LONGVARCHAR}, + + + api_failure_cases = #{record.apiFailureCases,jdbcType=LONGVARCHAR}, + + + scenario_all_cases = #{record.scenarioAllCases,jdbcType=LONGVARCHAR}, + + + scenario_failure_cases = #{record.scenarioFailureCases,jdbcType=LONGVARCHAR}, + + + load_all_Cases = #{record.loadAllCases,jdbcType=LONGVARCHAR}, + + + load_failure_cases = #{record.loadFailureCases,jdbcType=LONGVARCHAR}, + + + + + + + + update test_plan_report_content + set id = #{record.id,jdbcType=VARCHAR}, + test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + case_count = #{record.caseCount,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, + execute_rate = #{record.executeRate,jdbcType=DOUBLE}, + pass_rate = #{record.passRate,jdbcType=DOUBLE}, + is_third_part_issue = #{record.isThirdPartIssue,jdbcType=BIT}, + config = #{record.config,jdbcType=LONGVARCHAR}, + summary = #{record.summary,jdbcType=LONGVARCHAR}, + function_result = #{record.functionResult,jdbcType=LONGVARCHAR}, + api_result = #{record.apiResult,jdbcType=LONGVARCHAR}, + load_result = #{record.loadResult,jdbcType=LONGVARCHAR}, + function_all_cases = #{record.functionAllCases,jdbcType=LONGVARCHAR}, + function_failure_cases = #{record.functionFailureCases,jdbcType=LONGVARCHAR}, + issue_list = #{record.issueList,jdbcType=LONGVARCHAR}, + api_all_cases = #{record.apiAllCases,jdbcType=LONGVARCHAR}, + api_failure_cases = #{record.apiFailureCases,jdbcType=LONGVARCHAR}, + scenario_all_cases = #{record.scenarioAllCases,jdbcType=LONGVARCHAR}, + scenario_failure_cases = #{record.scenarioFailureCases,jdbcType=LONGVARCHAR}, + load_all_Cases = #{record.loadAllCases,jdbcType=LONGVARCHAR}, + load_failure_cases = #{record.loadFailureCases,jdbcType=LONGVARCHAR} + + + + + + update test_plan_report_content + set id = #{record.id,jdbcType=VARCHAR}, + test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + case_count = #{record.caseCount,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, + execute_rate = #{record.executeRate,jdbcType=DOUBLE}, + pass_rate = #{record.passRate,jdbcType=DOUBLE}, + is_third_part_issue = #{record.isThirdPartIssue,jdbcType=BIT} + + + + + + update test_plan_report_content + + + test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + + + start_time = #{startTime,jdbcType=BIGINT}, + + + case_count = #{caseCount,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + + + execute_rate = #{executeRate,jdbcType=DOUBLE}, + + + pass_rate = #{passRate,jdbcType=DOUBLE}, + + + is_third_part_issue = #{isThirdPartIssue,jdbcType=BIT}, + + + config = #{config,jdbcType=LONGVARCHAR}, + + + summary = #{summary,jdbcType=LONGVARCHAR}, + + + function_result = #{functionResult,jdbcType=LONGVARCHAR}, + + + api_result = #{apiResult,jdbcType=LONGVARCHAR}, + + + load_result = #{loadResult,jdbcType=LONGVARCHAR}, + + + function_all_cases = #{functionAllCases,jdbcType=LONGVARCHAR}, + + + function_failure_cases = #{functionFailureCases,jdbcType=LONGVARCHAR}, + + + issue_list = #{issueList,jdbcType=LONGVARCHAR}, + + + api_all_cases = #{apiAllCases,jdbcType=LONGVARCHAR}, + + + api_failure_cases = #{apiFailureCases,jdbcType=LONGVARCHAR}, + + + scenario_all_cases = #{scenarioAllCases,jdbcType=LONGVARCHAR}, + + + scenario_failure_cases = #{scenarioFailureCases,jdbcType=LONGVARCHAR}, + + + load_all_Cases = #{loadAllCases,jdbcType=LONGVARCHAR}, + + + load_failure_cases = #{loadFailureCases,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update test_plan_report_content + set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + case_count = #{caseCount,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, + execute_rate = #{executeRate,jdbcType=DOUBLE}, + pass_rate = #{passRate,jdbcType=DOUBLE}, + is_third_part_issue = #{isThirdPartIssue,jdbcType=BIT}, + config = #{config,jdbcType=LONGVARCHAR}, + summary = #{summary,jdbcType=LONGVARCHAR}, + function_result = #{functionResult,jdbcType=LONGVARCHAR}, + api_result = #{apiResult,jdbcType=LONGVARCHAR}, + load_result = #{loadResult,jdbcType=LONGVARCHAR}, + function_all_cases = #{functionAllCases,jdbcType=LONGVARCHAR}, + function_failure_cases = #{functionFailureCases,jdbcType=LONGVARCHAR}, + issue_list = #{issueList,jdbcType=LONGVARCHAR}, + api_all_cases = #{apiAllCases,jdbcType=LONGVARCHAR}, + api_failure_cases = #{apiFailureCases,jdbcType=LONGVARCHAR}, + scenario_all_cases = #{scenarioAllCases,jdbcType=LONGVARCHAR}, + scenario_failure_cases = #{scenarioFailureCases,jdbcType=LONGVARCHAR}, + load_all_Cases = #{loadAllCases,jdbcType=LONGVARCHAR}, + load_failure_cases = #{loadFailureCases,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + update test_plan_report_content + set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + case_count = #{caseCount,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, + execute_rate = #{executeRate,jdbcType=DOUBLE}, + pass_rate = #{passRate,jdbcType=DOUBLE}, + is_third_part_issue = #{isThirdPartIssue,jdbcType=BIT} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml index 07d1565c22..26b6624711 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml @@ -12,11 +12,12 @@ - - - + + + + @@ -79,7 +80,7 @@ id, test_plan_id, create_time, update_time, `name`, `status`, trigger_mode, creator, start_time, end_time, is_api_case_executing, is_scenario_executing, is_performance_executing, - principal, components + principal, components, is_new @@ -262,13 +269,13 @@ end_time = #{record.endTime,jdbcType=BIGINT}, - is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=TINYINT}, + is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=BIT}, - is_scenario_executing = #{record.isScenarioExecuting,jdbcType=TINYINT}, + is_scenario_executing = #{record.isScenarioExecuting,jdbcType=BIT}, - is_performance_executing = #{record.isPerformanceExecuting,jdbcType=TINYINT}, + is_performance_executing = #{record.isPerformanceExecuting,jdbcType=BIT}, principal = #{record.principal,jdbcType=VARCHAR}, @@ -276,6 +283,9 @@ components = #{record.components,jdbcType=VARCHAR}, + + is_new = #{record.isNew,jdbcType=BIT}, + @@ -293,11 +303,12 @@ creator = #{record.creator,jdbcType=VARCHAR}, start_time = #{record.startTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT}, - is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=TINYINT}, - is_scenario_executing = #{record.isScenarioExecuting,jdbcType=TINYINT}, - is_performance_executing = #{record.isPerformanceExecuting,jdbcType=TINYINT}, + is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=BIT}, + is_scenario_executing = #{record.isScenarioExecuting,jdbcType=BIT}, + is_performance_executing = #{record.isPerformanceExecuting,jdbcType=BIT}, principal = #{record.principal,jdbcType=VARCHAR}, - components = #{record.components,jdbcType=VARCHAR} + components = #{record.components,jdbcType=VARCHAR}, + is_new = #{record.isNew,jdbcType=BIT} @@ -333,13 +344,13 @@ end_time = #{endTime,jdbcType=BIGINT}, - is_api_case_executing = #{isApiCaseExecuting,jdbcType=TINYINT}, + is_api_case_executing = #{isApiCaseExecuting,jdbcType=BIT}, - is_scenario_executing = #{isScenarioExecuting,jdbcType=TINYINT}, + is_scenario_executing = #{isScenarioExecuting,jdbcType=BIT}, - is_performance_executing = #{isPerformanceExecuting,jdbcType=TINYINT}, + is_performance_executing = #{isPerformanceExecuting,jdbcType=BIT}, principal = #{principal,jdbcType=VARCHAR}, @@ -347,6 +358,9 @@ components = #{components,jdbcType=VARCHAR}, + + is_new = #{isNew,jdbcType=BIT}, + where id = #{id,jdbcType=VARCHAR} @@ -361,11 +375,12 @@ creator = #{creator,jdbcType=VARCHAR}, start_time = #{startTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT}, - is_api_case_executing = #{isApiCaseExecuting,jdbcType=TINYINT}, - is_scenario_executing = #{isScenarioExecuting,jdbcType=TINYINT}, - is_performance_executing = #{isPerformanceExecuting,jdbcType=TINYINT}, + is_api_case_executing = #{isApiCaseExecuting,jdbcType=BIT}, + is_scenario_executing = #{isScenarioExecuting,jdbcType=BIT}, + is_performance_executing = #{isPerformanceExecuting,jdbcType=BIT}, principal = #{principal,jdbcType=VARCHAR}, - components = #{components,jdbcType=VARCHAR} + components = #{components,jdbcType=VARCHAR}, + is_new = #{isNew,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.java index 4ce6c330b5..4ee4fb721f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.java @@ -12,5 +12,5 @@ import java.util.List; * @Description */ public interface ExtTestPlanReportMapper { - public List list(@Param("request")QueryTestPlanReportRequest request); + List list(@Param("request")QueryTestPlanReportRequest request); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml index c1676447e5..9485d68ae8 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml @@ -5,7 +5,7 @@ - \ No newline at end of file + diff --git a/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java b/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java index 11b4d4aaa4..95333daa8f 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/TestPlanUtils.java @@ -51,7 +51,7 @@ public class TestPlanUtils { Map statusResultMap, TestPlanSimpleReportDTO report, String successStatus) { planReportCaseDTOS.forEach(item -> { - report.setCaseCount(report.getCaseCount() + 1); + report.setCaseCount(report.getCaseCount() == null ? 0 : report.getCaseCount() + 1); String status = item.getStatus(); if (StringUtils.isNotBlank(status) && !StringUtils.equals(TestPlanTestCaseStatus.Underway.name(), status)) { report.setExecuteCount(report.getExecuteCount() + 1); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java index f3aca3162c..c0cd341792 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java @@ -12,6 +12,7 @@ import io.metersphere.commons.utils.SessionUtils; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.annotation.SendNotice; import io.metersphere.track.dto.TestPlanReportDTO; +import io.metersphere.track.dto.TestPlanSimpleReportDTO; import io.metersphere.track.request.report.QueryTestPlanReportRequest; import io.metersphere.track.request.report.TestPlanReportSaveRequest; import io.metersphere.track.service.TestPlanReportService; @@ -44,6 +45,11 @@ public class TestPlanReportController { return testPlanReportService.getMetric(planId); } + @GetMapping("/db/{reportId}") + public TestPlanSimpleReportDTO getReport(@PathVariable String reportId) { + return testPlanReportService.getReport(reportId); + } + @GetMapping("/sendTask/{planId}") public String sendTask(@PathVariable String planId) { TestPlanReport report = testPlanReportService.getTestPlanReport(planId); diff --git a/backend/src/main/java/io/metersphere/track/dto/TestPlanReportDTO.java b/backend/src/main/java/io/metersphere/track/dto/TestPlanReportDTO.java index 7ef0f73a07..7ea6ef72a9 100644 --- a/backend/src/main/java/io/metersphere/track/dto/TestPlanReportDTO.java +++ b/backend/src/main/java/io/metersphere/track/dto/TestPlanReportDTO.java @@ -16,6 +16,7 @@ import java.util.List; public class TestPlanReportDTO { private String id; private String testPlanId; + private Boolean isNew; private String name; private String testPlanName; private String creator; @@ -33,4 +34,4 @@ public class TestPlanReportDTO { private Long startTime; private Long endTime; private String projectName; -} \ No newline at end of file +} diff --git a/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java b/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java index 3386e86c44..2211081364 100644 --- a/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java +++ b/backend/src/main/java/io/metersphere/track/dto/TestPlanSimpleReportDTO.java @@ -3,6 +3,7 @@ package io.metersphere.track.dto; import io.metersphere.api.dto.automation.TestPlanFailureApiDTO; import io.metersphere.api.dto.automation.TestPlanFailureScenarioDTO; import io.metersphere.base.domain.IssuesDao; +import io.metersphere.base.domain.TestPlanReportContent; import lombok.Getter; import lombok.Setter; @@ -11,18 +12,14 @@ import java.util.List; @Getter @Setter -public class TestPlanSimpleReportDTO { +public class TestPlanSimpleReportDTO extends TestPlanReportContent { private String name; - private Long startTime; - private Long endTime; - private int caseCount; + private int executeCount; private int passCount; - private double executeRate; - private double passRate; private String summary; private String config; - private Boolean isThirdPartIssue; + private TestPlanFunctionResultReportDTO functionResult; private TestPlanApiResultReportDTO apiResult; private TestPlanLoadResultReportDTO loadResult; @@ -30,10 +27,10 @@ public class TestPlanSimpleReportDTO { List functionFailureCases; List functionAllCases; List issueList; - List apiFailureResult; + List apiFailureCases; List apiAllCases; - List scenarioFailureResult; + List scenarioFailureCases; List scenarioAllCases; - List loadAllTestCases; - List loadFailureTestCases; + List loadAllCases; + List loadFailureCases; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index 1d63fc4404..41a7a97a6b 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject; import io.metersphere.api.cache.TestPlanExecuteInfo; import io.metersphere.api.cache.TestPlanReportExecuteCatch; import io.metersphere.api.dto.automation.ApiScenarioDTO; +import io.metersphere.api.dto.automation.TestPlanFailureApiDTO; +import io.metersphere.api.dto.automation.TestPlanFailureScenarioDTO; import io.metersphere.api.dto.automation.TestPlanScenarioRequest; import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.api.dto.definition.TestPlanApiCaseDTO; @@ -31,10 +33,9 @@ import io.metersphere.track.request.testplan.LoadCaseRequest; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.session.SqlSession; -import org.apache.ibatis.session.SqlSessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -64,10 +65,6 @@ public class TestPlanReportService { @Resource ExtTestPlanLoadCaseMapper extTestPlanLoadCaseMapper; @Resource - TestPlanApiScenarioMapper testPlanScenarioCaseMapper; - @Resource - TestPlanApiCaseMapper testPlanApiCaseMapper; - @Resource ExtTestPlanReportMapper extTestPlanReportMapper; @Resource TestPlanMapper testPlanMapper; @@ -79,9 +76,12 @@ public class TestPlanReportService { ApiTestCaseMapper apiTestCaseMapper; @Resource LoadTestReportMapper loadTestReportMapper; - + @Lazy @Resource - SqlSessionFactory sqlSessionFactory; + TestPlanService testPlanService; + @Lazy + @Resource + TestPlanReportContentMapper testPlanReportContentMapper; private final ExecutorService executorService = Executors.newFixedThreadPool(20); @@ -192,16 +192,17 @@ public class TestPlanReportService { testPlanReport.setUpdateTime(System.currentTimeMillis()); try { testPlanReport.setName(testPlan.getName() + "-" + DateUtils.getTimeString(new Date())); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} + testPlanReport.setTriggerMode(saveRequest.getTriggerMode()); testPlanReport.setCreator(saveRequest.getUserId()); testPlanReport.setStartTime(System.currentTimeMillis()); testPlanReport.setEndTime(System.currentTimeMillis()); + testPlanReport.setIsNew(true); - TestPlanReportDataWithBLOBs testPlanReportData = new TestPlanReportDataWithBLOBs(); - testPlanReportData.setId(UUID.randomUUID().toString()); - testPlanReportData.setTestPlanReportId(testPlanReportID); + TestPlanReportContentWithBLOBs testPlanReportContent = new TestPlanReportContentWithBLOBs(); + testPlanReportContent.setId(UUID.randomUUID().toString()); + testPlanReportContent.setTestPlanReportId(testPlanReportID); Map apiCaseInfoMap = new HashMap<>(); Map scenarioInfoMap = new HashMap<>(); @@ -251,13 +252,8 @@ public class TestPlanReportService { testPlanReport.setStatus(APITestStatus.Completed.name()); } - SqlSession sqlSession = sqlSessionFactory.openSession(false); - TestPlanReportMapper insertReportMapper = sqlSession.getMapper(TestPlanReportMapper.class); - TestPlanReportDataMapper insertReportDataMapper = sqlSession.getMapper(TestPlanReportDataMapper.class); - insertReportMapper.insert(testPlanReport); - insertReportDataMapper.insert(testPlanReportData); - sqlSession.commit(); - sqlSession.flushStatements(); + testPlanReportMapper.insert(testPlanReport); + testPlanReportContentMapper.insert(testPlanReportContent); //更新TestPlan状态,改为进行中 testPlan.setStatus(TestPlanStatus.Underway.name()); @@ -600,7 +596,7 @@ public class TestPlanReportService { QueryTestPlanRequest queryTestPlanRequest = new QueryTestPlanRequest(); queryTestPlanRequest.setId(testPlanReport.getTestPlanId()); TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0); - String issuesInfo = null; +// String issuesInfo = null; //因为接口案例的定时任务是单个案例开线程运行, 所以要检查是否都执行完成。全部执行完成时才会进行统一整理 if (StringUtils.equalsAny(triggerMode, ReportTriggerMode.SCHEDULE.name(), ReportTriggerMode.API.name()) @@ -618,26 +614,26 @@ public class TestPlanReportService { testPlanReport.setEndTime(System.currentTimeMillis()); testPlanReport.setUpdateTime(System.currentTimeMillis()); - //手动触发的需要保存手工执行的信息 - int[] componentIndexArr = null; - if (StringUtils.equals(ReportTriggerMode.MANUAL.name(), triggerMode)) { - componentIndexArr = new int[]{1, 2, 3, 4, 5}; - } else { - componentIndexArr = new int[]{1, 3, 4}; - } - testPlanReport.setComponents(JSONArray.toJSONString(componentIndexArr)); +// //手动触发的需要保存手工执行的信息 +// int[] componentIndexArr = null; +// if (StringUtils.equals(ReportTriggerMode.MANUAL.name(), triggerMode)) { +// componentIndexArr = new int[]{1, 2, 3, 4, 5}; +// } else { +// componentIndexArr = new int[]{1, 3, 4}; +// } +// testPlanReport.setComponents(JSONArray.toJSONString(componentIndexArr)); - TestPlanService testPlanService = CommonBeanFactory.getBean(TestPlanService.class); - JSONArray componentIds = JSONArray.parseArray(testPlanReport.getComponents()); - List components = ReportComponentFactory.createComponents(componentIds.toJavaList(String.class), testPlan); - testPlanService.buildApiCaseReport(testPlanReport.getTestPlanId(), components); - testPlanService.buildScenarioCaseReport(testPlanReport.getTestPlanId(), components); - testPlanService.buildLoadCaseReport(testPlanReport.getTestPlanId(), components); +// TestPlanService testPlanService = CommonBeanFactory.getBean(TestPlanService.class); +// JSONArray componentIds = JSONArray.parseArray(testPlanReport.getComponents()); +// List components = ReportComponentFactory.createComponents(componentIds.toJavaList(String.class), testPlan); +// testPlanService.buildApiCaseReport(testPlanReport.getTestPlanId(), components); +// testPlanService.buildScenarioCaseReport(testPlanReport.getTestPlanId(), components); +// testPlanService.buildLoadCaseReport(testPlanReport.getTestPlanId(), components); - if (StringUtils.equals(ReportTriggerMode.MANUAL.name(), triggerMode)) { - List issues = testPlanService.buildFunctionalCaseReport(testPlanReport.getTestPlanId(), components); - issuesInfo = JSONArray.toJSONString(issues); - } +// if (StringUtils.equals(ReportTriggerMode.MANUAL.name(), triggerMode)) { +// List issues = testPlanService.buildFunctionalCaseReport(testPlanReport.getTestPlanId(), components); +// issuesInfo = JSONArray.toJSONString(issues); +// } //只针对定时任务做处理 @@ -655,82 +651,156 @@ public class TestPlanReportService { testPlanReport.setIsScenarioExecuting(false); testPlanReport.setIsApiCaseExecuting(false); } - TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO(); - components.forEach(component -> { - component.afterBuild(testCaseReportMetricDTO); - }); +// TestCaseReportMetricDTO testCaseReportMetricDTO = new TestCaseReportMetricDTO(); +// components.forEach(component -> { +// component.afterBuild(testCaseReportMetricDTO); +// }); - if (StringUtils.equalsAny(triggerMode, ReportTriggerMode.SCHEDULE.name(), ReportTriggerMode.API.name()) - && StringUtils.equalsAny(resourceRunMode, ApiRunMode.SCHEDULE_PERFORMANCE_TEST.name(), ApiRunMode.JENKINS_PERFORMANCE_TEST.name())) { +// if (StringUtils.equalsAny(triggerMode, ReportTriggerMode.SCHEDULE.name(), ReportTriggerMode.API.name()) +// && StringUtils.equalsAny(resourceRunMode, ApiRunMode.SCHEDULE_PERFORMANCE_TEST.name(), ApiRunMode.JENKINS_PERFORMANCE_TEST.name())) { //如果是性能测试作为触发,由于延迟原因可能会出现报告已经结束但是状态还是进行中的状态 - List loadResult = testCaseReportMetricDTO.getExecuteResult().getLoadResult(); - for (TestCaseReportStatusResultDTO dto : loadResult) { - if (StringUtils.equals(dto.getStatus(), TestPlanTestCaseStatus.Underway.name())) { - dto.setStatus(TestPlanTestCaseStatus.Pass.name()); - } - } - testCaseReportMetricDTO.getExecuteResult().setLoadResult(loadResult); - } +// List loadResult = testCaseReportMetricDTO.getExecuteResult().getLoadResult(); +// for (TestCaseReportStatusResultDTO dto : loadResult) { +// if (StringUtils.equals(dto.getStatus(), TestPlanTestCaseStatus.Underway.name())) { +// dto.setStatus(TestPlanTestCaseStatus.Pass.name()); +// } +// } +// testCaseReportMetricDTO.getExecuteResult().setLoadResult(loadResult); +// } - TestPlanReportDataExample example = new TestPlanReportDataExample(); + TestPlanReportContentExample example = new TestPlanReportContentExample(); example.createCriteria().andTestPlanReportIdEqualTo(planReportId); - List testPlanReportDataList = testPlanReportDataMapper.selectByExampleWithBLOBs(example); + List testPlanReportContentList = testPlanReportContentMapper.selectByExampleWithBLOBs(example); - TestPlanReportDataWithBLOBs testPlanReportData = null; - if (!testPlanReportDataList.isEmpty()) { - testPlanReportData = testPlanReportDataList.get(0); - if (CollectionUtils.isNotEmpty(scenarioIdList) - && StringUtils.equalsAny(triggerMode, ReportTriggerMode.SCHEDULE.name(), ReportTriggerMode.API.name()) - && StringUtils.equalsAny(resourceRunMode, ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(), ApiRunMode.JENKINS_SCENARIO_PLAN.name())) { - try { - List scenarioListArr = JSONArray.parseArray(testPlanReportData.getScenarioInfo(), String.class); - TestCaseReportAdvanceStatusResultDTO savedDTO = JSONObject.parseObject(testPlanReportData.getExecuteResult(), TestCaseReportAdvanceStatusResultDTO.class); - List executeScenarioList = new ArrayList<>(); - if (savedDTO != null) { - if (savedDTO.getExecutedScenarioIds() != null) { - executeScenarioList = savedDTO.getExecutedScenarioIds(); - } - } - for (String scenarioId : scenarioIdList) { - if (!executeScenarioList.contains(scenarioId)) { - executeScenarioList.add(scenarioId); - } - } - if (testCaseReportMetricDTO.getExecuteResult() == null) { - TestCaseReportAdvanceStatusResultDTO executeResultDTO = new TestCaseReportAdvanceStatusResultDTO(); - testCaseReportMetricDTO.setExecuteResult(executeResultDTO); - } - testCaseReportMetricDTO.getExecuteResult().setExecutedScenarioIds(executeScenarioList); + TestPlanReportContentWithBLOBs testPlanReportContent = null; + TestPlanSimpleReportDTO reportDTO = testPlanService.buildPlanReport(testPlan.getId(), false); + if (!testPlanReportContentList.isEmpty()) { + testPlanReportContent = testPlanReportContentList.get(0); +// +// if (CollectionUtils.isNotEmpty(scenarioIdList) +// && StringUtils.equalsAny(triggerMode, ReportTriggerMode.SCHEDULE.name(), ReportTriggerMode.API.name()) +// && StringUtils.equalsAny(resourceRunMode, ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(), ApiRunMode.JENKINS_SCENARIO_PLAN.name())) { +// try { +// List scenarioListArr = JSONArray.parseArray(testPlanReportData.getScenarioInfo(), String.class); +// TestCaseReportAdvanceStatusResultDTO savedDTO = JSONObject.parseObject(testPlanReportData.getExecuteResult(), TestCaseReportAdvanceStatusResultDTO.class); +// List executeScenarioList = new ArrayList<>(); +// if (savedDTO != null) { +// if (savedDTO.getExecutedScenarioIds() != null) { +// executeScenarioList = savedDTO.getExecutedScenarioIds(); +// } +// } +// for (String scenarioId : scenarioIdList) { +// if (!executeScenarioList.contains(scenarioId)) { +// executeScenarioList.add(scenarioId); +// } +// } +// if (testCaseReportMetricDTO.getExecuteResult() == null) { +// TestCaseReportAdvanceStatusResultDTO executeResultDTO = new TestCaseReportAdvanceStatusResultDTO(); +// testCaseReportMetricDTO.setExecuteResult(executeResultDTO); +// } +// testCaseReportMetricDTO.getExecuteResult().setExecutedScenarioIds(executeScenarioList); +// +// if (!CollectionUtils.isEqualCollection(scenarioListArr, executeScenarioList)) { +// testPlanReport.setIsScenarioExecuting(true); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } - if (!CollectionUtils.isEqualCollection(scenarioListArr, executeScenarioList)) { - testPlanReport.setIsScenarioExecuting(true); - } - } catch (Exception e) { - e.printStackTrace(); - } - } //统计执行的场景ID - testPlanReportData.setExecuteResult(JSONObject.toJSONString(testCaseReportMetricDTO.getExecuteResult())); - testPlanReportData.setFailurTestCases(JSONObject.toJSONString(testCaseReportMetricDTO.getFailureTestCases())); - testPlanReportData.setModuleExecuteResult(JSONArray.toJSONString(testCaseReportMetricDTO.getModuleExecuteResult())); - if (issuesInfo != null) { - testPlanReportData.setIssuesInfo(issuesInfo); - } - testPlanReportDataMapper.updateByPrimaryKeyWithBLOBs(testPlanReportData); +// testPlanReportData.setExecuteResult(JSONObject.toJSONString(testCaseReportMetricDTO.getExecuteResult())); +// testPlanReportData.setFailurTestCases(JSONObject.toJSONString(testCaseReportMetricDTO.getFailureTestCases())); +// testPlanReportData.setModuleExecuteResult(JSONArray.toJSONString(testCaseReportMetricDTO.getModuleExecuteResult())); +// if (issuesInfo != null) { +// testPlanReportData.setIssuesInfo(issuesInfo); +// } + + testPlanReportContentMapper.updateByPrimaryKeySelective(parseReportDaoToReportContent(reportDTO, testPlanReportContent)); } - String testPlanStatus = this.getTestPlanReportStatus(testPlanReport, testPlanReportData); + String testPlanStatus = this.getTestPlanReportStatus(testPlanReport, reportDTO); testPlanReport.setStatus(testPlanStatus); this.update(testPlanReport); } + public TestPlanReportContentWithBLOBs parseReportDaoToReportContent(TestPlanSimpleReportDTO reportDTO, TestPlanReportContentWithBLOBs testPlanReportContentWithBLOBs) { + String id = testPlanReportContentWithBLOBs.getId(); + BeanUtils.copyBean(testPlanReportContentWithBLOBs, reportDTO); + testPlanReportContentWithBLOBs.setId(id); + if (reportDTO.getFunctionResult() != null) { + testPlanReportContentWithBLOBs.setFunctionResult(JSONObject.toJSONString(reportDTO.getFunctionResult())); + } + if (reportDTO.getApiResult() != null) { + testPlanReportContentWithBLOBs.setApiResult(JSONObject.toJSONString(reportDTO.getApiResult())); + } + if (reportDTO.getLoadResult() != null) { + testPlanReportContentWithBLOBs.setLoadResult(JSONObject.toJSONString(reportDTO.getLoadResult())); + } + if (reportDTO.getFunctionAllCases() != null) { + testPlanReportContentWithBLOBs.setFunctionAllCases(JSONObject.toJSONString(reportDTO.getFunctionAllCases())); + } + if (reportDTO.getFunctionFailureCases() != null) { + testPlanReportContentWithBLOBs.setFunctionFailureCases(JSONObject.toJSONString(reportDTO.getFunctionFailureCases())); + } + if (reportDTO.getIssueList() != null) { + testPlanReportContentWithBLOBs.setIssueList(JSONObject.toJSONString(reportDTO.getIssueList())); + } + if (reportDTO.getApiAllCases() != null) { + testPlanReportContentWithBLOBs.setApiAllCases(JSONObject.toJSONString(reportDTO.getApiAllCases())); + } + if (reportDTO.getApiFailureCases() != null) { + testPlanReportContentWithBLOBs.setApiFailureCases(JSONObject.toJSONString(reportDTO.getApiFailureCases())); + } + if (reportDTO.getScenarioAllCases() != null) { + testPlanReportContentWithBLOBs.setScenarioAllCases(JSONObject.toJSONString(reportDTO.getScenarioAllCases())); + } + if (reportDTO.getScenarioFailureCases() != null) { + testPlanReportContentWithBLOBs.setScenarioFailureCases(JSONObject.toJSONString(reportDTO.getScenarioFailureCases())); + } + if (reportDTO.getLoadAllCases() != null) { + testPlanReportContentWithBLOBs.setLoadAllCases(JSONObject.toJSONString(reportDTO.getLoadAllCases())); + } + if (reportDTO.getLoadFailureCases() != null) { + testPlanReportContentWithBLOBs.setLoadFailureCases(JSONObject.toJSONString(reportDTO.getLoadFailureCases())); + } + return testPlanReportContentWithBLOBs; + } + /** * 计算测试计划的状态 * * @param testPlanReport * @return */ + private String getTestPlanReportStatus(TestPlanReport testPlanReport, TestPlanSimpleReportDTO reportDTO) { + String status = TestPlanReportStatus.COMPLETED.name(); + if (testPlanReport != null) { + if (testPlanReport.getIsApiCaseExecuting() || testPlanReport.getIsPerformanceExecuting() || testPlanReport.getIsScenarioExecuting()) { + status = TestPlanReportStatus.RUNNING.name(); + } else { + if (reportDTO != null) { + status = TestPlanReportStatus.SUCCESS.name(); + try { + if (CollectionUtils.isNotEmpty(reportDTO.getFunctionFailureCases()) + && CollectionUtils.isNotEmpty(reportDTO.getApiFailureCases()) + && CollectionUtils.isNotEmpty(reportDTO.getScenarioFailureCases()) + && CollectionUtils.isNotEmpty(reportDTO.getLoadFailureCases())) { + status = TestPlanReportStatus.FAILED.name(); + return status; + } + } catch (Exception e) { + status = TestPlanReportStatus.FAILED.name(); + } + } else { + status = TestPlanReportStatus.COMPLETED.name(); + } + } + } + return status; + } + private String getTestPlanReportStatus(TestPlanReport testPlanReport, TestPlanReportDataWithBLOBs testPlanReportData) { String status = TestPlanReportStatus.COMPLETED.name(); if (testPlanReport != null) { @@ -1071,4 +1141,53 @@ public class TestPlanReportService { } this.updateExecuteApis(planReportId); } + + public TestPlanSimpleReportDTO getReport(String reportId) { + TestPlanReportContentExample example = new TestPlanReportContentExample(); + example.createCriteria().andTestPlanReportIdEqualTo(reportId); + List testPlanReportContents = testPlanReportContentMapper.selectByExampleWithBLOBs(example); + if (CollectionUtils.isEmpty(testPlanReportContents)) { + return null; + } + TestPlanReportContentWithBLOBs testPlanReportContent = testPlanReportContents.get(0); + TestPlanSimpleReportDTO testPlanReportDTO = new TestPlanSimpleReportDTO(); + BeanUtils.copyBean(testPlanReportDTO, testPlanReportContent); + if (StringUtils.isNotBlank(testPlanReportContent.getFunctionResult())) { + testPlanReportDTO.setFunctionResult(JSONObject.parseObject(testPlanReportContent.getFunctionResult(), TestPlanFunctionResultReportDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getApiResult())) { + testPlanReportDTO.setApiResult(JSONObject.parseObject(testPlanReportContent.getApiResult(), TestPlanApiResultReportDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getLoadResult())) { + testPlanReportDTO.setLoadResult(JSONObject.parseObject(testPlanReportContent.getLoadResult(), TestPlanLoadResultReportDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getFunctionAllCases())) { + testPlanReportDTO.setFunctionAllCases(JSONObject.parseArray(testPlanReportContent.getFunctionAllCases(), TestPlanCaseDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getFunctionFailureCases())) { + testPlanReportDTO.setFunctionFailureCases(JSONObject.parseArray(testPlanReportContent.getFunctionFailureCases(), TestPlanCaseDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getIssueList())) { + testPlanReportDTO.setIssueList(JSONObject.parseArray(testPlanReportContent.getIssueList(), IssuesDao.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getApiAllCases())) { + testPlanReportDTO.setApiAllCases(JSONObject.parseArray(testPlanReportContent.getApiAllCases(), TestPlanFailureApiDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getApiFailureCases())) { + testPlanReportDTO.setApiFailureCases(JSONObject.parseArray(testPlanReportContent.getApiFailureCases(), TestPlanFailureApiDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getScenarioAllCases())) { + testPlanReportDTO.setScenarioAllCases(JSONObject.parseArray(testPlanReportContent.getScenarioAllCases(), TestPlanFailureScenarioDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getScenarioFailureCases())) { + testPlanReportDTO.setScenarioFailureCases(JSONObject.parseArray(testPlanReportContent.getScenarioFailureCases(), TestPlanFailureScenarioDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getLoadAllCases())) { + testPlanReportDTO.setLoadAllCases(JSONObject.parseArray(testPlanReportContent.getLoadAllCases(), TestPlanLoadCaseDTO.class)); + } + if (StringUtils.isNotBlank(testPlanReportContent.getLoadFailureCases())) { + testPlanReportDTO.setLoadFailureCases(JSONObject.parseArray(testPlanReportContent.getLoadFailureCases(), TestPlanLoadCaseDTO.class)); + } + return testPlanReportDTO; + } } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index db32ba045b..ea41f5a3c1 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1359,17 +1359,7 @@ public class TestPlanService { return envMap; } - public void exportPlanReport(String planId, HttpServletResponse response) throws UnsupportedEncodingException { - - TestPlanWithBLOBs testPlan = testPlanMapper.selectByPrimaryKey(planId); - - String reportConfig = testPlan.getReportConfig(); - JSONObject config = null; - if (StringUtils.isNotBlank(reportConfig)) { - config = JSONObject.parseObject(reportConfig); - } - TestPlanSimpleReportDTO report = getReport(planId); - + public void buildFunctionalReport(TestPlanSimpleReportDTO report, JSONObject config, String planId) { if (checkReportConfig(config, "functional")) { List allCases = null; if (checkReportConfig(config, "functional", "all")) { @@ -1393,7 +1383,9 @@ public class TestPlanService { report.setIssueList(issueList); } } + } + public void buildApiReport(TestPlanSimpleReportDTO report, JSONObject config, String planId, boolean saveResponse) { if (checkReportConfig(config, "api")) { List apiAllCases = null; List scenarioAllCases = null; @@ -1401,17 +1393,21 @@ public class TestPlanService { // 接口 apiAllCases = testPlanApiCaseService.getAllCases(planId); report.setApiAllCases(apiAllCases); - apiAllCases.forEach(item -> { - APIReportResult dbResult = apiDefinitionService.getDbResult(item.getId()); - if (dbResult != null && StringUtils.isNotBlank(dbResult.getContent())) { - item.setResponse(dbResult.getContent()); - } - }); + if (saveResponse) { + apiAllCases.forEach(item -> { + APIReportResult dbResult = apiDefinitionService.getDbResult(item.getId()); + if (dbResult != null && StringUtils.isNotBlank(dbResult.getContent())) { + item.setResponse(dbResult.getContent()); + } + }); + } //场景 scenarioAllCases = testPlanScenarioCaseService.getAllCases(planId); - scenarioAllCases.forEach((item) -> { - item.setResponse(apiScenarioReportService.get(item.getReportId())); - }); + if (saveResponse) { + scenarioAllCases.forEach((item) -> { + item.setResponse(apiScenarioReportService.get(item.getReportId())); + }); + } report.setScenarioAllCases(scenarioAllCases); } if (checkReportConfig(config, "api", "failure")) { @@ -1425,13 +1421,15 @@ public class TestPlanService { } else { apiFailureCases = testPlanApiCaseService.getFailureCases(planId); } - apiFailureCases.forEach(item -> { - APIReportResult dbResult = apiDefinitionService.getDbResult(item.getId()); - if (dbResult != null && StringUtils.isNotBlank(dbResult.getContent())) { - item.setResponse(dbResult.getContent()); - } - }); - report.setApiFailureResult(apiFailureCases); + if (saveResponse) { + apiFailureCases.forEach(item -> { + APIReportResult dbResult = apiDefinitionService.getDbResult(item.getId()); + if (dbResult != null && StringUtils.isNotBlank(dbResult.getContent())) { + item.setResponse(dbResult.getContent()); + } + }); + } + report.setApiFailureCases(apiFailureCases); // 场景 List scenarioFailureCases = null; @@ -1443,37 +1441,44 @@ public class TestPlanService { } else { scenarioFailureCases = testPlanScenarioCaseService.getFailureCases(planId); } - scenarioFailureCases.forEach((item) -> { - item.setResponse(apiScenarioReportService.get(item.getReportId())); - }); - report.setScenarioFailureResult(scenarioFailureCases); + if (saveResponse) { + scenarioFailureCases.forEach((item) -> { + item.setResponse(apiScenarioReportService.get(item.getReportId())); + }); + } + report.setScenarioFailureCases(scenarioFailureCases); } } + } + public void buildLoadReport(TestPlanSimpleReportDTO report, JSONObject config, String planId, boolean saveResponse) { if (checkReportConfig(config, "load")) { List allCases = null; if (checkReportConfig(config, "load", "all")) { allCases = testPlanLoadCaseService.getAllCases(planId); - allCases.forEach(item -> { - LoadCaseReportRequest request = new LoadCaseReportRequest(); - String reportId = item.getLoadReportId(); - request.setTestPlanLoadCaseId(item.getId()); - request.setReportId(reportId); - Boolean existReport = testPlanLoadCaseService.isExistReport(request); - if (existReport) { - LoadTestReportWithBLOBs loadTestReport = performanceReportService.getLoadTestReport(reportId); - ReportTimeInfo reportTimeInfo = performanceReportService.getReportTimeInfo(reportId); - TestPlanLoadCaseDTO.ReportDTO reportDTO = new TestPlanLoadCaseDTO.ReportDTO(); - if (loadTestReport != null) { - BeanUtils.copyBean(reportDTO, loadTestReport); + if (saveResponse) { + allCases.forEach(item -> { + LoadCaseReportRequest request = new LoadCaseReportRequest(); + String reportId = item.getLoadReportId(); + request.setTestPlanLoadCaseId(item.getId()); + request.setReportId(reportId); + Boolean existReport = testPlanLoadCaseService.isExistReport(request); + if (existReport) { + LoadTestReportWithBLOBs loadTestReport = performanceReportService.getLoadTestReport(reportId); + ReportTimeInfo reportTimeInfo = performanceReportService.getReportTimeInfo(reportId); + TestPlanLoadCaseDTO.ReportDTO reportDTO = new TestPlanLoadCaseDTO.ReportDTO(); + if (loadTestReport != null) { + BeanUtils.copyBean(reportDTO, loadTestReport); + } + if (reportTimeInfo != null) { + BeanUtils.copyBean(reportDTO, reportTimeInfo); + } + item.setResponse(reportDTO); + // todo 报告详情 } - if (reportTimeInfo != null) { - BeanUtils.copyBean(reportDTO, reportTimeInfo); - } - item.setResponse(reportDTO); - } - }); - report.setLoadAllTestCases(allCases); + }); + } + report.setLoadAllCases(allCases); } if (checkReportConfig(config, "load", "failure")) { List failureCases = null; @@ -1485,10 +1490,28 @@ public class TestPlanService { } else { failureCases = testPlanLoadCaseService.getFailureCases(planId); } - report.setLoadFailureTestCases(failureCases); + report.setLoadFailureCases(failureCases); } } - render(report, response); + } + + public TestPlanSimpleReportDTO buildPlanReport(String planId, boolean saveResponse) { + TestPlanWithBLOBs testPlan = testPlanMapper.selectByPrimaryKey(planId); + + String reportConfig = testPlan.getReportConfig(); + JSONObject config = null; + if (StringUtils.isNotBlank(reportConfig)) { + config = JSONObject.parseObject(reportConfig); + } + TestPlanSimpleReportDTO report = getReport(planId); + buildFunctionalReport(report, config, planId); + buildApiReport(report, config, planId, saveResponse); + buildLoadReport(report, config, planId, saveResponse); + return report; + } + + public void exportPlanReport(String planId, HttpServletResponse response) throws UnsupportedEncodingException { + render(buildPlanReport(planId, true), response); } public Boolean checkReportConfig(JSONObject config, String key) { @@ -1554,7 +1577,7 @@ public class TestPlanService { report.setFunctionResult(functionResult); report.setApiResult(apiResult); report.setStartTime(testPlan.getActualStartTime()); - report.setStartTime(testPlan.getActualEndTime()); + report.setEndTime(testPlan.getActualEndTime()); report.setSummary(testPlan.getReportSummary()); report.setConfig(testPlan.getReportConfig()); IssueTemplateDao template = issueTemplateService.getTemplate(testPlan.getProjectId()); diff --git a/backend/src/main/resources/db/migration/V93__v1.12_release.sql b/backend/src/main/resources/db/migration/V93__v1.12_release.sql index 0c440582a6..efd3199efa 100644 --- a/backend/src/main/resources/db/migration/V93__v1.12_release.sql +++ b/backend/src/main/resources/db/migration/V93__v1.12_release.sql @@ -223,4 +223,44 @@ END // DELIMITER ; CALL set_notice(); -DROP PROCEDURE IF EXISTS set_notice; \ No newline at end of file +DROP PROCEDURE IF EXISTS set_notice; + + +-- 保存测试报告 +ALTER TABLE test_plan_report ADD is_new TINYINT(1) NULL COMMENT 'v1.12报告改版标记'; +ALTER table test_plan_report modify `is_api_case_executing` TINYINT(1) NULL COMMENT 'is Api Case executing'; +ALTER table test_plan_report modify `is_scenario_executing` TINYINT(1) NULL COMMENT 'is scenario Case executing'; +ALTER table test_plan_report modify `is_performance_executing` TINYINT(1) NULL COMMENT 'is performance executing'; +CREATE TABLE IF NOT EXISTS `test_plan_report_content` ( + `id` VARCHAR (50) NOT NULL COMMENT 'ID', + `test_plan_report_id` VARCHAR ( 50 ) NOT NULL COMMENT 'Test plan ID', + `start_time` bigint(13) NULL, + `case_count` bigint(10) NULL, + `end_time` bigint(13) NULL, + `execute_rate` DOUBLE NULL, + `pass_rate` DOUBLE NULL, + `is_third_part_issue` TINYINT(1) NULL COMMENT 'is third part issue', + + `config` text COMMENT 'plan config (JSON format)', + `summary` text COMMENT 'summary', + + `function_result` text COMMENT 'function result (JSON format)', + `api_result` text COMMENT 'api result (JSON format)', + `load_result` text COMMENT 'api result (JSON format)', + + `function_all_cases` longtext COMMENT 'function all cases (JSON format)', + `function_failure_cases` longtext COMMENT 'function failure cases (JSON format)', + `issue_list` longtext COMMENT 'issue list (JSON format)', + + `api_all_cases` longtext COMMENT 'api all cases (JSON format)', + `api_failure_cases` longtext COMMENT 'api failure cases (JSON format)', + + `scenario_all_cases` longtext COMMENT 'scenario all cases (JSON format)', + `scenario_failure_cases` longtext COMMENT 'scenario failure cases (JSON format)', + + `load_all_Cases` longtext COMMENT 'load all cases (JSON format)', + `load_failure_cases` longtext COMMENT 'load failure cases (JSON format)', + + PRIMARY KEY ( `id` ), + UNIQUE KEY `test_plan_report_id` ( `test_plan_report_id` ) +) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE utf8mb4_general_ci; diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue index dd1b7cdca4..d5f5ff3485 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanApiReport.vue @@ -1,14 +1,14 @@