| | |
| | | // } |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(orderTaxi.getUserId()); |
| | | Integer promotion = isPromotion(orderTaxi.getUserId(), driver.getPlaceOfEmployment()); |
| | | if(promotion!=null){ |
| | | orderTaxi.setPromotion(2); |
| | | Driver driver1 = driverService.selectById(promotion); |
| | |
| | | orderTaxi.setTravelId(travelItinerary); |
| | | }else{ |
| | | //改派抢单 |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderTaxi.getTravelId()); |
| | | request1.setStatus(orderTaxi.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderTaxi.getTravelId()); |
| | | request1.setStatus(orderTaxi.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | this.updateById(orderTaxi); |
| | | |
| | |
| | | |
| | | return ResultUtil.success(orderTaxi.getId()); |
| | | } |
| | | private Integer isPromotion(Integer userId){ |
| | | private Integer isPromotion(Integer userId, String code){ |
| | | UserInfo userInfo = userInfoMapper.selectById(userId); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).le("startTime", new Date()).ge("endTime", new Date()).last("AND FIND_IN_SET(" + 2 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1) |
| | | .eq("districtCode", code).le("startTime", new Date()).ge("endTime", new Date()).last("AND FIND_IN_SET(" + 2 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return userInfo.getBindDriverId(); |
| | | } |
| | |
| | | orderTaxi.setOrderType(orderPrivateCar.getOrderType()); |
| | | orderTaxi.setOrderSource(orderPrivateCar.getOrderSource()); |
| | | orderTaxi.setIsDelete(1); |
| | | orderTaxi.setIsReassign(1); |
| | | return orderTaxi; |
| | | } |
| | | |
| | |
| | | } |
| | | this.updateById(orderTaxi); |
| | | |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderTaxi.getTravelId()); |
| | | request.setStatus(orderTaxi.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderTaxi.getTravelId()); |
| | | request.setStatus(orderTaxi.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | new Thread(new Runnable() { |
| | |
| | | this.updateById(orderTaxi); |
| | | |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderTaxi.getTravelId()); |
| | | request.setStatus(orderTaxi.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderTaxi.getTravelId()); |
| | | request.setStatus(orderTaxi.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | |
| | | //回滚司机状态为空闲 |
| | | driver.setState(2); |
| | |
| | | this.updateById(orderTaxi); |
| | | |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderTaxi.getTravelId()); |
| | | request1.setStatus(orderTaxi.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderTaxi.getTravelId()); |
| | | request1.setStatus(orderTaxi.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderTaxi.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderTaxi.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | |
| | | //回滚司机状态为空闲 |
| | | driver.setState(2); |