| | |
| | | |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | @Autowired |
| | | private IDriverWorkService iDriverWorkService; |
| | | |
| | | /** |
| | | * 跳转投诉页面 |
| | | * |
| | |
| | | public Object selectCarOpt(Integer tDriverId,Integer carId) { |
| | | if (SinataUtil.isNotEmpty(tDriverId) && SinataUtil.isNotEmpty(carId)){ |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | DriverWork driverWork = iDriverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", tDriverId).eq("state", 1)); |
| | | if(null != driverWork && !tDriver.getCarId().equals(carId)){ |
| | | throw new RuntimeException("司机上班中,不能更换车辆"); |
| | | } |
| | | tDriver.setCarId(carId); |
| | | tDriverService.updateById(tDriver); |
| | | } |