| | |
| | | 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.service.impl.CompanyServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.OrderUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.ModifyTravelItineraryRequest; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.MerchantCouponListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | |
| | | private CarModelMapper carModelMapper; |
| | | @Autowired |
| | | private CarServiceImpl carServiceImpl; |
| | | private CompanyServiceImpl companyServiceImpl; |
| | | |
| | | |
| | | /** |
| | |
| | | return ResultUtil.error("订单已被取消,不能继续操作"); |
| | | } |
| | | UserInfo userInfo = userInfoMapper.selectById(orderCrossCity.getUserId()); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | Company company = companyServiceImpl.selectById(driver.getCompanyId()); |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderCrossCity.setState(3); |
| | |
| | | orderCrossCity.setGetoffTime(new Date()); |
| | | orderCrossCity.setState(8);//跨城直接到待评价 |
| | | orderCrossCity.setEndServiceTime(new Date()); |
| | | |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | //添加抽成及收入记录 |
| | | Map<String, Object> map = incomeService.saveIncome(orderCrossCity.getId(), 3, orderCrossCity.getOrderMoney()); |
| | | orderCrossCity.setSplitAllocation(JSON.toJSONString(map)); |
| | | |
| | | //非追缴单才需要记录收入 |
| | | if(0 == orderCrossCity.getRecoveryOrder()){ |
| | | //添加收入 |
| | | Double orderMoney = (2 == orderCrossCity.getAbnormal() && 2 == orderCrossCity.getAbnormalStatus() ? orderCrossCity.getResponsibilityMoney().doubleValue() : orderCrossCity.getOrderMoney()); |
| | | Map<String, Object> map = incomeService.saveIncome(orderCrossCity.getId(), 3, orderMoney); |
| | | orderCrossCity.setSplitAllocation(JSON.toJSONString(map)); |
| | | } |
| | | //待审核的异常单修改状态为已关闭 |
| | | if(2 == orderCrossCity.getAbnormal() && 1 == orderCrossCity.getAbnormalStatus()){ |
| | | orderCrossCity.setAbnormalStatus(3); |
| | | orderCrossCity.setResponsibilityMoney(new BigDecimal(orderCrossCity.getOrderMoney())); |
| | | orderCrossCity.setResponsibilityType(3); |
| | | orderCrossCity.setAbnormalRemark("乘客已支付订单,申诉已自动关闭"); |
| | | } |
| | | |
| | | //还原座位数 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(orderCrossCity.getLineShiftDriverId()); |
| | |
| | | } |
| | | this.updateById(orderCrossCity); |
| | | |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | | request1.setOrderId(orderCrossCity.getTravelId()); |
| | | request1.setStatus(orderCrossCity.getState()); |
| | | if (null != orderCrossCity.getDriverId()) { |
| | | request1.setDriverId(driver.getEmpId().toString()); |
| | | request1.setSupplierShopId(company.getEnterCode()); |
| | | } |
| | | if (2 == orderCrossCity.getPromotion()) { |
| | | Driver driver2 = driverService.selectById(orderCrossCity.getPromotionDriverId()); |
| | | request1.setPromoterId(driver2.getEmpId().toString()); |
| | | } |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | new Thread(new Runnable() { |
| | | @Override |