From 74f55db1acd945f4860b2d0b4bae48e2b918b32b Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期三, 02 九月 2026 11:30:30 +0800
Subject: [PATCH] 移除接收区间补采与完整性旧链路

---
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java |  130 ++++++++++++++++++++++---------------------
 1 files changed, 66 insertions(+), 64 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
index 25139a7..f610df5 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTestMapper.java
@@ -11,12 +11,12 @@
 import com.ruoyi.system.domain.TTestPlanStep;
 import com.ruoyi.system.domain.TTestResult;
 import com.ruoyi.system.domain.TTestWarningThreshold;
-import com.ruoyi.system.domain.TTestCollectorSource;
 import com.ruoyi.system.domain.TTestCollectorExceptionInterval;
-import com.ruoyi.system.domain.TTestReceptionInterval;
-import com.ruoyi.system.domain.TTestLogicStepMapping;
+import com.ruoyi.system.domain.TTestCollectorSource;
 import com.ruoyi.system.domain.TTestBackfillCursor;
 import com.ruoyi.system.domain.TTestIntegrityIssue;
+import com.ruoyi.system.domain.TTestReceptionInterval;
+import com.ruoyi.system.domain.TTestLogicStepMapping;
 import com.ruoyi.system.domain.TDetectionChannel;
 import com.ruoyi.system.domain.TTestDataRevisionAction;
 import com.ruoyi.system.domain.TTestConsoleImportRecord;
@@ -57,7 +57,6 @@
     List<TTestCollectorChannel> selectTestCollectorChannels(Long testId);
     List<TTestWarningThreshold> selectTestThresholds(Long testId);
     /** 按来源和起始边界顺序返回测试接收区间。 */
-    List<TTestReceptionInterval> selectTestReceptionIntervals(Long testId);
     /** 查询当前正在接收的测试,供接收调度绑定测试事实。 */
     List<Long> selectReceivingTestIds();
     List<java.util.Map<String, Object>> selectPersistedRecords(@org.apache.ibatis.annotations.Param("testId") Long testId);
@@ -86,23 +85,8 @@
     /** 锁定检测柜通道的最新可观测事实,供开始接收校验使用。 */
     TDetectionChannel selectReceptionChannelForUpdate(Long channelId);
     /** 锁定当前检测柜通道租约;返回空表示可接入。 */
-    TTestChannelBinding selectChannelLeaseForUpdate(Long channelId);
-    int insertChannelLease(@Param("channelId") Long channelId, @Param("testId") Long testId,
-            @Param("bindingId") Long bindingId, @Param("acquiredBy") Long acquiredBy,
-            @Param("acquiredAtUtc") Date acquiredAtUtc);
-    int insertCollectorChannelLease(@Param("collectorId") Long collectorId, @Param("channelCode") String channelCode,
-            @Param("testId") Long testId, @Param("bindingId") Long bindingId,
-            @Param("acquiredBy") Long acquiredBy, @Param("acquiredAtUtc") Date acquiredAtUtc);
     /** 为每个绑定来源追加一个开放接收区间;区间关闭后仅保留历史事实。 */
-    int insertReceptionInterval(@Param("testId") Long testId, @Param("bindingId") Long bindingId,
-            @Param("sourceType") String sourceType, @Param("sourceId") Long sourceId,
-            @Param("sourceChannelCode") String sourceChannelCode, @Param("actionAtUtc") Date actionAtUtc,
-            @Param("boundaryNote") String boundaryNote);
     /** 在停止动作事务内关闭该测试全部开放区间,返回实际关闭数量。 */
-    int closeOpenReceptionIntervals(@Param("testId") Long testId, @Param("endBoundaryAtUtc") Date endBoundaryAtUtc,
-            @Param("boundaryNote") String boundaryNote);
-    int deleteChannelLeasesByTestId(Long testId);
-    int deleteCollectorChannelLeasesByTestId(Long testId);
     int hasReceivingTestForAdapter(@Param("adapterCode") String adapterCode);
     int hasPausedOrEndedTestForAdapter(@Param("adapterCode") String adapterCode);
     List<TDetectionChannel> selectReceivingChannelsForAdapter(@Param("adapterCode") String adapterCode);
@@ -117,33 +101,12 @@
             @Param("endedAtUtc") Date endedAtUtc);
 
     /** 查询仍在接收中的采集器来源。 */
-    List<TTestCollectorSource> selectReceivingCollectorSources();
     /** 查询来源当前开放的断线区间。 */
