| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IDriverOnlineService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ISettlementRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | import java.util.TimeZone; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private JGPushUtil jgPushUtil; |
| | | |
| | | @Autowired |
| | | private ISettlementRecordService settlementRecordService; |
| | | |
| | | public Set<Integer> driverIds = new HashSet<>();//存储需要提醒司机预约单的司机id |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private IDriverOnlineService driverOnlineService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 5秒钟处理的任务 |
| | | */ |
| | | @Scheduled(fixedRate = 5000) |
| | | public void task5Second(){ |
| | | try { |
| | | // orderService.getDriverNowPosition(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | driverService.taskMinute(); |
| | | //处于预约单 |
| | | orderService.reservationOrder(); |
| | | //处理车载端断电后的自动下班 |
| | | driverService.taskOffWork(); |
| | | //处理结束订单后30分钟解绑小号功能 |
| | | orderService.taskMidAxbUnBindSend(); |
| | | //处理司机连续不接单的情况 |
| | | driverOnlineService.deductionDuration1(); |
| | | //处理google订单状态 |
| | | orderService.overGoogleOrder(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | @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(); |
| | | } |
| | |
| | | try { |
| | | //生成当天的司机活动 |
| | | driverService.addTodayActivity(); |
| | | //处理所有司机待结算数据 |
| | | settlementRecordService.taskSettlement(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |