| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null); |
| | | if(updateTrip){ |
| | | continue; |
| | | privateCar.setIsover(1); |
| | | orderPrivateCarService.updateById(privateCar); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | privateCar.setIsover(1); |
| | | orderPrivateCarService.updateById(privateCar); |
| | | } |
| | | } |
| | | if(Arrays.asList(6, 7, 8, 9).contains(state) && !"COMPLETE".equals(tripStatus)){ |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null); |
| | | if(updateTrip){ |
| | | continue; |
| | | privateCar.setIsover(1); |
| | | orderPrivateCarService.updateById(privateCar); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | privateCar.setIsover(1); |
| | | orderPrivateCarService.updateById(privateCar); |
| | | } |
| | | } |
| | | } |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null); |
| | | if(updateTrip){ |
| | | continue; |
| | | orderLogistics.setIsover(1); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | orderLogistics.setIsover(1); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | } |
| | | } |
| | | if(Arrays.asList(6, 7, 8, 9).contains(state) && !"COMPLETE".equals(tripStatus)){ |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", (null != car ? car.getVehicleId() : null), null, tripId, null, null, null, null); |
| | | if(updateTrip){ |
| | | continue; |
| | | orderLogistics.setIsover(1); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | orderLogistics.setIsover(1); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | } |
| | | } |
| | | } |
| | |
| | | @TableField("tripId") |
| | | private String tripId; |
| | | /** |
| | | * google行程结束标识-是否结束(0=否,1=是) |
| | | */ |
| | | @TableField("isover") |
| | | private Integer isover; |
| | | /** |
| | | * 司机预估到达预约单时间 |
| | | */ |
| | | @TableField("estimateArriveTime") |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | orderLogistics.setIsover(1); |
| | | this.updateById(orderLogistics); |
| | | break; |
| | | } |
| | | try { |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | orderLogistics.setIsover(1); |
| | | this.updateById(orderLogistics); |
| | | } |
| | | //上报行程 |
| | | boolean reportBillableEvent = fleetEngineUtil.reportBillableEvent(orderLogistics.getTripId()); |
| | |
| | | @TableField("tripId") |
| | | private String tripId; |
| | | /** |
| | | * google行程结束标识-是否结束(0=否,1=是) |
| | | */ |
| | | @TableField("isover") |
| | | private Integer isover; |
| | | /** |
| | | * 司机预估到达预约单时间 |
| | | */ |
| | | @TableField("estimateArriveTime") |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | orderPrivateCar.setIsover(1); |
| | | this.updateById(orderPrivateCar); |
| | | break; |
| | | } |
| | | try { |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | orderPrivateCar.setIsover(1); |
| | | this.updateById(orderPrivateCar); |
| | | } |
| | | |
| | | //上报行程 |
| | |
| | | Date date = new Date(); |
| | | double d = (null == orderPrivateCar.getMileage() ? 0D : orderPrivateCar.getMileage()) / 1000;//实际公里 |
| | | double t = ((orderPrivateCar.getEndServiceTime().getTime() - orderPrivateCar.getStartServiceTime().getTime()) / 60000) + 1;//实际时间(不满一分钟按一分钟算) |
| | | double w = ((orderPrivateCar.getStartServiceTime().getTime() - orderPrivateCar.getArriveTime().getTime()) / 60000) + 1;//等待分钟(不满一分钟按一分钟算) |
| | | double w = ((orderPrivateCar.getStartServiceTime().getTime() - (null == orderPrivateCar.getArriveTime() ? orderPrivateCar.getStartServiceTime() : orderPrivateCar.getArriveTime()).getTime()) / 60000) + 1;//等待分钟(不满一分钟按一分钟算) |
| | | double d1 = (d - num2) < 0 ? 0 : d - num2;//超出起步里程的公里 |
| | | double t1 = (t - num3) < 0 ? 0 : new BigDecimal(t - num3).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超过起步分钟数的时间 |
| | | double w1 = (w - num6) < 0 ? 0 : new BigDecimal(w - num6).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超出等待时间的时间 |
| | |
| | | @Scheduled(fixedRate = 1000 * 60 * 5) |
| | | public void taskFiveMinute(){ |
| | | try { |
| | | //处理未支付订单发送短信通知 |
| | | orderService.taskSmsSend(); |
| | | for (Integer id: driverIds){ |
| | | jgPushUtil.push(1, "您的预约订单出行时间就要到了,请尽快前往预约地点接乘客", "DRIVER" + id); |
| | | } |
| | | this.driverIds.clear(); |
| | | // //处理未支付订单发送短信通知 |
| | | // orderService.taskSmsSend(); |
| | | // for (Integer id: driverIds){ |
| | | // jgPushUtil.push(1, "您的预约订单出行时间就要到了,请尽快前往预约地点接乘客", "DRIVER" + id); |
| | | // } |
| | | // this.driverIds.clear(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |