package com.onemap.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.onemap.common.core.utils.poi.ExcelUtil; import com.onemap.common.core.web.controller.BaseController; import com.onemap.common.core.web.domain.AjaxResult; import com.onemap.common.core.web.page.TableDataInfo; import com.onemap.common.log.annotation.Log; import com.onemap.common.log.enums.BusinessType; import com.onemap.common.security.annotation.RequiresPermissions; import com.onemap.system.domain.TEntityCodeTable; import com.onemap.system.service.ITEntityCodeTableService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 实体编码表Controller * * @author zhx * @date 2024-12-27 */ @RestController @RequestMapping("/dimentity/code/table") public class TEntityCodeTableController extends BaseController { @Autowired private ITEntityCodeTableService tEntityCodeTableService; /** * 查询实体编码表列表 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:list')") @GetMapping("/list") public TableDataInfo list(TEntityCodeTable tEntityCodeTable) { startPage(); List list = tEntityCodeTableService.selectTEntityCodeTableList(tEntityCodeTable); return getDataTable(list); } /** * 导出实体编码表列表 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:export')") @Log(title = "实体编码表", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TEntityCodeTable tEntityCodeTable) { List list = tEntityCodeTableService.selectTEntityCodeTableList(tEntityCodeTable); ExcelUtil util = new ExcelUtil(TEntityCodeTable.class); util.exportExcel(response, list, "实体编码表数据"); } /** * 获取实体编码表详细信息 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(tEntityCodeTableService.selectTEntityCodeTableById(id)); } /** * 新增实体编码表 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:add')") @Log(title = "实体编码表", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TEntityCodeTable tEntityCodeTable) { return toAjax(tEntityCodeTableService.insertTEntityCodeTable(tEntityCodeTable)); } /** * 修改实体编码表 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:edit')") @Log(title = "实体编码表", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TEntityCodeTable tEntityCodeTable) { return toAjax(tEntityCodeTableService.updateTEntityCodeTable(tEntityCodeTable)); } /** * 删除实体编码表 */ @RequiresPermissions("@ss.hasPermi('dimentity:code:table:remove')") @Log(title = "实体编码表", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(tEntityCodeTableService.deleteTEntityCodeTableByIds(ids)); } }