| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.dao.LinePriceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Resource |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | userInfo.setInsertUser(uid); |
| | | userInfoService.insert(userInfo); |
| | | } |
| | | |
| | | /** |
| | | * 1.出租车、专车、跨城有待支付的订单不能叫车 |
| | | * 2.小件物流有未完成的订单可以下跨城、专车、出租车 |
| | | * 3.出租车、专车、跨城有预约单可以下即时单 |
| | | */ |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(userInfo.getId(), null, 1, 7, 12); |
| | | if(orderPrivateCars.size() > 0){ |
| | | return ResultUtil.error("乘客有未完成的订单"); |
| | | } |
| | | List<OrderTaxi> list = orderTaxiMapper.queryByState(userInfo.getId(), null, 1, 7, 12); |
| | | if(list.size() > 0){ |
| | | return ResultUtil.error("乘客有未完成的订单"); |
| | | } |
| | | |
| | | List<OrderCrossCity> orderCrossCities2 = orderCrossCityMapper.queryOrders(orderCrossCityWarpper.getDriverId(), orderCrossCityWarpper.getLineShiftDriverId(), Arrays.asList(5)); |
| | | if(orderCrossCities2.size() > 0){ |
| | | return ResultUtil.error("司机正在服务中"); |
| | | } |
| | | |
| | | |
| | | orderCrossCity.setUserId(userInfo.getId()); |
| | | orderCrossCity.setPassengers(orderCrossCityWarpper.getPassengers()); |
| | | orderCrossCity.setPassengersPhone(orderCrossCityWarpper.getPassengersPhone()); |
| | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |