From b7780e95ace86db4c92a91bc0aa739bdfba49aee Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期一, 31 八月 2026 10:08:50 +0800
Subject: [PATCH] 整理 Ticket14 验收后业务注释

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java     |    1 +
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestBackfillServiceImpl.java  |    5 +++++
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestIntegrityServiceImpl.java |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java
index 5f4e359..f87fa4d 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java
@@ -26,6 +26,7 @@
     @GetMapping("/{testId}/live-state")
     public AjaxResult liveState(@PathVariable Long testId) { return success(liveService.current(testId)); }
 
+    /** 查询测试完整性问题和可追溯的历史异常事实。 */
     @PreAuthorize("@ss.hasPermi('system:test:query')")
     @GetMapping("/{testId}/integrity")
     public AjaxResult integrity(@PathVariable Long testId) { return success(integrityService.selectIssues(testId)); }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestBackfillServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestBackfillServiceImpl.java
index b886001..8e725bf 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestBackfillServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestBackfillServiceImpl.java
@@ -55,6 +55,7 @@
         this.transactionTemplate = new TransactionTemplate(transactionManager);
     }
 
+    /** 将已自然结束的设备事实转为待补采测试,并关闭其开放接收区间。 */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void reconcileNaturalEnd()
@@ -78,6 +79,7 @@
         }
     }
 
+    /** 恢复等待中的历史补采;完整性未确认时继续保持完成确认中。 */
     @Override
     public void resumePendingBackfill()
     {
@@ -93,6 +95,7 @@
         }
     }
 
+    /** 记录自然结束并释放租约;测试完成状态由后续补采完整性门禁确认。 */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void endNaturally(Long testId, String reason)
@@ -108,6 +111,7 @@
                         "receptionStatus", "ENDED", "reason", reason == null ? "NATURAL_FINISH" : reason)));
     }
 
+    /** 补采全部来源历史,只有完整性和异常检查通过后才写入检测完成。 */
     @Transactional(rollbackFor = Exception.class)
     protected void backfill(TTest test)
     {
@@ -253,6 +257,7 @@
 
     private boolean checkIntegrity(TTest test, Date checkedAt)
     {
+        // 序号只在同一来源、同一接收区间内比较;区间边界和暂停间隔不构成缺口。
         boolean complete = true;
         for (TTestReceptionInterval interval : mapper.selectTestReceptionIntervals(test.getTestId()))
         {
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestIntegrityServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestIntegrityServiceImpl.java
index d445727..59d037e 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestIntegrityServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestIntegrityServiceImpl.java
@@ -18,6 +18,7 @@
     public TestIntegrityServiceImpl(TTestMapper mapper, ITTestService tests)
     { this.mapper = mapper; this.tests = tests; }
 
+    /** 返回持久化完整性问题和历史异常事实,不把实时快照当作最终结果。 */
     @Override
     public List<TTestIntegrityIssue> selectIssues(Long testId)
     {

--
Gitblit v1.7.1