Commit c1ff536734b0d065830d48aeb9a1d7db27c38d04

Authored by yiming
1 parent dd588add

bf2

bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineController.java
1 package com.ruoyi.project.system.line.controller; 1 package com.ruoyi.project.system.line.controller;
2 2
  3 +import cn.hutool.http.HttpUtil;
  4 +import com.alibaba.fastjson.JSONArray;
  5 +import com.alibaba.fastjson.JSONObject;
3 import com.ruoyi.common.utils.poi.ExcelUtil; 6 import com.ruoyi.common.utils.poi.ExcelUtil;
4 import com.ruoyi.common.utils.security.ShiroUtils; 7 import com.ruoyi.common.utils.security.ShiroUtils;
5 import com.ruoyi.framework.aspectj.lang.annotation.Log; 8 import com.ruoyi.framework.aspectj.lang.annotation.Log;
@@ -310,5 +313,14 @@ public class BsthTLineController extends BaseController @@ -310,5 +313,14 @@ public class BsthTLineController extends BaseController
310 return bsthTLineKFKS; 313 return bsthTLineKFKS;
311 } 314 }
312 315
  316 + @GetMapping("/getStation")
  317 + @ResponseBody
  318 + public JSONObject getStation(String lng,String lat,String dis)
  319 + {
  320 + String url="https://180.167.126.126:18991/prod-api/service/interfact/getStation?lng="+lng+"&lat="+lat+"&dis="+dis;
  321 + String s=HttpUtil.get(url);
  322 + System.out.println(s);
  323 + return JSONObject.parseObject(s);
  324 + }
313 325
314 } 326 }
bsthLineProfiles/src/main/resources/templates/system/line/map.html
@@ -209,6 +209,9 @@ body, html, #container { @@ -209,6 +209,9 @@ body, html, #container {
209 //地点查询 209 //地点查询
210 function searchStation(){ 210 function searchStation(){
211 var distance=$("#distance").val(); 211 var distance=$("#distance").val();
  212 + if(distance==''){
  213 + return;
  214 + }
212 map.clearOverlays(); 215 map.clearOverlays();
213 map.centerAndZoom(sp, 18); 216 map.centerAndZoom(sp, 18);
214 var marker = new BMapGL.Marker(sp); 217 var marker = new BMapGL.Marker(sp);
@@ -244,7 +247,7 @@ body, html, #container { @@ -244,7 +247,7 @@ body, html, #container {
244 247
245 //站点标注 248 //站点标注
246 function a(lng,lat,distance){ 249 function a(lng,lat,distance){
247 - $.get("https://180.167.126.126:18991/prod-api/service/interfact/getStation?lng=" 250 + $.get("../line/getStation?lng="
248 +lng + "&lat=" + lat + "&dis=" 251 +lng + "&lat=" + lat + "&dis="
249 + distance / 1000, function(data) { 252 + distance / 1000, function(data) {
250 if (data.code == "200") { 253 if (data.code == "200") {
@@ -308,7 +311,7 @@ body, html, #container { @@ -308,7 +311,7 @@ body, html, #container {
308 311
309 //站点标注用来查道路的 多了个站点筛选和 去除 圆形范围 312 //站点标注用来查道路的 多了个站点筛选和 去除 圆形范围
310 function b(lng,lat,distance,roadName){ 313 function b(lng,lat,distance,roadName){
311 - $.get("https://180.167.126.126:18991/prod-api/service/interfact/getStation?lng=" 314 + $.get("../line/getStation?lng="
312 +lng + "&lat=" + lat + "&dis=" 315 +lng + "&lat=" + lat + "&dis="
313 + distance / 1000, function(data) { 316 + distance / 1000, function(data) {
314 if (data.code == "200") { 317 if (data.code == "200") {