提交 5e5fc153 authored 作者: xuyanqi's avatar xuyanqi

点击地图查询路线信息

上级 93d0eab2
...@@ -13,6 +13,7 @@ import com.elephant.framework.galaxy.aroad.module.szgl.entity.Line; ...@@ -13,6 +13,7 @@ import com.elephant.framework.galaxy.aroad.module.szgl.entity.Line;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SzglService; import com.elephant.framework.galaxy.aroad.module.szgl.service.SzglService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -25,9 +26,10 @@ import java.util.Map; ...@@ -25,9 +26,10 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/szgl") @RequestMapping("/szgl")
@AllArgsConstructor @AllArgsConstructor
public class SzglController { public class SzglController {
@Value("${shape.identify-url}")
private final String identify = "";
private final BaseindexdataService baseindexdataService; private final BaseindexdataService baseindexdataService;
private final RoadConditionEventService eventService; private final RoadConditionEventService eventService;
private final SzglService szglService; private final SzglService szglService;
...@@ -216,7 +218,9 @@ public class SzglController { ...@@ -216,7 +218,9 @@ public class SzglController {
*/ */
@GetMapping("/getObjByLngLat/{lng}/{lat}") @GetMapping("/getObjByLngLat/{lng}/{lat}")
public R getObjByLngLat(@PathVariable String lng, @PathVariable String lat) throws Exception { public R getObjByLngLat(@PathVariable String lng, @PathVariable String lat) throws Exception {
String uri = "http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=" + lng + "&latitude=" + lat; System.out.println(identify);
String uri = "http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=";
uri += lng + "&latitude=" + lat;
RestTemplate rest = new RestTemplate(); RestTemplate rest = new RestTemplate();
ResponseEntity<String> response = rest.getForEntity(uri, String.class); ResponseEntity<String> response = rest.getForEntity(uri, String.class);
String body = response.getBody().trim(); String body = response.getBody().trim();
...@@ -228,13 +232,22 @@ public class SzglController { ...@@ -228,13 +232,22 @@ public class SzglController {
String mm = StringEscapeUtils.unescapeJava(text); String mm = StringEscapeUtils.unescapeJava(text);
JSONObject object = JSONObject.parseObject(mm); JSONObject object = JSONObject.parseObject(mm);
Line line = object.toJavaObject(Line.class); Line line = object.toJavaObject(Line.class);
/* List<Basehighwayalldata> lines = EsUtil_fanshe.queryHighWayFiler(line.getCode(), line.getM(), road.getIndexType()); List<Basehighwayalldata> lines = EsUtil_fanshe.queryHighWayFiler(line.getCode(), line.getM(),"basehighwayalldata", road.getIndexType());
if (lines != null && lines.size() > 0) { if (lines != null && lines.size() > 0) {
lx = lines.get(0); lx = lines.get(0);
}*/ }
} }
return new R(lx); Map<String,Object> resultMap = new HashMap<String, Object>();
if(lx != null){
resultMap.put("name", lx.getLuxianmingcheng());
resultMap.put("code", lx.getLuxianbianhao());
resultMap.put("iden", "luxian");
resultMap.put("idenVal", "路线");
resultMap.put("data", lx);
resultMap.put("total", 1);
}
return new R(resultMap);
} }
/** /**
* 根据路线编号、中心桩号 查询路况事件 * 根据路线编号、中心桩号 查询路况事件
...@@ -276,4 +289,11 @@ public class SzglController { ...@@ -276,4 +289,11 @@ public class SzglController {
public R getQzZhEvent(@RequestParam("roadCode") String roadCode, @RequestParam("startM") String startM, @RequestParam("endM") String endM){ public R getQzZhEvent(@RequestParam("roadCode") String roadCode, @RequestParam("startM") String startM, @RequestParam("endM") String endM){
return new R<>(eventService.getQzdzhEvent(startM,endM,roadCode)); return new R<>(eventService.getQzdzhEvent(startM,endM,roadCode));
} }
/**
* 查询桥梁全部数据
*/
@GetMapping("/qlall")
public R getQlAll() throws Exception {
return new R<>(EsUtil_fanshe.queryBridgeAll("basebridgealldata","2018",0,20000));
}
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ spring: ...@@ -14,7 +14,7 @@ spring:
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/aroad?useUnicode=true&characterEncoding=utf-8&useSSL=false url: jdbc:mysql://127.0.0.1:3306/aroad?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root username: root
password: 123456 password: root
cache: cache:
type: redis type: redis
redis: redis:
...@@ -57,4 +57,5 @@ connect: ...@@ -57,4 +57,5 @@ connect:
host_3: 192.168.7.220 host_3: 192.168.7.220
port_net: 9300 port_net: 9300
shape: shape:
url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry= url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry=
\ No newline at end of file identify-url: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
\ No newline at end of file
...@@ -58,4 +58,5 @@ connect: ...@@ -58,4 +58,5 @@ connect:
host_3: 192.168.7.220 host_3: 192.168.7.220
port_net: 9300 port_net: 9300
shape: shape:
url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry= url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry=
\ No newline at end of file identifyurl: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论