| | |
| | | if(registeredWarpper.getCompanyId()==null){ |
| | | return ResultUtil.error("请选择服务商"); |
| | | } |
| | | |
| | | String code = registeredWarpper.getPlaceOfEmployment(); |
| | | Company query = companyCityService.query(code); |
| | | if(null == query){ |
| | | return ResultUtil.error("选择从业地暂未开通业务"); |
| | | } |
| | | if(null != query){ |
| | | switch (query.getType()){ |
| | | case 1://平台 |
| | | driver.setCompanyId(query.getId()); |
| | | break; |
| | | case 2://分公司 |
| | | driver.setCompanyId(query.getId()); |
| | | break; |
| | | case 3://加盟商 |
| | | driver.setCompanyId(query.getSuperiorId()); |
| | | driver.setFranchiseeId(query.getId()); |
| | | break; |
| | | } |
| | | } |
| | | driver.setHeadImgUrl(registeredWarpper.getHeadImgUrl()); |
| | | driver.setIdCardImgUrl1(registeredWarpper.getIdCardImgUrl1()); |
| | | driver.setIdCardImgUrl2(registeredWarpper.getIdCardImgUrl2()); |
| | |
| | | return ResultUtil.error("车辆正在使用中"); |
| | | } |
| | | } |
| | | |
| | | //专车业务需要校验 |
| | | // if(0 == driver.getIsSynchronous() && type.contains("1")){ |
| | | // return ResultUtil.error("请先开通钱包"); |
| | | // } |
| | | //判断车辆是否正在使用中 |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | if(car.getUseDriverId() != null && !car.getUseDriverId().equals(uid)){ |
| | |
| | | if(driver.getState() == 3){ |
| | | return ResultUtil.error("还在服务中,不能更换"); |
| | | } |
| | | // boolean idle = carService.idle(carId); |
| | | // 修改是否别司机在使用 |
| | | boolean idle = carService.useState(carId,uid); |
| | | if(!idle){ |
| | | if(idle){ |
| | | return ResultUtil.error("当前车辆已经有其他司机在使用,请更换车辆"); |
| | | } |
| | | // 将所有绑定他的车 =null |
| | | carService.updateUseState(carId,uid); |
| | | List<Driver> drivers = this.selectList(new EntityWrapper<Driver>().eq("carId", carId) |
| | | .eq("authState", 2).ne("flag", 3)); |
| | | drivers.forEach(d->{ |
| | | d.setCarId(null); |
| | | }); |
| | | if(drivers.size() > 0){ |
| | | this.updateAllColumnBatchById(drivers); |
| | | } |
| | | |
| | | Car car = carService.selectById(carId); |
| | | car.setUseDriverId(uid); |
| | | carService.updateById( car); |
| | |
| | | driverIndexVo.setTodayOrderNum(orderPrivateCars.size() + orderCrossCities.size() + orderTaxis.size()); |
| | | |
| | | |
| | | double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |
| | | double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | double sum2 = orderTaxis.stream().filter(e->e.getOrderMoney()!=null).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | driverIndexVo.setTodayOrderMoney(new BigDecimal(sum +sum1+sum2)); |
| | | // |
| | | // double sum1 = orderCrossCities.stream().mapToDouble(OrderCrossCity::getOrderMoney).sum(); |
| | | // double sum2 = orderTaxis.stream().filter(e->e.getOrderMoney()!=null).mapToDouble(OrderTaxi::getOrderMoney).sum(); |
| | | // |
| | | |
| | | List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid).eq("userType", 2).eq("type", 2).like("insertTime", LocalDate.now().toString())); |
| | | double sum = incomes.stream().mapToDouble(Income::getMoney).sum(); |
| | | |
| | | driverIndexVo.setTodayOrderMoney(new BigDecimal(sum)); |
| | | |
| | | |
| | | BigDecimal reduce = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("promotionDriverId", uid).like("insertTime", LocalDate.now().toString())).stream().map(OrderPrivateCar::getPromotionMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | |
| | | // List<OrderTaxi> orderTaxis = orderTaxiMapper.selectList(new EntityWrapper<OrderTaxi>().in("state",Arrays.asList(8,9)).eq("driverId", uid)); |
| | | |
| | | |
| | | List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid).eq("objectType", 2).eq("type", 2)); |
| | | List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid).eq("userType", 2).eq("type", 2)); |
| | | |
| | | |
| | | // double sum = orderPrivateCars.stream().mapToDouble(OrderPrivateCar::getOrderMoney).sum(); |