| | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.task.dto.TaskPlaceRectificationDTO; |
| | |
| | | public class TaskPlaceRectificationController extends BladeController { |
| | | |
| | | private final ITaskPlaceRectificationService taskPlaceRectificationService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 场所整改任务表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiLog("场所整改任务表 详情") |
| | | @ApiOperation(value = "详情", notes = "传入taskPlaceRectification") |
| | | public R<TaskPlaceRectificationVO> detail(TaskPlaceRectificationEntity taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 详情", JsonUtil.toJson(taskPlaceRectification)); |
| | | TaskPlaceRectificationEntity detail = taskPlaceRectificationService.getOne(Condition.getQueryWrapper(taskPlaceRectification)); |
| | | return R.data(TaskPlaceRectificationWrapper.build().entityVO(detail)); |
| | | } |
| | |
| | | * 场所整改任务表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiLog("场所整改任务表 自定义分页") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入taskPlaceRectification") |
| | | public R<IPage<TaskPlaceRectificationVO>> page(TaskPlaceRectificationVO taskPlaceRectification, Query query) { |
| | | bladeLogger.info("场所整改任务表 自定义分页", JsonUtil.toJson(taskPlaceRectification)); |
| | | IPage<TaskPlaceRectificationVO> pages = taskPlaceRectificationService.selectTaskPlaceRectificationPage(Condition.getPage(query), taskPlaceRectification); |
| | | return R.data(pages); |
| | | } |
| | |
| | | * 场所整改任务表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiLog("场所整改任务表 新增") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入taskPlaceRectification") |
| | | public R save(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 新增", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.status(taskPlaceRectificationService.save(taskPlaceRectification)); |
| | | } |
| | | |
| | |
| | | * 场所整改任务表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiLog("场所整改任务表 修改") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入taskPlaceRectification") |
| | | public R update(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 修改", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.status(taskPlaceRectificationService.updateById(taskPlaceRectification)); |
| | | } |
| | | |
| | |
| | | * 场所整改任务表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiLog("场所整改任务表 新增或修改") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入taskPlaceRectification") |
| | | public R submit(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 新增或修改", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.status(taskPlaceRectificationService.saveOrUpdate(taskPlaceRectification)); |
| | | } |
| | | |
| | |
| | | * 场所整改任务表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiLog("场所整改任务表 详情") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | bladeLogger.info("场所整改任务表 删除", JsonUtil.toJson(ids)); |
| | | return R.status(taskPlaceRectificationService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | |
| | | * 场所整改任务表 详情 |
| | | */ |
| | | @GetMapping("/detailByTaskId") |
| | | @ApiLog("场所整改任务表 详情") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入taskPlaceRectification") |
| | | public R<TaskPlaceRectificationVO> detailById(TaskPlaceRectificationEntity taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 详情", JsonUtil.toJson(taskPlaceRectification)); |
| | | TaskPlaceRectificationEntity detail = taskPlaceRectificationService.selectTaskPlaceRectificationById(taskPlaceRectification.getTaskId()); |
| | | return R.data(TaskPlaceRectificationWrapper.build().entityVO(detail)); |
| | | } |
| | |
| | | * 场所整改任务表 详情 |
| | | */ |
| | | @GetMapping("/getTaskPlaceRectificationList") |
| | | @ApiLog("场所整改任务表 详情") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "消防隐患整改情况登记表", notes = "传入taskPlaceRectification") |
| | | @ApiOperation(value = "场所整改任务表 详情", notes = "传入taskPlaceRectification") |
| | | public R<IPage<TaskPlaceRectificationVO>> getTaskPlaceRectificationList(TaskPlaceRectificationDTO taskPlaceRectification, Query query) { |
| | | bladeLogger.info("场所整改任务表 详情", JsonUtil.toJson(taskPlaceRectification)); |
| | | IPage<TaskPlaceRectificationVO> taskPlaceRectificationDTOS = taskPlaceRectificationService.selectTaskPlaceRectificationList(Condition.getPage(query), taskPlaceRectification); |
| | | return R.data(taskPlaceRectificationDTOS); |
| | | } |
| | |
| | | * 场所整改任务表 修改 |
| | | */ |
| | | @PostMapping("/updateRectification") |
| | | @ApiLog("场所整改任务表 修改") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "场所负责人整改", notes = "传入taskPlaceRectification") |
| | | public R updateRectification(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) { |
| | | bladeLogger.info("场所整改任务表 修改", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.status(taskPlaceRectificationService.updateRectification(taskPlaceRectification)); |
| | | } |
| | | |
| | |
| | | * 民警审核 |
| | | */ |
| | | @PostMapping("/applyRectification") |
| | | @ApiLog("民警审核") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "民警审核", notes = "传入taskPlaceRectification") |
| | | public R applyRectification(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) { |
| | | bladeLogger.info("民警审核", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.status(taskPlaceRectificationService.applyRectification(taskPlaceRectification)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 民警审核 |
| | | * 九小场所类型隐患数量统计 |
| | | */ |
| | | @PostMapping("/rectificationStatistics") |
| | | @ApiLog("九小场所类型隐患数量统计") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "九小场所类型隐患数量统计", notes = "传入taskPlaceRectification") |
| | | public R rectificationStatistics(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) { |
| | | bladeLogger.info("民警审核", JsonUtil.toJson(taskPlaceRectification)); |
| | | return R.data(taskPlaceRectificationService.rectificationStatistics(taskPlaceRectification)); |
| | | } |
| | | |
| | | /** |
| | | * 导出房屋 |
| | | * 导出场所整改任务 |
| | | */ |
| | | @GetMapping("exportRectificationStatistics") |
| | | @ApiLog("导出场所整改任务") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出整改统计", notes = "传入user") |
| | | public void exportHouse(TaskPlaceRectificationsVO taskPlaceRectificationVO, HttpServletResponse response) { |
| | | bladeLogger.info("导出场所整改任务", JsonUtil.toJson(taskPlaceRectificationVO)); |
| | | List<TaskPlaceRectificationExcel> list = taskPlaceRectificationService.export(taskPlaceRectificationVO); |
| | | ExcelUtil.export(response, "整改数据" + DateUtil.time(), "场所数据表", list, TaskPlaceRectificationExcel.class); |
| | | } |