From f9b9131367d9ba6fe852130b12083c0f5ea68bbb Mon Sep 17 00:00:00 2001 From: zhibing.pu <393733352@qq.com> Date: 星期一, 27 五月 2024 17:26:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0 --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 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 8df6b19..12bbfbc 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 @@ -14,6 +14,7 @@ import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.*; +import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; 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; @@ -95,6 +96,9 @@ @Autowired private IReminderRulesService reminderRulesService; + + @Autowired + private FleetEngineUtil fleetEngineUtil; @@ -191,7 +195,7 @@ } } - if(orderPrivateCar.getState() == 9){ + if(orderPrivateCar.getState() == 10){ return ResultUtil.error(language == 1 ? "订单已取消" : language == 2 ? "Order cancelled" : "Commande annulée"); } if(orderPrivateCar.getState() != 1){ @@ -214,7 +218,6 @@ } - //todo 待翻译 //添加定时任务(普通任务) ReminderRules reminderRules = reminderRulesService.selectOne(new EntityWrapper<ReminderRules>().eq("companyId", driver.getCompanyId())); if(null != reminderRules){ @@ -227,7 +230,7 @@ jobDataMap.put("driverId", uid); jobDataMap.put("orderId", orderPrivateCar.getId()); jobDataMap.put("orderType", 1); - jobDataMap.put("describe", "您的打车订单已超时" + m + "分钟,请抓紧!"); + jobDataMap.put("describe", language == 1 ? "您的打车订单已超时" + m + "分钟,请抓紧!" : language == 2 ? "Your ride order is overdue for " + m + " minute(s), please go faster." : "Votre commande de course est en retard depuis " + m + " minute(s), veuillez aller plus vite."); QuartzUtil.addSimpleQuartzTask( new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) , new Date(specialCarTimeoutReminderInterval), specialCarTimeoutReminderInterval, -1); @@ -257,6 +260,9 @@ , new Date(appointmentReminder + appointmentTimeoutReminderInterval), appointmentTimeoutReminderInterval, -1); } } + + //开始修改行程数据 + fleetEngineUtil.updateTrip(null, driver.getCarId(), null, 1, orderPrivateCar.getId(), null, null, null, null); //推送相关代码------------------start---------------- new Thread(new Runnable() { @@ -320,12 +326,14 @@ if(state==4 && orderPrivateCar.getState()!=3){ return ResultUtil.error(language == 1 ? "当前订单不能到达预约地点" : language == 2 ? "The current order cannot arrive at the reservation" : "La commande en cours ne peut pas atteindre le rendez-vous"); } + String tripStatus = "UNKNOWN_TRIP_STATUS"; switch (state){ case 3://出发前往预约点 orderPrivateCar.setState(3); orderPrivateCar.setSetOutTime(new Date()); systemNoticeService.addSystemNotice(1, language == 1 ? "司机已出发,请耐心等待" : language == 2 ? "The driver is on the way, please wait." : "Le chauffeur est en route. Veuillez patienter.", orderPrivateCar.getUserId()); pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);//主动推送司机定位 + tripStatus = "ENROUTE_TO_PICKUP"; break; case 4://到达预约点,等待客户上车 orderPrivateCar.setState(4); @@ -333,6 +341,7 @@ systemNoticeService.addSystemNotice(1, language == 1 ? "司机已到达您设置的预约地点,请及时上车" : language == 2 ? "The driver has arrived at the reserved location, please get in timely." : "Le chauffeur est arrivé à l'endroit prévu, veuillez monter dans la voiture à temps.", orderPrivateCar.getUserId()); + tripStatus = "ARRIVED_AT_PICKUP"; break; case 5://开始服务 orderPrivateCar.setBoardingLon(lon); @@ -365,6 +374,7 @@ out.write(JSON.toJSONString(orderPositions)); out.flush(); out.close(); + tripStatus = "ENROUTE_TO_DROPOFF"; break; case 6://结束服务(专车可以返回继续服务)不修改状态 orderPrivateCar.setState(6); @@ -373,9 +383,14 @@ orderPrivateCar.setGetoffAddress(address); orderPrivateCar.setGetoffTime(new Date()); orderPrivateCar.setEndServiceTime(new Date()); + tripStatus = "COMPLETE"; break; } this.updateById(orderPrivateCar); + + Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); + //修改行程数据 + fleetEngineUtil.updateTrip(tripStatus, null, 1, 1, orderPrivateCar.getId(), null, null, null, null); // TODO: 2020/6/5 推送状态 OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; -- Gitblit v1.7.1