| | |
| | | package com.yssh.controller; |
| | | |
| | | import com.yssh.entity.Qxsh; |
| | | import com.yssh.utils.CacheUtils; |
| | | import com.yssh.utils.DateUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | |
| | | import com.yssh.utils.Result; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = "告警分析") |
| | | @RequestMapping("/warning") |
| | |
| | | @Resource |
| | | private WarningAnalyseService warningService; |
| | | |
| | | /** |
| | | * 1.查询当前时间的所有点位value值(以47.dat查询即可) |
| | | * 2.筛选大于yssh_bjyj中的jcbj字段的值 返回id+经纬度+value |
| | | */ |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "获取实时报警", notes = "获取实时报警分析数据") |
| | | @GetMapping("/runAlarm") |
| | |
| | | return Result.OK(warningService.getRunTimeAlarmAnalyse()); |
| | | } |
| | | |
| | | /** |
| | | * 1.查询当前时间的所有点位value值(以47.dat查询即可) |
| | | * 2.筛选大于yssh_bjyj中的jcyj字段的值 返回id+经纬度+value |
| | | */ |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "获取实时预警", notes = "获取实时预警分析数据") |
| | | @GetMapping("/runWarning") |
| | |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "本月预警、报警统计", notes = "本月预警、报警统计,返回参数alarmNumber对应值为本月报警数据量,参数warningNumber对应值为本月预警数据量") |
| | | @ApiOperation(value = "本月预警报警统计", notes = "本月预警报警统计,返回参数alarmNumber对应值为本月报警数据量,参数warningNumber对应值为本月预警数据量") |
| | | @GetMapping("/monthCount") |
| | | public Result thisMonthCount() { |
| | | return Result.OK(warningService.countThisMonthAlarmAndWarning()); |
| | | public Result thisMonthCount(@RequestParam(value = "end", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | return Result.OK(warningService.monthCount(null == date ? new Date() : date)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 4) |
| | |
| | | if (null == begin || null == end) { |
| | | return Result.error(null); |
| | | } |
| | | |
| | | if (begin.getTime() > end.getTime()) { |
| | | Date tmp = end; |
| | | Date tmp = begin; |
| | | begin = end; |
| | | end = tmp; |
| | | } |