燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-18 93bfb9dc2bc52801132fdbc024e2bf5cb4e96316
1
已修改2个文件
55 ■■■■ 文件已修改
src/main/java/com/yssh/controller/SuYuanController.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/SuYuanService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/SuYuanController.java
@@ -153,40 +153,40 @@
        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 = "根据ID和日期查询溯源46表", notes = "根据ID和日期查询溯源46表")
    @ApiOperationSupport(order = 15)
    @ApiOperationSupport(order = 12)
    @GetMapping("/selectSuYuan46ById")
    public Result selectSuYuan46ById(@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.selectSuYuan46ById(id, date));
    }
    @ApiOperation(value = "根据ID和日期查询溯源700表", notes = "根据ID和日期查询溯源700表")
    @ApiOperationSupport(order = 13)
    @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 = "根据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));
    }
    @ApiOperation(value = "根据经纬度查询地名", notes = "根据经纬度查询地名")
    @ApiOperationSupport(order = 16)
    @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));
    }
    @ApiOperation(value = "根据X、Y值查询矩形框", notes = "根据X、Y值查询矩形框")
    @ApiOperationSupport(order = 16)
    @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));
    }
}
src/main/java/com/yssh/service/SuYuanService.java
@@ -306,15 +306,16 @@
    }
    public String selectAddrByXY(double x, double y) {
        // 1米=0.0000089932
        List<Location> locations = locationMapper.selectByXY(x, y);
        if (null != locations && locations.size() > 0) {
            return locations.get(0).getName();
        }
        locations = locService.selectVocAddrs(x, y);
        /*locations = locService.selectVocAddrs(x, y);
        if (null != locations && locations.size() > 0) {
            return locations.get(0).getName();
        }
        }*/
        return null;
    }