From 6bfe966372f0f772772fbfef3e74250e75e0dce3 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 9 Apr 2024 20:43:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1038927 --user=王孝刚 【项目任务中心】实时任务-接口用例-模糊搜索内容不正确 https://www.tapd.cn/55049933/s/1492239 --- .../metersphere/api/mapper/ExtApiReportMapper.xml | 12 +++++++++--- .../api/mapper/ExtApiScenarioReportMapper.xml | 13 ++++++++++--- .../system/dto/taskcenter/TaskCenterDTO.java | 3 +++ .../metersphere/system/mapper/ExtScheduleMapper.xml | 2 +- .../system/service/TaskCenterService.java | 3 ++- frontend/src/models/projectManagement/taskCenter.ts | 1 + .../taskCenter/component/apiCase.vue | 4 ++-- 7 files changed, 28 insertions(+), 10 deletions(-) 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 9817d15f94..0347c695af 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 @@ -161,6 +161,11 @@ CASE WHEN api_report.integrated = 0 THEN c.num ELSE api_report.id + END AS resourceNum, + + CASE + WHEN api_report.integrated = 0 THEN + c.id ELSE api_report.id END AS resourceId, CASE @@ -182,9 +187,10 @@ #{projectId} - and ( - api_report.name like concat('%', #{request.keyword},'%') - or c.name like concat('%', #{request.keyword},'%') + and ( (api_report.name like concat('%', #{request.keyword},'%') + and c.name like concat('%', #{request.keyword},'%')) + or (api_report.id like concat('%', #{request.keyword},'%') + and 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 711156e4de..fd9cf3c223 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 @@ -152,13 +152,18 @@ CASE WHEN api_scenario_report.integrated = 0 THEN s.num ELSE api_scenario_report.id - END AS resourceId, + END AS resourceNum, CASE WHEN api_scenario_report.integrated = 0 THEN s.NAME ELSE api_scenario_report.NAME END AS resourceName, + CASE + WHEN api_scenario_report.integrated = 0 THEN + s.id ELSE api_scenario_report.id + END AS resourceId, + t.name as poolName from api_scenario_report left join api_scenario_record a on api_scenario_report.id = a.api_scenario_report_id @@ -173,8 +178,10 @@ and ( - api_scenario_report.name like concat('%', #{request.keyword},'%') - or s.name like concat('%', #{request.keyword},'%') + (api_scenario_report.name like concat('%', #{request.keyword},'%') + and s.name like concat('%', #{request.keyword},'%')) + or (api_scenario_report.id like concat('%', #{request.keyword},'%') + and s.num like concat('%', #{request.keyword},'%')) ) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java index c7a69889fc..e8e272a499 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/TaskCenterDTO.java @@ -31,6 +31,9 @@ public class TaskCenterDTO implements Serializable { @Schema(description = "资源Id 单独报告显示模块业务id 集合报告显示报告id") private String resourceId; + @Schema(description = "资源编号 单独报告显示模块编号 集合报告显示报告编号") + private String resourceNum; + @Schema(description = "资源名称 单独报告显示模块名称 集合报告显示报告名称") private String resourceName; diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml index 2b348e8366..36ae0fbf8a 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtScheduleMapper.xml @@ -50,7 +50,7 @@ and ( task.resource_name like concat('%', #{request.keyword},'%') or - task.resource_id like concat('%', #{request.keyword},'%') + task.resource_num like concat('%', #{request.keyword},'%') ) 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 04d3521074..2fb378d799 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 @@ -13,6 +13,7 @@ import io.metersphere.system.dto.taskcenter.TaskCenterScheduleDTO; import io.metersphere.system.dto.taskcenter.enums.ScheduleTagType; import io.metersphere.system.dto.taskcenter.request.TaskCenterSchedulePageRequest; import io.metersphere.system.mapper.*; +import io.metersphere.system.schedule.BaseScheduleJob; import io.metersphere.system.schedule.ScheduleService; import io.metersphere.system.utils.PageUtils; import io.metersphere.system.utils.Pager; @@ -206,7 +207,7 @@ public class TaskCenterService { schedule.setEnable(!schedule.getEnable()); scheduleService.editSchedule(schedule); scheduleService.addOrUpdateCronJob(schedule, new JobKey(schedule.getKey(), schedule.getJob()), - new TriggerKey(schedule.getKey(),schedule.getJob()), schedule.getJob().getClass()); + new TriggerKey(schedule.getKey(),schedule.getJob()), BaseScheduleJob.class); } diff --git a/frontend/src/models/projectManagement/taskCenter.ts b/frontend/src/models/projectManagement/taskCenter.ts index c6bbea0765..41b1b3417d 100644 --- a/frontend/src/models/projectManagement/taskCenter.ts +++ b/frontend/src/models/projectManagement/taskCenter.ts @@ -5,6 +5,7 @@ export interface RealTaskCenterApiCaseItem { projectId: string; id: string; resourceId: string; + resourceNum: number; // 资源业务id resourceName: string; // 资源名称 单独报告显示模块名称 集合报告显示报告名称 triggerMode: string; // 触发模式(手动,定时,批量,测试计划) poolName: string; // 资源池名称 diff --git a/frontend/src/views/project-management/taskCenter/component/apiCase.vue b/frontend/src/views/project-management/taskCenter/component/apiCase.vue index cfd7639879..ccb0ee10b2 100644 --- a/frontend/src/views/project-management/taskCenter/component/apiCase.vue +++ b/frontend/src/views/project-management/taskCenter/component/apiCase.vue @@ -193,8 +193,8 @@ const columns: MsTableColumn = [ { title: 'project.taskCenter.resourceID', - dataIndex: 'resourceId', - slotName: 'resourceId', + dataIndex: 'resourceNum', + slotName: 'resourceNum', width: 200, showTooltip: true, showDrag: false,