ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
@@ -59,6 +59,7 @@
import javax.annotation.Resource;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -101,21 +102,8 @@
    @Override
    public List<BoxInfoReceiver> getBoxList() {
        List<ArdServerInfo> ardServerInfos = ardServerService.selectArdServerManagementList(new ArdServerInfo());
        return ardServerInfos.stream()
                .flatMap(ardServerInfo -> {
                    String baseUrl = "http://" + ardServerInfo.getHost() + ":" + ardServerInfo.getHttpPort();
                    try {
                        List<BoxInfoReceiver> boxes = tyClient.getBoxList(baseUrl).getContent();
                        return Optional.ofNullable(boxes).orElse(Collections.emptyList()).stream();
                    } catch (Exception e) {
                        log.error("获取云盒列表失败: {}", baseUrl, e);
                        return Stream.empty();
                    }
                })
                .collect(Collectors.toList());
        return getBoxList(ardServerInfos);
    }
    /**
     * 获取直播地址
@@ -851,6 +839,39 @@
        }
    }
    /**
     * 根据boxSn获取六合盒子列表
     * @return List<BoxInfoReceiver>
     */
    @Override
    public List<BoxInfoReceiver> getBoxSnToList(String id) {
        ArdServerInfo ardServerInfos = ardServerService.selectArdServerManagementById(id);
        String baseUrl = "http://" + ardServerInfos.getHost() + ":" + ardServerInfos.getHttpPort();
        List<BoxInfoReceiver> lisbox = new ArrayList<>();
        try {
            lisbox = tyClient.getBoxList(baseUrl).getContent();
            return lisbox;
        } catch (Exception e) {
            log.error("获取云盒列表失败: {}", baseUrl, e);
            return lisbox;
        }
    }
    private List<BoxInfoReceiver> getBoxList(List<ArdServerInfo> ls) {
        return ls.stream()
                .flatMap(ardServerInfo -> {
                    String baseUrl = "http://" + ardServerInfo.getHost() + ":" + ardServerInfo.getHttpPort();
                    try {
                        List<BoxInfoReceiver> boxes = tyClient.getBoxList(baseUrl).getContent();
                        return Optional.ofNullable(boxes).orElse(Collections.emptyList()).stream();
                    } catch (Exception e) {
                        log.error("获取云盒列表失败: {}", baseUrl, e);
                        return Stream.empty();
                    }
                })
                .collect(Collectors.toList());
    }
    //公共日志打印
    private void logPrint(String message, Object obj) {
        log.debug("收到{}回复{}", message, obj);