燕山石化溯源三维电子沙盘-【后端】-服务
5
13693261870
2023-07-29 25169ce9015c91b1596619fcc27b5554bd73bee7
src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -1,8 +1,5 @@
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;
@@ -17,10 +14,7 @@
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")
@@ -30,10 +24,6 @@
    @Resource
    private WarningAnalyseService warningService;
    /**
     * 1.查询当前时间的所有点位value值(以47.dat查询即可)
     * 2.筛选大于yssh_bjyj中的jcbj字段的值 返回id+经纬度+value
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "获取实时报警", notes = "获取实时报警分析数据")
    @GetMapping("/runAlarm")
@@ -41,10 +31,6 @@
        return Result.OK(warningService.getRunTimeAlarmAnalyse());
    }
    /**
     * 1.查询当前时间的所有点位value值(以47.dat查询即可)
     * 2.筛选大于yssh_bjyj中的jcyj字段的值 返回id+经纬度+value
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "获取实时预警", notes = "获取实时预警分析数据")
    @GetMapping("/runWarning")
@@ -53,10 +39,10 @@
    }
    @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)
@@ -91,9 +77,8 @@
        if (null == begin || null == end) {
            return Result.error(null);
        }
        if (begin.getTime() > end.getTime()) {
            Date tmp = end;
            Date tmp = begin;
            begin = end;
            end = tmp;
        }