TTargetyardstickController.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package com.ruoyi.project.plant.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.plant.domain.TTargetyardstick;
  16. import com.ruoyi.project.plant.service.ITTargetyardstickService;
  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 ruoyi
  25. * @date 2021-08-16
  26. */
  27. @RestController
  28. @RequestMapping("/plant/targetyardstick")
  29. public class TTargetyardstickController extends BaseController
  30. {
  31. @Autowired
  32. private ITTargetyardstickService tTargetyardstickService;
  33. /**
  34. * 查询目标完成判定标准列表
  35. */
  36. @GetMapping("/list")
  37. public TableDataInfo list(TTargetyardstick tTargetyardstick)
  38. {
  39. startPage();
  40. List<TTargetyardstick> list = tTargetyardstickService.selectTTargetyardstickList(tTargetyardstick);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出目标完成判定标准列表
  45. */
  46. @PreAuthorize("@ss.hasPermi('plant:targetyardstick:export')")
  47. @Log(title = "目标完成判定标准", businessType = BusinessType.EXPORT)
  48. @GetMapping("/export")
  49. public AjaxResult export(TTargetyardstick tTargetyardstick)
  50. {
  51. List<TTargetyardstick> list = tTargetyardstickService.selectTTargetyardstickList(tTargetyardstick);
  52. ExcelUtil<TTargetyardstick> util = new ExcelUtil<TTargetyardstick>(TTargetyardstick.class);
  53. return util.exportExcel(list, "targetyardstick");
  54. }
  55. /**
  56. * 获取目标完成判定标准详细信息
  57. */
  58. @PreAuthorize("@ss.hasPermi('plant:targetyardstick:query')")
  59. @GetMapping(value = "/{id}")
  60. public AjaxResult getInfo(@PathVariable("id") Long id)
  61. {
  62. return AjaxResult.success(tTargetyardstickService.selectTTargetyardstickById(id));
  63. }
  64. /**
  65. * 新增目标完成判定标准
  66. */
  67. @PreAuthorize("@ss.hasPermi('plant:targetyardstick:add')")
  68. @Log(title = "目标完成判定标准", businessType = BusinessType.INSERT)
  69. @PostMapping
  70. public AjaxResult add(@RequestBody TTargetyardstick tTargetyardstick)
  71. {
  72. return toAjax(tTargetyardstickService.insertTTargetyardstick(tTargetyardstick));
  73. }
  74. /**
  75. * 修改目标完成判定标准
  76. */
  77. @PreAuthorize("@ss.hasPermi('plant:targetyardstick:edit')")
  78. @Log(title = "目标完成判定标准", businessType = BusinessType.UPDATE)
  79. @PutMapping
  80. public AjaxResult edit(@RequestBody TTargetyardstick tTargetyardstick)
  81. {
  82. return toAjax(tTargetyardstickService.updateTTargetyardstick(tTargetyardstick));
  83. }
  84. /**
  85. * 删除目标完成判定标准
  86. */
  87. @PreAuthorize("@ss.hasPermi('plant:targetyardstick:remove')")
  88. @Log(title = "目标完成判定标准", businessType = BusinessType.DELETE)
  89. @DeleteMapping("/{ids}")
  90. public AjaxResult remove(@PathVariable Long[] ids)
  91. {
  92. return toAjax(tTargetyardstickService.deleteTTargetyardstickByIds(ids));
  93. }
  94. }