| | |
| | | package com.yssh.controller; |
| | | |
| | | import com.yssh.config.InitConfig; |
| | | import com.yssh.entity.Report; |
| | | import com.yssh.utils.CacheUtils; |
| | | import com.yssh.utils.DateUtils; |
| | |
| | | private Integer getStartTime(Date start, Date end) { |
| | | do { |
| | | if (null == start && null == end) { |
| | | start = DateUtils.getAPeriodOfTime(new Date(), -5, Calendar.HOUR_OF_DAY); |
| | | start = DateUtils.getAPeriodOfTime(InitConfig.getDate(), -5, Calendar.HOUR_OF_DAY); |
| | | break; |
| | | } |
| | | if (null != start && null == end) { |
| | |
| | | private Integer getEndTime(Date start, Date end) { |
| | | do { |
| | | if (null == start && null == end) { |
| | | end = new Date(); |
| | | end = InitConfig.getDate(); |
| | | break; |
| | | } |
| | | if (null != start && null == end) { |
| | |
| | | @ApiOperation(value = "本月预警报警统计", notes = "本月预警报警统计,返回参数alarmNumber对应值为本月报警数据量,参数warningNumber对应值为本月预警数据量") |
| | | @GetMapping("/monthCount") |
| | | public Result thisMonthCount(@RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | return Result.OK(warningService.monthCount(null == date ? new Date() : date)); |
| | | return Result.OK(warningService.monthCount(null == date ? InitConfig.getDate() : date)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "一周预警报警数量变化趋势", notes = "一周预警报警数量变化趋势,返回参数alarmDayCount为一周每日报警统计数量列表,参数warningDayCount为一周每日预警统计数量列表") |
| | | @GetMapping("/everydayCount") |
| | | public Result everydayCount(@RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | return Result.OK(warningService.everydayCount(null == date ? new Date() : date)); |
| | | return Result.OK(warningService.everydayCount(null == date ? InitConfig.getDate() : date)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "三小时监测站点数据变化趋势", notes = "返回值为三小时监测站点监测数据,返回值为map集合,其中key为站点名称,value为list集合,保存每天监测数值数据") |
| | | @GetMapping("/locationDataChange") |
| | | public Result locationDataChange(@RequestParam(value = "end", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | return Result.OK(warningService.select3Hours(null == date ? new Date() : date)); |
| | | return Result.OK(warningService.select3Hours(null == date ? InitConfig.getDate() : date)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 6) |