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

点击地图查询路线信息

上级 93d0eab2
......@@ -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 lombok.AllArgsConstructor;
import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
......@@ -25,9 +26,10 @@ import java.util.Map;
@RestController
@RequestMapping("/szgl")
@AllArgsConstructor
public class SzglController {
@Value("${shape.identify-url}")
private final String identify = "";
private final BaseindexdataService baseindexdataService;
private final RoadConditionEventService eventService;
private final SzglService szglService;
......@@ -216,7 +218,9 @@ public class SzglController {
*/
@GetMapping("/getObjByLngLat/{lng}/{lat}")
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();
ResponseEntity<String> response = rest.getForEntity(uri, String.class);
String body = response.getBody().trim();
......@@ -228,13 +232,22 @@ public class SzglController {
String mm = StringEscapeUtils.unescapeJava(text);
JSONObject object = JSONObject.parseObject(mm);
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) {
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 {
public R getQzZhEvent(@RequestParam("roadCode") String roadCode, @RequestParam("startM") String startM, @RequestParam("endM") String endM){
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:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/aroad?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: 123456
password: root
cache:
type: redis
redis:
......@@ -58,3 +58,4 @@ connect:
port_net: 9300
shape:
url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry=
identify-url: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
\ No newline at end of file
......@@ -59,3 +59,4 @@ connect:
port_net: 9300
shape:
url: http://47.105.99.44:8080/sdlkapi/LRS/GetAmapGeometry?geometry=
identifyurl: http://47.105.99.44:8080/sdlkapi/LRS/IdentifyM?longitude=
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论