ZxInvestmentController.java 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package com.ruoyi.web.controller.investment;
  2. import javax.servlet.http.HttpServletResponse;
  3. import com.ruoyi.common.utils.poi.ExcelUtil;
  4. import com.ruoyi.system.domain.investment.ZxInvestment;
  5. import org.springframework.security.access.prepost.PreAuthorize;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PostMapping;
  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.common.annotation.Log;
  14. import com.ruoyi.common.core.controller.BaseController;
  15. import com.ruoyi.common.core.domain.AjaxResult;
  16. import com.ruoyi.common.enums.BusinessType;
  17. import com.ruoyi.system.service.IZxInvestmentService;
  18. import com.ruoyi.common.core.page.TableDataInfo;
  19. import java.util.List;
  20. /**
  21. * 政协委员招商引资Controller
  22. *
  23. * @author boman
  24. * @date 2024-03-27
  25. */
  26. @RestController
  27. @RequestMapping("/zx/investment")
  28. public class ZxInvestmentController extends BaseController {
  29. @Autowired
  30. private IZxInvestmentService zxInvestmentService;
  31. /**
  32. * 查询政协委员招商引资列表
  33. */
  34. @PreAuthorize("@ss.hasPermi('zx:investment:list')")
  35. @GetMapping("/list")
  36. public TableDataInfo list(ZxInvestment zxInvestment) {
  37. startPage();
  38. List<ZxInvestment> list = zxInvestmentService.selectZxInvestmentList(zxInvestment);
  39. return getDataTable(list);
  40. }
  41. /**
  42. * 导出政协委员招商引资列表
  43. */
  44. @PreAuthorize("@ss.hasPermi('zx:investment:export')")
  45. @Log(title = "政协委员招商引资", businessType = BusinessType.EXPORT)
  46. @PostMapping("/export")
  47. public void export(HttpServletResponse response, ZxInvestment zxInvestment) {
  48. List<ZxInvestment> list = zxInvestmentService.selectZxInvestmentList(zxInvestment);
  49. ExcelUtil<ZxInvestment> util = new ExcelUtil<ZxInvestment>(ZxInvestment.class);
  50. util.exportExcel(response, list, "政协委员招商引资数据");
  51. }
  52. /**
  53. * 获取政协委员招商引资详细信息
  54. */
  55. @PreAuthorize("@ss.hasPermi('zx:investment:query')")
  56. @GetMapping(value = "/{investmentId}")
  57. public AjaxResult getInfo(@PathVariable("investmentId") Long investmentId) {
  58. return success(zxInvestmentService.selectZxInvestmentByInvestmentId(investmentId));
  59. }
  60. /**
  61. * 新增政协委员招商引资
  62. */
  63. @PreAuthorize("@ss.hasPermi('zx:investment:add')")
  64. @Log(title = "政协委员招商引资", businessType = BusinessType.INSERT)
  65. @PostMapping
  66. public AjaxResult add(@RequestBody ZxInvestment zxInvestment) {
  67. return toAjax(zxInvestmentService.insertZxInvestment(zxInvestment));
  68. }
  69. /**
  70. * 修改政协委员招商引资
  71. */
  72. @PreAuthorize("@ss.hasPermi('zx:investment:edit')")
  73. @Log(title = "政协委员招商引资", businessType = BusinessType.UPDATE)
  74. @PostMapping("/put")
  75. public AjaxResult edit(@RequestBody ZxInvestment zxInvestment) {
  76. return zxInvestmentService.updateZxInvestment(zxInvestment);
  77. }
  78. /**
  79. * 审核/签约按钮政协委员招商引资
  80. */
  81. @PreAuthorize("@ss.hasPermi('zx:investment:examine')")
  82. @Log(title = "政协委员招商引资", businessType = BusinessType.UPDATE)
  83. @PostMapping("/examine")
  84. public AjaxResult examine(@RequestBody ZxInvestment zxInvestment) {
  85. return zxInvestmentService.updateZxInvestment(zxInvestment);
  86. }
  87. /**
  88. * 删除政协委员招商引资
  89. */
  90. @PreAuthorize("@ss.hasPermi('zx:investment:remove')")
  91. @Log(title = "政协委员招商引资", businessType = BusinessType.DELETE)
  92. @GetMapping("/delete/{investmentIds}")
  93. public AjaxResult remove(@PathVariable Long[] investmentIds) {
  94. return toAjax(zxInvestmentService.deleteZxInvestmentByInvestmentIds(investmentIds));
  95. }
  96. }