CenterdataTWaterRainfallStationController.java 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.sooka.sponest.data.digitalwaterconservancy.controller;
  2. import java.util.List;
  3. import java.io.IOException;
  4. import javax.servlet.http.HttpServletResponse;
  5. import com.sooka.sponest.data.digitalwaterconservancy.domain.CenterdataTWaterRainfallStation;
  6. import com.sooka.sponest.data.digitalwaterconservancy.service.ICenterdataTWaterRainfallStationService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.PutMapping;
  11. import org.springframework.web.bind.annotation.DeleteMapping;
  12. import org.springframework.web.bind.annotation.PathVariable;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import com.ruoyi.common.log.annotation.Log;
  17. import com.ruoyi.common.log.enums.BusinessType;
  18. import com.ruoyi.common.security.annotation.RequiresPermissions;
  19. import com.ruoyi.common.core.web.controller.BaseController;
  20. import com.ruoyi.common.core.web.domain.AjaxResult;
  21. import com.ruoyi.common.core.utils.poi.ExcelUtil;
  22. import com.ruoyi.common.core.web.page.TableDataInfo;
  23. /**
  24. * 水利-雨量站管理Controller
  25. *
  26. * @author LG
  27. * @date 2025-02-20
  28. */
  29. @RestController
  30. @RequestMapping("/rainfall/station")
  31. public class CenterdataTWaterRainfallStationController extends BaseController {
  32. @Autowired
  33. private ICenterdataTWaterRainfallStationService centerdataTWaterRainfallStationService;
  34. /**
  35. * 查询水利-雨量站管理列表
  36. */
  37. @GetMapping("/list")
  38. public TableDataInfo list(CenterdataTWaterRainfallStation centerdataTWaterRainfallStation) {
  39. startPage();
  40. List<CenterdataTWaterRainfallStation> list = centerdataTWaterRainfallStationService.selectCenterdataTWaterRainfallStationList(centerdataTWaterRainfallStation);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出水利-雨量站管理列表
  45. */
  46. @Log(title = "水利-雨量站管理", businessType = BusinessType.EXPORT)
  47. @PostMapping("/export")
  48. public void export(HttpServletResponse response, CenterdataTWaterRainfallStation centerdataTWaterRainfallStation) {
  49. List<CenterdataTWaterRainfallStation> list = centerdataTWaterRainfallStationService.selectCenterdataTWaterRainfallStationList(centerdataTWaterRainfallStation);
  50. ExcelUtil<CenterdataTWaterRainfallStation> util = new ExcelUtil<CenterdataTWaterRainfallStation>(CenterdataTWaterRainfallStation.class);
  51. util.exportExcel(response, list, "水利-雨量站管理数据");
  52. }
  53. /**
  54. * 获取水利-雨量站管理详细信息
  55. */
  56. @GetMapping(value = "/{id}")
  57. public AjaxResult getInfo(@PathVariable("id") String id) {
  58. return AjaxResult.success(centerdataTWaterRainfallStationService.selectCenterdataTWaterRainfallStationById(id));
  59. }
  60. /**
  61. * 新增水利-雨量站管理
  62. */
  63. @Log(title = "水利-雨量站管理", businessType = BusinessType.INSERT)
  64. @PostMapping
  65. public AjaxResult add(@RequestBody CenterdataTWaterRainfallStation centerdataTWaterRainfallStation) {
  66. return toAjax(centerdataTWaterRainfallStationService.insertCenterdataTWaterRainfallStation(centerdataTWaterRainfallStation));
  67. }
  68. /**
  69. * 修改水利-雨量站管理
  70. */
  71. @Log(title = "水利-雨量站管理", businessType = BusinessType.UPDATE)
  72. @PutMapping
  73. public AjaxResult edit(@RequestBody CenterdataTWaterRainfallStation centerdataTWaterRainfallStation) {
  74. return toAjax(centerdataTWaterRainfallStationService.updateCenterdataTWaterRainfallStation(centerdataTWaterRainfallStation));
  75. }
  76. /**
  77. * 删除水利-雨量站管理
  78. */
  79. @Log(title = "水利-雨量站管理", businessType = BusinessType.DELETE)
  80. @DeleteMapping("/{ids}")
  81. public AjaxResult remove(@PathVariable String[] ids) {
  82. return toAjax(centerdataTWaterRainfallStationService.deleteCenterdataTWaterRainfallStationByIds(ids));
  83. }
  84. }