linwe
2024-05-29 c10d6358b9f014375a13821465bc978d0c0da22e
src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java
@@ -26,9 +26,12 @@
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;
@@ -60,14 +63,17 @@
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));
   }
@@ -87,9 +93,11 @@
    * 场所整改任务表 自定义分页
    */
   @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);
   }
@@ -98,9 +106,11 @@
    * 场所整改任务表 新增
    */
   @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));
   }
@@ -108,9 +118,11 @@
    * 场所整改任务表 修改
    */
   @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));
   }
@@ -118,9 +130,11 @@
    * 场所整改任务表 新增或修改
    */
   @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));
   }
@@ -128,9 +142,11 @@
    * 场所整改任务表 删除
    */
   @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)));
   }
@@ -138,9 +154,11 @@
    * 场所整改任务表 详情
    */
   @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));
   }
@@ -150,9 +168,11 @@
    * 场所整改任务表 详情
    */
   @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);
   }
@@ -162,9 +182,11 @@
    * 场所整改任务表 修改
    */
   @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));
   }
@@ -172,9 +194,11 @@
    * 民警审核
    */
   @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));
   }
@@ -183,19 +207,23 @@
    * 民警审核
    */
   @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);
   }