From d2ac70b4c4935de179a546b74f9d049284ff5046 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 16 May 2022 14:48:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E6=9F=A5=E8=AF=A2=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5=E6=94=BE=E5=88=B0ext=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --- .../base/mapper/TestPlanReportMapper.java | 3 --- .../base/mapper/TestPlanReportMapper.xml | 13 +------------ .../base/mapper/ext/ExtTestPlanReportMapper.java | 9 +++++++-- .../base/mapper/ext/ExtTestPlanReportMapper.xml | 13 +++++++++++++ .../metersphere/track/service/TestPlanService.java | 4 ++-- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.java index 0f55e57a55..bb02f5767e 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.java @@ -32,7 +32,4 @@ public interface TestPlanReportMapper { int updateByPrimaryKeySelective(TestPlanReport record); int updateByPrimaryKey(TestPlanReport record); - - @MapKey("id") - Map reportCount(@Param("planIds") Set planIds); } \ 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 24a7fbfa34..a2b277876a 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestPlanReportMapper.xml @@ -235,18 +235,7 @@ - + update test_plan_report 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 8ad038f8b7..99f1370873 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 @@ -1,12 +1,14 @@ package io.metersphere.base.mapper.ext; -import io.metersphere.base.domain.TestPlanReport; +import io.metersphere.api.dto.definition.ParamsDTO; import io.metersphere.track.dto.TestPlanReportDTO; import io.metersphere.track.request.report.QueryTestPlanReportRequest; -import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.MapKey; import org.springframework.data.repository.query.Param; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author song.tianyang @@ -15,4 +17,7 @@ import java.util.List; */ public interface ExtTestPlanReportMapper { List list(@Param("request")QueryTestPlanReportRequest request); + + @MapKey("id") + Map reportCount(@Param("planIds") Set planIds); } 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 790179635b..d6d57c1e59 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 @@ -140,4 +140,17 @@ + + 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 355842e63e..0462a797ff 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -147,7 +147,7 @@ public class TestPlanService { @Resource private TestCaseTestMapper testCaseTestMapper; @Resource - private TestPlanReportMapper testPlanReportMapper; + private ExtTestPlanReportMapper extTestPlanReportMapper; @Resource private TestPlanReportService testPlanReportService; @Lazy @@ -438,7 +438,7 @@ public class TestPlanService { ArrayList idList = new ArrayList<>(ids); List scheduleByResourceIds = scheduleService.getScheduleByResourceIds(idList, ScheduleGroup.TEST_PLAN_TEST.name()); Map scheduleMap = scheduleByResourceIds.stream().collect(Collectors.toMap(Schedule::getResourceId, Schedule -> Schedule)); - Map stringParamsDTOMap = testPlanReportMapper.reportCount(ids); + Map stringParamsDTOMap = extTestPlanReportMapper.reportCount(ids); testPlans.forEach(item -> { item.setExecutionTimes(stringParamsDTOMap.get(item.getId()) == null ? 0 : Integer.parseInt(stringParamsDTOMap.get(item.getId()).getValue() == null ? "0" : stringParamsDTOMap.get(item.getId()).getValue()));