liyg 3 년 전
부모
커밋
f5439757ec

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

@@ -851,6 +851,11 @@ 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);
+        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());
+        }
         return currentLocationResult;
     }
 

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

@@ -81,9 +81,6 @@ public class CurrentLocation implements Serializable {
 
     public void setLat(String lat) {
         this.lat = lat;
-        Double[] lngLon = LngLonUtil.gps84_To_Gcj02((Double.valueOf(this.lat) / 600000), (Double.valueOf(this.lon) / 600000));
-        this.lon=lngLon[0].toString();
-        this.lat=lngLon[1].toString();
     }
     public String getLat() {
         return lat;