ReviewCommentsController.java 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package com.ruoyi.web.controller.review;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import com.ruoyi.system.domain.review.ReviewComments;
  5. import com.ruoyi.system.service.review.IReviewCommentsService;
  6. import org.springframework.security.access.prepost.PreAuthorize;
  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.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.ruoyi.common.annotation.Log;
  15. import com.ruoyi.common.core.controller.BaseController;
  16. import com.ruoyi.common.core.domain.AjaxResult;
  17. import com.ruoyi.common.enums.BusinessType;
  18. import com.ruoyi.common.utils.poi.ExcelUtil;
  19. import com.ruoyi.common.core.page.TableDataInfo;
  20. /**
  21. * 业务审核意见Controller
  22. *
  23. * @author boman
  24. * @date 2024-04-24
  25. */
  26. @RestController
  27. @RequestMapping("/comments")
  28. public class ReviewCommentsController extends BaseController {
  29. @Autowired
  30. private IReviewCommentsService reviewCommentsService;
  31. /**
  32. * 查询业务审核意见列表
  33. */
  34. @PreAuthorize("@ss.hasPermi('system:comments:list')")
  35. @GetMapping("/list")
  36. public TableDataInfo list(ReviewComments reviewComments) {
  37. List<ReviewComments> list = reviewCommentsService.selectReviewCommentsList(reviewComments);
  38. return getDataTable(list);
  39. }
  40. /**
  41. * 导出业务审核意见列表
  42. */
  43. @PreAuthorize("@ss.hasPermi('system:comments:export')")
  44. @Log(title = "业务审核意见", businessType = BusinessType.EXPORT)
  45. @PostMapping("/export")
  46. public void export(HttpServletResponse response, ReviewComments reviewComments) {
  47. List<ReviewComments> list = reviewCommentsService.selectReviewCommentsList(reviewComments);
  48. ExcelUtil<ReviewComments> util = new ExcelUtil<ReviewComments>(ReviewComments.class);
  49. util.exportExcel(response, list, "业务审核意见数据");
  50. }
  51. /**
  52. * 获取业务审核意见详细信息
  53. */
  54. @PreAuthorize("@ss.hasPermi('system:comments:query')")
  55. @GetMapping(value = "/{reviewCommentsId}")
  56. public AjaxResult getInfo(@PathVariable("reviewCommentsId") Long reviewCommentsId) {
  57. return success(reviewCommentsService.selectReviewCommentsByReviewCommentsId(reviewCommentsId));
  58. }
  59. /**
  60. * 新增业务审核意见
  61. */
  62. @PreAuthorize("@ss.hasPermi('system:comments:add')")
  63. @Log(title = "业务审核意见", businessType = BusinessType.INSERT)
  64. @PostMapping
  65. public AjaxResult add(@RequestBody ReviewComments reviewComments) {
  66. return toAjax(reviewCommentsService.insertReviewComments(reviewComments));
  67. }
  68. /**
  69. * 修改业务审核意见
  70. */
  71. @PreAuthorize("@ss.hasPermi('system:comments:edit')")
  72. @Log(title = "业务审核意见", businessType = BusinessType.UPDATE)
  73. @PostMapping("/put")
  74. public AjaxResult edit(@RequestBody ReviewComments reviewComments) {
  75. return toAjax(reviewCommentsService.updateReviewComments(reviewComments));
  76. }
  77. /**
  78. * 删除业务审核意见
  79. */
  80. @PreAuthorize("@ss.hasPermi('system:comments:remove')")
  81. @Log(title = "业务审核意见", businessType = BusinessType.DELETE)
  82. @GetMapping("/delete/{reviewCommentsIds}")
  83. public AjaxResult remove(@PathVariable Long[] reviewCommentsIds) {
  84. return toAjax(reviewCommentsService.deleteReviewCommentsByReviewCommentsIds(reviewCommentsIds));
  85. }
  86. }