diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index b5c4d27fe8..d7ba20b6af 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -503,14 +503,13 @@ public class TestPlanReportService { } TestPlanReportContentWithBLOBs content = null; try { - HttpHeaderUtils.runAsUser("admin"); + HttpHeaderUtils.runAsUser(testPlanReport.getCreator()); testPlanReport.setStatus(status); content = this.initTestPlanContent(testPlanReport, status); } catch (Exception e) { - HttpHeaderUtils.clearUser(); - testPlanReport.setStatus(status); LogUtil.error("统计测试计划状态失败!", e); } finally { + HttpHeaderUtils.clearUser(); testPlanReportMapper.updateByPrimaryKey(testPlanReport); testPlanMessageService.checkTestPlanStatusAndSendMessage(testPlanReport, content, isSendMessage); this.executeTestPlanByQueue(testPlanReportId); @@ -535,7 +534,6 @@ public class TestPlanReportService { testPlanReport.setEndTime(endTime); testPlanReport.setUpdateTime(endTime); } - TestPlanReportContentExample contentExample = new TestPlanReportContentExample(); contentExample.createCriteria().andTestPlanReportIdEqualTo(testPlanReport.getTestPlanId()); List contents = testPlanReportContentMapper.selectByExampleWithBLOBs(contentExample);