yeg
2026-09-29 b78295e8da96c3e5e76befeef9582ce5273dbb74
ruoyi-admin/src/main/java/com/battery/business/runtime/RedisDeviceDiscoveryCandidateStore.java
@@ -28,6 +28,7 @@
        this.redisTemplate = redisTemplate;
    }
    /** 按设备编码 upsert 本轮检测柜候选,本轮未返回的候选保留至逻辑过期。 */
    @Override
    public synchronized void recordCabinets(List<CabinetCandidate> candidates)
    {
@@ -38,6 +39,7 @@
        save(new StoredState(CURRENT_VERSION, List.copyOf(merged.values()), current.collectors()));
    }
    /** 替换指定设备适配器实例的全部采集器候选,其它实例的候选保持不变。 */
    @Override
    public synchronized void replaceCollectors(String adapterCode, List<CollectorCandidate> candidates)
    {
@@ -49,6 +51,7 @@
        save(new StoredState(CURRENT_VERSION, current.cabinets(), merged));
    }
    /** 删除指定设备适配器实例的检测柜与采集器候选;仅供人工重置或实机联调清理。 */
    @Override
    public synchronized void removeAdapter(String adapterCode)
    {
@@ -60,6 +63,11 @@
        save(new StoredState(CURRENT_VERSION, cabinets, collectors));
    }
    /**
     * 返回指定时刻尚未过期的发现候选,并顺带清掉已逻辑过期的条目。
     *
     * <p>是否“在用”由操作员判断,适配器不自动判定。</p>
     */
    @Override
    public synchronized CandidateSnapshot snapshot(Instant now)
    {