MaintenanceStaffController.java 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.ruoyi.web.controller.maintenance;
  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.poi.ExcelUtil;
  8. import com.ruoyi.system.domain.maintenance.MaintenanceStaff;
  9. import com.ruoyi.system.service.IMaintenanceStaffService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.security.access.prepost.PreAuthorize;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.servlet.http.HttpServletResponse;
  14. import java.util.List;
  15. /**
  16. * 维修人员管理Controller
  17. *
  18. * @author boman
  19. * @date 2025-02-14
  20. */
  21. @RestController
  22. @RequestMapping("/wuYe/staff")
  23. public class MaintenanceStaffController extends BaseController
  24. {
  25. @Autowired
  26. private IMaintenanceStaffService maintenanceStaffService;
  27. /**
  28. * 查询维修人员管理列表
  29. */
  30. @PreAuthorize("@ss.hasPermi('wuYe:staff:list')")
  31. @GetMapping("/list")
  32. public TableDataInfo list(MaintenanceStaff maintenanceStaff)
  33. {
  34. startPage();
  35. List<MaintenanceStaff> list = maintenanceStaffService.selectMaintenanceStaffList(maintenanceStaff);
  36. return getDataTable(list);
  37. }
  38. /**
  39. * 导出维修人员管理列表
  40. */
  41. @PreAuthorize("@ss.hasPermi('wuYe:staff:export')")
  42. @Log(title = "维修人员管理", businessType = BusinessType.EXPORT)
  43. @PostMapping("/export")
  44. public void export(HttpServletResponse response, MaintenanceStaff maintenanceStaff)
  45. {
  46. List<MaintenanceStaff> list = maintenanceStaffService.selectMaintenanceStaffList(maintenanceStaff);
  47. ExcelUtil<MaintenanceStaff> util = new ExcelUtil<MaintenanceStaff>(MaintenanceStaff.class);
  48. util.exportExcel(response, list, "维修人员管理数据");
  49. }
  50. /**
  51. * 获取维修人员管理详细信息
  52. */
  53. @PreAuthorize("@ss.hasPermi('wuYe:staff:query')")
  54. @GetMapping(value = "/{staffId}")
  55. public AjaxResult getInfo(@PathVariable("staffId") Long staffId)
  56. {
  57. return success(maintenanceStaffService.selectMaintenanceStaffByStaffId(staffId));
  58. }
  59. /**
  60. * 新增维修人员管理
  61. */
  62. @PreAuthorize("@ss.hasPermi('wuYe:staff:add')")
  63. @Log(title = "维修人员管理", businessType = BusinessType.INSERT)
  64. @PostMapping
  65. public AjaxResult add(@RequestBody MaintenanceStaff maintenanceStaff)
  66. {
  67. return toAjax(maintenanceStaffService.insertMaintenanceStaff(maintenanceStaff));
  68. }
  69. /**
  70. * 修改维修人员管理
  71. */
  72. @PreAuthorize("@ss.hasPermi('wuYe:staff:edit')")
  73. @Log(title = "维修人员管理", businessType = BusinessType.UPDATE)
  74. @PostMapping("/put")
  75. public AjaxResult edit(@RequestBody MaintenanceStaff maintenanceStaff)
  76. {
  77. return toAjax(maintenanceStaffService.updateMaintenanceStaff(maintenanceStaff));
  78. }
  79. /**
  80. * 删除维修人员管理
  81. */
  82. @PreAuthorize("@ss.hasPermi('wuYe:staff:remove')")
  83. @Log(title = "维修人员管理", businessType = BusinessType.DELETE)
  84. @GetMapping("/delete/{staffIds}")
  85. public AjaxResult remove(@PathVariable Long[] staffIds)
  86. {
  87. return toAjax(maintenanceStaffService.deleteMaintenanceStaffByStaffIds(staffIds));
  88. }
  89. }