diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index 5c695226ea..bf200a4aa5 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -182,7 +182,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl apiDefinitionExecResultService.saveApiResultByScheduleTask(testResult, ApiRunMode.SCHEDULE_API_PLAN.name()); List testPlanReportIdList = new ArrayList<>(); testPlanReportIdList.add(debugReportId); - testPlanReportService.updateReport(testPlanReportIdList,ApiRunMode.SCHEDULE_API_PLAN.name()); + testPlanReportService.updateReport(testPlanReportIdList,ApiRunMode.SCHEDULE_API_PLAN.name(),ReportTriggerMode.SCHEDULE.name()); }else { apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name()); } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 74518d25e9..380d39c2c3 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -190,7 +190,7 @@ public class ApiDefinitionService { .andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath()) .andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId()); Project project = projectMapper.selectByPrimaryKey(request.getProjectId()); - if (apiDefinitionMapper.countByExample(example) > 0 && !project.getRepeatable()) { + if (apiDefinitionMapper.countByExample(example) > 0 && (project.getRepeatable() == null || !project.getRepeatable())) { MSException.throwException(Translator.get("api_definition_url_not_repeating")); } } else { diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index 7a9b2452bc..99840996d5 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -16,6 +16,7 @@ import io.metersphere.base.mapper.ApiScenarioReportMapper; import io.metersphere.base.mapper.TestPlanApiScenarioMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioReportMapper; import io.metersphere.commons.constants.ApiRunMode; +import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.CommonBeanFactory; import io.metersphere.commons.utils.DateUtils; @@ -211,6 +212,7 @@ public class ApiScenarioReportService { TestPlanReportService testPlanReportService = CommonBeanFactory.getBean(TestPlanReportService.class); testPlanReportService.updateReport(testPlanReportIdList, ApiRunMode.SCHEDULE_SCENARIO_PLAN.name()); + testPlanReportService.updateReport(testPlanReportIdList,ApiRunMode.SCHEDULE_SCENARIO_PLAN.name(), ReportTriggerMode.SCHEDULE.name()); return lastReport; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReview.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReview.java index 145cb42127..3787996ee7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReview.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReview.java @@ -19,6 +19,8 @@ public class TestCaseReview implements Serializable { private Long endTime; + private String projectId; + private String description; private static final long serialVersionUID = 1L; diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReviewExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReviewExample.java index 551c4b23ae..1935c4c171 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReviewExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReviewExample.java @@ -563,6 +563,76 @@ public class TestCaseReviewExample { addCriterion("end_time not between", value1, value2, "endTime"); return (Criteria) this; } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReviewMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReviewMapper.xml index 54c5352f42..16691a5515 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReviewMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReviewMapper.xml @@ -9,6 +9,7 @@ + @@ -72,7 +73,7 @@ - id, `name`, creator, `status`, create_time, update_time, end_time + id, `name`, creator, `status`, create_time, update_time, end_time, project_id description @@ -128,10 +129,12 @@ insert into test_case_review (id, `name`, creator, `status`, create_time, update_time, - end_time, description) + end_time, project_id, description + ) values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, - #{endTime,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR}) + #{endTime,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR} + ) insert into test_case_review @@ -157,6 +160,9 @@ end_time, + + project_id, + description, @@ -183,6 +189,9 @@ #{endTime,jdbcType=BIGINT}, + + #{projectId,jdbcType=VARCHAR}, + #{description,jdbcType=LONGVARCHAR}, @@ -218,6 +227,9 @@ end_time = #{record.endTime,jdbcType=BIGINT}, + + project_id = #{record.projectId,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=LONGVARCHAR}, @@ -235,6 +247,7 @@ create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=VARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR} @@ -248,7 +261,8 @@ `status` = #{record.status,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, - end_time = #{record.endTime,jdbcType=BIGINT} + end_time = #{record.endTime,jdbcType=BIGINT}, + project_id = #{record.projectId,jdbcType=VARCHAR} @@ -274,6 +288,9 @@ end_time = #{endTime,jdbcType=BIGINT}, + + project_id = #{projectId,jdbcType=VARCHAR}, + description = #{description,jdbcType=LONGVARCHAR}, @@ -288,6 +305,7 @@ create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=VARCHAR}, description = #{description,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} @@ -298,7 +316,8 @@ `status` = #{status,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, - end_time = #{endTime,jdbcType=BIGINT} + end_time = #{endTime,jdbcType=BIGINT}, + project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml index d9f9bb3b42..02af9171cd 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml @@ -6,17 +6,16 @@ parameterType="io.metersphere.track.request.testreview.QueryCaseReviewRequest"> select distinct test_case_review.id, test_case_review.name, test_case_review.creator, test_case_review.status, test_case_review.create_time, test_case_review.update_time, test_case_review.end_time, - test_case_review.description, user.name as creatorName - from test_case_review join test_case_review_project on test_case_review.id = test_case_review_project.review_id - join project on test_case_review_project.project_id = project.id - left join user on test_case_review.creator = user.id + test_case_review.description, user.name as creatorName, project.name as projectName, test_case_review.project_id + from test_case_review + join project on project.id = test_case_review.project_id + left join user on test_case_review.creator = user.id and test_case_review.name like CONCAT('%', #{request.name},'%') - and project.workspace_id = #{request.workspaceId} - and test_case_review_project.project_id = #{request.projectId} + and test_case_review.project_id = #{request.projectId} @@ -30,13 +29,10 @@ \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml index 672c4f437b..1c7ab3e819 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml @@ -98,8 +98,9 @@ diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml index 0269e5f567..e0988937dc 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml @@ -202,11 +202,10 @@