GEmergencyRepairProcessController.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package com.ruoyi.web.controller.gas;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.annotation.RepeatSubmit;
  4. import com.ruoyi.common.core.controller.BaseController;
  5. import com.ruoyi.common.core.domain.AjaxResult;
  6. import com.ruoyi.common.core.page.TableDataInfo;
  7. import com.ruoyi.common.core.validate.AddGroup;
  8. import com.ruoyi.common.core.validate.EditGroup;
  9. import com.ruoyi.common.core.validate.QueryGroup;
  10. import com.ruoyi.common.enums.BusinessType;
  11. import com.ruoyi.common.utils.poi.ExcelUtil;
  12. import com.ruoyi.gas.domain.bo.GEmergencyRepairProcessBo;
  13. import com.ruoyi.gas.domain.vo.GEmergencyRepairProcessVo;
  14. import com.ruoyi.gas.service.IGEmergencyRepairProcessService;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import lombok.RequiredArgsConstructor;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.security.access.prepost.PreAuthorize;
  20. import org.springframework.validation.annotation.Validated;
  21. import org.springframework.web.bind.annotation.*;
  22. import javax.servlet.http.HttpServletResponse;
  23. import javax.validation.constraints.NotEmpty;
  24. import javax.validation.constraints.NotNull;
  25. import java.util.Arrays;
  26. import java.util.List;
  27. /**
  28. * 抢险维修审核Controller
  29. *
  30. * @author ruoyi
  31. * @date 2024-01-16
  32. */
  33. @Validated
  34. @Api(value = "抢险维修审核控制器", tags = {"抢险维修审核管理"})
  35. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  36. @RestController
  37. @RequestMapping("/gas/emergencyRepairProcess")
  38. public class GEmergencyRepairProcessController extends BaseController {
  39. private final IGEmergencyRepairProcessService iGEmergencyRepairProcessService;
  40. /**
  41. * 查询抢险维修审核列表
  42. */
  43. @ApiOperation("查询抢险维修审核列表")
  44. @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:list')")
  45. @GetMapping("/list")
  46. public TableDataInfo<GEmergencyRepairProcessVo> list(@Validated(QueryGroup.class) GEmergencyRepairProcessBo bo) {
  47. return iGEmergencyRepairProcessService.queryPageList(bo);
  48. }
  49. /**
  50. * 导出抢险维修审核列表
  51. */
  52. @ApiOperation("导出抢险维修审核列表")
  53. @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:export')")
  54. @Log(title = "抢险维修审核", businessType = BusinessType.EXPORT)
  55. @GetMapping("/export")
  56. public void export(@Validated GEmergencyRepairProcessBo bo, HttpServletResponse response) {
  57. List<GEmergencyRepairProcessVo> list = iGEmergencyRepairProcessService.queryList(bo);
  58. ExcelUtil.exportExcel(list, "抢险维修审核", GEmergencyRepairProcessVo.class, response);
  59. }
  60. /**
  61. * 获取抢险维修审核详细信息
  62. */
  63. @ApiOperation("获取抢险维修审核详细信息")
  64. @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:query')")
  65. @GetMapping("/{id}")
  66. public AjaxResult<GEmergencyRepairProcessVo> getInfo(@NotNull(message = "主键不能为空")
  67. @PathVariable("id") String id) {
  68. return AjaxResult.success(iGEmergencyRepairProcessService.queryById(id));
  69. }
  70. /**
  71. * 新增抢险维修审核
  72. */
  73. @ApiOperation("新增抢险维修审核")
  74. // @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:add')")
  75. @Log(title = "抢险维修审核", businessType = BusinessType.INSERT)
  76. @RepeatSubmit()
  77. @PostMapping()
  78. public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody GEmergencyRepairProcessBo bo) {
  79. return toAjax(iGEmergencyRepairProcessService.insertByBo(bo) ? 1 : 0);
  80. }
  81. /**
  82. * 修改抢险维修审核
  83. */
  84. @ApiOperation("修改抢险维修审核")
  85. @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:edit')")
  86. @Log(title = "抢险维修审核", businessType = BusinessType.UPDATE)
  87. @RepeatSubmit()
  88. @PutMapping()
  89. public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody GEmergencyRepairProcessBo bo) {
  90. return toAjax(iGEmergencyRepairProcessService.updateByBo(bo) ? 1 : 0);
  91. }
  92. /**
  93. * 删除抢险维修审核
  94. */
  95. @ApiOperation("删除抢险维修审核")
  96. @PreAuthorize("@ss.hasPermi('gas:emergencyRepairProcess:remove')")
  97. @Log(title = "抢险维修审核" , businessType = BusinessType.DELETE)
  98. @DeleteMapping("/{ids}")
  99. public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
  100. @PathVariable String[] ids) {
  101. return toAjax(iGEmergencyRepairProcessService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
  102. }
  103. }