TIntactYsjController.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package com.ruoyi.project.intact.controller;
  2. import java.util.Date;
  3. import java.util.List;
  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.framework.aspectj.lang.annotation.Log;
  15. import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
  16. import com.ruoyi.project.intact.domain.TIntactYsj;
  17. import com.ruoyi.project.intact.service.ITIntactYsjService;
  18. import com.ruoyi.framework.web.controller.BaseController;
  19. import com.ruoyi.framework.web.domain.AjaxResult;
  20. import com.ruoyi.common.utils.poi.ExcelUtil;
  21. import com.ruoyi.framework.web.page.TableDataInfo;
  22. /**
  23. * 设备完整性压缩机台账Controller
  24. *
  25. * @author ruoyi
  26. * @date 2022-06-21
  27. */
  28. @RestController
  29. @RequestMapping("/intact/ysj")
  30. public class TIntactYsjController extends BaseController
  31. {
  32. @Autowired
  33. private ITIntactYsjService tIntactYsjService;
  34. /**
  35. * 查询设备完整性压缩机台账列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('intact:ysj:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(TIntactYsj tIntactYsj)
  40. {
  41. startPage();
  42. List<TIntactYsj> list = tIntactYsjService.selectTIntactYsjList(tIntactYsj);
  43. return getDataTable(list);
  44. }
  45. /**
  46. * 导出设备完整性压缩机台账列表
  47. */
  48. @PreAuthorize("@ss.hasPermi('intact:ysj:export')")
  49. @Log(title = "设备完整性压缩机台账", businessType = BusinessType.EXPORT)
  50. @GetMapping("/export")
  51. public AjaxResult export(TIntactYsj tIntactYsj)
  52. {
  53. List<TIntactYsj> list = tIntactYsjService.selectTIntactYsjList(tIntactYsj);
  54. ExcelUtil<TIntactYsj> util = new ExcelUtil<TIntactYsj>(TIntactYsj.class);
  55. return util.exportExcel(list, "ysj");
  56. }
  57. /**
  58. * 获取设备完整性压缩机台账详细信息
  59. */
  60. @PreAuthorize("@ss.hasPermi('intact:ysj:query')")
  61. @GetMapping(value = "/{id}")
  62. public AjaxResult getInfo(@PathVariable("id") Long id)
  63. {
  64. return AjaxResult.success(tIntactYsjService.selectTIntactYsjById(id));
  65. }
  66. /**
  67. * 新增设备完整性压缩机台账
  68. */
  69. @PreAuthorize("@ss.hasPermi('intact:ysj:add')")
  70. @Log(title = "设备完整性压缩机台账", businessType = BusinessType.INSERT)
  71. @PostMapping
  72. public AjaxResult add(@RequestBody TIntactYsj tIntactYsj)
  73. {
  74. //获取操作人员ID
  75. Long userId = getUserId();
  76. tIntactYsj.setCreaterCode(userId.toString());
  77. tIntactYsj.setCreatedate(new Date());
  78. return toAjax(tIntactYsjService.insertTIntactYsj(tIntactYsj));
  79. }
  80. /**
  81. * 修改设备完整性压缩机台账
  82. */
  83. @PreAuthorize("@ss.hasPermi('intact:ysj:edit')")
  84. @Log(title = "设备完整性压缩机台账", businessType = BusinessType.UPDATE)
  85. @PutMapping
  86. public AjaxResult edit(@RequestBody TIntactYsj tIntactYsj)
  87. {
  88. return toAjax(tIntactYsjService.updateTIntactYsj(tIntactYsj));
  89. }
  90. /**
  91. * 删除设备完整性压缩机台账
  92. */
  93. @PreAuthorize("@ss.hasPermi('intact:ysj:remove')")
  94. @Log(title = "设备完整性压缩机台账", businessType = BusinessType.DELETE)
  95. @DeleteMapping("/{ids}")
  96. public AjaxResult remove(@PathVariable Long[] ids)
  97. {
  98. return toAjax(tIntactYsjService.deleteTIntactYsjByIds(ids));
  99. }
  100. }