TgjjZcxxController.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package com.sooka.system.controller;
  2. import java.util.List;
  3. import com.sooka.common.core.controller.BaseController;
  4. import com.sooka.common.core.domain.AjaxResult;
  5. import com.sooka.common.core.page.TableDataInfo;
  6. import com.sooka.common.enums.BusinessType;
  7. import com.sooka.common.utils.poi.ExcelUtil;
  8. import org.apache.shiro.authz.annotation.RequiresPermissions;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Controller;
  11. import org.springframework.ui.ModelMap;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.ResponseBody;
  17. import com.sooka.common.annotation.Log;
  18. import com.sooka.system.domain.TgjjZcxx;
  19. import com.sooka.system.service.ITgjjZcxxService;
  20. /**
  21. * 政策信息Controller
  22. *
  23. * @author lei
  24. * @date 2021-11-16
  25. */
  26. @Controller
  27. @RequestMapping("/system/zcxx")
  28. public class TgjjZcxxController extends BaseController
  29. {
  30. private String prefix = "system/zcxx";
  31. @Autowired
  32. private ITgjjZcxxService tgjjZcxxService;
  33. @RequiresPermissions("system:zcxx:view")
  34. @GetMapping()
  35. public String zcxx()
  36. {
  37. return prefix + "/zcxx";
  38. }
  39. /**
  40. * 查询政策信息列表
  41. */
  42. @RequiresPermissions("system:zcxx:list")
  43. @PostMapping("/list")
  44. @ResponseBody
  45. public TableDataInfo list(TgjjZcxx tgjjZcxx)
  46. {
  47. startPage();
  48. List<TgjjZcxx> list = tgjjZcxxService.selectTgjjZcxxList(tgjjZcxx);
  49. return getDataTable(list);
  50. }
  51. /**
  52. * 导出政策信息列表
  53. */
  54. @RequiresPermissions("system:zcxx:export")
  55. @Log(title = "政策信息", businessType = BusinessType.EXPORT)
  56. @PostMapping("/export")
  57. @ResponseBody
  58. public AjaxResult export(TgjjZcxx tgjjZcxx)
  59. {
  60. List<TgjjZcxx> list = tgjjZcxxService.selectTgjjZcxxList(tgjjZcxx);
  61. ExcelUtil<TgjjZcxx> util = new ExcelUtil<TgjjZcxx>(TgjjZcxx.class);
  62. return util.exportExcel(list, "zcxx");
  63. }
  64. /**
  65. * 新增政策信息
  66. */
  67. @GetMapping("/add")
  68. public String add()
  69. {
  70. return prefix + "/add";
  71. }
  72. /**
  73. * 新增保存政策信息
  74. */
  75. @RequiresPermissions("system:zcxx:add")
  76. @Log(title = "政策信息", businessType = BusinessType.INSERT)
  77. @PostMapping("/add")
  78. @ResponseBody
  79. public AjaxResult addSave(TgjjZcxx tgjjZcxx)
  80. {
  81. return toAjax(tgjjZcxxService.insertTgjjZcxx(tgjjZcxx));
  82. }
  83. /**
  84. * 修改政策信息
  85. */
  86. @GetMapping("/edit/{ID}")
  87. public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
  88. {
  89. TgjjZcxx tgjjZcxx = tgjjZcxxService.selectTgjjZcxxById(ID);
  90. mmap.put("tgjjZcxx", tgjjZcxx);
  91. return prefix + "/edit";
  92. }
  93. /**
  94. * 修改保存政策信息
  95. */
  96. @RequiresPermissions("system:zcxx:edit")
  97. @Log(title = "政策信息", businessType = BusinessType.UPDATE)
  98. @PostMapping("/edit")
  99. @ResponseBody
  100. public AjaxResult editSave(TgjjZcxx tgjjZcxx)
  101. {
  102. return toAjax(tgjjZcxxService.updateTgjjZcxx(tgjjZcxx));
  103. }
  104. /**
  105. * 删除政策信息
  106. */
  107. @RequiresPermissions("system:zcxx:remove")
  108. @Log(title = "政策信息", businessType = BusinessType.DELETE)
  109. @PostMapping( "/remove")
  110. @ResponseBody
  111. public AjaxResult remove(String ids)
  112. {
  113. return toAjax(tgjjZcxxService.deleteTgjjZcxxByIds(ids));
  114. }
  115. }