| | |
| | | @Autowired |
| | | private ITaxiCardService taxiCardService; |
| | | |
| | | @Autowired |
| | | private ITaxiCardPaymentService taxiCardPaymentService; |
| | | |
| | | |
| | | @Autowired |
| | | private IUserUserService userUserService; |
| | | |
| | |
| | | //添加收入 |
| | | Map<String, Object> map = incomeService.saveIncome(orderTaxi.getId(), 2, orderTaxi.getOrderMoney()); |
| | | orderTaxi.setSplitAllocation(JSON.toJSONString(map)); |
| | | |
| | | this.updateAllColumnById(orderTaxi); |
| | | promotion(orderTaxi.getId()); |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | |
| | | resultUtil = appOrderController.placeAnOrder(new BigDecimal(orderMoney), 4, orderId, 9, integer); |
| | | |
| | | } |
| | | |
| | | this.updateAllColumnById(orderTaxi); |
| | | if(payType!=3){ |
| | | this.updateAllColumnById(orderTaxi); |
| | | } |
| | | |
| | | return resultUtil; |
| | | } |
| | | |
| | |
| | | //计算预计距离和剩余时间 |
| | | String value = null; |
| | | if (null != orderTaxi.getDriverId()) { |
| | | value = (String) redisTemplate.opsForValue().get("DRIVER" + orderTaxi.getDriverId()); |
| | | value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + orderTaxi.getDriverId()); |
| | | if (null == value || "".equals(value)) { |
| | | System.err.println("司机没有上传位置信息"); |
| | | |
| | |
| | | } |
| | | } |
| | | Thread.sleep(pushOrder.getPushTime() * 1000);//设置等待时间 |
| | | OrderTaxi orderTaxi1 = OrderTaxiServiceImpl.this.selectById(orderTaxi.getId()); |
| | | OrderPrivateCar orderTaxi1 = orderPrivateCarService.selectById(orderTaxi.getId()); |
| | | Integer state = orderTaxi1.getState(); |
| | | if (state != 1) { |
| | | break; |
| | |
| | | UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); |
| | | if (orderTaxi.getPromotionDriverId() != null) { |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 2 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).le("startTime", new Date()).ge("endTime", new Date()).last("AND FIND_IN_SET(" + 2 + ", bizType) limit 1")); |
| | | if (tDriverPromotionActivity != null) { |
| | | Double payMoney = orderTaxi.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderTaxi.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderTaxi.setPromotionMoney(bigDecimal); |
| | | orderTaxi.setPromotionActivityId(tDriverPromotionActivity.getId()); |
| | | orderTaxi.setSuccessTime(new Date()); |
| | | this.baseMapper.updateById(orderTaxi); |
| | | } |
| | | } |