From f34c06ae314cd4a3f9a3bd50a264a3ce0da5d7e7 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 10 四月 2023 13:54:19 +0800 Subject: [PATCH] 1 --- src/main/java/com/terra/coal/controller/MainController.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/terra/coal/controller/MainController.java b/src/main/java/com/terra/coal/controller/MainController.java index 016be14..e41c8a8 100644 --- a/src/main/java/com/terra/coal/controller/MainController.java +++ b/src/main/java/com/terra/coal/controller/MainController.java @@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.math.BigDecimal; import java.util.List; /** @@ -75,9 +76,9 @@ @ApiOperation(value = "鏍规嵁鑼冨洿缁熻") @ApiImplicitParams({ - @ApiImplicitParam(name = "wkt", value = "WKT鏂囨湰", dataType = "String", paramType = "query", example = "POLYGON ((113.5807 45.4897,113.5898 45.4893,113.5857 45.4837,113.5807 45.4897))"), @ApiImplicitParam(name = "z", value = "楂樺害", dataType = "double", paramType = "query", example = "640"), - @ApiImplicitParam(name = "deep", value = "娣卞害", dataType = "double", paramType = "query", example = "50") + @ApiImplicitParam(name = "deep", value = "娣卞害", dataType = "double", paramType = "query", example = "50"), + @ApiImplicitParam(name = "wkt", value = "WKT鏂囨湰", dataType = "String", paramType = "query", example = "POLYGON ((113.5807 45.4897,113.5898 45.4893,113.5857 45.4837,113.5807 45.4897))") }) @GetMapping(value = "/countByRange") public ResponseMsg<Object> countByRange(String wkt, double z, double deep) { @@ -92,9 +93,9 @@ return fail("寮�鎸栨繁搴﹁繃灏�", null); } - List<CountEntity> rs = mainService.countByRange("'" + wkt + "'", z, z + deep); + List<CountEntity> rs = mainService.countByRange(BigDecimal.valueOf(z), BigDecimal.valueOf(z + deep), wkt); - return success("鎴愬姛", rs); + return success("鎴愬姛", null == rs ? 0 : rs.size(), rs); } catch (Exception ex) { log.error(ex.getMessage(), ex); return fail(ex.getMessage(), null); -- Gitblit v1.9.3