| | |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.service.impl.CarServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.MerchantCouponListWarpper; |
| | |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | @Autowired |
| | | private CarModelMapper carModelMapper; |
| | | @Autowired |
| | | private CarServiceImpl carServiceImpl; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | //还原座位数 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(orderCrossCity.getLineShiftDriverId()); |
| | | lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber()); |
| | | if(1 == orderCrossCity.getTravelMode()){ |
| | | lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber()); |
| | | }else{ |
| | | Car car = carServiceImpl.selectById(driver.getCarId()); |
| | | CarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | lineShiftDriver.setLaveSeat(carModel.getSeat() - 1); |
| | | } |
| | | lineShiftDriver.setLaveSeatNumber( |
| | | (ToolUtil.isNotEmpty(lineShiftDriver.getLaveSeatNumber()) ? lineShiftDriver.getLaveSeatNumber() + "," : "") + |
| | | orderCrossCity.getSeatNumber() |
| | |
| | | |
| | | //修改司机空闲状态 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityMapper.queryWithin30Minutes(orderCrossCity.getDriverId(), 2, 3, 4, 5, 11); |
| | | if(orderCrossCities.size() == 0){ |
| | | if(orderCrossCities.size() <= 1){ |
| | | driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | |
| | | public void promotion(Integer orderId) { |
| | | OrderCrossCity orderCrossCity = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoMapper.selectById(orderCrossCity.getUserId()); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | if(orderCrossCity.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(" + 3 + ", 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(" + 3 + ", bizType) limit 1")); |
| | | System.out.println("ddddd"+tDriverPromotionActivity); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderCrossCity.getPayMoney(); |
| | | System.out.println(payMoney); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | System.out.println(bigDecimal); |
| | | orderCrossCity.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderCrossCity.setPromotionMoney(bigDecimal); |
| | | orderCrossCity.setPromotionActivityId(tDriverPromotionActivity.getId()); |
| | | orderCrossCity.setSuccessTime(new Date()); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /** |
| | |
| | | String lat = orderPosition.getLat(); |
| | | OrderCrossCity order = this.selectById(orderId); |
| | | if(null == order){ |
| | | System.err.println("订单数据异常:" + orderId); |
| | | System.err.println("跨城订单数据异常:" + orderId); |
| | | return false; |
| | | } |
| | | |