2021与蓝度共同重构项目,服务端
chenjiantian
2022-01-17 b861218460bd7d96bf638242608ecb2002299880
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
@@ -131,10 +131,11 @@
        for (LightControlParam param : paramList) {
            A5LightBrightnessReqInnerFrame lightControlFrame = new A5LightBrightnessReqInnerFrame(param.getBrightness());
            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);
            Map<String, Object> map = new HashMap<>();
            map.put("deviceCode", param.getDeviceCode());
            if (frame == null) {
                map.put("status", DeviceRespStatusEnums.OTHER_ERROR.getCode());
                resultList.add(map);
@@ -151,6 +152,10 @@
                light.setLightPercent(param.getBrightness());
                update(light, Wrappers.lambdaUpdate(Light.class).eq(Light::getDeviceCode, param.getDeviceCode()));
            }
            }catch (BusinessException e){
                map.put("status", DeviceRespStatusEnums.OTHER_ERROR.getCode());
                resultList.add(map);
            }
        }
        return resultList;