BomanReservatConfigTimeController.java 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.ruoyi.web.controller.appointment;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import org.springframework.security.access.prepost.PreAuthorize;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.PutMapping;
  9. import org.springframework.web.bind.annotation.DeleteMapping;
  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.system.domain.BomanReservatConfigTime;
  19. import com.ruoyi.system.service.IBomanReservatConfigTimeService;
  20. import com.ruoyi.common.utils.poi.ExcelUtil;
  21. import com.ruoyi.common.core.page.TableDataInfo;
  22. /**
  23. * 预约时段配置Controller
  24. *
  25. * @author ruoyi
  26. * @date 2024-02-27
  27. */
  28. @RestController
  29. @RequestMapping("/reservat/time")
  30. public class BomanReservatConfigTimeController extends BaseController {
  31. @Autowired
  32. private IBomanReservatConfigTimeService bomanReservatConfigTimeService;
  33. /**
  34. * 查询预约时段配置列表
  35. */
  36. @PreAuthorize("@ss.hasPermi('system:time:list')")
  37. @GetMapping("/list")
  38. public TableDataInfo list(BomanReservatConfigTime bomanReservatConfigTime) {
  39. startPage();
  40. List<BomanReservatConfigTime> list = bomanReservatConfigTimeService.selectBomanReservatConfigTimeList(bomanReservatConfigTime);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出预约时段配置列表
  45. */
  46. @PreAuthorize("@ss.hasPermi('system:time:export')")
  47. @Log(title = "预约时段配置", businessType = BusinessType.EXPORT)
  48. @PostMapping("/export")
  49. public void export(HttpServletResponse response, BomanReservatConfigTime bomanReservatConfigTime) {
  50. List<BomanReservatConfigTime> list = bomanReservatConfigTimeService.selectBomanReservatConfigTimeList(bomanReservatConfigTime);
  51. ExcelUtil<BomanReservatConfigTime> util = new ExcelUtil<BomanReservatConfigTime>(BomanReservatConfigTime.class);
  52. util.exportExcel(response, list, "预约时段配置数据");
  53. }
  54. /**
  55. * 获取预约时段配置详细信息
  56. */
  57. @PreAuthorize("@ss.hasPermi('system:time:query')")
  58. @GetMapping(value = "/{reservatConfigTimeId}")
  59. public AjaxResult getInfo(@PathVariable("reservatConfigTimeId") Long reservatConfigTimeId) {
  60. return success(bomanReservatConfigTimeService.selectBomanReservatConfigTimeByReservatConfigTimeId(reservatConfigTimeId));
  61. }
  62. /**
  63. * 新增预约时段配置
  64. */
  65. @PreAuthorize("@ss.hasPermi('system:time:add')")
  66. @Log(title = "预约时段配置", businessType = BusinessType.INSERT)
  67. @PostMapping
  68. public AjaxResult add(@RequestBody BomanReservatConfigTime bomanReservatConfigTime) {
  69. return toAjax(bomanReservatConfigTimeService.insertBomanReservatConfigTime(bomanReservatConfigTime));
  70. }
  71. /**
  72. * 修改预约时段配置
  73. */
  74. @PreAuthorize("@ss.hasPermi('system:time:edit')")
  75. @Log(title = "预约时段配置", businessType = BusinessType.UPDATE)
  76. @PostMapping("/put")
  77. public AjaxResult edit(@RequestBody BomanReservatConfigTime bomanReservatConfigTime) {
  78. return toAjax(bomanReservatConfigTimeService.updateBomanReservatConfigTime(bomanReservatConfigTime));
  79. }
  80. /**
  81. * 删除预约时段配置
  82. */
  83. @PreAuthorize("@ss.hasPermi('system:time:remove')")
  84. @Log(title = "预约时段配置", businessType = BusinessType.DELETE)
  85. @GetMapping("/delete/{reservatConfigTimeIds}")
  86. public AjaxResult remove(@PathVariable Long[] reservatConfigTimeIds) {
  87. return toAjax(bomanReservatConfigTimeService.deleteBomanReservatConfigTimeByReservatConfigTimeIds(reservatConfigTimeIds));
  88. }
  89. }