yeg
2026-09-09 a011865a0989b51d5818f2791d04790b6408acd1
battery-business/src/main/java/com/battery/business/service/impl/TestConsoleDataServiceImpl.java
@@ -310,6 +310,12 @@
        }
        if ("REALTIME".equals(type))
        {
            // 相对时长是来源事实,独立于绝对设备时间;旧记录缺失不补算。
            BigDecimal relativeTime = importMetric(row, "relativeTimeSeconds");
            if (relativeTime != null && relativeTime.signum() < 0) throw new ServiceException("列「记录时间(h:min:s.ms)」:不能为负数");
            Map<String, Object> extension = new LinkedHashMap<>();
            extension.put("relativeTimeSeconds", relativeTime);
            values.put("extension_measurements_json", JSON.toJSONString(extension));
            values.put("cabinet_sequence_id", importInteger(row, "sequenceId", "记录序号", 9007199254740991L));
            for (String field : List.of("devtype", "devid", "subdevid", "chlid")) values.put("cabinet_" + field, binding.get(field));
            // 导入不是轮询采样;同秒可有不同记录,设备时间不能为槽位唯一性而偏移。
@@ -360,6 +366,7 @@
    private String metricLabel(String field)
    {
        return switch (field) {
            case "relativeTimeSeconds" -> "记录时间(h:min:s.ms)";
            case "voltage" -> "电压(V)"; case "current" -> "电流(A)"; case "capacity" -> "容量(Ah)"; case "energy" -> "能量(Wh)";
            case "temperature" -> "温度(℃)"; case "positivePotential" -> "正电位(V)"; case "negativePotential" -> "负电位(V)";
            case "endVoltage" -> "终止电压(V)"; case "startVoltage" -> "起始电压(V)"; case "stepDuration" -> "工步时间";