TLeakagePointsPatrolController.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.ruoyi.project.asset.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.springframework.security.access.prepost.PreAuthorize;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.PutMapping;
  9. import org.springframework.web.bind.annotation.DeleteMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import com.ruoyi.common.annotation.Log;
  15. import com.ruoyi.common.core.controller.BaseController;
  16. import com.ruoyi.common.core.domain.AjaxResult;
  17. import com.ruoyi.common.enums.BusinessType;
  18. import com.ruoyi.project.asset.domain.TLeakagePointsPatrol;
  19. import com.ruoyi.project.asset.service.ITLeakagePointsPatrolService;
  20. import com.ruoyi.common.utils.poi.ExcelUtil;
  21. import com.ruoyi.common.core.page.TableDataInfo;
  22. /**
  23. * 漏点巡检Controller
  24. *
  25. * @author ruoyi
  26. * @date 2024-04-01
  27. */
  28. @RestController
  29. @RequestMapping("/asset/pointPatrol")
  30. public class TLeakagePointsPatrolController extends BaseController
  31. {
  32. @Autowired
  33. private ITLeakagePointsPatrolService tLeakagePointsPatrolService;
  34. /**
  35. * 查询漏点巡检列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(TLeakagePointsPatrol tLeakagePointsPatrol)
  40. {
  41. startPage();
  42. List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
  43. return getDataTable(list);
  44. }
  45. /**
  46. * 导出漏点巡检列表
  47. */
  48. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:export')")
  49. @Log(title = "漏点巡检", businessType = BusinessType.EXPORT)
  50. @PostMapping("/export")
  51. public void export(HttpServletResponse response, TLeakagePointsPatrol tLeakagePointsPatrol)
  52. {
  53. List<TLeakagePointsPatrol> list = tLeakagePointsPatrolService.selectTLeakagePointsPatrolList(tLeakagePointsPatrol);
  54. ExcelUtil<TLeakagePointsPatrol> util = new ExcelUtil<TLeakagePointsPatrol>(TLeakagePointsPatrol.class);
  55. util.exportExcel(response, list, "漏点巡检数据");
  56. }
  57. /**
  58. * 获取漏点巡检详细信息
  59. */
  60. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:query')")
  61. @GetMapping(value = "/{id}")
  62. public AjaxResult getInfo(@PathVariable("id") Long id)
  63. {
  64. return success(tLeakagePointsPatrolService.selectTLeakagePointsPatrolById(id));
  65. }
  66. /**
  67. * 新增漏点巡检
  68. */
  69. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:add')")
  70. @Log(title = "漏点巡检", businessType = BusinessType.INSERT)
  71. @PostMapping
  72. public AjaxResult add(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol)
  73. {
  74. return toAjax(tLeakagePointsPatrolService.insertTLeakagePointsPatrol(tLeakagePointsPatrol));
  75. }
  76. /**
  77. * 修改漏点巡检
  78. */
  79. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:edit')")
  80. @Log(title = "漏点巡检", businessType = BusinessType.UPDATE)
  81. @PutMapping
  82. public AjaxResult edit(@RequestBody TLeakagePointsPatrol tLeakagePointsPatrol)
  83. {
  84. return toAjax(tLeakagePointsPatrolService.updateTLeakagePointsPatrol(tLeakagePointsPatrol));
  85. }
  86. /**
  87. * 删除漏点巡检
  88. */
  89. @PreAuthorize("@ss.hasPermi('asset:pointPatrol:remove')")
  90. @Log(title = "漏点巡检", businessType = BusinessType.DELETE)
  91. @DeleteMapping("/{ids}")
  92. public AjaxResult remove(@PathVariable Long[] ids)
  93. {
  94. return toAjax(tLeakagePointsPatrolService.deleteTLeakagePointsPatrolByIds(ids));
  95. }
  96. }