Pu Zhibing
6 天以前 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -478,7 +478,7 @@
            return orderService.confirmFees(language, orderId, orderType, type, travelFee, parkingFee, crossingFee, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
            return ResultUtil.runErr(null, e.getMessage());
        }
    }
@@ -549,7 +549,7 @@
     */
    @ResponseBody
    @PostMapping("/base/order/pushOrderState")
    public String pushOrderState(Integer language, Integer orderId, Integer orderType){
    public String pushOrderState(Integer language, Integer orderId, Integer orderType, String from){
        try {
            Map<String, Object> map = orderService.queryOrderInfo(language, orderId, orderType);
            //更新小号绑定关系
@@ -559,7 +559,7 @@
            pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, "");
            pushUtil.pushOrderState(1, Integer.valueOf(String.valueOf(map.get("userId"))), Integer.valueOf(String.valueOf(map.get("orderId"))), orderType,
                    Integer.valueOf(String.valueOf(map.get("orderState"))), 0, "");
                    Integer.valueOf(String.valueOf(map.get("orderState"))), 0, "", from);
            return JSON.toJSONString(ResultUtil.success());
        }catch (Exception e){
            e.printStackTrace();
@@ -711,7 +711,7 @@
            return ResultUtil.success(MoneyInfoWarpper.getMoneyInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
            return ResultUtil.runErr(null, e.getMessage());
        }
    }
@@ -933,7 +933,7 @@
    @ResponseBody
    @PostMapping("/base/taxi/editTripStatus")
    public ResultUtil editTripStatus(String tripStatus, String tripId){
        boolean b = fleetEngineUtil.updateTrip(tripStatus, null, null, tripId, null, null, null, null);
        boolean b = fleetEngineUtil.updateTrip(tripStatus, null, null, tripId, null, null, null, null, null, null);
        if(b){
            return ResultUtil.success();
        }
@@ -983,36 +983,46 @@
                Car car = carService.selectById(privateCar.getCarId());
                if(Arrays.asList(10, 12).contains(state) && !"CANCELED".equals(tripStatus)){
                    //修改行程信息
                    boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                    boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, privateCar.getId(), 1);
                    if(!updateTrip){
                        for (int i = 0; i < 5; i++) {
                            updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                            updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, privateCar.getId(), 1);
                            if(updateTrip){
                                continue;
                                privateCar.setIsover(1);
                                orderPrivateCarService.updateById(privateCar);
                                break;
                            }
                            try {
                                Thread.sleep(3000L);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                                e.printStackTrace();
                            }
                        }
                    }else{
                        privateCar.setIsover(1);
                        orderPrivateCarService.updateById(privateCar);
                    }
                }
                if(Arrays.asList(6, 7, 8, 9).contains(state) && !"COMPLETE".equals(tripStatus)){
                    //修改行程信息
                    boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                    boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, privateCar.getId(), 1);
                    if(!updateTrip){
                        for (int i = 0; i < 5; i++) {
                            updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                            updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, privateCar.getId(), 1);
                            if(updateTrip){
                                continue;
                                privateCar.setIsover(1);
                                orderPrivateCarService.updateById(privateCar);
                                break;
                            }
                            try {
                                Thread.sleep(3000L);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                                e.printStackTrace();
                            }
                        }
                    }else{
                        privateCar.setIsover(1);
                        orderPrivateCarService.updateById(privateCar);
                    }
                }
            }
@@ -1028,36 +1038,46 @@
                Car car = carService.selectById(orderLogistics.getCarId());
                if(Arrays.asList(10, 12).contains(state) && !"CANCELED".equals(tripStatus)){
                    //修改行程信息
                    boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                    boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, orderLogistics.getId(), 4);
                    if(!updateTrip){
                        for (int i = 0; i < 5; i++) {
                            updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                            updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, orderLogistics.getId(), 4);
                            if(updateTrip){
                                continue;
                                orderLogistics.setIsover(1);
                                orderLogisticsService.updateById(orderLogistics);
                                break;
                            }
                            try {
                                Thread.sleep(3000L);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                                e.printStackTrace();
                            }
                        }
                    }else{
                        orderLogistics.setIsover(1);
                        orderLogisticsService.updateById(orderLogistics);
                    }
                }
                if(Arrays.asList(6, 7, 8, 9).contains(state) && !"COMPLETE".equals(tripStatus)){
                    //修改行程信息
                    boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                    boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, orderLogistics.getId(), 4);
                    if(!updateTrip){
                        for (int i = 0; i < 5; i++) {
                            updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null);
                            updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null, orderLogistics.getId(), 4);
                            if(updateTrip){
                                continue;
                                orderLogistics.setIsover(1);
                                orderLogisticsService.updateById(orderLogistics);
                                break;
                            }
                            try {
                                Thread.sleep(3000L);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                                e.printStackTrace();
                            }
                        }
                    }else{
                        orderLogistics.setIsover(1);
                        orderLogisticsService.updateById(orderLogistics);
                    }
                }
            }