zhibing.pu
2024-08-27 7ae343fc7761a3b5535716ff07a82e5d571d60e8
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java
@@ -262,11 +262,13 @@
        switch (orderType){
            case 1://专车
                map = orderPrivateCarService.queryPushOrder(orderId, language);
                DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon));
                OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId());
                DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon), tripId);
                map.put("startDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0);
                //总距离
                distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()));
                distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()), tripId);
                map.put("totalDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0);
                Integer orderSource = Integer.valueOf(String.valueOf(map.get("orderSource")));
@@ -371,11 +373,13 @@
                break;
            case 4://市内小件物流
                map = orderLogisticsService.queryPushOrder(orderId, language);
                DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon));
                OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                String tripId1 = redisUtil.getValue("trip" + orderLogistics.getUserId());
                DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon), tripId1);
                map.put("startDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0);
                //总距离
                distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()));
                distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()), tripId1);
                map.put("totalDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0);
                Integer orderSource3 = Integer.valueOf(String.valueOf(map.get("orderSource")));
@@ -568,20 +572,15 @@
     */
    @Override
    public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, String pickUpCode, Integer language) throws Exception {
        ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon);
        if(null == reverseGeocode){
            return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides");
        }
        String address = reverseGeocode.getAddress();
        switch (orderType){
            case 1://专车
                return orderPrivateCarService.process(orderId, state, lon, lat, address, phone, language, uid);
                return orderPrivateCarService.process(orderId, state, lon, lat, phone, language, uid);
            case 2://出租
//                return orderTaxiService.process(orderId, state, lon, lat, address);
            case 3://城际
//                return orderCrossCityService.process(orderId, state, lon, lat, address);
            case 4://同城小件
                return orderLogisticsService.process(orderId, state, lon, lat, address, pickUpCode, language, uid);
                return orderLogisticsService.process(orderId, state, lon, lat, pickUpCode, language, uid);
            case 5://跨城小件
//                return orderLogisticsService.process(orderId, state, lon, lat, address);
            case 6: