| | |
| | | @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); |
| | |
| | | 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); |
| | | } |
| | | } |