SysProjectStaffController.java 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.takai.web.controller.system;
  2. import com.takai.common.annotation.Log;
  3. import com.takai.common.core.controller.BaseController;
  4. import com.takai.common.core.domain.AjaxResult;
  5. import com.takai.common.core.page.TableDataInfo;
  6. import com.takai.common.enums.BusinessType;
  7. import com.takai.common.utils.poi.ExcelUtil;
  8. import com.takai.system.domain.SysProjectStaff;
  9. import com.takai.system.service.ISysProjectStaffService;
  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 takai
  19. * @date 2025-05-28
  20. */
  21. @RestController
  22. @RequestMapping("/system/staff")
  23. public class SysProjectStaffController extends BaseController
  24. {
  25. @Autowired
  26. private ISysProjectStaffService sysProjectStaffService;
  27. /**
  28. * 查询【请填写功能名称】列表
  29. */
  30. @PreAuthorize("@ss.hasPermi('system:staff:list')")
  31. @GetMapping("/list")
  32. public TableDataInfo list(SysProjectStaff sysProjectStaff)
  33. {
  34. startPage();
  35. List<SysProjectStaff> list = sysProjectStaffService.selectSysProjectStaffList(sysProjectStaff);
  36. return getDataTable(list);
  37. }
  38. /**
  39. * 导出【请填写功能名称】列表
  40. */
  41. @PreAuthorize("@ss.hasPermi('system:staff:export')")
  42. @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
  43. @PostMapping("/export")
  44. public void export(HttpServletResponse response, SysProjectStaff sysProjectStaff)
  45. {
  46. List<SysProjectStaff> list = sysProjectStaffService.selectSysProjectStaffList(sysProjectStaff);
  47. ExcelUtil<SysProjectStaff> util = new ExcelUtil<SysProjectStaff>(SysProjectStaff.class);
  48. util.exportExcel(response, list, "【请填写功能名称】数据");
  49. }
  50. /**
  51. * 获取【请填写功能名称】详细信息
  52. */
  53. @PreAuthorize("@ss.hasPermi('system:staff:query')")
  54. @GetMapping(value = "/{id}")
  55. public AjaxResult getInfo(@PathVariable("id") Long id)
  56. {
  57. return success(sysProjectStaffService.selectSysProjectStaffById(id));
  58. }
  59. /**
  60. * 新增【请填写功能名称】
  61. */
  62. @PreAuthorize("@ss.hasPermi('system:staff:add')")
  63. @Log(title = "【添加项目成员】", businessType = BusinessType.INSERT)
  64. @PostMapping
  65. public AjaxResult add(@RequestBody SysProjectStaff sysProjectStaff)
  66. {
  67. return toAjax(sysProjectStaffService.insertSysProjectStaff(sysProjectStaff));
  68. }
  69. /**
  70. * 修改【请填写功能名称】
  71. */
  72. @PreAuthorize("@ss.hasPermi('system:staff:edit')")
  73. @Log(title = "【修改项目成员】", businessType = BusinessType.UPDATE)
  74. @PutMapping
  75. public AjaxResult edit(@RequestBody SysProjectStaff sysProjectStaff)
  76. {
  77. return toAjax(sysProjectStaffService.updateSysProjectStaff(sysProjectStaff));
  78. }
  79. /**
  80. * 删除【请填写功能名称】
  81. */
  82. @PreAuthorize("@ss.hasPermi('system:staff:remove')")
  83. @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
  84. @DeleteMapping("/{ids}")
  85. public AjaxResult remove(@PathVariable Long[] ids)
  86. {
  87. return toAjax(sysProjectStaffService.deleteSysProjectStaffByIds(ids));
  88. }
  89. }