package com.battery.business.test.dto; import java.util.List; /** 单个测试电池及检测柜、采集器通道绑定请求。 */ public record TestBatteryBindingDto( Long testBatteryId, Long relationId, Long groupId, String batteryNo, Long collectorId, CabinetChannelDto cabinetChannel, CabinetChannelDto binding, List collectorChannels) { public TestBatteryBindingDto(Long testBatteryId, Long groupId, String batteryNo, Long collectorId, CabinetChannelDto cabinetChannel, List collectorChannels) { this(testBatteryId, null, groupId, batteryNo, collectorId, cabinetChannel, null, collectorChannels); } /** 测试电池主键;兼容只传旧页面入参别名 relationId 的调用方。 */ public Long resolvedTestBatteryId() { return testBatteryId != null ? testBatteryId : relationId; } /** 检测柜通道绑定;兼容只传旧页面入参别名 binding 的调用方。 */ public CabinetChannelDto resolvedCabinetChannel() { return cabinetChannel != null ? cabinetChannel : binding; } public record CabinetChannelDto(Long channelId, String expectedBarcode) { } public record CollectorChannelDto(String measurementCode, String measurementName, String channelCode) { } }