| | |
| | | driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); |
| | | orderPrivateCar.setState(2); |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | |
| | | |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(orderPrivateCar.getUserId()); |
| | | Integer promotion = isPromotion(orderPrivateCar.getUserId(), driver.getPlaceOfEmployment()); |
| | | if(null != promotion){ |
| | | orderPrivateCar.setPromotion(2); |
| | | Driver driver1 = driverService.selectById(promotion); |
| | |
| | | orderPrivateCar.setTravelId(travelItinerary); |
| | | }else{ |
| | | //改派抢单 |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderPrivateCar.getTravelId()); |
| | | request1.setStatus(orderPrivateCar.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderPrivateCar.getTravelId()); |
| | | request1.setStatus(orderPrivateCar.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | |
| | | this.updateById(orderPrivateCar); |
| | |
| | | } |
| | | |
| | | |
| | | 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).last(" and now() between startTime and endTime AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1) |
| | | .eq("districtCode", code).last(" and now() between startTime and endTime AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return userInfo.getBindDriverId(); |
| | | } |
| | |
| | | } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderPrivateCar.getTravelId()); |
| | | request.setStatus(orderPrivateCar.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderPrivateCar.getTravelId()); |
| | | request.setStatus(orderPrivateCar.getState()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderPrivateCar.getTravelId()); |
| | | request.setStatus(7); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | request.setOrderId(orderPrivateCar.getTravelId()); |
| | | request.setStatus(7); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | |
| | | |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Double amount = jsonObject.getDouble("amount"); |
| | | if(amount == 0){ |
| | | continue; |
| | | } |
| | | OrderAdditionalFee orderAdditionalFee = new OrderAdditionalFee(); |
| | | orderAdditionalFee.setOrderType(1); |
| | | orderAdditionalFee.setOrderId(orderId); |
| | |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderPrivateCar.getTravelId()); |
| | | request1.setStatus(orderPrivateCar.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderPrivateCar.getTravelId()); |
| | | request1.setStatus(orderPrivateCar.getState()); |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | if(2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request1.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId(), 1); |
| | |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderMoney", orderPrivateCar.getOrderMoney()==null?0:orderPrivateCar.getOrderMoney());//订单金额 |
| | | if(orderPrivateCar.getState() == 5){ |
| | | map.put("orderMoney", orderPrivateCar.getOrderMoney()==null?0:orderPrivateCar.getOrderMoney());//订单金额 |
| | | }else{ |
| | | if(orderPrivateCar.getAbnormal() == 2 && orderPrivateCar.getResponsibilityType() > 2 && orderPrivateCar.getAbnormalStatus() == 2){ |
| | | map.put("orderMoney", orderPrivateCar.getResponsibilityMoney()); |
| | | }else{ |
| | | map.put("orderMoney", orderPrivateCar.getOrderMoney()==null?0:orderPrivateCar.getOrderMoney());//订单金额 |
| | | } |
| | | } |
| | | map.put("startMileage", orderPrivateCar.getStartMileage());//起步价 |
| | | map.put("startMoney", orderPrivateCar.getStartMoney());//起步价 |
| | | map.put("mileageKilometers", orderPrivateCar.getMileageKilometers());//里程费 |