From 9d0f5be85b5e80448fdc63c2943abf7222d2ce5a Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Sun, 23 Apr 2023 17:01:23 +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=E6=8A=A5=E5=91=8A=E7=8A=B6=E6=80=81=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025715 --user=赵勇 【测试跟踪】测试计划-关联接口场景-执行-测试计划内场景一直为Running状态,实际已执行完成 https://www.tapd.cn/55049933/s/1365815 Signed-off-by: fit2-zhao --- .../scenario/ApiScenarioReportService.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java index d96188c8e6..b5328c5f9e 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java @@ -256,27 +256,27 @@ public class ApiScenarioReportService { return report; } - public ApiScenarioReport editReport(String reportType, String reportId, String status, String runMode) { - ApiScenarioReport report = apiScenarioReportMapper.selectByPrimaryKey(reportId); - if (report != null) { - if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString()) - || StringUtils.equals(report.getStatus(), ApiReportStatus.STOPPED.name())) { - return report; - } - ApiScenarioReportWithBLOBs bloBs = new ApiScenarioReportWithBLOBs(); - if (StringUtils.equals(runMode, CommonConstants.CASE)) { - bloBs.setTriggerMode(TriggerMode.MANUAL.name()); - } - bloBs.setId(reportId); - bloBs.setStatus(status); - bloBs.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis())); - bloBs.setEndTime(System.currentTimeMillis()); - bloBs.setUpdateTime(System.currentTimeMillis()); - if (StringUtils.isNotEmpty(report.getTriggerMode()) && report.getTriggerMode().equals(CommonConstants.CASE)) { - bloBs.setTriggerMode(TriggerMode.MANUAL.name()); - } - apiScenarioReportMapper.updateByPrimaryKeySelective(bloBs); + public ApiScenarioReportWithBLOBs editReport(String reportType, String reportId, String status, String runMode) { + ApiScenarioReportWithBLOBs report = apiScenarioReportMapper.selectByPrimaryKey(reportId); + if (report == null) { + report = new ApiScenarioReportWithBLOBs(); + report.setId(reportId); } + if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString()) + || StringUtils.equals(report.getStatus(), ApiReportStatus.STOPPED.name())) { + return report; + } + if (StringUtils.equals(runMode, CommonConstants.CASE)) { + report.setTriggerMode(TriggerMode.MANUAL.name()); + } + report.setStatus(status); + report.setName(report.getScenarioName() + "-" + DateUtils.getTimeStr(System.currentTimeMillis())); + report.setEndTime(System.currentTimeMillis()); + report.setUpdateTime(System.currentTimeMillis()); + if (StringUtils.isNotEmpty(report.getTriggerMode()) && report.getTriggerMode().equals(CommonConstants.CASE)) { + report.setTriggerMode(TriggerMode.MANUAL.name()); + } + apiScenarioReportMapper.updateByPrimaryKeySelective(report); return report; }