linwe
2024-07-29 aeb7d068be92312dcdcea75e1240bcf2a78dd0fe
src/main/java/org/springblade/modules/task/controller/TaskPlaceSelfCheckController.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.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
@@ -57,14 +60,17 @@
public class TaskPlaceSelfCheckController extends BladeController {
   private final ITaskPlaceSelfCheckService taskPlaceSelfCheckService;
   private final BladeLogger bladeLogger;
   /**
    * 获取消防自查记任务表详细信息
    */
   @ApiOperation("获取消防自查记任务表详细信息")
   @ApiLog("获取消防自查记任务表详细信息")
   @GetMapping(value = "/getInfo")
   public R<TaskPlaceSelfCheckVO> getInfo(TaskPlaceSelfCheckEntity taskPlaceSelfCheck){
      bladeLogger.info("获取消防自查记任务表详细信息", JsonUtil.toJson(taskPlaceSelfCheck));
      TaskPlaceSelfCheckDTO taskPlaceSelfCheckDTO = taskPlaceSelfCheckService.selectTaskPlaceSelfCheckById(taskPlaceSelfCheck);
      TaskPlaceSelfCheckVO taskPlaceSelfCheckDetailVO = BeanUtil.copy(taskPlaceSelfCheckDTO, TaskPlaceSelfCheckVO.class);
      return R.data(taskPlaceSelfCheckDetailVO);
@@ -78,6 +84,19 @@
   @ApiOperation(value = "详情", notes = "传入taskPlaceSelfCheck")
   public R<TaskPlaceSelfCheckVO> detail(TaskPlaceSelfCheckEntity taskPlaceSelfCheck) {
      TaskPlaceSelfCheckEntity detail = taskPlaceSelfCheckService.getOne(Condition.getQueryWrapper(taskPlaceSelfCheck));
      return R.data(TaskPlaceSelfCheckWrapper.build().entityVO(detail));
   }
   /**
    * 获取消防自查记任务表详细信息
    */
   @GetMapping("/detailByTaskId")
   @ApiLog("获取消防自查记任务表详细信息")
   @ApiOperationSupport(order = 1)
   @ApiOperation(value = "自定义详情", notes = "传入taskPlaceSelfCheck")
   public R<TaskPlaceSelfCheckVO> detailByTaskId(Long taskId) {
      bladeLogger.info("获取消防自查记任务表详细信息", JsonUtil.toJson(taskId));
      TaskPlaceSelfCheckEntity detail = taskPlaceSelfCheckService.getDetailByTaskId( taskId);
      return R.data(TaskPlaceSelfCheckWrapper.build().entityVO(detail));
   }
   /**
@@ -95,9 +114,11 @@
    * 消防自查记任务表 自定义分页
    */
   @GetMapping("/page")
   @ApiLog("消防自查记任务表 自定义分页")
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "分页", notes = "传入taskPlaceSelfCheck")
   public R<IPage<TaskPlaceSelfCheckVO>> page(TaskPlaceSelfCheckVO taskPlaceSelfCheck, Query query) {
      bladeLogger.info("消防自查记任务表 自定义分页", JsonUtil.toJson(taskPlaceSelfCheck));
      IPage<TaskPlaceSelfCheckVO> pages = taskPlaceSelfCheckService.selectTaskPlaceSelfCheckPage(Condition.getPage(query), taskPlaceSelfCheck);
      return R.data(pages);
   }
@@ -106,18 +127,22 @@
    * 消防自查记任务表 新增
    */
   @PostMapping("/save")
   @ApiLog("消防自查记任务表 新增")
   @ApiOperationSupport(order = 4)
   @ApiOperation(value = "新增", notes = "传入taskPlaceSelfCheck")
   public R save(@Valid @RequestBody TaskPlaceSelfCheckEntity taskPlaceSelfCheck) {
      bladeLogger.info("消防自查记任务表 新增", JsonUtil.toJson(taskPlaceSelfCheck));
      return R.status(taskPlaceSelfCheckService.save(taskPlaceSelfCheck));
   }
   /**
    * 消防自查记任务表 新增
    */
   @PostMapping("/saveTwo")
   @ApiLog("消防自查记任务表 新增")
   @ApiOperationSupport(order = 4)
   @ApiOperation(value = "新增", notes = "传入taskPlaceSelfCheck")
   public R saveTwo(@Valid @RequestBody TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception {
      bladeLogger.info("消防自查记任务表 新增", JsonUtil.toJson(taskPlaceSelfCheck));
      return R.status(taskPlaceSelfCheckService.savePlace(taskPlaceSelfCheck));
   }
@@ -125,9 +150,11 @@
    * 消防自查记任务表 修改
    */
   @PostMapping("/update")
   @ApiLog("消防自查记任务表 修改")
   @ApiOperationSupport(order = 5)
   @ApiOperation(value = "修改", notes = "传入taskPlaceSelfCheck")
   public R update(@Valid @RequestBody TaskPlaceSelfCheckEntity taskPlaceSelfCheck) {
      bladeLogger.info("消防自查记任务表 修改", JsonUtil.toJson(taskPlaceSelfCheck));
      return R.status(taskPlaceSelfCheckService.updateById(taskPlaceSelfCheck));
   }
@@ -135,9 +162,11 @@
    * 消防自查记任务表 新增或修改
    */
   @PostMapping("/submit")
   @ApiLog("消防自查记任务表 新增或修改")
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入taskPlaceSelfCheck")
   public R submit(@Valid @RequestBody TaskPlaceSelfCheckEntity taskPlaceSelfCheck) {
      bladeLogger.info("消防自查记任务表 新增或修改", JsonUtil.toJson(taskPlaceSelfCheck));
      return R.status(taskPlaceSelfCheckService.saveOrUpdate(taskPlaceSelfCheck));
   }
@@ -145,9 +174,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(taskPlaceSelfCheckService.removeBatchByIds(Func.toLongList(ids)));
   }
@@ -155,9 +186,11 @@
    * 消防自查记任务表 修改
    */
   @PostMapping("/updateTaskPlaceSelfCheck")
   @ApiLog("消防自查记任务表 修改")
   @ApiOperationSupport(order = 8)
   @ApiOperation(value = "更新自查详情接口", notes = "传入taskPlaceSelfCheck")
   public R updateTaskPlaceSelfCheck(@Valid @RequestBody TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception {
      bladeLogger.info("消防自查记任务表 修改", JsonUtil.toJson(taskPlaceSelfCheck));
      return R.status(taskPlaceSelfCheckService.updateTaskPlaceSelfCheck(taskPlaceSelfCheck));
   }
@@ -167,9 +200,11 @@
    * @param taskPlaceSelfCheck
    */
   @GetMapping("export-taskPlaceSelfCheck")
   @ApiLog("获取消防自查记任务表详细信息")
   @ApiOperationSupport(order = 9)
   @ApiOperation(value = "导出消防自查", notes = "传入taskPlaceSelfCheck")
   public void exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck, HttpServletResponse response) {
      bladeLogger.info("导出消防自查信息", JsonUtil.toJson(taskPlaceSelfCheck));
      List<TaskPlaceSelfCheckExcel> list = taskPlaceSelfCheckService.exportTaskPlaceSelfCheck(taskPlaceSelfCheck);
      ExcelUtil.export(response, "消防自查" + DateUtil.time(), "消防自查记录表", list, TaskPlaceSelfCheckExcel.class);
   }