From 6a90f2d1feaf583c211d5f9fe95dff7f7c748ed3 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 06 九月 2024 17:42:20 +0800 Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0 --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java index cabeeb7..9e57fbd 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java @@ -18,6 +18,7 @@ import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; +import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil; import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob; import com.stylefeng.guns.modular.taxi.model.OrderTaxi; @@ -194,6 +195,7 @@ @Override public synchronized ResultUtil grabOrder(Integer orderId, Integer uid, Integer language) throws Exception { OrderPrivateCar orderPrivateCar = this.selectById(orderId); + String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); //处理摆渡车的情况 if(orderPrivateCar.getType() == 2){ //查看用户下的摆渡车是否已被人抢了 @@ -239,7 +241,7 @@ String value = redisUtil.getValue("DRIVER" + driver.getId()); if(ToolUtil.isNotEmpty(value)) { String[] split = value.split(","); - DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); + DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); //超时时间 long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); @@ -471,8 +473,14 @@ * @throws Exception */ @Override - public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language, Integer uid) throws Exception { + public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat,String phone, Integer language, Integer uid) throws Exception { OrderPrivateCar orderPrivateCar = this.selectById(orderId); + String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); + ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon, tripId); + if(null == reverseGeocode){ + return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); + } + String address = reverseGeocode.getAddress(); if(!uid.equals(orderPrivateCar.getDriverId())){ return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande"); } @@ -539,13 +547,13 @@ tripStatus = "ENROUTE_TO_DROPOFF"; switch (language){ case 1: - audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-CN.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-CN.mp3"; break; case 2: - audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-EN.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-EN.mp3"; break; case 3: - audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-FR.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-FR.mp3"; break; } break; @@ -559,13 +567,13 @@ tripStatus = "COMPLETE"; switch (language){ case 1: - audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-CN.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-CN.mp3"; break; case 2: - audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-EN.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-EN.mp3"; break; case 3: - audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-FR.mp3"; + audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-FR.mp3"; break; } break; -- Gitblit v1.7.1