yeg
2026-08-26 bf277b4aafb72df8b4eb852cf01d940f46178606
docs(device): 整理 Ticket 01 协议注释
2个文件已修改
4 ■■■■■ 已修改文件
ruoyi-device/src/main/java/com/ruoyi/device/bts/BtsTcpTransport.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-device/src/main/java/com/ruoyi/device/bts/BtsXmlCodec.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-device/src/main/java/com/ruoyi/device/bts/BtsTcpTransport.java
@@ -27,6 +27,7 @@
    private final int connectTimeoutMs;
    private final int responseTimeoutMs;
    private final int maxResponseBytes;
    // BTS TCP 会话按“单请求、单响应”工作,同一适配器实例不得并发复用连接。
    private final ReentrantLock requestLock = new ReentrantLock(true);
    private Socket socket;
ruoyi-device/src/main/java/com/ruoyi/device/bts/BtsXmlCodec.java
@@ -167,6 +167,7 @@
        Document document = parse(xml, "download_resp");
        Element download = firstElement(document, "download");
        String btsTestId = requiredAttribute(download, "testid");
        // download 是单通道响应,身份不一致时拒绝结果,避免历史事实被归入错误测试。
        if (integerAttribute(download, "devtype") != channel.devtype()
                || integerAttribute(download, "devid") != channel.devid()
                || integerAttribute(download, "subdevid") != channel.subdevid()
@@ -186,6 +187,7 @@
                    requiredAttribute(element, "steptype"), optionalLong(element, "testtime"), parseDeviceTime(rawTime), rawTime,
                    optionalDecimal(element, "volt"), optionalDecimal(element, "curr"), optionalDecimal(element, "cap"),
                    optionalDecimal(element, "eng"), dynamicMeasurements(element, HISTORY_ATTRIBUTES)));
            // 解析层保留重复和乱序事实;完整性检查按 seqid 另行判定并解释缺口。
            next = Math.max(next, sequence + 1);
        }
        return new HistoryPage(channel, btsTestId, requestedStart, next, samples);
@@ -251,6 +253,7 @@
    {
        try
        {
            // BTS 时间不带时区,按适配器配置的现场时区解释后统一转换为 UTC 时间点。
            return LocalDateTime.parse(value, BTS_TIME).atZone(deviceZone).toInstant();
        }
        catch (DateTimeParseException ex)