TXinyiMedicineParamController.java 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. package com.slibra.web.controller.business;
  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.slibra.common.annotation.Log;
  15. import com.slibra.common.core.controller.BaseController;
  16. import com.slibra.common.core.domain.AjaxResult;
  17. import com.slibra.common.enums.BusinessType;
  18. import com.slibra.business.domain.TXinyiMedicineParam;
  19. import com.slibra.business.service.ITXinyiMedicineParamService;
  20. import com.slibra.common.utils.poi.ExcelUtil;
  21. import com.slibra.common.core.page.TableDataInfo;
  22. /**
  23. * 智能投药参数设置Controller
  24. *
  25. * @author slibra
  26. * @date 2024-09-09
  27. */
  28. @RestController
  29. @RequestMapping("/business/medicineParamSetting")
  30. public class TXinyiMedicineParamController extends BaseController
  31. {
  32. @Autowired
  33. private ITXinyiMedicineParamService tXinyiMedicineParamService;
  34. // 前端需要的接口
  35. /**
  36. * 修改智能投药参数设置
  37. *
  38. */
  39. // @PreAuthorize("@ss.hasPermi('business:param:edit')")
  40. // @Log(title = "智能投药参数设置", businessType = BusinessType.UPDATE)
  41. @PutMapping
  42. public AjaxResult edit(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
  43. {
  44. tXinyiMedicineParam.setUpdateBy(getUsername());
  45. return toAjax(tXinyiMedicineParamService.updateTXinyiMedicineParam(tXinyiMedicineParam));
  46. }
  47. /**
  48. * 获取智能投药参数设置详细信息最新的一条数据
  49. */
  50. // @PreAuthorize("@ss.hasPermi('business:param:query')")
  51. @GetMapping(value = "/getLatestRecord")
  52. public AjaxResult getLatestRecord()
  53. {
  54. return success(tXinyiMedicineParamService.getLatestRecord());
  55. }
  56. /**
  57. * 获取智能投药参数设置详细信息的历史记录-统计使用
  58. */
  59. @GetMapping(value = "/getList")
  60. public AjaxResult getList(TXinyiMedicineParam tXinyiMedicineParam)
  61. {
  62. return success(tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam));
  63. }
  64. /**
  65. * 新增智能投药参数设置
  66. */
  67. // @PreAuthorize("@ss.hasPermi('business:param:add')")
  68. // @Log(title = "智能投药参数设置", businessType = BusinessType.INSERT)
  69. @PostMapping
  70. public AjaxResult add(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
  71. {
  72. tXinyiMedicineParam.setCreateBy(getUsername());
  73. return toAjax(tXinyiMedicineParamService.insertTXinyiMedicineParam(tXinyiMedicineParam));
  74. }
  75. //下面的前端暂时用不到
  76. /**
  77. * 查询智能投药参数设置列表
  78. */
  79. // @PreAuthorize("@ss.hasPermi('business:param:list')")
  80. @GetMapping("/list")
  81. public TableDataInfo list(TXinyiMedicineParam tXinyiMedicineParam)
  82. {
  83. startPage();
  84. List<TXinyiMedicineParam> list = tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam);
  85. return getDataTable(list);
  86. }
  87. /**
  88. * 导出智能投药参数设置列表
  89. */
  90. // @PreAuthorize("@ss.hasPermi('business:param:export')")
  91. // @Log(title = "智能投药参数设置", businessType = BusinessType.EXPORT)
  92. @PostMapping("/export")
  93. public void export(HttpServletResponse response, TXinyiMedicineParam tXinyiMedicineParam)
  94. {
  95. List<TXinyiMedicineParam> list = tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam);
  96. ExcelUtil<TXinyiMedicineParam> util = new ExcelUtil<TXinyiMedicineParam>(TXinyiMedicineParam.class);
  97. util.exportExcel(response, list, "智能投药参数设置数据");
  98. }
  99. /**
  100. * 获取智能投药参数设置详细信息
  101. */
  102. // @PreAuthorize("@ss.hasPermi('business:param:query')")
  103. @GetMapping(value = "/{id}")
  104. public AjaxResult getInfo(@PathVariable("id") Long id)
  105. {
  106. return success(tXinyiMedicineParamService.selectTXinyiMedicineParamById(id));
  107. }
  108. /**
  109. * 删除智能投药参数设置
  110. */
  111. // @PreAuthorize("@ss.hasPermi('business:param:remove')")
  112. // @Log(title = "智能投药参数设置", businessType = BusinessType.DELETE)
  113. @DeleteMapping("/{ids}")
  114. public AjaxResult remove(@PathVariable Long[] ids)
  115. {
  116. return toAjax(tXinyiMedicineParamService.deleteTXinyiMedicineParamByIds(ids));
  117. }
  118. }