Pu Zhibing
6 天以前 4c99ee7028c3fe58a2cd4b8273b22c75c45574fc
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -249,10 +249,10 @@
            }
        }else{
            //开始修改行程数据
            boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
            boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                    updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
                    if(updateTrip){
                        break;
                    }
@@ -293,16 +293,9 @@
            jobDataMap.put("timeOut", timeOut);
            jobDataMap.put("driverTimeout", driverTimeout);
            jobDataMap.put("describe", language == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language == 2 ? "Reminder You are overdue for " + driverTimeout + " minutes The subscriber could cancel the order for free Confirm" : "Rappel Vous êtes en retard de " + driverTimeout + " minutes L’abonné peut annuler la commande gratuitement Confirmer");
//            QuartzUtil.addSimpleQuartzTask(
//                    new OrderTimeOutJob().buildQuartzJob("1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
//                    , new Date(timeOut), timeOut, 0);
    
            try {
                quartzUtil.addSimpleQuartzTask(OrderTimeOutJob.class,"1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap
                        , new Date(timeOut), timeOut, 0);
            } catch (SchedulerException e) {
                throw new RuntimeException(e);
            }
            quartzUtil.addSimpleQuartzTask(OrderTimeOutJob.class,"1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap
                    , new Date(timeOut), timeOut, 0);
            
    
            //超时循环提醒
@@ -315,16 +308,9 @@
            jobDataMap.put("timeOut", orderLogistics.getEstimateArriveTime().getTime());
            jobDataMap.put("driverTimeout", driverTimeout);
            jobDataMap.put("describe", "");
//            QuartzUtil.addSimpleQuartzTask(
//                    new OrderTimeOutJob().buildQuartzJob("3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap)
//                    , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
    
            try {
                quartzUtil.addSimpleQuartzTask(OrderTimeOutJob.class,"3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap
                        , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
            } catch (SchedulerException e) {
                throw new RuntimeException(e);
            }
            quartzUtil.addSimpleQuartzTask(OrderTimeOutJob.class,"3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap
                    , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1);
        }
        
        
@@ -332,8 +318,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
            }
        }).start();
        Integer language1 = userInfoMapper.selectById(orderLogistics.getUserId()).getLanguage();
@@ -465,10 +451,10 @@
        //修改行程数据
        if(ToolUtil.isNotEmpty(tripStatus)){
            Car car = carService.selectById(orderLogistics.getCarId());
            boolean updateTrip = fleetEngineUtil.updateTrip(tripStatus, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
            boolean updateTrip = fleetEngineUtil.updateTrip(tripStatus, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip(tripStatus, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                    updateTrip = fleetEngineUtil.updateTrip(tripStatus, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
                    if(updateTrip){
                        break;
                    }
@@ -485,8 +471,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
            }
        }).start();
        
@@ -621,8 +607,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "");
                pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
                pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "driver");
            }
        }).start();
        Integer language1 = userInfoMapper.selectById(orderLogistics.getUserId()).getLanguage();
@@ -793,11 +779,11 @@
            //修改google地图行程终点
            Car car = carService.selectById(orderLogistics.getCarId());
            boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(),
                    null, null, orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString());
                    null, null, orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString(), orderLogistics.getId(), 4);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(),
                            null, null, orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString());
                            null, null, orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString(), orderLogistics.getId(), 4);
                    if(updateTrip){
                        break;
                    }
@@ -863,6 +849,9 @@
     */
    public OrderLogistics setMoney(OrderLogistics orderLogistics, Double parkingFee, Double crossingFee) throws Exception {
        Map<String, Object> query1 = systemPriceMapper.query(orderLogistics.getCompanyId(), 4, orderLogistics.getServerCarModelId());
        if(null == query1){
            throw new RuntimeException("请先添加计费规则");
        }
        //开始根据不同的方式计算金额
        double amount = 0;
        JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());
@@ -1142,10 +1131,10 @@
        this.updateById(orderLogistics);
        //修改行程数据
        Car car = carService.selectById(orderLogistics.getCarId());
        boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
        boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
        if(!updateTrip){
            for (int i = 0; i < 5; i++) {
                updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4);
                if(updateTrip){
                    orderLogistics.setIsover(1);
                    this.updateById(orderLogistics);
@@ -1154,7 +1143,7 @@
                try {
                    Thread.sleep(3000L);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                    e.printStackTrace();
                }
            }
        }else{
@@ -1172,7 +1161,7 @@
                try {
                    Thread.sleep(3000L);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                    e.printStackTrace();
                }
            }
        }
@@ -1193,8 +1182,8 @@
        new Thread(new Runnable() {
            @Override
            public void run() {
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "");
                pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "", "driver");
                pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, "", "driver");
            }
        }).start();
        return ResultUtil.success();