| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @Autowired |
| | | private InspectionTaskService inspectionTaskService; |
| | | |
| | | /** |
| | | * 巡检任务表表查询 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("巡检任务表表查询") |
| | | @ApiOperation("巡检任务列表查询") |
| | | public R<IPage<InspectionTaskDto>> list(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto) { |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page,inspectionTaskDto); |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page, inspectionTaskDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出定时任务记录") |
| | | @ApiOperation(value = "导出巡检任务记录") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | Page page = new Page<>(-1, -1); |
| | | InspectionTaskDto timingTask = new InspectionTaskDto(); |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page,timingTask); |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page, timingTask); |
| | | ExcelUtil<InspectionTaskDto> util = new ExcelUtil<>(InspectionTaskDto.class); |
| | | util.exportExcel(response, list.getRecords(), "导出定时任务记录"); |
| | | util.exportExcel(response, list.getRecords(), "导出巡检任务记录"); |
| | | } |
| | | |
| | | /** |
| | | * 巡检任务表新增修改 |
| | | */ |
| | | @PostMapping("/addOrEditInspectionTask") |
| | | @ApiOperation("巡检任务表新增修改") |
| | | @ApiOperation("巡检任务批量新增修改") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addOrEditInspectionTask(@RequestBody InspectionTaskDto inspectionTaskDto) throws IOException { |
| | | return R.ok(inspectionTaskService.addOrEditInspectionTask(inspectionTaskDto)); |
| | | public R addOrEditInspectionTask(@RequestBody List<InspectionTaskDto> inspectionTaskDtoList) throws IOException { |
| | | return R.ok(inspectionTaskService.addOrEditInspectionTask(inspectionTaskDtoList)); |
| | | } |
| | | |
| | | /** |
| | | * 巡检任务表删除 |
| | | */ |
| | | @DeleteMapping("/delInspectionTask") |
| | | @ApiOperation("巡检任务表删除") |
| | | @ApiOperation("巡检任务删除") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R remove(@RequestBody Long[] ids) { |
| | | return R.ok(inspectionTaskService.delByIds(ids)); |
| | | } |
| | | |
| | | } |