From 53c18d2fdc8cea108af23d6f36dc1923d367152e Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 24 Oct 2022 21:00:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4api?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=E7=89=88=E6=9C=AC=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001018778 --user=郭雨琦 --- .../java/io/metersphere/service/MsHashTreeService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java index de70a8798b..ead64e964d 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java @@ -4,6 +4,8 @@ import io.metersphere.api.dto.automation.ApiScenarioDTO; import io.metersphere.api.dto.definition.ApiDefinitionResult; import io.metersphere.api.dto.definition.ApiTestCaseInfo; import io.metersphere.api.dto.definition.request.ElementUtil; +import io.metersphere.base.domain.Project; +import io.metersphere.base.mapper.ProjectMapper; import io.metersphere.service.definition.ApiDefinitionService; import io.metersphere.service.definition.ApiTestCaseService; import io.metersphere.base.domain.ApiScenarioWithBLOBs; @@ -36,6 +38,9 @@ public class MsHashTreeService { @Resource private ExtApiScenarioMapper extApiScenarioMapper; + @Resource + private ProjectMapper projectMapper; + public static final String CASE = "CASE"; public static final String REFERENCED = "referenced"; public static final String REF = "REF"; @@ -163,6 +168,9 @@ public class MsHashTreeService { } else { if (StringUtils.equalsIgnoreCase(element.optString(REFERENCED), "Copy")) { ApiDefinitionResult definitionWithBLOBs = apiDefinitionService.getById(element.optString(ID)); + Project project = projectMapper.selectByPrimaryKey(definitionWithBLOBs.getProjectId()); + definitionWithBLOBs.setProjectName(project.getName()); + definitionWithBLOBs.setVersionEnable(project.getVersionEnable()); if (definitionWithBLOBs != null) { element.put(ID, definitionWithBLOBs.getId()); this.setElement(element, definitionWithBLOBs.getNum(), enable, definitionWithBLOBs.getVersionName(), definitionWithBLOBs.getVersionEnable());