| | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | @Autowired |
| | | private IAppOperationLogService appOperationLogService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | // } |
| | | // System.out.println(map); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | appOperationLogService.addAppOperationLog(orderPrivateCar.getDriverId(), "{\"type\":\"司机抢单成功\",\"orderId\":\"" + orderPrivateCar.getId() + "\",\"orderInfo\":\"" + JSON.toJSONString(orderPrivateCar) + "\"}"); |
| | | //如果是预约单,则不修改司机为服务中 |
| | | if(orderPrivateCar.getOrderType() != 2 || (orderPrivateCar.getOrderType() == 2 && orderPrivateCar.getTravelTime().getTime() < System.currentTimeMillis() + 600000)){ |
| | | //修改司机为服务中 |
| | |
| | | /*if(state==5 && orderPrivateCar.getState()!=4){ |
| | | return ResultUtil.error("当前订单不能开始服务"); |
| | | }*/ |
| | | String stateName = ""; |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | // 判断是否有其他未完成的单子 |
| | |
| | | orderPrivateCar.setState(3); |
| | | orderPrivateCar.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderPrivateCar.getUserId()); |
| | | stateName = "出发前往预约点"; |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderPrivateCar.setState(4); |
| | | orderPrivateCar.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderPrivateCar.getUserId()); |
| | | stateName = "到达预约点,等待客户上车"; |
| | | break; |
| | | case 5://开始服务 |
| | | orderPrivateCar.setBoardingLon(lon); |
| | |
| | | orderPrivateCar.setStartServiceTime(new Date()); |
| | | |
| | | pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);//主动推送司机定位 |
| | | |
| | | stateName = "开始服务"; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | orderPrivateCar.setGetoffAddress(address); |
| | | orderPrivateCar.setGetoffTime(new Date()); |
| | | orderPrivateCar.setEndServiceTime(new Date()); |
| | | |
| | | stateName = "结束服务"; |
| | | // 结束服务时查询轨迹,计算距离 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | double sum = 0; |
| | |
| | | break; |
| | | } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | appOperationLogService.addAppOperationLog(orderPrivateCar.getDriverId(), "{\"type\":\"司机操作订单," + stateName + "\",\"orderId\":\"" + orderPrivateCar.getId() + "\",\"orderInfo\":\"" + JSON.toJSONString(orderPrivateCar) + "\"}"); |
| | | // TODO: 2020/6/5 推送状态 |
| | | OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | |
| | | // } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | |
| | | appOperationLogService.addAppOperationLog(orderPrivateCar.getDriverId(), "{\"type\":\"司机确认费用\",\"orderId\":\"" + orderPrivateCar.getId() + "\",\"orderInfo\":\"" + JSON.toJSONString(orderPrivateCar) + "\"}"); |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId()); |
| | | |
| | |
| | | orderPrivateCar.setPriceAuditState(1); |
| | | orderPrivateCar.setState(6); |
| | | this.updateById(orderPrivateCar); |
| | | appOperationLogService.addAppOperationLog(orderPrivateCar.getDriverId(), "{\"type\":\"司机修改费用\",\"orderId\":\"" + orderPrivateCar.getId() + "\",\"orderInfo\":\"" + JSON.toJSONString(orderPrivateCar) + "\"}"); |
| | | // 推送新的价格给用户 |
| | | pushUtil.pushOrderMoney(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, updatePrice, 0); |
| | | pushUtil.pushOrderMoney(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, updatePrice, 0); |