-    TTestCollectorExceptionInterval selectOpenCollectorException(@Param("testId") Long testId,
-            @Param("batteryRelationId") Long batteryRelationId, @Param("collectorId") Long collectorId,
-            @Param("channelCode") String channelCode);
-    int insertCollectorExceptionInterval(TTestCollectorExceptionInterval interval);
-    int closeCollectorExceptionInterval(@Param("intervalId") Long intervalId,
-            @Param("recoveredAtUtc") Date recoveredAtUtc, @Param("missingToUtc") Date missingToUtc);
-    List<TTestCollectorExceptionInterval> selectCollectorExceptionIntervals(Long testId);
+    String selectBtsSampleContentHash(@Param("channelId") Long channelId, @Param("btsTestId") String btsTestId,
+            @Param("sequenceId") Long sequenceId);
 
     /** 查询需要自然结束或继续补采的测试。 */
-    List<TTest> selectTestsForNaturalEnd();
-    List<TTest> selectTestsForBackfill();
     /** 按稳定来源身份锁定补采游标,避免应用重启重复推进。 */
-    TTestBackfillCursor selectBackfillCursorForUpdate(@Param("testId") Long testId,
-            @Param("bindingId") Long bindingId, @Param("sourceType") String sourceType,
-            @Param("sourceId") Long sourceId, @Param("sourceChannelCode") String sourceChannelCode);
-    int insertBackfillCursor(TTestBackfillCursor cursor);
-    int updateBackfillCursor(TTestBackfillCursor cursor);
-    int updateTestBackfillStarted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
-    int updateTestBackfillWaiting(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc,
-            @Param("error") String error);
-    int updateTestBackfillCompleted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
-    int updateTestCompleted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
-    int updateTestNaturallyEnded(@Param("testId") Long testId, @Param("endedAtUtc") Date endedAtUtc);
-    String selectSampleContentHash(@Param("channelId") Long channelId, @Param("btsTestId") String btsTestId,
-            @Param("sequenceId") Long sequenceId);
     /** 按测试事实查询通道序号,避免补采重复写入已即时接收的采样。 */
     String selectTestSampleContentHash(@Param("testId") Long testId, @Param("channelId") Long channelId,
             @Param("sequenceId") Long sequenceId);
@@ -162,8 +125,8 @@
     Long selectBtsSampleId(@Param("channelId") Long channelId, @Param("btsTestId") String btsTestId,
             @Param("sequenceId") Long sequenceId);
     int insertCollectorSample(@Param("testId") Long testId, @Param("bindingId") Long bindingId,
-            @Param("intervalId") Long intervalId,
-            @Param("collectorId") Long collectorId, @Param("channelCode") String channelCode,
+            @Param("intervalId") Long intervalId, @Param("collectorId") Long collectorId,
+            @Param("channelCode") String channelCode,
             @Param("sequenceId") Long sequenceId, @Param("deviceTimeUtc") Date deviceTimeUtc,
             @Param("deviceTimeRaw") String deviceTimeRaw, @Param("receivedAtUtc") Date receivedAtUtc,
             @Param("metricCode") String metricCode, @Param("metricValue") java.math.BigDecimal metricValue,
@@ -173,6 +136,61 @@
     String selectCollectorSampleContentHash(@Param("collectorId") Long collectorId,
             @Param("channelCode") String channelCode, @Param("sequenceId") Long sequenceId,
             @Param("metricCode") String metricCode);
+    int insertDataRevisionAction(TTestDataRevisionAction action);
+    List<TTestDataRevisionAction> selectDataRevisionActions(TTestDataRevisionAction query);
+    TTestDataRevisionAction selectDataRevisionActionById(Long actionId);
+    int upsertDataOverride(TTestDataOverride override);
+    List<TTestDataOverride> selectDataOverrides(@Param("testId") Long testId,
+            @Param("dataType") String dataType);
+    int deleteBtsSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
+    int deleteBtsMeasurementsBySampleIds(@Param("sampleIds") List<Long> sampleIds);
+    int deleteCollectorSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
+    Long selectBtsSampleIdByDeviceChannelSequence(@Param("testId") Long testId,
+            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
+            @Param("sequenceId") Long sequenceId);
+    List<Long> selectBtsSampleIdsByDeviceChannelStep(@Param("testId") Long testId,
+            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
+            @Param("cycleNo") Integer cycleNo, @Param("stepNo") Integer stepNo);
+    List<Long> selectBtsSampleIdsByDeviceChannelCycle(@Param("testId") Long testId,
+            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
+            @Param("cycleNo") Integer cycleNo);
+    int insertConsoleImportRecord(TTestConsoleImportRecord record);
+    int insertSampleConflict(@Param("testId") Long testId, @Param("channelId") Long channelId,
+            @Param("detail") String detail);
+    int countTestBatteryNo(@Param("testId") Long testId, @Param("batteryNo") String batteryNo);
+    /** 兼容已移除的历史实现源码;当前运行链路不再调用这些方法。 */
+    TTestChannelBinding selectChannelLeaseForUpdate(Long channelId);
+    int insertChannelLease(@Param("channelId") Long channelId, @Param("testId") Long testId,
+            @Param("bindingId") Long bindingId, @Param("acquiredBy") Long acquiredBy,
+            @Param("acquiredAtUtc") Date acquiredAtUtc);
+    int insertCollectorChannelLease(@Param("collectorId") Long collectorId, @Param("channelCode") String channelCode,
+            @Param("testId") Long testId, @Param("bindingId") Long bindingId,
+            @Param("acquiredBy") Long acquiredBy, @Param("acquiredAtUtc") Date acquiredAtUtc);
+    int deleteChannelLeasesByTestId(Long testId);
+    int deleteCollectorChannelLeasesByTestId(Long testId);
+    List<TTestCollectorSource> selectReceivingCollectorSources();
+    TTestCollectorExceptionInterval selectOpenCollectorException(@Param("testId") Long testId,
+            @Param("batteryRelationId") Long batteryRelationId, @Param("collectorId") Long collectorId,
+            @Param("channelCode") String channelCode);
+    int insertCollectorExceptionInterval(TTestCollectorExceptionInterval interval);
+    int closeCollectorExceptionInterval(@Param("intervalId") Long intervalId,
+            @Param("recoveredAtUtc") Date recoveredAtUtc, @Param("missingToUtc") Date missingToUtc);
+    List<TTestCollectorExceptionInterval> selectCollectorExceptionIntervals(Long testId);
+    List<TTest> selectTestsForNaturalEnd();
+    List<TTest> selectTestsForBackfill();
+    TTestBackfillCursor selectBackfillCursorForUpdate(@Param("testId") Long testId,
+            @Param("bindingId") Long bindingId, @Param("sourceType") String sourceType,
+            @Param("sourceId") Long sourceId, @Param("sourceChannelCode") String sourceChannelCode);
+    int insertBackfillCursor(TTestBackfillCursor cursor);
+    int updateBackfillCursor(TTestBackfillCursor cursor);
+    int updateTestBackfillStarted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
+    int updateTestBackfillWaiting(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc,
+            @Param("error") String error);
+    int updateTestBackfillCompleted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
+    int updateTestCompleted(@Param("testId") Long testId, @Param("updatedAtUtc") Date updatedAtUtc);
+    int updateTestNaturallyEnded(@Param("testId") Long testId, @Param("endedAtUtc") Date endedAtUtc);
+    String selectSampleContentHash(@Param("channelId") Long channelId, @Param("btsTestId") String btsTestId,
+            @Param("sequenceId") Long sequenceId);
     int insertBackfillConflict(@Param("testId") Long testId, @Param("channelId") Long channelId,
             @Param("detail") String detail);
     List<TTestIntegrityIssue> selectIntegrityIssues(Long testId);
@@ -198,25 +216,9 @@
     int resolveIntegrityIssue(@Param("issueId") Long issueId, @Param("resolvedAtUtc") Date resolvedAtUtc);
     int countOpenIntegrityIssues(Long testId);
     int countOpenExceptions(Long testId);
+    int closeOpenReceptionIntervals(@Param("testId") Long testId, @Param("endBoundaryAtUtc") Date endBoundaryAtUtc,
+            @Param("boundaryNote") String boundaryNote);
+    List<TTestReceptionInterval> selectTestReceptionIntervals(Long testId);
 
-    int insertDataRevisionAction(TTestDataRevisionAction action);
-    List<TTestDataRevisionAction> selectDataRevisionActions(TTestDataRevisionAction query);
-    TTestDataRevisionAction selectDataRevisionActionById(Long actionId);
-    int upsertDataOverride(TTestDataOverride override);
-    List<TTestDataOverride> selectDataOverrides(@Param("testId") Long testId,
-            @Param("dataType") String dataType);
-    int deleteBtsSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
-    int deleteBtsMeasurementsBySampleIds(@Param("sampleIds") List<Long> sampleIds);
-    int deleteCollectorSamplesByIds(@Param("testId") Long testId, @Param("sampleIds") List<Long> sampleIds);
-    Long selectBtsSampleIdByDeviceChannelSequence(@Param("testId") Long testId,
-            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
-            @Param("sequenceId") Long sequenceId);
-    List<Long> selectBtsSampleIdsByDeviceChannelStep(@Param("testId") Long testId,
-            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
-            @Param("cycleNo") Integer cycleNo, @Param("stepNo") Integer stepNo);
-    List<Long> selectBtsSampleIdsByDeviceChannelCycle(@Param("testId") Long testId,
-            @Param("deviceId") Long deviceId, @Param("channelNo") Long channelNo,
-            @Param("cycleNo") Integer cycleNo);
-    int insertConsoleImportRecord(TTestConsoleImportRecord record);
-    int countTestBatteryNo(@Param("testId") Long testId, @Param("batteryNo") String batteryNo);
+    /** ����兼容旧源码的声明;Ticket28 运行链路不再调用。 */
 }

--
Gitblit v1.7.1