| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = driverService.queryInfo(language, uid); |
| | | map.put("qrCodeIsOpen",driverService.getAppOpenInfo(1)==1); |
| | | map.put("qrCodeIsOpen", driverService.getAppOpenInfo(1)==1); |
| | | DriverInfoWarpper driverInfoWarpper = DriverInfoWarpper.getDriverInfoWarpper(map); |
| | | // Double money = driverService.getThisWeekMoney(uid); |
| | | // driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money)); |
| | |
| | | //更新小号绑定关系 |
| | | orderService.RebindMidAxbBindSend(orderId, orderType); |
| | | |
| | | pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType); |
| | | pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("driverId"))), 2,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType, ""); |
| | | |
| | | pushUtil.pushOrderReassign(Integer.valueOf(String.valueOf(map.get("userId"))), 1,Integer.valueOf(String.valueOf(map.get("orderId"))), orderType); |
| | | 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")))); |
| | | Integer.valueOf(String.valueOf(map.get("orderState"))), 0, ""); |
| | | return JSON.toJSONString(ResultUtil.success()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 2, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 2, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 2, orderCrossCity.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 2, orderCrossCity.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState()); |
| | | pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | */ |
| | | @TableField("startDuration") |
| | | private Integer startDuration; |
| | | /** |
| | | * 预估里程 |
| | | */ |
| | | @TableField("estimatedMileage") |
| | | private Double estimatedMileage; |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private OrderLogisticsMapper orderLogisticsMapper; |
| | | |
| | | @Resource |
| | | private IOrderCancelService orderCancelService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver.getCompanyId())); |
| | | Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout"); |
| | | //超时时间 |
| | | long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000); |
| | | long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60000); |
| | | //乘客取消不收费提醒 |
| | | JobDataMap jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", uid); |
| | |
| | | jobDataMap.put("orderType", 4); |
| | | jobDataMap.put("language", language); |
| | | 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(UUIDUtil.getRandomCode(5) + "_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("1_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(timeOut), timeOut, 0); |
| | | |
| | | //超时循环提醒 |
| | |
| | | jobDataMap.put("orderType", 4); |
| | | jobDataMap.put("language", language); |
| | | jobDataMap.put("timeOut", orderLogistics.getEstimateArriveTime().getTime()); |
| | | jobDataMap.put("driverTimeout", driverTimeout); |
| | | jobDataMap.put("describe", ""); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("3_" + orderLogistics.getId() + "_4", "ORDER_TIME_OUT", jobDataMap) |
| | | , orderLogistics.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1); |
| | | } |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer language, Integer orderId) throws Exception { |
| | | Map<String, Object> map = orderLogisticsMapper.queryOrderInfo(orderId); |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(null != map.get("travelTime_")){ |
| | | String travelTime_ = map.get("travelTime_").toString(); |
| | | map.put("travelTime_", DateUtil.conversionFormat1(language, travelTime_)); |
| | | } |
| | | Integer orderState = Integer.valueOf(map.get("orderState").toString()); |
| | | if(orderState == 12){ |
| | | OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>().eq("orderId", orderId) |
| | | .eq("orderType", 4).eq("state", 1).orderBy("insertTime desc limit 0, 1")); |
| | | if(null != orderCancel){ |
| | | map.put("cancelPayMoney", orderCancel.getMoney()); |
| | | } |
| | | } |
| | | map.put("cancelUser", language == 1 ? "用户" : language == 2 ? "The client" : "Le client"); |
| | | map.put("timeOutCancel", 0); |
| | | if(null != orderLogistics.getEstimateArriveTime()){ |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderLogistics.getCompanyId())); |
| | | JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent()); |
| | | int driverTimeout = jsonObject.getIntValue("driverTimeout"); |
| | | long timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout; |
| | | map.put("timeOutCancel", timeOutCancel); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState()); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 4, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | @Override |
| | | public boolean calculateMileage(Integer orderId, String lon, String lat) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() == 2){ |
| | | return false; |
| | | } |
| | | OrderPosition orderPosition = orderPositionService.queryNew(orderId, 4); |
| | | String now = lon + "," + lat; |
| | | String old = null; |
| | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(now, old); |
| | | if(null != distance){ |
| | | Double distance1 = distance.get("WGS84"); |
| | | if(distance1 > 50 && orderLogistics.getState() < 5){//大于50米表示在移动 |
| | | if(distance1 > 50 && Arrays.asList(3, 4).contains(orderLogistics.getState())){//大于50米表示在移动 |
| | | orderLogistics.setToStartPointMileage(new BigDecimal(orderLogistics.getToStartPointMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | this.updateById(orderLogistics); |
| | | return true; |
| | |
| | | */ |
| | | @TableField("estimateArriveMileage") |
| | | private Long estimateArriveMileage; |
| | | /** |
| | | * 预估里程 |
| | | */ |
| | | @TableField("estimatedMileage") |
| | | private Double estimatedMileage; |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | private IOrderCancelService orderCancelService; |
| | | |
| | | |
| | | |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | 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(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(timeOut), timeOut, 0); |
| | | |
| | | //超时循环提醒 |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getEstimateArriveTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", ""); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , orderPrivateCar.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1); |
| | | }else{ |
| | | //超时时间 |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | 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(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(timeOut), timeOut, 0); |
| | | |
| | | |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | jobDataMap.put("timeOut", timeOut); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + ",请准时!" : |
| | | language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " : |
| | | "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure."); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("2_1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(travelTime), travelTime, 0); |
| | | |
| | | //预约单出发循环提醒 |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + ",请准时!" : |
| | | language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " : |
| | | "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure."); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("2_2_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(travelTime + reminderRules.getReserveNext() * 60000), reminderRules.getReserveNext() * 60000, -1); |
| | | |
| | | //超时循环提醒 |
| | |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", ""); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob(UUIDUtil.getRandomCode(5) + "_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , orderPrivateCar.getTravelTime(), reminderRules.getCar() * 60000, -1); |
| | | } |
| | | } |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState()); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState()); |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, ""); |
| | | if(orderPrivateCar.getType() == 2){ |
| | | pushUtil.pushFerryOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 2); |
| | | } |
| | |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer language, Integer orderId) throws Exception { |
| | | Map<String, Object> map = orderPrivateCarMapper.queryOrderInfo(orderId); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(null != map.get("travelTime_")){ |
| | | String travelTime_ = map.get("travelTime_").toString(); |
| | | map.put("travelTime_", DateUtil.conversionFormat1(language, travelTime_)); |
| | | } |
| | | Integer orderState = Integer.valueOf(map.get("orderState").toString()); |
| | | if(orderState == 12){ |
| | | OrderCancel orderCancel = orderCancelService.selectOne(new EntityWrapper<OrderCancel>().eq("orderId", orderId) |
| | | .eq("orderType", 1).eq("state", 1).orderBy("insertTime desc limit 0, 1")); |
| | | if(null != orderCancel){ |
| | | map.put("cancelPayMoney", orderCancel.getMoney()); |
| | | } |
| | | } |
| | | map.put("cancelUser", language == 1 ? "用户" : language == 2 ? "The client" : "Le client"); |
| | | long timeOutCancel = 0L; |
| | | // CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderPrivateCar.getCompanyId())); |
| | | // JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent()); |
| | | // int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000; |
| | | if(orderPrivateCar.getOrderType() == 1 && null != orderPrivateCar.getEstimateArriveTime()){ |
| | | timeOutCancel = orderPrivateCar.getEstimateArriveTime().getTime(); |
| | | }else{ |
| | | timeOutCancel = orderPrivateCar.getTravelTime().getTime(); |
| | | } |
| | | map.put("timeOutCancel", timeOutCancel); |
| | | return map; |
| | | } |
| | | |
| | |
| | | tripStatus = "ENROUTE_TO_DROPOFF"; |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/OnboardReminder-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-FR.mp3"; |
| | | break; |
| | | } |
| | | break; |
| | |
| | | tripStatus = "COMPLETE"; |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ReachDestination-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-FR.mp3"; |
| | | break; |
| | | } |
| | | break; |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderPrivateCar.getUserId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderPrivateCar.getUserId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(audioUrl); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | @Override |
| | | public boolean calculateMileage(Integer orderId, String lon, String lat) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(orderPrivateCar.getState() == 2){ |
| | | return false; |
| | | } |
| | | OrderPosition orderPosition = orderPositionService.queryNew(orderId, 1); |
| | | String now = lon + "," + lat; |
| | | String old = null; |
| | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(now, old); |
| | | if(null != distance){ |
| | | Double distance1 = distance.get("WGS84"); |
| | | if(distance1 > 50 && orderPrivateCar.getState() < 5){//大于50米表示在移动 |
| | | if(distance1 > 50 && Arrays.asList(3, 4).contains(orderPrivateCar.getState())){//大于50米表示在移动 |
| | | orderPrivateCar.setToStartPointMileage(new BigDecimal(orderPrivateCar.getToStartPointMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | this.updateById(orderPrivateCar); |
| | | return true; |
| | |
| | | */ |
| | | List<Company> query(@Param("province") String province, @Param("city") String city, |
| | | @Param("code") String code); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据行政区域代码获取企业 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | Company query1(@Param("cityIds") List<Integer> cityIds); |
| | | |
| | | |
| | | List<Company> queryList(@Param("city") String[] city, @Param("type") Integer type); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Double getThisWeekMoney(@Param("driverId") Integer driverId); |
| | | |
| | | |
| | | /** |
| | | * 获取当前已上班type业务类型、设置了可以接此类型的单据、服务车型匹配且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | List<Driver> queryIdleDriver_(@Param("type") Integer type, @Param("serverCarModelId") Integer serverCarModelId, |
| | | @Param("companyId") Integer companyId); |
| | | } |
| | |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="query1" resultType="Company"> |
| | | select |
| | | id as id, |
| | | isSpe as isSpe, |
| | | isTaxi as isTaxi, |
| | | isCross as isCross, |
| | | isCrossLogistics as isCrossLogistics, |
| | | isSameLogistics as isSameLogistics, |
| | | isCharter as isCharter, |
| | | isSpeFixedOrProportional as isSpeFixedOrProportional, |
| | | isTaxiFixedOrProportional as isTaxiFixedOrProportional, |
| | | isCrossLogisticsFixedOrProportional as isCrossLogisticsFixedOrProportional, |
| | | isSameLogisticsFixedOrProportional as isSameLogisticsFixedOrProportional, |
| | | speMoney as speMoney, |
| | | taxiMoney as taxiMoney, |
| | | crossLogisticsMoney as crossLogisticsMoney, |
| | | sameLogisticsMoney as sameLogisticsMoney, |
| | | isNeedFerry as isNeedFerry, |
| | | name as name, |
| | | type as type, |
| | | superiorId as superiorId, |
| | | principalName as principalName, |
| | | principalPhone as principalPhone, |
| | | adminName as adminName, |
| | | adminPhone as adminPhone, |
| | | urgentPhoen as urgentPhoen, |
| | | setupTime as setupTime, |
| | | identifier as identifier, |
| | | addressCode as addressCode, |
| | | businessScope as businessScope, |
| | | contactAddress as contactAddress, |
| | | documentAddress as documentAddress, |
| | | economicType as economicType, |
| | | regCapital as regCapital, |
| | | legalName as legalName, |
| | | legalId as legalId, |
| | | legalPhone as legalPhone, |
| | | legalPhotoUrl as legalPhotoUrl, |
| | | licensingAgency as licensingAgency, |
| | | licenseTime as licenseTime, |
| | | licenseStartTime as licenseStartTime, |
| | | licenseEndTime as licenseEndTime, |
| | | licenseNumber as licenseNumber, |
| | | carNum as carNum, |
| | | driverNum as driverNum, |
| | | mac as mac, |
| | | state as state, |
| | | flag as flag, |
| | | upload as upload, |
| | | insertTime as insertTime |
| | | from t_company where flag != 3 and state = 0 and id in ( |
| | | select companyId from t_company_city where state = 1 |
| | | <if test="null != cityIds"> |
| | | and cityId in |
| | | <foreach collection="cityIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) order by `type` desc limit 0, 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="queryList" resultType="Company"> |
| | | select |
| | | id as id, |
| | |
| | | date_format(insertTime, '%Y-%m-%d') |
| | | ) = YEARWEEK(now()) |
| | | </select> |
| | | |
| | | |
| | | <select id="queryIdleDriver_" resultType="Driver"> |
| | | select * from ( |
| | | select |
| | | * |
| | | from t_driver |
| | | where flag != 3 and state = 2 and authState = 2 |
| | | <if test="null != companyId"> |
| | | <choose> |
| | | <when test="companyId != 1"> |
| | | and companyId = #{companyId} or franchiseeId = #{companyId} |
| | | </when> |
| | | <otherwise> |
| | | and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0 |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </if> |
| | | and id in |
| | | ( |
| | | select driverId from t_driver_work where startTime < now() and state = 1 and `type` like CONCAT('%', #{type}, '%') |
| | | ) |
| | | and id in (select driverId from t_driver_orders where `type` = #{type}) |
| | | and carId in (select carId from t_car_service where `type` = #{type} |
| | | |
| | | <if test="null != serverCarModelId"> |
| | | and serverCarModelId = #{serverCarModelId} |
| | | </if> |
| | | ) |
| | | ) as aa <!--where aa.id not in ( |
| | | select driverId from t_order_private_car where isDelete = 1 and driverPay = 1 and state in (7, 8, 9) |
| | | union all |
| | | select driverId from t_order_logistics where isDelete = 1 and driverPay = 1 and state != 10 |
| | | )--> |
| | | </select> |
| | | </mapper> |
| | |
| | | * @throws Exception |
| | | */ |
| | | Company query(String lon, String lat) throws Exception; |
| | | Company query1(String lon, String lat) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | Double getThisWeekMoney(@Param("driverId") Integer driverId); |
| | | |
| | | |
| | | /** |
| | | * 获取给定车型且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param lon |
| | | * @param lat |
| | | * @param distance |
| | | * @param companyId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.PushOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IPushOrderService extends IService<PushOrder> { |
| | | |
| | | |
| | | /** |
| | | * 获取推送配置数据 |
| | | * @param type |
| | | * @param pushType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CompanyCityMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CompanyMapper; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.CompanyCity; |
| | | import com.stylefeng.guns.modular.system.service.ICityService; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyCityService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | |
| | | /** |
| | |
| | | Company query = this.query(districtCode); |
| | | return query; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Company query1(String lon, String lat) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon)); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] citys = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | citys[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Company query = this.query1(citys); |
| | | return query; |
| | | } |
| | | |
| | | /** |
| | | * 根据行政编号获取所属企业 |
| | | * @param code |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | public Company query1(String[] city) throws Exception { |
| | | List<City> cities = cityService.selectList(new EntityWrapper<City>().in("chineseName", Arrays.asList(city)).or() |
| | | .in("englishName", Arrays.asList(city)).or().in("frenchName", Arrays.asList(city))); |
| | | List<Integer> collect = cities.stream().map(City::getId).collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | return null; |
| | | } |
| | | return companyMapper.query1(collect); |
| | | } |
| | | } |
| | |
| | | String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" : |
| | | language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" : |
| | | "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail"; |
| | | String fileName = "OffLine" + driver.getId() + ".mp3"; |
| | | String audioUrl = null; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("msg", msg); |
| | | map.put("audioUrl", audioUrl); |
| | | pushUtil.pushOffline(driverOnline.getDriverId(), 2, map); |
| | | pushUtil.afterWork(driverOnline.getDriverId(), 2, map); |
| | | |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" : |
| | | language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" : |
| | | "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail"; |
| | | String fileName = "OffLine" + driver.getId() + ".mp3"; |
| | | String audioUrl = null; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("msg", msg); |
| | | map.put("audioUrl", audioUrl); |
| | | pushUtil.pushOffline(driverWork.getDriverId(), 2, map); |
| | | pushUtil.afterWork(driverWork.getDriverId(), 2, map); |
| | | |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | 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.AddressComponentsVo; |
| | | 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.GoogleMap.*; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryHomeData(Integer uid, Integer language) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLanguage(language); |
| | | this.updateById(driver); |
| | | Map<String, Object> map = driverMapper.queryHomeData(uid); |
| | | int size = this.queryMyActivity(uid, new Date(), language).size(); |
| | | map.put("activity", size); |
| | |
| | | public ResultUtil work(Integer uid, String type, Integer language) throws Exception { |
| | | DriverWork driverWork = driverWorkMapper.queryNewWork(uid, null, 1); |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLanguage(language); |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | String audioUrl = ""; |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(null != driverWork){//作下班操作 |
| | | //检测是否有未完成的订单 |
| | | List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid, language); |
| | |
| | | } |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-FR.mp3"; |
| | | break; |
| | | } |
| | | }else{ |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(driver.getCompanyId()==null){ |
| | | loginWarpper.setJumpCode("100000"); |
| | | return ResultUtil.success(loginWarpper); |
| | |
| | | |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-FR.mp3"; |
| | | break; |
| | | } |
| | | } |
| | | this.updateById(driver); |
| | | return ResultUtil.success(audioUrl); |
| | | loginWarpper.setAudioUrl(audioUrl); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | |
| | |
| | | public Double getThisWeekMoney(Integer driverId) { |
| | | return this.baseMapper.getThisWeekMoney(driverId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取给定车型且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param lon |
| | | * @param lat |
| | | * @param distance |
| | | * @param companyId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | if(null != distancematrix){ |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | if(null != map.get("telX")){ |
| | | map.put("phone", map.get("telX")); |
| | | } |
| | | Integer companyId = 1; |
| | | if(null != map.get("driverId")){ |
| | | companyId = Integer.valueOf(String.valueOf(map.get("companyId"))); |
| | | } |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", companyId)); |
| | | JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent()); |
| | | int driverTimeout = jsonObject.getIntValue("driverTimeout"); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Integer type = Integer.valueOf(map.get("orderType").toString()); |
| | | if(type == 2){ |
| | | String travelTime = map.get("travelTime").toString(); |
| | | long time = System.currentTimeMillis() - sdf.parse(travelTime).getTime() - (driverTimeout * 60000); |
| | | map.put("timeOutCancel", Double.valueOf(time / 60000).intValue()); |
| | | }else{ |
| | | String estimateArriveTime = map.get("estimateArriveTime").toString(); |
| | | long time = System.currentTimeMillis() - sdf.parse(estimateArriveTime).getTime() - (driverTimeout * 60000); |
| | | map.put("timeOutCancel", Double.valueOf(time / 60000).intValue()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalUserId, orderId, orderType, finalState); |
| | | pushUtil.pushOrderState(2, finalDriverId, orderId, orderType, finalState); |
| | | pushUtil.pushOrderState(1, finalUserId, orderId, orderType, finalState, 0, ""); |
| | | pushUtil.pushOrderState(2, finalDriverId, orderId, orderType, finalState, 0, ""); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.PushOrderMapper; |
| | | import com.stylefeng.guns.modular.system.model.PushOrder; |
| | | import com.stylefeng.guns.modular.system.service.IPushOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class PushOrderServiceImpl extends ServiceImpl<PushOrderMapper, PushOrder> implements IPushOrderService { |
| | | |
| | | @Resource |
| | | private PushOrderMapper pushOrderMapper; |
| | | |
| | | |
| | | /** |
| | | * 获取推送配置 |
| | | * @param type |
| | | * @param pushType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, companyId); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.DispatchMapper; |
| | | import com.stylefeng.guns.modular.system.dao.ReassignMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.server.impl.OrderPrivateCarServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | 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.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.quartz.QuartzUtil; |
| | | import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.apache.shiro.util.StringUtils; |
| | | import org.quartz.JobDataMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | |
| | | @Autowired |
| | | private IPushOrderService pushOrderService; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private ISysOvertimeService sysOvertimeService; |
| | | |
| | | @Resource |
| | | private ICancleOrderService cancleOrderService; |
| | | |
| | | @Resource |
| | | private UserInfoMapper userInfoMapper; |
| | | |
| | | @Resource |
| | | private FleetEngineUtil fleetEngineUtil; |
| | | |
| | | @Resource |
| | | private CarModelMapper carModelMapper; |
| | | |
| | | |
| | | |
| | |
| | | "Your request for reassignment was submitted, we shall handle it for you as soon as possible." : |
| | | "Votre demande de réaffectation a été soumise. Nous la traiterons pour vous dans les plus brefs délais.", uid); |
| | | |
| | | //开始自动完成改派 |
| | | switch (reassign.getOrderType()){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(reassign.getOrderId()); |
| | | Company company = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | PushOrder pushOrder = pushOrderService.querys(1, 1, company.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | String text = ""; |
| | | Driver driver1 = list.get(0); |
| | | reassign.setState(3); |
| | | reassign.setNowDriverId(driver1.getId()); |
| | | reassign.setNowCarId(driver1.getCarId()); |
| | | reassign.setCompleteTime(new Date()); |
| | | this.updateById(reassign); |
| | | |
| | | |
| | | Integer language1 = driver1.getLanguage(); |
| | | switch (language1){ |
| | | case 1: |
| | | text = "收到新的打车订单,从" + orderPrivateCar.getStartAddress() + "出发,全程约" + orderPrivateCar.getEstimatedMileage() + "公里"; |
| | | break; |
| | | case 2: |
| | | text = "Received a new ride order, starting from " + orderPrivateCar.getStartAddress() + ", the whole journey is about " + orderPrivateCar.getEstimatedMileage() + "kilometre"; |
| | | break; |
| | | case 3: |
| | | text = "J'ai reçu une nouvelle commande de course, à partir de " + orderPrivateCar.getStartAddress() + ", le trajet complet est d’environ " + orderPrivateCar.getEstimatedMileage() + "kilométrage"; |
| | | break; |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (process != null) { |
| | | process.destroy(); |
| | | } |
| | | } |
| | | }, 30000); |
| | | |
| | | orderPrivateCar.setDriverId(driver1.getId()); |
| | | orderPrivateCar.setCarId(driver1.getCarId()); |
| | | orderPrivateCar.setCompanyId(driver1.getFranchiseeId() != null && driver1.getFranchiseeId() != 0 ? driver1.getFranchiseeId() : ( |
| | | driver1.getCompanyId() != null && driver1.getCompanyId() != 0 ? driver1.getCompanyId() : 1)); |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | orderPrivateCar.setState(orderPrivateCar.getOldState()); |
| | | orderPrivateCar.setOldState(null); |
| | | if(!StringUtils.hasLength(orderPrivateCar.getTripId())){ |
| | | orderPrivateCar.setTripId(UUIDUtil.getRandomCode()); |
| | | } |
| | | |
| | | if(orderPrivateCar.getOrderType() == 1){ |
| | | String value = redisUtil.getValue("DRIVER" + driver1.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])); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); |
| | | orderPrivateCar.setEstimateArriveMileage(distancematrix.getDistance()); |
| | | } |
| | | } |
| | | orderPrivateCarService.updateAllColumnById(orderPrivateCar); |
| | | driver1.setState(3); |
| | | driverService.updateById(driver1); |
| | | |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | //删除定时任务 |
| | | QuartzUtil.deleteQuartzTask("1_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("2_1_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("2_2_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("3_" + orderPrivateCar.getId() + "_1","ORDER_TIME_OUT"); |
| | | |
| | | /** |
| | | * 超时用户取消不收费的提醒 |
| | | * 预约单:行程时间 + 配置不收费的时间 > 当前时间 (只弹一次) |
| | | * 即时单:预估到达预约点时间 + 配置不收费的时间 > 当前时间 (只弹一次) |
| | | * |
| | | * 超时用户取消订单后需要弹给司机提醒弹框,超时时间 = 当前时间 - 行程时间 - 配置不收费的时间 |
| | | * |
| | | * 定时提醒弹框 |
| | | * 司机只要开始超时且还未到达预约点,则需要定时提醒 |
| | | * |
| | | * 预约单需要提前xx分钟提醒司机需要接乘客,过后每隔xx分钟提醒一次。超时后停止提醒 |
| | | */ |
| | | |
| | | //添加定时任务(普通任务) |
| | | SysOvertime reminderRules = sysOvertimeService.selectOne(new EntityWrapper<SysOvertime>().eq("companyId", driver1.getCompanyId())); |
| | | if(null != reminderRules){ |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver1.getCompanyId())); |
| | | Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout"); |
| | | |
| | | //即时单 |
| | | if(orderPrivateCar.getOrderType() == 1){ |
| | | //超时时间 |
| | | long timeOut = orderPrivateCar.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000); |
| | | //乘客取消不收费提醒 |
| | | JobDataMap jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 1); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", timeOut); |
| | | jobDataMap.put("driverTimeout", driverTimeout); |
| | | jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 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_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(timeOut), timeOut, 0); |
| | | |
| | | //超时循环提醒 |
| | | jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 3); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getEstimateArriveTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", ""); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , orderPrivateCar.getEstimateArriveTime(), reminderRules.getCar() * 60000, -1); |
| | | }else{ |
| | | //超时时间 |
| | | long timeOut = orderPrivateCar.getTravelTime().getTime() + (driverTimeout * 60000); |
| | | //乘客取消不收费提醒 |
| | | JobDataMap jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 1); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", timeOut); |
| | | jobDataMap.put("driverTimeout", driverTimeout); |
| | | jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 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_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(timeOut), timeOut, 0); |
| | | |
| | | |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | | |
| | | //预约单出发首次提醒 |
| | | long travelTime = orderPrivateCar.getTravelTime().getTime() - reminderRules.getReserveTime() * 60000; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); |
| | | jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 2); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", timeOut); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", language1 == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + ",请准时!" : |
| | | language1 == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " : |
| | | "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure."); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob("2_1_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(travelTime), travelTime, 0); |
| | | |
| | | //预约单出发循环提醒 |
| | | jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 2); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", language1 == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + ",请准时!" : |
| | | language1 == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " : |
| | | "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure."); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob("2_2_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , new Date(travelTime + reminderRules.getReserveNext() * 60000), reminderRules.getReserveNext() * 60000, -1); |
| | | |
| | | //超时循环提醒 |
| | | jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 3); |
| | | jobDataMap.put("orderId", orderPrivateCar.getId()); |
| | | jobDataMap.put("orderType", 1); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", orderPrivateCar.getTravelTime().getTime()); |
| | | jobDataMap.put("driverTimeout", 0); |
| | | jobDataMap.put("describe", ""); |
| | | QuartzUtil.addSimpleQuartzTask( |
| | | new OrderTimeOutJob().buildQuartzJob("3_" + orderPrivateCar.getId() + "_1", "ORDER_TIME_OUT", jobDataMap) |
| | | , orderPrivateCar.getTravelTime(), reminderRules.getCar() * 60000, -1); |
| | | } |
| | | } |
| | | |
| | | new Thread(()->{ |
| | | try { |
| | | Car car = carService.selectById(orderPrivateCar.getCarId()); |
| | | if(!StringUtils.hasLength(car.getVehicleId())){ |
| | | car.setVehicleId(UUIDUtil.getRandomCode()); |
| | | carService.updateById(car); |
| | | } |
| | | String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId()); |
| | | if(ToolUtil.isEmpty(trip)){ |
| | | String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | if(ToolUtil.isEmpty(vehicles)){ |
| | | CarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | } |
| | | fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(), |
| | | orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | } |
| | | //开始修改行程数据 |
| | | fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | |
| | | //推送相关代码------------------start---------------- |
| | | String finalAudioUrl = audioUrl; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderReassign(orderPrivateCar.getUserId(), 1, orderPrivateCar.getId(), 1, ""); |
| | | pushUtil.pushOrderReassign(orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, finalAudioUrl); |
| | | } |
| | | }).start(); |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(2, language1 == 1 ? "您已成功抢得打车订单,请及时联系客户!" : |
| | | language1 == 2 ? "You have grabbed the ride order, please contact the client timely." |
| | | : "Vous avez saisi la commande de course, veuillez contacter le client en temps opportun.", orderPrivateCar.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver1.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language1 == 2 ? "Your order has been assigned to the driver- " + driver1.getFirstName() + ", please keep your line on." |
| | | : "Votre commande a été attribuée au chauffeur- " + driver1.getFirstName() + ", S'il vous plaît, restez en ligne.", orderPrivateCar.getUserId()); |
| | | |
| | | } |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | | Company company1 = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | PushOrder pushOrder1 = pushOrderService.querys(1, 1, company1.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list1)); |
| | | if(list1.size() > 0){ |
| | | Driver driver1 = list1.get(0); |
| | | reassign.setState(3); |
| | | reassign.setNowDriverId(driver1.getId()); |
| | | reassign.setNowCarId(driver1.getCarId()); |
| | | reassign.setCompleteTime(new Date()); |
| | | this.updateById(reassign); |
| | | |
| | | String text = ""; |
| | | Integer language1 = driver1.getLanguage(); |
| | | switch (language1){ |
| | | case 1: |
| | | text = "收到新的包裹订单,从" + orderLogistics.getStartAddress() + "出发,全程约" + orderLogistics.getEstimatedMileage() + "公里"; |
| | | break; |
| | | case 2: |
| | | text = "Received a new delivery order, starting from " + orderLogistics.getStartAddress() + ", the whole journey is about " + orderLogistics.getEstimatedMileage() + "kilometre"; |
| | | break; |
| | | case 3: |
| | | text = "J'ai reçu une nouvelle commande de livraison, à partir de " + orderLogistics.getStartAddress() + ", le trajet complet est d’environ " + orderLogistics.getEstimatedMileage() + "kilométrage"; |
| | | break; |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + driver1.getId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (process != null) { |
| | | process.destroy(); |
| | | } |
| | | } |
| | | }, 30000); |
| | | |
| | | |
| | | orderLogistics.setDriverId(driver1.getId()); |
| | | orderLogistics.setCarId(driver1.getCarId()); |
| | | orderLogistics.setCompanyId(driver1.getFranchiseeId() != null && driver1.getFranchiseeId() != 0 ? driver1.getFranchiseeId() : ( |
| | | driver1.getCompanyId() != null && driver1.getCompanyId() != 0 ? driver1.getCompanyId() : 1)); |
| | | orderLogistics.setState(orderLogistics.getOldState()); |
| | | orderLogistics.setOldState(null); |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | if(!StringUtils.hasLength(orderLogistics.getTripId())){ |
| | | orderLogistics.setTripId(UUIDUtil.getRandomCode()); |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + driver1.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | | orderLogistics.setEstimateArriveMileage(distancematrix.getDistance()); |
| | | } |
| | | orderLogisticsService.updateAllColumnById(orderLogistics); |
| | | //修改司机为服务中 |
| | | driver1.setState(3); |
| | | driverService.updateById(driver1); |
| | | |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | //删除定时任务 |
| | | QuartzUtil.deleteQuartzTask("1_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("2_1_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("2_2_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT"); |
| | | QuartzUtil.deleteQuartzTask("3_" + orderLogistics.getId() + "_4","ORDER_TIME_OUT"); |
| | | |
| | | /** |
| | | * 超时用户取消不收费的提醒 |
| | | * 即时单:预估到达预约点时间 + 配置不收费的时间 > 当前时间 (只弹一次) |
| | | * |
| | | * 超时用户取消订单后需要弹给司机提醒弹框,超时时间 = 当前时间 - 行程时间 - 配置不收费的时间 |
| | | * |
| | | * 定时提醒弹框 |
| | | * 司机只要开始超时且还未到达预约点,则需要定时提醒 |
| | | */ |
| | | |
| | | //添加定时任务(普通任务) |
| | | SysOvertime reminderRules = sysOvertimeService.selectOne(new EntityWrapper<SysOvertime>().eq("companyId", driver1.getCompanyId())); |
| | | if(null != reminderRules){ |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", driver1.getCompanyId())); |
| | | Integer driverTimeout = JSON.parseObject(cancleOrder.getContent()).getInteger("driverTimeout"); |
| | | //超时时间 |
| | | long timeOut = orderLogistics.getEstimateArriveTime().getTime() + (driverTimeout * 60 * 1000); |
| | | //乘客取消不收费提醒 |
| | | JobDataMap jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 1); |
| | | jobDataMap.put("orderId", orderLogistics.getId()); |
| | | jobDataMap.put("orderType", 4); |
| | | jobDataMap.put("language", language1); |
| | | jobDataMap.put("timeOut", timeOut); |
| | | jobDataMap.put("driverTimeout", driverTimeout); |
| | | jobDataMap.put("describe", language1 == 1 ? "您已超时" + driverTimeout + "分钟,用户可免费取消订单" : language1 == 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); |
| | | |
| | | //超时循环提醒 |
| | | jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("driverId", driver1.getId()); |
| | | jobDataMap.put("timeOutType", 3); |
| | | jobDataMap.put("orderId", orderLogistics.getId()); |
| | | jobDataMap.put("orderType", 4); |
| | | jobDataMap.put("language", language1); |
| | | 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); |
| | | } |
| | | |
| | | new Thread(()->{ |
| | | try { |
| | | Car car = carService.selectById(orderLogistics.getCarId()); |
| | | if(!StringUtils.hasLength(car.getVehicleId())){ |
| | | car.setVehicleId(UUIDUtil.getRandomCode()); |
| | | carService.updateById(car); |
| | | } |
| | | String trip = fleetEngineUtil.getTrip(orderLogistics.getTripId()); |
| | | if(ToolUtil.isEmpty(trip)){ |
| | | String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | if(ToolUtil.isEmpty(vehicles)){ |
| | | CarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | } |
| | | fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(), |
| | | orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(), orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString()); |
| | | }else{ |
| | | //开始修改行程数据 |
| | | fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | |
| | | //推送相关代码------------------start---------------- |
| | | String finalAudioUrl = audioUrl; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderReassign(orderLogistics.getUserId(), 1, orderLogistics.getId(), 4, ""); |
| | | pushUtil.pushOrderReassign(orderLogistics.getDriverId(), 2, orderLogistics.getId(), 4, finalAudioUrl); |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, language1 == 1 ? "您已成功抢得包裹订单,请及时联系客户!" : |
| | | language1 == 2 ? "You have grabbed the delivery order, please contact the client timely." |
| | | : "Vous avez saisi la commande du livraison. Veuillez contacter le client en temps opportun.", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? "您的订单已指派给" + driver1.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language1 == 2 ? "Your order has been assigned to the driver- " + driver1.getFirstName() + ", please keep your line on." |
| | | : "Votre commande a été attribuée au chauffeur- " + driver1.getFirstName() + ", S'il vous plaît, restez en ligne.", orderLogistics.getUserId()); |
| | | |
| | | } |
| | | break; |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | |
| | | driver1.setLaveBusinessMoney(new BigDecimal(laveBusinessMoney).subtract(new BigDecimal(payMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | settlementRecord.setPaymentStatus(2); |
| | | settlementRecord.setPayType(payType); |
| | | settlementRecord.setBalanceType(1); |
| | | settlementRecord.setBalanceType(2); |
| | | settlementRecord.setPayTime(new Date()); |
| | | this.updateById(settlementRecord); |
| | | balanceUsageRecordService.saveBalanceUsageRecord(settlementRecord.getDriverId(), 2, payMoney, settlementRecord.getType() + 2); |
| | |
| | | queryHistoricalSettlement.setType(Integer.valueOf(map.get("type").toString())); |
| | | } |
| | | if(null != map.get("payType")){ |
| | | Integer balanceType = Integer.valueOf(map.get("balanceType").toString()); |
| | | switch (map.get("payType").toString()){ |
| | | case "1": |
| | | queryHistoricalSettlement.setPayType(language == 1 ? "手机支付" : language == 2 ? "Mobile Money" : "Paiement mobile"); |
| | |
| | | queryHistoricalSettlement.setPayType(language == 1 ? "线上支付" : language == 2 ? "Bank Card" : "Carte bancaire"); |
| | | break; |
| | | default: |
| | | Integer balanceType = Integer.valueOf(map.get("balanceType").toString()); |
| | | queryHistoricalSettlement.setPayType(language == 1 ? "余额支付(" + (balanceType == 1 ? "奖励" : "收入") + ")" : language == 2 ? "Wallet (" + (balanceType == 1 ? "Reward" : "Income") + ")" : "Portefeuille (" + (balanceType == 1 ? "Récompense" : "Revenu") + ")"); |
| | | break; |
| | | } |
| | |
| | | * @param orderType 订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | * @param state 订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中) |
| | | */ |
| | | public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state){ |
| | | public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state, Integer time, String audioUrl){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("state", state); |
| | | map.put("audioUrl", audioUrl); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | |
| | | * @param orderId |
| | | * @param orderType |
| | | */ |
| | | public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType){ |
| | | public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType, String audioUrl){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("audioUrl", audioUrl); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void afterWork(Integer id, Integer type, Object object){ |
| | | JSONObject msg = new JSONObject(); |
| | | msg.put("code", 200); |
| | | msg.put("msg", "SUCCESS"); |
| | | msg.put("method", "AFTER_WORK"); |
| | | msg.put("data", object); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IUserService; |
| | | import com.stylefeng.guns.modular.system.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.util.TextToSpeechUtil; |
| | | import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Timer; |
| | |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | @Resource |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | @Resource |
| | | private IDriverService driverService; |
| | | @Resource |
| | | private UserInfoMapper userInfoMapper; |
| | | |
| | | |
| | | |
| | |
| | | Integer driverId = jobDataMap.getIntValue("driverId"); |
| | | Integer orderId = jobDataMap.getIntValue("orderId"); |
| | | Integer orderType = jobDataMap.getIntValue("orderType"); |
| | | Integer language = jobDataMap.getIntValue("language"); |
| | | Integer driverTimeout = jobDataMap.getIntValue("driverTimeout"); |
| | | long timeOut = jobDataMap.getLongValue("timeOut"); |
| | | String describe = jobDataMap.getString("describe"); |
| | | Driver driver = driverService.selectById(driverId); |
| | | Integer language = driver.getLanguage(); |
| | | if(1 == timeOutType){ |
| | | if(orderType == 1){ |
| | | 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"; |
| | | } |
| | | if(orderType == 4){ |
| | | 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"; |
| | | } |
| | | } |
| | | if(2 == timeOutType){ |
| | | if(orderType == 1){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); |
| | | describe = language == 1 ? "您将于" + sdf.format(orderPrivateCar.getTravelTime()) + "去接" + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + ",请准时!" : |
| | | language == 2 ? "You are going to pick up " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " at " + sdf.format(orderPrivateCar.getTravelTime()) + ", please be on time. " : |
| | | "Vous allez chercher " + (ToolUtil.isEmpty(userInfo.getFirstName()) ? userInfo.getNickName() : userInfo.getFirstName() + " " + userInfo.getLastName()) + " à " + sdf.format(orderPrivateCar.getTravelTime()) + ", s’il vous plaît soyez à l’heure."; |
| | | } |
| | | if(orderType == 4){ |
| | | } |
| | | } |
| | | if(3 == timeOutType){ |
| | | Integer m = Double.valueOf((System.currentTimeMillis() - timeOut) / 60000).intValue(); |
| | | if(orderType == 1){ |
| | |
| | | } |
| | | } |
| | | |
| | | String fileName = "orderTimeOut" + driverId + "_" + timeOutType + ".mp3"; |
| | | String audioUrl = null; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", describe, "orderTimeOut" + driverId + "_" + timeOutType + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", describe, fileName); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/orderTimeOut" + driverId + "_" + timeOutType + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("google车辆id") |
| | | private String vehicleId; |
| | | |
| | | private String audioUrl; |
| | | |
| | | |
| | | public String getJumpCode() { |
| | |
| | | public void setVehicleId(String vehicleId) { |
| | | this.vehicleId = vehicleId; |
| | | } |
| | | |
| | | public String getAudioUrl() { |
| | | return audioUrl; |
| | | } |
| | | |
| | | public void setAudioUrl(String audioUrl) { |
| | | this.audioUrl = audioUrl; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("是否冻结(1=否,2=是)") |
| | | private Integer isFrozen; |
| | | @ApiModelProperty("超时取消时间") |
| | | private Integer timeOutCancel; |
| | | private Long timeOutCancel; |
| | | @ApiModelProperty("超时语音文件地址") |
| | | private String audioUrl; |
| | | @ApiModelProperty("接单时间") |
| | |
| | | this.isFrozen = isFrozen; |
| | | } |
| | | |
| | | public Integer getTimeOutCancel() { |
| | | public Long getTimeOutCancel() { |
| | | return timeOutCancel; |
| | | } |
| | | |
| | | public void setTimeOutCancel(Integer timeOutCancel) { |
| | | public void setTimeOutCancel(Long timeOutCancel) { |
| | | this.timeOutCancel = timeOutCancel; |
| | | } |
| | | |
| | |
| | | orderInfoWarpper.setUserName(null != map.get("userName") ? String.valueOf(map.get("userName")) : ""); |
| | | orderInfoWarpper.setDriverPay(null != map.get("driverPay") ? Integer.valueOf(map.get("driverPay").toString()) : 0); |
| | | orderInfoWarpper.setIsFrozen(null != map.get("isFrozen") ? Integer.valueOf(map.get("isFrozen").toString()) : 1); |
| | | orderInfoWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Integer.valueOf(map.get("timeOutCancel").toString()) : 0); |
| | | orderInfoWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Long.valueOf(map.get("timeOutCancel").toString()) : 0); |
| | | orderInfoWarpper.setSnatchOrderTime(null != map.get("snatchOrderTime") ? map.get("snatchOrderTime").toString() : ""); |
| | | orderInfoWarpper.setUserPhone(null != map.get("userPhone") ? map.get("userPhone").toString() : ""); |
| | | orderInfoWarpper.setTripId(null != map.get("tripId") ? map.get("tripId").toString() : ""); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | if(orderTaxi.getType() == 2){ |
| | | pushUtil.pushFerryOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, 2); |
| | | System.err.println("----------------------------------推送摆渡订单-----------------------------"); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | //添加定时任务6分钟司机不确认收款自动完成支付(仅车载端),6分钟之内司机无法接单 |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8); |
| | | pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8); |
| | | pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8, 0, ""); |
| | | pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8, 0, ""); |
| | | } |
| | | }).start(); |
| | | } |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8); |
| | | pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8); |
| | | pushUtil.pushOrderState(1, orderTaxi1.getUserId(), orderId, 2, 8, 0, ""); |
| | | pushUtil.pushOrderState(2, orderTaxi1.getDriverId(), orderId, 2, 8, 0, ""); |
| | | } |
| | | }).start(); |
| | | } |