| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | |
| | | /** |
| | | * 批量订单 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> saveOrderPrivateCars(String serverCarModel, 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 uid, Integer peopleNum) throws Exception { |
| | | public ResultUtil<BaseWarpper> saveOrderPrivateCars(String serverCarModel, 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 uid, Integer peopleNum) throws Exception { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | if (lock.tryLock()) { |
| | | try{ |
| | | //如果出行时间大于当前10分钟则默认为预约单 |
| | | if(travelTime.getTime() > (System.currentTimeMillis() + 600000)){ |
| | | reservation = 2; |
| | | } |
| | | |
| | | /** |
| | | * 1.出租车、专车、跨城有待支付的订单不能叫车 |
| | | try { |
| | | //如果出行时间大于当前10分钟则默认为预约单 |
| | | if (travelTime.getTime() > (System.currentTimeMillis() + 600000)) { |
| | | reservation = 2; |
| | | } |
| | | |
| | | /** |
| | | * 1.出租车、专车、跨城有待支付的订单不能叫车 |
| | | * 2.小件物流有未完成的订单可以下跨城、专车、出租车 |
| | | * 3.出租车、专车、跨城有预约单可以下即时单 |
| | | */ |
| | |
| | | public List<Map<String, Object>> queryOrderInfo2(Integer orderId, Integer state, String lon, String lat) { |
| | | return this.baseMapper.queryOrderInfo2(orderId,state,lon,lat); |
| | | } |
| | | |
| | | /** |
| | | * 获取专车未支付订单 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayPrivateOrders(Integer uid) { |
| | | EntityWrapper<OrderPrivateCar> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | //查出未支付订单 |
| | | List<OrderPrivateCar> orderPrivateCars = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderPrivateCar order : orderPrivateCars) { |
| | | UnPayOrderVO vo = new UnPayOrderVO(); |
| | | // 复制属性 |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); vo.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(order, vo); |
| | | unPayOrderVOList.add(vo); |
| | | } |
| | | |
| | | return unPayOrderVOList; |
| | | } |
| | | } |