TRelMaintMemoController.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package com.ruoyi.project.reliability.controller;
  2. import java.util.List;
  3. import org.springframework.security.access.prepost.PreAuthorize;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.PutMapping;
  8. import org.springframework.web.bind.annotation.DeleteMapping;
  9. import org.springframework.web.bind.annotation.PathVariable;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import com.ruoyi.framework.aspectj.lang.annotation.Log;
  14. import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
  15. import com.ruoyi.project.reliability.domain.TRelMaintMemo;
  16. import com.ruoyi.project.reliability.service.ITRelMaintMemoService;
  17. import com.ruoyi.framework.web.controller.BaseController;
  18. import com.ruoyi.framework.web.domain.AjaxResult;
  19. import com.ruoyi.common.utils.poi.ExcelUtil;
  20. import com.ruoyi.framework.web.page.TableDataInfo;
  21. /**
  22. * 维修备忘录Controller
  23. *
  24. * @author ssy
  25. * @date 2025-11-06
  26. */
  27. @RestController
  28. @RequestMapping("/reliability/rel_maint_memo")
  29. public class TRelMaintMemoController extends BaseController
  30. {
  31. @Autowired
  32. private ITRelMaintMemoService tRelMaintMemoService;
  33. /**
  34. * 查询维修备忘录列表
  35. */
  36. @GetMapping("/list")
  37. public TableDataInfo list(TRelMaintMemo tRelMaintMemo)
  38. {
  39. startPage();
  40. List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出维修备忘录列表
  45. */
  46. @Log(title = "维修备忘录", businessType = BusinessType.EXPORT)
  47. @GetMapping("/export")
  48. public AjaxResult export(TRelMaintMemo tRelMaintMemo)
  49. {
  50. List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
  51. ExcelUtil<TRelMaintMemo> util = new ExcelUtil<TRelMaintMemo>(TRelMaintMemo.class);
  52. return util.exportExcel(list, "rel_maint_memo");
  53. }
  54. /**
  55. * 获取维修备忘录详细信息
  56. */
  57. @GetMapping(value = "/{memoId}")
  58. public AjaxResult getInfo(@PathVariable("memoId") Long memoId)
  59. {
  60. return AjaxResult.success(tRelMaintMemoService.selectTRelMaintMemoById(memoId));
  61. }
  62. /**
  63. * 新增维修备忘录
  64. */
  65. @Log(title = "维修备忘录", businessType = BusinessType.INSERT)
  66. @PostMapping
  67. public AjaxResult add(@RequestBody TRelMaintMemo tRelMaintMemo)
  68. {
  69. return toAjax(tRelMaintMemoService.insertTRelMaintMemo(tRelMaintMemo));
  70. }
  71. /**
  72. * 修改维修备忘录
  73. */
  74. @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:edit')")
  75. @Log(title = "维修备忘录", businessType = BusinessType.UPDATE)
  76. @PutMapping
  77. public AjaxResult edit(@RequestBody TRelMaintMemo tRelMaintMemo)
  78. {
  79. return toAjax(tRelMaintMemoService.updateTRelMaintMemo(tRelMaintMemo));
  80. }
  81. /**
  82. * 删除维修备忘录
  83. */
  84. @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:remove')")
  85. @Log(title = "维修备忘录", businessType = BusinessType.DELETE)
  86. @DeleteMapping("/{memoIds}")
  87. public AjaxResult remove(@PathVariable Long[] memoIds)
  88. {
  89. return toAjax(tRelMaintMemoService.deleteTRelMaintMemoByIds(memoIds));
  90. }
  91. }