BmConstructionEntryController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package com.ruoyi.web.controller.project;
  2. import java.util.List;
  3. import com.ruoyi.common.enums.BusinessType;
  4. import com.ruoyi.common.utils.poi.ExcelUtil;
  5. import com.ruoyi.system.domain.project.BmConstructionEntry;
  6. import com.ruoyi.system.service.project.IBmConstructionEntryService;
  7. import org.springframework.security.access.prepost.PreAuthorize;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.GetMapping;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.PutMapping;
  12. import org.springframework.web.bind.annotation.DeleteMapping;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import com.ruoyi.common.annotation.Log;
  18. import com.ruoyi.common.core.controller.BaseController;
  19. import com.ruoyi.common.core.domain.AjaxResult;
  20. import com.ruoyi.common.core.page.TableDataInfo;
  21. /**
  22. * 项目入规
  23. (跟项目一对一)Controller
  24. *
  25. * @author ruoyi
  26. * @date 2021-12-20
  27. */
  28. @RestController
  29. @RequestMapping("/constructionEntry/entry")
  30. public class BmConstructionEntryController extends BaseController
  31. {
  32. @Autowired
  33. private IBmConstructionEntryService bmConstructionEntryService;
  34. /**
  35. * 查询项目入规
  36. (跟项目一对一)列表
  37. */
  38. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:list')")
  39. @GetMapping("/list")
  40. public TableDataInfo list(BmConstructionEntry bmConstructionEntry)
  41. {
  42. startPage();
  43. List<BmConstructionEntry> list = bmConstructionEntryService.selectBmConstructionEntryList(bmConstructionEntry);
  44. return getDataTable(list);
  45. }
  46. /**
  47. * 导出项目入规
  48. (跟项目一对一)列表
  49. */
  50. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:export')")
  51. @Log(title = "项目入规 (跟项目一对一)", businessType = BusinessType.EXPORT)
  52. @GetMapping("/export")
  53. public AjaxResult export(BmConstructionEntry bmConstructionEntry)
  54. {
  55. List<BmConstructionEntry> list = bmConstructionEntryService.selectBmConstructionEntryList(bmConstructionEntry);
  56. ExcelUtil<BmConstructionEntry> util = new ExcelUtil<BmConstructionEntry>(BmConstructionEntry.class);
  57. return util.exportExcel(list, "entry");
  58. }
  59. /**
  60. * 获取项目入规
  61. (跟项目一对一)详细信息
  62. */
  63. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:query')")
  64. @GetMapping(value = "/{id}")
  65. public AjaxResult getInfo(@PathVariable("id") Long id)
  66. {
  67. return AjaxResult.success(bmConstructionEntryService.selectBmConstructionEntryById(id));
  68. }
  69. /**
  70. * 新增项目入规
  71. (跟项目一对一)
  72. */
  73. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:add')")
  74. @Log(title = "项目入规 (跟项目一对一)", businessType = BusinessType.INSERT)
  75. @PostMapping
  76. public AjaxResult add(@RequestBody BmConstructionEntry bmConstructionEntry)
  77. {
  78. return toAjax(bmConstructionEntryService.insertBmConstructionEntry(bmConstructionEntry));
  79. }
  80. /**
  81. * 修改项目入规
  82. (跟项目一对一)
  83. */
  84. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:edit')")
  85. @Log(title = "项目入规 (跟项目一对一)", businessType = BusinessType.UPDATE)
  86. @PutMapping
  87. public AjaxResult edit(@RequestBody BmConstructionEntry bmConstructionEntry)
  88. {
  89. return toAjax(bmConstructionEntryService.updateBmConstructionEntry(bmConstructionEntry));
  90. }
  91. /**
  92. * 删除项目入规
  93. (跟项目一对一)
  94. */
  95. @PreAuthorize("@ss.hasPermi('constructionEntry:entry:remove')")
  96. @Log(title = "项目入规 (跟项目一对一)", businessType = BusinessType.DELETE)
  97. @DeleteMapping("/{ids}")
  98. public AjaxResult remove(@PathVariable Long[] ids)
  99. {
  100. return toAjax(bmConstructionEntryService.deleteBmConstructionEntryByIds(ids));
  101. }
  102. }