| | |
| | | public ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat, |
| | | String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer type, Integer uid, |
| | | BigDecimal estimatedPrice, String cityCode, Integer carIndex) throws Exception { |
| | | String k = "addOrder" + uid; |
| | | boolean b = redisUtil.hasKey(k); |
| | | if(b){ |
| | | return ResultUtil.error("不能重复下单"); |
| | | } |
| | | redisUtil.setStrValue(k, UUIDUtil.getRandomCode(), 30); |
| | | |
| | | try { |
| | | long timeMillis = System.currentTimeMillis(); |
| | | //如果出行时间大于当前10分钟则默认为预约单 |
| | | if(travelTime.getTime() > (System.currentTimeMillis() + 600000)){ |
| | |
| | | timeMillis = timeMillis4; |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | redisUtil.remove(k); |
| | | } |
| | | return ResultUtil.error("下单失败"); |
| | | } |
| | | |
| | | // @Override |