| | |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysTask; |
| | | import com.ruoyi.system.domain.SysTaskLog; |
| | | import com.ruoyi.system.domain.VehicleInfo; |
| | | import com.ruoyi.system.domain.vo.TaskQueryVO; |
| | | import com.ruoyi.system.domain.vo.TaskCreateVO; |
| | | import com.ruoyi.system.domain.vo.TaskUpdateVO; |
| | | import com.ruoyi.system.domain.vo.TaskStatisticsVO; |
| | | import com.ruoyi.system.domain.enums.TaskStatus; |
| | | import com.ruoyi.system.service.ISysTaskService; |
| | | import com.ruoyi.system.service.IVehicleInfoService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ISysTaskService sysTaskService; |
| | | |
| | | @Autowired |
| | | private IVehicleInfoService vehicleInfoService; |
| | | |
| | | /** |
| | | * 查询任务管理列表(后台管理端) |
| | |
| | | @Log(title = "任务管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/admin") |
| | | public AjaxResult adminEdit(@RequestBody TaskUpdateVO updateVO) { |
| | | return toAjax(sysTaskService.updateSysTask(updateVO)); |
| | | return toAjax(sysTaskService.updateSysTask(updateVO,false)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "任务修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult appEdit(@RequestBody TaskUpdateVO updateVO) { |
| | | return toAjax(sysTaskService.updateSysTask(updateVO)); |
| | | return toAjax(sysTaskService.updateSysTask(updateVO,false)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检查车辆是否有正在进行中的任务(APP端) |
| | | * 正在进行中的任务是指状态不为:PENDING(待处理)、COMPLETED(已完成)、CANCELLED(已取消)的任务 |
| | | */ |
| | | @GetMapping("/vehicle/{vehicleId}/active") |
| | | public AjaxResult checkVehicleActiveTasks(@PathVariable Long vehicleId) { |
| | | List<SysTask> activeTasks = sysTaskService.checkVehicleActiveTasks(vehicleId); |
| | | return success(activeTasks); |
| | | } |
| | | |
| | | /** |
| | | * 分配任务请求对象 |
| | | */ |
| | | public static class AssignTaskRequest { |