From 12498f9691ede2af27b240b187dc5994f9133302 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 30 Jan 2023 16:17:23 +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=E8=AE=A1=E5=88=92=E8=84=91=E5=9B=BE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=94=A8=E4=BE=8B=E5=90=8E=E6=89=A7=E8=A1=8C=E4=BA=BA?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022024 --user=陈建星 【测试跟踪】github#21405,测试计划内的case,在脑图模式下更新用例执行结果,用例执行人没有更新。 https://www.tapd.cn/55049933/s/1328983 --- .../plan/service/TestPlanTestCaseService.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java index c5c5cfef92..42a30c7f16 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanTestCaseService.java @@ -182,6 +182,17 @@ public class TestPlanTestCaseService { //记录功能用例执行信息 functionCaseExecutionInfoService.insertExecutionInfo(testPlanTestCase.getId(), testPlanTestCase.getStatus()); } + setUpdateCaseExecutor(testPlanTestCase); + + testPlanTestCase.setUpdateTime(System.currentTimeMillis()); + testPlanTestCase.setRemark(null); + testPlanTestCaseMapper.updateByPrimaryKeySelective(testPlanTestCase); + testCaseService.updateLastExecuteStatus(testPlanTestCase.getCaseId(), testPlanTestCase.getStatus()); + + saveComment(testPlanTestCase); + } + + private void setUpdateCaseExecutor(TestPlanTestCaseWithBLOBs testPlanTestCase) { if (StringUtils.isNotBlank(testPlanTestCase.getStatus())) { TestPlanTestCaseWithBLOBs originData = testPlanTestCaseMapper.selectByPrimaryKey(testPlanTestCase.getId()); if (!StringUtils.equals(originData.getStatus(), testPlanTestCase.getStatus())) { @@ -189,12 +200,6 @@ public class TestPlanTestCaseService { testPlanTestCase.setExecutor(SessionUtils.getUser().getId()); } } - testPlanTestCase.setUpdateTime(System.currentTimeMillis()); - testPlanTestCase.setRemark(null); - testPlanTestCaseMapper.updateByPrimaryKeySelective(testPlanTestCase); - testCaseService.updateLastExecuteStatus(testPlanTestCase.getCaseId(), testPlanTestCase.getStatus()); - - saveComment(testPlanTestCase); } private void saveComment(TestPlanFuncCaseEditRequest testPlanTestCase) { @@ -451,6 +456,7 @@ public class TestPlanTestCaseService { public void editTestCaseForMinder(List testPlanTestCases) { testPlanTestCases.forEach(item -> { item.setUpdateTime(System.currentTimeMillis()); + setUpdateCaseExecutor(item); testPlanTestCaseMapper.updateByPrimaryKeySelective(item); testCaseService.updateLastExecuteStatus(item.getCaseId(), item.getStatus()); });