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 @@