HsEventBusinessRelationController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.willalp.web.controller.clockingin;
  2. import com.willalp.common.annotation.Log;
  3. import com.willalp.common.core.controller.BaseController;
  4. import com.willalp.common.core.domain.AjaxResult;
  5. import com.willalp.common.core.page.TableDataInfo;
  6. import com.willalp.common.enums.BusinessType;
  7. import com.willalp.common.utils.poi.ExcelUtil;
  8. import com.willalp.event.domain.HsEventBusinessRelation;
  9. import com.willalp.event.service.IHsEventBusinessRelationService;
  10. import org.springframework.security.access.prepost.PreAuthorize;
  11. import org.springframework.web.bind.annotation.*;
  12. import javax.annotation.Resource;
  13. import java.util.Arrays;
  14. import java.util.List;
  15. /**
  16. * 事件相关业务关系Controller
  17. *
  18. * @author willalp
  19. * @date 2023-01-29
  20. */
  21. @RestController
  22. @RequestMapping("/eventConfig/relation")
  23. public class HsEventBusinessRelationController extends BaseController {
  24. @Resource
  25. private IHsEventBusinessRelationService hsEventBusinessRelationService;
  26. /**
  27. * 查询事件相关业务关系列表
  28. */
  29. @PreAuthorize("@ss.hasPermi('eventConfig:relation:list')")
  30. @PostMapping("/submit/binding")
  31. public AjaxResult submitBinding(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
  32. return toAjax(hsEventBusinessRelationService.doBindingRelation(hsEventBusinessRelation));
  33. }
  34. /**
  35. * 查询事件相关业务关系列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('eventConfig:relation:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(HsEventBusinessRelation hsEventBusinessRelation) {
  40. startPage();
  41. List<HsEventBusinessRelation> list = hsEventBusinessRelationService.selectHsEventBusinessRelationList(hsEventBusinessRelation);
  42. return getDataTable(list);
  43. }
  44. /**
  45. * 导出事件相关业务关系列表
  46. */
  47. @PreAuthorize("@ss.hasPermi('eventConfig:relation:export')")
  48. @Log(title = "事件相关业务关系", businessType = BusinessType.EXPORT)
  49. @GetMapping("/export")
  50. public AjaxResult export(HsEventBusinessRelation hsEventBusinessRelation) {
  51. List<HsEventBusinessRelation> list = hsEventBusinessRelationService.selectHsEventBusinessRelationList(hsEventBusinessRelation);
  52. ExcelUtil<HsEventBusinessRelation> util = new ExcelUtil<HsEventBusinessRelation>(HsEventBusinessRelation.class);
  53. return util.exportExcel(list, "事件相关业务关系数据");
  54. }
  55. /**
  56. * 获取事件相关业务关系详细信息
  57. */
  58. @PreAuthorize("@ss.hasPermi('eventConfig:relation:query')")
  59. @GetMapping(value = "/{eventId}")
  60. public AjaxResult getInfo(@PathVariable("eventId") String eventId) {
  61. return AjaxResult.success(hsEventBusinessRelationService.getById(eventId));
  62. }
  63. /**
  64. * 新增事件相关业务关系
  65. */
  66. @PreAuthorize("@ss.hasPermi('eventConfig:relation:add')")
  67. @Log(title = "事件相关业务关系", businessType = BusinessType.INSERT)
  68. @PostMapping
  69. public AjaxResult add(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
  70. return toAjax(hsEventBusinessRelationService.save(hsEventBusinessRelation));
  71. }
  72. /**
  73. * 修改事件相关业务关系
  74. */
  75. @PreAuthorize("@ss.hasPermi('eventConfig:relation:edit')")
  76. @Log(title = "事件相关业务关系", businessType = BusinessType.UPDATE)
  77. @PutMapping
  78. public AjaxResult edit(@RequestBody HsEventBusinessRelation hsEventBusinessRelation) {
  79. return toAjax(hsEventBusinessRelationService.updateById(hsEventBusinessRelation));
  80. }
  81. /**
  82. * 删除事件相关业务关系
  83. */
  84. @PreAuthorize("@ss.hasPermi('eventConfig:relation:remove')")
  85. @Log(title = "事件相关业务关系", businessType = BusinessType.DELETE)
  86. @DeleteMapping("/{eventIds}")
  87. public AjaxResult remove(@PathVariable String[] eventIds) {
  88. return toAjax(hsEventBusinessRelationService.removeByIds(Arrays.asList(eventIds)));
  89. }
  90. }