CpsUsrApplyController.java 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. package com.ruoyi.web.controller.cp;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.core.controller.BaseController;
  4. import com.ruoyi.common.core.domain.AjaxResult;
  5. import com.ruoyi.common.core.page.TableDataInfo;
  6. import com.ruoyi.common.enums.BusinessType;
  7. import com.ruoyi.common.utils.DateUtils;
  8. import com.ruoyi.common.utils.poi.ExcelUtil;
  9. import com.ruoyi.system.domain.CpsUsrApply;
  10. import com.ruoyi.system.service.ICpsUsrApplyService;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.security.access.prepost.PreAuthorize;
  13. import org.springframework.web.bind.annotation.DeleteMapping;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.PathVariable;
  16. import org.springframework.web.bind.annotation.PostMapping;
  17. import org.springframework.web.bind.annotation.PutMapping;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import javax.servlet.http.HttpServletResponse;
  22. import java.util.List;
  23. /**
  24. * cps_usr_apply与会申请Controller
  25. *
  26. * @author ruoyi
  27. * @date 2024-09-03
  28. */
  29. @RestController
  30. @RequestMapping("/cp/usrApply")
  31. public class CpsUsrApplyController extends BaseController {
  32. @Autowired
  33. private ICpsUsrApplyService cpsUsrApplyService;
  34. /**
  35. * 查询cps_usr_apply与会申请列表
  36. */
  37. @GetMapping("/list")
  38. @PreAuthorize("@ss.hasPermi('cp:apply:index')")
  39. public TableDataInfo list(CpsUsrApply cpsUsrApply) {
  40. startPage();
  41. List<CpsUsrApply> list = cpsUsrApplyService.selectCpsUsrDataRole(cpsUsrApply);
  42. return getDataTable(list);
  43. }
  44. @GetMapping("/regist/list")
  45. public AjaxResult registList() {
  46. return AjaxResult.success(cpsUsrApplyService.qryUserApplyList());
  47. }
  48. /**
  49. * 导出cps_usr_apply与会申请列表
  50. */
  51. @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.EXPORT)
  52. @PostMapping("/export")
  53. public void export(HttpServletResponse response, CpsUsrApply cpsUsrApply) {
  54. List<CpsUsrApply> list = cpsUsrApplyService.selectCpsUsrApplyList(cpsUsrApply);
  55. ExcelUtil<CpsUsrApply> util = new ExcelUtil<CpsUsrApply>(CpsUsrApply.class);
  56. util.exportExcel(response, list, "cps_usr_apply与会申请数据");
  57. }
  58. /**
  59. * 获取cps_usr_apply与会申请详细信息
  60. */
  61. @GetMapping(value = "/{id}")
  62. public AjaxResult getInfo(@PathVariable("id") Long id) {
  63. return success(cpsUsrApplyService.selectCpsUsrApplyById(id));
  64. }
  65. @GetMapping(value = "/info/meeting")
  66. public AjaxResult getUsrMeetingInfo() {
  67. return success(cpsUsrApplyService.selectCpsUsrApplyByTel());
  68. }
  69. @GetMapping(value = "/info/meeting/{type}")
  70. public AjaxResult getUsrThemeMeetingInfo(@PathVariable("type") String type) {
  71. return success(cpsUsrApplyService.selectCpsUsrApplyThemeMeeting(type));
  72. }
  73. /**
  74. * 新增cps_usr_apply与会申请
  75. */
  76. @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.INSERT)
  77. @PostMapping
  78. public AjaxResult add(@RequestBody CpsUsrApply cpsUsrApply) {
  79. cpsUsrApply.setCreateTime(DateUtils.getNowDate());
  80. return toAjax(cpsUsrApplyService.insertCpsUsrApply(cpsUsrApply));
  81. }
  82. /**
  83. * 修改cps_usr_apply与会申请
  84. */
  85. @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.UPDATE)
  86. @PutMapping
  87. public AjaxResult edit(@RequestBody CpsUsrApply cpsUsrApply) {
  88. return toAjax(cpsUsrApplyService.updateCpsUsrApply(cpsUsrApply));
  89. }
  90. @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.UPDATE)
  91. @PutMapping("/reject")
  92. public AjaxResult reject(@RequestBody CpsUsrApply cpsUsrApply) {
  93. return toAjax(cpsUsrApplyService.rejectCpsUsrApply(cpsUsrApply));
  94. }
  95. /**
  96. * 删除cps_usr_apply与会申请
  97. */
  98. @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.DELETE)
  99. @DeleteMapping("/{ids}")
  100. public AjaxResult remove(@PathVariable Long[] ids) {
  101. return toAjax(cpsUsrApplyService.deleteCpsUsrApplyByIds(ids));
  102. }
  103. }