MakeCardAllocationController.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package com.tour.web.controller;
  2. import java.util.List;
  3. import java.util.Arrays;
  4. import lombok.RequiredArgsConstructor;
  5. import com.tour.common.annotation.Log;
  6. import com.tour.common.core.controller.BaseController;
  7. import com.tour.common.core.domain.Result;
  8. import com.tour.common.core.page.TableDataInfo;
  9. import com.tour.common.enums.BusinessType;
  10. import com.tour.common.utils.poi.ExcelUtil;
  11. import org.springframework.security.access.prepost.PreAuthorize;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.GetMapping;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.PutMapping;
  16. import org.springframework.web.bind.annotation.DeleteMapping;
  17. import org.springframework.web.bind.annotation.PathVariable;
  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 com.tour.module.domain.MakeCardAllocation;
  22. import com.tour.module.service.IMakeCardAllocationService;
  23. /**
  24. * 制卡分配情况Controller
  25. *
  26. * @author zoe
  27. * @date 2023-06-02
  28. */
  29. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  30. @RestController
  31. @RequestMapping("/module/MakeCardAllocation" )
  32. public class MakeCardAllocationController extends BaseController {
  33. private final IMakeCardAllocationService iMakeCardAllocationService;
  34. /**
  35. * 查询制卡分配情况列表
  36. */
  37. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:list')")
  38. @GetMapping("/list")
  39. public TableDataInfo list(MakeCardAllocation MakeCardAllocation) {
  40. startPage();
  41. List<MakeCardAllocation> list = iMakeCardAllocationService.queryList(MakeCardAllocation);
  42. return getDataTable(list);
  43. }
  44. /**
  45. * 导出制卡分配情况列表
  46. */
  47. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:export')" )
  48. @Log(title = "制卡分配情况" , businessType = BusinessType.EXPORT)
  49. @GetMapping("/export" )
  50. public Result export(MakeCardAllocation MakeCardAllocation) {
  51. List<MakeCardAllocation> list = iMakeCardAllocationService.queryList(MakeCardAllocation);
  52. ExcelUtil<MakeCardAllocation> util = new ExcelUtil<MakeCardAllocation>(MakeCardAllocation.class);
  53. return util.exportExcel(list, "MakeCardAllocation" );
  54. }
  55. /**
  56. * 获取制卡分配情况详细信息
  57. */
  58. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:query')" )
  59. @GetMapping(value = "/{id}" )
  60. public Result getInfo(@PathVariable("id" ) Long id) {
  61. return Result.success(iMakeCardAllocationService.getById(id));
  62. }
  63. /**
  64. * 新增制卡分配情况
  65. */
  66. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:add')" )
  67. @Log(title = "制卡分配情况" , businessType = BusinessType.INSERT)
  68. @PostMapping
  69. public Result add(@RequestBody List<MakeCardAllocation> list) {
  70. return toAjax(iMakeCardAllocationService.saveBatch(list) ? 1 : 0);
  71. }
  72. /**
  73. * 修改制卡分配情况
  74. */
  75. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:edit')" )
  76. @Log(title = "制卡分配情况" , businessType = BusinessType.UPDATE)
  77. @PutMapping
  78. public Result edit(@RequestBody MakeCardAllocation MakeCardAllocation) {
  79. return toAjax(iMakeCardAllocationService.updateById(MakeCardAllocation) ? 1 : 0);
  80. }
  81. /**
  82. * 删除制卡分配情况
  83. */
  84. @PreAuthorize("@ss.hasPermi('module:MakeCardAllocation:remove')" )
  85. @Log(title = "制卡分配情况" , businessType = BusinessType.DELETE)
  86. @DeleteMapping("/{ids}" )
  87. public Result remove(@PathVariable Long[] ids) {
  88. return toAjax(iMakeCardAllocationService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
  89. }
  90. }