| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysTaskVehicle; |
| | | import com.ruoyi.system.domain.VehicleInfo; |
| | | import com.ruoyi.system.service.ISysTaskService; |
| | | import com.ruoyi.system.service.IVehicleInfoService; |
| | | |
| | | /** |
| | | * 任务车辆关联Controller |
| | |
| | | |
| | | @Autowired |
| | | private ISysTaskService sysTaskService; |
| | | |
| | | @Autowired |
| | | private IVehicleInfoService vehicleInfoService; |
| | | |
| | | /** |
| | | * 查询任务关联的车辆列表 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询可用车辆列表 |
| | | * 查询可用车辆列表(根据用户权限) |
| | | * 根据用户所在的分公司,通过车辆-分公司关联表查询所有可用车辆 |
| | | * |
| | | * @param deptId 部门ID(可选,如果不传则使用当前用户的deptId) |
| | | * @param taskType 任务类型(可选) |
| | | * @return 车辆列表 |
| | | */ |
| | | @GetMapping("/available") |
| | | public AjaxResult getAvailableVehicles(@RequestParam Long deptId, @RequestParam(required = false) String taskType) { |
| | | List<SysTaskVehicle> list = sysTaskService.getAvailableVehicles(deptId, taskType); |
| | | return success(list); |
| | | public AjaxResult getAvailableVehicles( |
| | | @RequestParam(required = false) Long deptId, |
| | | @RequestParam(required = false) String taskType) { |
| | | // 如果没有传deptId,使用当前用户的userId查询 |
| | | List<VehicleInfo> vehicles = vehicleInfoService.selectAvailableVehiclesByUser(getUserId()); |
| | | return success(vehicles); |
| | | } |
| | | |
| | | /** |