| | |
| | | } |
| | | |
| | | // 10. 检查等待时间 |
| | | Integer waitTime = getWaitTime(routeAndFareDto.getOrigin().getLongitude(), routeAndFareDto.getOrigin().getLatitude()); |
| | | if (waitTime > 3) { |
| | | throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME); |
| | | } |
| | | fareVo.setWaitingTime(waitTime); |
| | | // Integer waitTime = getWaitTime(routeAndFareDto.getOrigin().getLongitude(), routeAndFareDto.getOrigin().getLatitude()); |
| | | // if (waitTime > 3) { |
| | | // throw new ServiceException("当前区域正在等待中,请耐心等待", I18nKeyConstant.WAITING_TIME); |
| | | // } |
| | | // fareVo.setWaitingTime(waitTime); |
| | | |
| | | |
| | | // 11. 生成订单ID并缓存 |
| | |
| | | } |
| | | |
| | | // 判断当天取消的次数 后台配置 redis 查询 |
| | | Object cancelOrder = redisService.getCacheObject("CANCEL_ORDER_" + uid); |
| | | log.info("取消次数:{}", cancelOrder); |
| | | // 静默处理 |
| | | boolean isSilent = false; |
| | | if (cancelOrder != null) { |
| | | Integer num = Integer.valueOf(cancelOrder.toString()); |
| | | if (num >= cancelCount) { |
| | | isSilent = true; |
| | | } |
| | | } |
| | | // Object cancelOrder = redisService.getCacheObject("CANCEL_ORDER_" + uid); |
| | | // log.info("取消次数:{}", cancelOrder); |
| | | // // 静默处理 |
| | | // boolean isSilent = false; |
| | | // if (cancelOrder != null) { |
| | | // Integer num = Integer.valueOf(cancelOrder.toString()); |
| | | // if (num >= cancelCount) { |
| | | // isSilent = true; |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // 获取起步里程 |
| | |
| | | Long orderId = addOrderR.getData(); |
| | | xpOrder.setId(orderId); |
| | | // 静默处理 不推单 |
| | | if (isSilent) { |
| | | log.info("订单取消次数达到上限,执行静默处理,不推单。"); |
| | | return orderId.toString(); |
| | | } |
| | | // if (isSilent) { |
| | | // log.info("订单取消次数达到上限,执行静默处理,不推单。"); |
| | | // return orderId.toString(); |
| | | // } |
| | | |
| | | // 最大距离 |
| | | Object maxPushDistanceObj = redisService.getCacheObject(CacheConstants.MAX_PUSH_DISTANCE); |