2021与蓝度共同重构项目,服务端
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
@@ -51,6 +51,8 @@
import java.util.*;
import java.util.stream.Collectors;
import static com.sandu.ximon.admin.localMQTT.callback.StatusMqttCallBack.localMqttConnectStatusMap;
/**
 * @author chenjiantian
 * @date 2021/12/13 16:00
@@ -144,7 +146,8 @@
        // 获取最近的上报时间
        List<String> deviceCodeList = listLight.stream().map(Light::getDeviceCode).collect(Collectors.toList());
        //拆分list
//        //拆分list
        List<List<String>> split = CollectionUtil.split(deviceCodeList, 100);
        List<BatchGetDeviceStateResponse.DeviceStatus> deviceStatuses = null;
@@ -265,13 +268,17 @@
        List<Map<String, Object>> resultList = new ArrayList<>();
        for (LightControlParam param : paramList) {
            A5LightBrightnessReqInnerFrame lightControlFrame = new A5LightBrightnessReqInnerFrame(param.getBrightness(), param.getLightAddress());
            A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_LIGHT_DATA.getCode(), lightControlFrame);
            A5LightBrightnessReqInnerFrame
                    lightControlFrame = new A5LightBrightnessReqInnerFrame(param.getBrightness(), param.getLightAddress());
            A5Frame a5Frame = new A5Frame(
                    A5OrderEnum.REQUEST_LIGHT_DATA.getCode(),
                    lightControlFrame);
            Map<String, Object> map = new HashMap<>();
            try {
                map.put("deviceCode", param.getDeviceCode());
                WrapResponseCommonFrame<A5LightBrightnessRespInnerFrame> frame
                        = MainBoardInvokeSyncService.getInstance().sendRRPC(param.getDeviceCode(), a5Frame, A5LightBrightnessRespInnerFrame.class);
                        = MainBoardInvokeSyncService.getInstance().sendRRPC
                        (param.getDeviceCode(), a5Frame, A5LightBrightnessRespInnerFrame.class);
                //存储控制帧指令
                StoreOperationRecordsUtils.storeInnerFrameData(param.getDeviceCode(), "单灯帧-亮度控制", a5Frame, frame);