燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-05 2b8df9f5452218cad1f012a008acea724de81fff
src/main/java/com/yssh/controller/SuYuanController.java
@@ -1,11 +1,13 @@
package com.yssh.controller;
import com.yssh.entity.MonitorPointPosition;
import com.yssh.entity.*;
import com.yssh.service.ICommonService;
import com.yssh.service.VocValsService;
import com.yssh.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@@ -18,9 +20,6 @@
import org.springframework.web.bind.annotation.RestController;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yssh.entity.SuYuan2d;
import com.yssh.entity.SuYuan3d;
import com.yssh.entity.SuYuanMonitorData;
import com.yssh.service.ISuYuanService;
import com.yssh.utils.Result;
@@ -41,8 +40,13 @@
    @Resource
    private ICommonService commonService;
    @Autowired
    @Resource
    private ISuYuanService suYuanService;
    @Resource
    private VocValsService vocValsService;
    private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH");
    @ApiOperation(value = "查询2d热力图数据", notes = "根据时间查询2d热力图数据")
    @ApiOperationSupport(order = 1)
@@ -129,4 +133,52 @@
        return Result.OK(point);
    }
    @ApiOperation(value = "根据Qxsh值", notes = "根据Qxsh值")
    @ApiOperationSupport(order = 10)
    @GetMapping("/queryQxsh")
    public Result queryQxsh(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        List<Qxsh> list = suYuanService.queryQxsh(date);
        return Result.OK(list);
    }
    @ApiOperation(value = "根据时间查询Voc值", notes = "根据时间查询Voc值")
    @ApiOperationSupport(order = 11)
    @GetMapping("/selectVocByTime")
    public Result selectVocByTime(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        List<VocVals> list = vocValsService.selectByTime(format.format(date));
        return Result.OK(list);
    }
    @ApiOperation(value = "根据X,Y值查询地址", notes = "根据X,Y值查询地址")
    @ApiOperationSupport(order = 12)
    @GetMapping("/selectCoords")
    public Result selectVocByTime(@RequestParam(value = "x", required = false) Integer x, @RequestParam(value = "y", required = false) Integer y) {
        return Result.OK(vocValsService.selectCoords(x, y));
    }
    @ApiOperation(value = "根据X、Y值查询矩形框", notes = "根据X、Y值查询矩形框")
    @ApiOperationSupport(order = 13)
    @GetMapping("/selectRects")
    public Result selectRects(@RequestParam(value = "x[]", required = true) Double[] x, @RequestParam(value = "y[]", required = true) Double[] y) {
        if (null == x || null == y || x.length == 0 || x.length != y.length) return Result.OK(null);
        return Result.OK(suYuanService.selectRects(x, y));
    }
    @ApiOperation(value = "根据ID和日期查询溯源700表", notes = "根据ID和日期查询溯源700表")
    @ApiOperationSupport(order = 14)
    @GetMapping("/selectSuYuan700ById")
    public Result selectSuYuan700ById(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        return Result.OK(suYuanService.selectSuYuan700ById(id, date));
    }
    @ApiOperation(value = "根据经纬度查询地名", notes = "根据经纬度查询地名")
    @ApiOperationSupport(order = 15)
    @GetMapping("/selectAddrByXY")
    public Result selectAddrByXY(@RequestParam(value = "x", required = true) double x, @RequestParam(value = "y", required = true) double y) {
        return Result.OK(suYuanService.selectAddrByXY(x, y));
    }
}