From 13b683d6719b14cb2a760031c82afa624364ca0a Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Tue, 4 Jun 2024 15:36:19 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?=
=?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/mapper/ExtApiReportMapper.xml | 15 ++--
.../api/mapper/ExtApiScenarioReportMapper.xml | 20 +++--
.../api/service/ApiTaskCenterService.java | 18 ++--
.../controller/TaskCenterController.java | 37 +++++++++
.../system/mapper/ExtRealMapper.java | 13 +++
.../system/mapper/ExtRealMapper.xml | 41 +++++++++
.../system/mapper/ExtScheduleMapper.java | 2 +
.../system/mapper/ExtScheduleMapper.xml | 83 +++++++++++--------
.../system/service/TaskCenterService.java | 73 +++++++++++++---
.../TaskCenterScheduleControllerTests.java | 11 ++-
.../modules/project-management/taskCenter.ts | 46 ++++++++++
.../requrls/project-management/taskCenter.ts | 8 ++
.../taskCenter/component/scheduledTask.vue | 17 ----
13 files changed, 294 insertions(+), 90 deletions(-)
create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtRealMapper.java
create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtRealMapper.xml
diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml
index 4b8c8d5321..16aa9b18bf 100644
--- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml
+++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml
@@ -191,14 +191,15 @@
LEFT JOIN test_resource_pool t ON ar.pool_id = t.id
left join project on ar.project_id = project.id
where
- ar.test_plan_id = 'NONE'
- and ar.start_time BETWEEN #{startTime} AND #{endTime}
+ ar.start_time BETWEEN #{startTime} AND #{endTime}
- and
- ar.project_id IN
-
- #{projectId}
-
+
+ and
+ ar.project_id IN
+
+ #{projectId}
+
+
and ( if(ar.integrated, ar.id, c.num) like concat('%', #{request.keyword},'%')
diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml
index c92d87cdae..aca12b5ff4 100644
--- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml
+++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml
@@ -163,18 +163,20 @@
INNER JOIN api_scenario s on a.api_scenario_id = s.id
left JOIN test_resource_pool t on asr.pool_id = t.id
left join project on asr.project_id = project.id
- where asr.test_plan_id = 'NONE'
- and asr.start_time BETWEEN #{startTime} AND #{endTime}
- and
- asr.project_id IN
-
- #{projectId}
-
+ where asr.start_time BETWEEN #{startTime} AND #{endTime}
+
+ and
+ asr.project_id IN
+
+ #{projectId}
+
+
+
and (
if(asr.integrated, asr.id, s.num) like concat('%', #{request.keyword},'%')
- or if(asr.integrated, asr.name,s.name) like concat('%', #{request.keyword},'%')
- )
+ or if(asr.integrated, asr.name,s.name) like concat('%', #{request.keyword},'%')
+ )
diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java
index 382476a4a2..b7414422b7 100644
--- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java
+++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java
@@ -99,7 +99,7 @@ public class ApiTaskCenterService {
public Pager> getProjectPage(TaskCenterPageRequest request, String projectId) {
checkProjectExist(projectId);
List projectList = getProjectOption(projectId);
- return createTaskCenterPager(request, projectList);
+ return createTaskCenterPager(request, projectList, false);
}
/**
@@ -111,7 +111,7 @@ public class ApiTaskCenterService {
public Pager> getOrganizationPage(TaskCenterPageRequest request, String organizationId) {
checkOrganizationExist(organizationId);
List projectList = getOrgProjectList(organizationId);
- return createTaskCenterPager(request, projectList);
+ return createTaskCenterPager(request, projectList, false);
}
/**
@@ -122,22 +122,22 @@ public class ApiTaskCenterService {
*/
public Pager> getSystemPage(TaskCenterPageRequest request) {
List projectList = getSystemProjectList();
- return createTaskCenterPager(request, projectList);
+ return createTaskCenterPager(request, projectList, true);
}
- private Pager> createTaskCenterPager(TaskCenterPageRequest request, List projectList) {
+ private Pager> createTaskCenterPager(TaskCenterPageRequest request, List projectList, boolean isSystem) {
Page
+
\ No newline at end of file
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/TaskCenterService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/TaskCenterService.java
index aa58d28174..61aa402a35 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/TaskCenterService.java
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/TaskCenterService.java
@@ -8,6 +8,7 @@ import io.metersphere.sdk.constants.HttpMethodConstants;
import io.metersphere.sdk.constants.PermissionConstants;
import io.metersphere.sdk.constants.TaskCenterResourceType;
import io.metersphere.sdk.exception.MSException;
+import io.metersphere.sdk.util.DateUtils;
import io.metersphere.sdk.util.SubListUtils;
import io.metersphere.sdk.util.Translator;
import io.metersphere.system.domain.Organization;
@@ -93,6 +94,8 @@ public class TaskCenterService {
ApiScheduleNoticeService apiScheduleNoticeService;
@Resource
UserMapper userMapper;
+ @Resource
+ ExtRealMapper extRealMapper;
private static final String CREATE_TIME_SORT = "create_time desc";
@@ -101,33 +104,31 @@ public class TaskCenterService {
public Pager> getProjectSchedulePage(TaskCenterSchedulePageRequest request, String projectId) {
checkProjectExist(projectId);
List projectList = getProjectOption(projectId);
- return createTaskCenterSchedulePager(request, projectList);
+ return createTaskCenterSchedulePager(request, projectList, false);
}
public Pager> getOrgSchedulePage(TaskCenterSchedulePageRequest request, String organizationId) {
checkOrganizationExist(organizationId);
List projectList = getOrgProjectList(organizationId);
- return createTaskCenterSchedulePager(request, projectList);
+ return createTaskCenterSchedulePager(request, projectList, false);
}
public Pager> getSystemSchedulePage(TaskCenterSchedulePageRequest request) {
List projectList = getSystemProjectList();
- return createTaskCenterSchedulePager(request, projectList);
+ return createTaskCenterSchedulePager(request, projectList, true);
}
- private Pager> createTaskCenterSchedulePager(TaskCenterSchedulePageRequest request, List projectList) {
+ private Pager> createTaskCenterSchedulePager(TaskCenterSchedulePageRequest request, List projectList, boolean isSystem) {
Page