11
0

2 Commity 8f52edecbb ... 6ee780e400

Autor SHA1 Správa Dátum
  Tiroble 6ee780e400 修改 3 rokov pred
  Tiroble 3be559ed64 修改 3 rokov pred

+ 3 - 6
src/main/java/com/steerinfo/inPlantNavigation/controller/IPMMSVertexController.java

@@ -8,10 +8,7 @@ import com.steerinfo.inPlantNavigation.service.IIPMMSVertexEdgeService;
 import com.steerinfo.inPlantNavigation.service.IIPMMSVertexService;
 import com.steerinfo.inPlantNavigation.service.impl.IPMMSVertexServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -28,11 +25,11 @@ public class IPMMSVertexController extends BaseRESTfulController {
 
 
     @GetMapping("/getObtainTheOptimalPath")
-    public RESTfulResult getObtainTheOptimalPath(){
+    public RESTfulResult getObtainTheOptimalPath(@RequestParam("startPoint") String startPoint,@RequestParam("endPoint")  String endPoint){
 
         Map<String, List<IPMMSVertexEdge>> vertexEdgeList= ipmmsVertexEdgeService.initVertexEdge();
         Map<String, IPMMSVertex> vertexList = ipmmsVertexService.initIPMMSVertex();
-        ArrayList<IPMMSVertex> obtainTheOptimalPath= ipmmsVertexService.getObtainTheOptimalPath("2","0",vertexEdgeList,vertexList);
+        ArrayList<IPMMSVertex> obtainTheOptimalPath= ipmmsVertexService.getObtainTheOptimalPath(startPoint,endPoint,vertexEdgeList,vertexList);
         return success(obtainTheOptimalPath);
     }
 

+ 5 - 0
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -851,10 +851,15 @@ public class RouteServiceImpl implements RouteService {
     public CurrentLocationResult getCurrentLocation(String capcityNumber) throws Exception {
         String json = zhongJiaoXingLu.vLastLocationV3(capcityNumber);
         CurrentLocationResult currentLocationResult = (CurrentLocationResult) DataConversionTool.jsonToBean(json, CurrentLocationResult.class);
+<<<<<<< HEAD
+        if (currentLocationResult.equals(1006)){
+            return null;
+=======
         if(currentLocationResult.getResult().getLat()!=null&&currentLocationResult.getResult().getLon()!=null){
             Double[] lngLon = LngLonUtil.gps84_To_Gcj02((Double.valueOf(currentLocationResult.getResult().getLat()) / 600000), (Double.valueOf(currentLocationResult.getResult().getLon()) / 600000));
             currentLocationResult.getResult().setLat(lngLon[0].toString());
             currentLocationResult.getResult().setLon(lngLon[1].toString());
+>>>>>>> 8f52edecbb90f4859e5e95585c3a90a1a6731cf2
         }
         return currentLocationResult;
     }

+ 1 - 1
src/main/java/com/steerinfo/route/util/DataConversionTool.java

@@ -50,7 +50,7 @@ public class DataConversionTool {
                 //开启权限
                 field.setAccessible(true);
                 //判断是否保护属性值
-                if(jsonObject.containsKey(field.getName())){
+                if(jsonObject!=null&&jsonObject.containsKey(field.getName())){
                     Object objectValue =jsonObject.get(field.getName());
                     //判断jsonObject的item是否是String或者Integer,是简单类型直接赋值
                     if ((objectValue instanceof Long)||(objectValue instanceof String)||(objectValue instanceof Integer)||(objectValue instanceof Boolean)||(objectValue instanceof BigDecimal)){

+ 1 - 0
src/main/java/com/steerinfo/route/vo/currentLocation/CurrentLocation.java

@@ -79,6 +79,7 @@ public class CurrentLocation implements Serializable {
         return adr;
     }
 
+
     public void setLat(String lat) {
         this.lat = lat;
     }

+ 2 - 2
src/main/java/com/steerinfo/route/vo/currentLocation/CurrentLocationResult.java

@@ -10,10 +10,10 @@ public class CurrentLocationResult {
         return result;
     }
 
-    public void setStatus(int status) {
+    public void setStatus(Integer status) {
         this.status = status;
     }
-    public int getStatus() {
+    public Integer getStatus() {
         return status;
     }
 }