jinpengyong
2023-11-08 72a6d5a954312a8a53e5bdd18c5f8f8b57b54dbc
screen-api/src/main/java/com/moral/api/controller/DeviceController.java
@@ -54,8 +54,17 @@
    @Autowired
    private DeviceService deviceService;
    /**
    * @Description: 根据mac查询报警信息
            * @Param: [mac]
            * @return: com.moral.constant.ResultMessage
            * @Author: 陈凯裕
            * @Date: 2021/8/23
            */
    @GetMapping("queryAlarmByMac")
    public ResultMessage queryAlarmByMac(String mac) {
        if(mac==null)
            return new ResultMessage(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg(),null);
        List<Sensor> sensors = organizationUnitAlarmService.queryAlarmLevel(mac);
        AlarmLevelVO vo = AlarmLevelVO.convert(sensors);
        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(), vo);
@@ -135,7 +144,7 @@
        if (!params.containsKey("macs") || !params.containsKey("sensorCode") || !params.containsKey("type") || !params.containsKey("times")) {
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        List<Map<String, Object>> response = deviceService.getTrendChartData(params);
        List<Map<String, Object>> response = deviceService.getTrendChartDataV2(params);
        return ResultMessage.ok(response);
    }
}