无关风月
2024-11-14 3af9c82375df6bd77ae78a5d900c409a895ecd18
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java
@@ -449,7 +449,7 @@
    * @param end_lng 终点经度
    * @return
    */
   public boolean createTrip(String vehicleId, Integer numberOfPassengers, String tripId, String start_lat, String start_lng, String end_lat, String end_lng) {
   public JSONObject createTrip(String vehicleId, Integer numberOfPassengers, String tripId, String start_lat, String start_lng, String end_lat, String end_lng) {
      String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/trips?tripId=" + tripId;
      HttpRequest post = HttpUtil.createPost(url);
      Map<String, String> headers = new HashMap<>();
@@ -478,7 +478,7 @@
      end_point.put("longitude", end_lng);
      dropoffPoint.put("point", end_point);
      body.put("dropoffPoint", dropoffPoint);
      logger.info("创建行程请求:{}", body.toJSONString());
      logger.info("创建行程请求:{}   {}", tripId, body.toJSONString());
      HttpRequest request = post.body(body.toJSONString());
      HttpResponse response = request.execute();
      logger.info("创建行程结果:{}", response.body());
@@ -499,7 +499,6 @@
            }
         }
         logger.error("创建行程异常:  tripId={}  body={}", tripId, response.body());
         return false;
      }
      /**
       * 返回结果
@@ -616,7 +615,7 @@
       *    "currentRouteSegmentTrafficVersion": "2024-05-27T02:05:37.941167Z"
       * }
       */
      return true;
      return jsonObject;
   }
   
   
@@ -698,7 +697,7 @@
         dropoffPoint.put("point", end_point);
         body.put("dropoffPoint", dropoffPoint);
      }
      logger.info("修改行程请求:{}", body.toJSONString());
      logger.info("修改行程请求:{}   {}", tripId, body.toJSONString());
      HttpRequest request = put.body(body.toJSONString());
      HttpResponse response = request.execute();
      logger.info("修改行程结果:{}", response.body());
@@ -857,6 +856,7 @@
      headers.put("Content-Type", "application/json");
      get.addHeaders(headers);
      
      logger.info("查询行程请求:{}  {}", tripId, url);
      HttpResponse response = get.execute();
      logger.info("查询行程结果:{}", response.body());
      JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type"));
@@ -864,7 +864,7 @@
      if(null != error){
         Integer code = error.getInteger("code");
         if(code == 404){
            return "";
            return null;
         }
         if(code == 401){
            String status = error.getString("status");