燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-11-05 971d4858fcba2b551bc26f281c71f16e8671ab62
src/main/java/com/yssh/controller/SuYuanController.java
@@ -1,5 +1,6 @@
package com.yssh.controller;
import cn.hutool.core.date.DateTime;
import com.yssh.entity.*;
import com.yssh.service.CommonService;
import com.yssh.service.VocValsService;
@@ -170,8 +171,13 @@
    @ApiOperation(value = "根据X,Y值查询地址", notes = "根据X,Y值查询地址")
    @ApiOperationSupport(order = 14)
    @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 / 10, y / 10));
    public Result selectCoords(@RequestParam(value = "x") Integer x, @RequestParam(value = "y") Integer y, @RequestParam(value = "isSuYuan") Integer isSuYuan) {
        if (isSuYuan < 1) {
            x = x / 10;
            y = y / 10;
        }
        return Result.OK(vocValsService.selectCoords(x, y));
    }
    @ApiOperation(value = "根据经纬度查询地名", notes = "根据经纬度查询地名")
@@ -189,4 +195,23 @@
        return Result.OK(suYuanService.selectRects(x, y));
    }
    @ApiOperation(value = "根据名称查询溯源ID", notes = "根据名称查询溯源ID")
    @ApiOperationSupport(order = 17)
    @GetMapping("/selectSuYuanIdByName")
    public Result selectSuYuanIdByName(@RequestParam(value = "name") String name) {
        if (null == name || name.length() == 0) return Result.OK(null);
        return Result.OK(suYuanService.selectSuYuanIdByName(name));
    }
    @ApiOperation(value = "根据ID查询快速溯源")
    @ApiOperationSupport(order = 18)
    @GetMapping("/selectFastById")
    public Result selectFastById(@RequestParam(value = "id") String id, @RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        if (StringUtils.isEmpty(id)) return Result.OK(null);
        if (null == date) date = DateTime.now();
        return Result.OK(suYuanService.selectFastById(id, date));
    }
}