From df74750df6f6f0397567af697d72e077ad569087 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Wed, 15 Mar 2023 15:09:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA)?= =?UTF-8?q?=EF=BC=9A1=E6=96=B0=E5=A2=9E=E5=85=B3=E8=81=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=AF=BC=E8=87=B4=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=EF=BC=8C2=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E7=94=A8=E4=BE=8B=E6=A0=87=E9=A2=98=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024444 --user=王旭 【测试跟踪】用例评审-关联垮项目用例-用例评审结果为终态-评审列表状态仍为进行中 https://www.tapd.cn/55049933/s/1350520 --bug=1024244 --user=王旭 【测试跟踪】用例复制,标题为超长文本时复制展示错位 https://www.tapd.cn/55049933/s/1350513 --- .../TestReviewTestCaseController.java | 4 -- .../service/TestCaseReviewService.java | 7 +++- .../service/TestReviewTestCaseService.java | 11 ++--- test-track/frontend/src/api/testCase.js | 3 -- .../business/case/components/BatchMove.vue | 41 ++++++++++++++++++- .../business/case/components/TestCaseEdit.vue | 2 +- .../components/TestReviewTestCaseList.vue | 10 +---- 7 files changed, 52 insertions(+), 26 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java index 1c60148849..491a388f75 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java @@ -104,9 +104,5 @@ public class TestReviewTestCaseController { testReviewTestCaseService.updateOrder(request); } - @GetMapping("/auto-check/{caseId}") - public void autoCheck(@PathVariable String caseId) { - testReviewTestCaseService.checkStatus(caseId); - } } diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseReviewService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseReviewService.java index 9c9d2d17ff..4526910521 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseReviewService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseReviewService.java @@ -144,6 +144,9 @@ public class TestCaseReviewService { request.setReviewerId(SessionUtils.getUserId()); } List list = extTestCaseReviewMapper.list(request); + list.forEach(testCaseReviewDTO -> { + testReviewTestCaseService.checkStatus(testCaseReviewDTO); + }); calcReviewRate(list); setReviews(list); return list; @@ -521,11 +524,11 @@ public class TestCaseReviewService { } TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(request.getReviewId()); - if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name()) - || StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Completed.name())) { + if (StringUtils.equals(testCaseReview.getStatus(), TestCaseReviewStatus.Prepare.name())) { testCaseReview.setStatus(TestCaseReviewStatus.Underway.name()); testCaseReviewMapper.updateByPrimaryKey(testCaseReview); } + } public List getTestCaseReviewerIds(String reviewId) { diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java index 7daf743b94..89fa184f02 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java @@ -15,6 +15,7 @@ import io.metersphere.constants.TestCaseCommentType; import io.metersphere.constants.TestCaseReviewCommentStatus; import io.metersphere.constants.TestCaseReviewPassRule; import io.metersphere.dto.TestCaseCommentDTO; +import io.metersphere.dto.TestCaseReviewDTO; import io.metersphere.dto.TestReviewCaseDTO; import io.metersphere.excel.converter.TestReviewCaseStatus; import io.metersphere.log.vo.DetailColumn; @@ -768,16 +769,16 @@ public class TestReviewTestCaseService { /** * 检查执行结果,自动更新计划状态 - * @param caseId + * @param testCaseReviewDTO */ - public void checkStatus(String caseId) { - TestCaseReview testCaseReview = testCaseReviewMapper.selectByPrimaryKey(caseId); - if (testCaseReview.getEndTime() != null && testCaseReview.getEndTime() < System.currentTimeMillis()) { + public void checkStatus(TestCaseReviewDTO testCaseReviewDTO) { + if (testCaseReviewDTO.getEndTime() != null && testCaseReviewDTO.getEndTime() < System.currentTimeMillis() && !testCaseReviewDTO.getStatus().equals(TestPlanStatus.Finished.name())) { TestCaseReviewExample example = new TestCaseReviewExample(); - example.createCriteria().andIdEqualTo(caseId); + example.createCriteria().andIdEqualTo(testCaseReviewDTO.getId()); TestCaseReview review = new TestCaseReview(); review.setStatus(TestPlanStatus.Finished.name()); testCaseReviewMapper.updateByExampleSelective(review,example); + testCaseReviewDTO.setStatus(TestPlanStatus.Finished.name()); } } } diff --git a/test-track/frontend/src/api/testCase.js b/test-track/frontend/src/api/testCase.js index e0ad521c07..0d90c90083 100644 --- a/test-track/frontend/src/api/testCase.js +++ b/test-track/frontend/src/api/testCase.js @@ -273,6 +273,3 @@ export function checkProjectPermission(projectId) { return get(BASE_URL + "check/permission/" + projectId); } -export function testCaseAutoCheck(caseId) { - return get(`/test/review/case/auto-check/${caseId}`); -} diff --git a/test-track/frontend/src/business/case/components/BatchMove.vue b/test-track/frontend/src/business/case/components/BatchMove.vue index fbc4374d95..d3c1289770 100644 --- a/test-track/frontend/src/business/case/components/BatchMove.vue +++ b/test-track/frontend/src/business/case/components/BatchMove.vue @@ -1,12 +1,23 @@