TEntityCodeTableController.java 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.onemap.system.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import com.onemap.common.core.utils.poi.ExcelUtil;
  5. import com.onemap.common.core.web.controller.BaseController;
  6. import com.onemap.common.core.web.domain.AjaxResult;
  7. import com.onemap.common.core.web.page.TableDataInfo;
  8. import com.onemap.common.log.annotation.Log;
  9. import com.onemap.common.log.enums.BusinessType;
  10. import com.onemap.common.security.annotation.RequiresPermissions;
  11. import com.onemap.system.domain.TEntityCodeTable;
  12. import com.onemap.system.service.ITEntityCodeTableService;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.PostMapping;
  16. import org.springframework.web.bind.annotation.PutMapping;
  17. import org.springframework.web.bind.annotation.DeleteMapping;
  18. import org.springframework.web.bind.annotation.PathVariable;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RestController;
  22. /**
  23. * 实体编码表Controller
  24. *
  25. * @author zhx
  26. * @date 2024-12-27
  27. */
  28. @RestController
  29. @RequestMapping("/dimentity/code/table")
  30. public class TEntityCodeTableController extends BaseController {
  31. @Autowired
  32. private ITEntityCodeTableService tEntityCodeTableService;
  33. /**
  34. * 查询实体编码表列表
  35. */
  36. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:list')")
  37. @GetMapping("/list")
  38. public TableDataInfo list(TEntityCodeTable tEntityCodeTable) {
  39. startPage();
  40. List<TEntityCodeTable> list = tEntityCodeTableService.selectTEntityCodeTableList(tEntityCodeTable);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出实体编码表列表
  45. */
  46. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:export')")
  47. @Log(title = "实体编码表", businessType = BusinessType.EXPORT)
  48. @PostMapping("/export")
  49. public void export(HttpServletResponse response, TEntityCodeTable tEntityCodeTable) {
  50. List<TEntityCodeTable> list = tEntityCodeTableService.selectTEntityCodeTableList(tEntityCodeTable);
  51. ExcelUtil<TEntityCodeTable> util = new ExcelUtil<TEntityCodeTable>(TEntityCodeTable.class);
  52. util.exportExcel(response, list, "实体编码表数据");
  53. }
  54. /**
  55. * 获取实体编码表详细信息
  56. */
  57. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:query')")
  58. @GetMapping(value = "/{id}")
  59. public AjaxResult getInfo(@PathVariable("id") String id) {
  60. return success(tEntityCodeTableService.selectTEntityCodeTableById(id));
  61. }
  62. /**
  63. * 新增实体编码表
  64. */
  65. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:add')")
  66. @Log(title = "实体编码表", businessType = BusinessType.INSERT)
  67. @PostMapping
  68. public AjaxResult add(@RequestBody TEntityCodeTable tEntityCodeTable) {
  69. return toAjax(tEntityCodeTableService.insertTEntityCodeTable(tEntityCodeTable));
  70. }
  71. /**
  72. * 修改实体编码表
  73. */
  74. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:edit')")
  75. @Log(title = "实体编码表", businessType = BusinessType.UPDATE)
  76. @PutMapping
  77. public AjaxResult edit(@RequestBody TEntityCodeTable tEntityCodeTable) {
  78. return toAjax(tEntityCodeTableService.updateTEntityCodeTable(tEntityCodeTable));
  79. }
  80. /**
  81. * 删除实体编码表
  82. */
  83. @RequiresPermissions("@ss.hasPermi('dimentity:code:table:remove')")
  84. @Log(title = "实体编码表", businessType = BusinessType.DELETE)
  85. @DeleteMapping("/{ids}")
  86. public AjaxResult remove(@PathVariable String[] ids) {
  87. return toAjax(tEntityCodeTableService.deleteTEntityCodeTableByIds(ids));
  88. }
  89. }