TMtPersonController.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package com.cpms.project.plant.controller;
  2. import com.cpms.common.annotation.Log;
  3. import com.cpms.common.core.controller.BaseController;
  4. import com.cpms.common.core.domain.AjaxResult;
  5. import com.cpms.common.core.page.TableDataInfo;
  6. import com.cpms.common.enums.BusinessType;
  7. import com.cpms.common.utils.poi.ExcelUtil;
  8. import com.cpms.project.plant.domain.TMtPerson;
  9. import com.cpms.project.plant.mapper.TStaffmgrMapper;
  10. import com.cpms.project.plant.service.ITMtPersonService;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.security.access.prepost.PreAuthorize;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.annotation.Resource;
  15. import java.util.List;
  16. /**
  17. * 会议人员Controller
  18. *
  19. * @author ruoyi
  20. * @date 2021-01-14
  21. */
  22. @RestController
  23. @RequestMapping("/plant/person")
  24. public class TMtPersonController extends BaseController
  25. {
  26. @Autowired
  27. private ITMtPersonService tMtPersonService;
  28. @Resource
  29. private TStaffmgrMapper tStaffmgrMapper;
  30. /**
  31. * 查询会议人员列表
  32. */
  33. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:list')")
  34. @GetMapping("/list")
  35. public TableDataInfo list(TMtPerson tMtPerson)
  36. {
  37. startPage();
  38. List<TMtPerson> list = tMtPersonService.selectTMtPersonList(tMtPerson);
  39. return getDataTable(list);
  40. }
  41. /**
  42. * 导出会议人员列表
  43. */
  44. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:export')")
  45. @Log(title = "会议人员", businessType = BusinessType.EXPORT)
  46. @GetMapping("/export")
  47. public AjaxResult export(TMtPerson tMtPerson)
  48. {
  49. List<TMtPerson> list = tMtPersonService.selectTMtPersonList(tMtPerson);
  50. ExcelUtil<TMtPerson> util = new ExcelUtil<TMtPerson>(TMtPerson.class);
  51. return util.exportExcel(list, "person");
  52. }
  53. /**
  54. * 获取会议人员详细信息
  55. */
  56. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:query')")
  57. @GetMapping(value = "/{id}")
  58. public AjaxResult getInfo(@PathVariable("id") Long id)
  59. {
  60. return AjaxResult.success(tMtPersonService.selectTMtPersonById(id));
  61. }
  62. /**
  63. * 新增会议人员
  64. */
  65. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:add')")
  66. @Log(title = "会议人员", businessType = BusinessType.INSERT)
  67. @PostMapping
  68. public AjaxResult add(@RequestBody TMtPerson tMtPerson)
  69. {
  70. // TStaffmgr t = tStaffmgrMapper.selectTStaffmgrByStaffId(tMtPerson.getStaffid());
  71. // tMtPerson.setActualpost(t.getActualpost());
  72. // tMtPerson.setDeptId(t.getDeptId());
  73. // tMtPerson.setName(t.getName());
  74. // tMtPerson.setPlantCode(t.getPlantCode());
  75. // tMtPerson.setUnit(t.getUnit());
  76. // tMtPerson.setContact(t.getContact());
  77. // tMtPerson.setTeam(t.getTeam());
  78. // tMtPerson.setSex(t.getSex());
  79. return toAjax(tMtPersonService.insertTMtPerson(tMtPerson));
  80. }
  81. /**
  82. * 修改会议人员
  83. */
  84. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:edit')")
  85. @Log(title = "会议人员", businessType = BusinessType.UPDATE)
  86. @PutMapping
  87. public AjaxResult edit(@RequestBody TMtPerson tMtPerson)
  88. {
  89. return toAjax(tMtPersonService.updateTMtPerson(tMtPerson));
  90. }
  91. /**
  92. * 删除会议人员
  93. */
  94. @PreAuthorize("@ss.hasPermi('plant:keymaintenance:remove')")
  95. @Log(title = "会议人员", businessType = BusinessType.DELETE)
  96. @DeleteMapping("/{ids}")
  97. public AjaxResult remove(@PathVariable Long[] ids)
  98. {
  99. return toAjax(tMtPersonService.deleteTMtPersonByIds(ids));
  100. }
  101. }