后台资产展示代码

master
冷调 2024-08-27 15:12:33 +08:00
parent 772ad74d3c
commit 1230764550
2 changed files with 17 additions and 1 deletions

View File

@ -36,7 +36,6 @@ public class TableInfoResp {
/** 是否核心 'Y'是 'N'不是 */ /** 是否核心 'Y'是 'N'不是 */
private String isCenter; private String isCenter;
/** /**
* *
*/ */

View File

@ -66,6 +66,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:list") @RequiresPermissions("data:data:list")
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "查询结构列表", description = "查询结构列表")
public Result<TableDataInfo<TableData>> list(TableData tableData) { public Result<TableDataInfo<TableData>> list(TableData tableData) {
startPage(); startPage();
List<TableData> list = tableDataService.selectTableDataList(tableData); List<TableData> list = tableDataService.selectTableDataList(tableData);
@ -77,6 +78,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:export") @RequiresPermissions("data:data:export")
@PostMapping("/export") @PostMapping("/export")
@Operation(summary = "导出结构列表", description = "导出结构列表")
public void export(HttpServletResponse response, TableData tableData) { public void export(HttpServletResponse response, TableData tableData) {
List<TableData> list = tableDataService.selectTableDataList(tableData); List<TableData> list = tableDataService.selectTableDataList(tableData);
ExcelUtil<TableData> util = new ExcelUtil<TableData>(TableData.class); ExcelUtil<TableData> util = new ExcelUtil<TableData>(TableData.class);
@ -88,6 +90,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:query") @RequiresPermissions("data:data:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@Operation(summary = "获取结构详细信息", description = "获取结构详细信息")
public Result<List<TableData>> getInfo(@PathVariable("id") Long id) { public Result<List<TableData>> getInfo(@PathVariable("id") Long id) {
return success(tableDataService.selectTableDataById(id)); return success(tableDataService.selectTableDataById(id));
} }
@ -97,6 +100,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:add") @RequiresPermissions("data:data:add")
@PostMapping @PostMapping
@Operation(summary = "新增结构", description = "新增结构")
public Result<Integer> add( public Result<Integer> add(
@Validated @RequestBody TableData tableData) { @Validated @RequestBody TableData tableData) {
if (tableDataService.checkIdUnique(tableData)) { if (tableDataService.checkIdUnique(tableData)) {
@ -111,6 +115,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:edit") @RequiresPermissions("data:data:edit")
@PutMapping @PutMapping
@Operation(summary = "修改结构", description = "修改结构")
public Result<Integer> edit( public Result<Integer> edit(
@Validated @RequestBody TableData tableData) { @Validated @RequestBody TableData tableData) {
if (!tableDataService.checkIdUnique(tableData)) { if (!tableDataService.checkIdUnique(tableData)) {
@ -125,6 +130,7 @@ public class TableDataController extends BaseController {
*/ */
@RequiresPermissions("data:data:remove") @RequiresPermissions("data:data:remove")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@Operation(summary = "删除结构", description = "删除结构")
public Result<Integer> remove(@PathVariable("ids") Long[] ids) { public Result<Integer> remove(@PathVariable("ids") Long[] ids) {
tableDataService.removeBatchByIds(Arrays.asList(ids)); tableDataService.removeBatchByIds(Arrays.asList(ids));
return success(); return success();
@ -137,11 +143,17 @@ public class TableDataController extends BaseController {
* @return Result * @return Result
*/ */
@PutMapping("/updIsDict") @PutMapping("/updIsDict")
@Operation(summary = "修改字段类型是否为字典类型", description = "修改字段类型是否为字典类型")
public Result updIsDict(@RequestBody TableData tableData) { public Result updIsDict(@RequestBody TableData tableData) {
return toAjax(tableDataService.updateById(tableData)); return toAjax(tableDataService.updateById(tableData));
} }
/**
*
* @return tableInfoTreeReps
*/
@GetMapping("/findTableInfo") @GetMapping("/findTableInfo")
@Operation(summary = "查询表结构树", description = "查询表结构树")
public Result<List<TableInfoTreeRep>> findTableInfo() { public Result<List<TableInfoTreeRep>> findTableInfo() {
List<Children> childrenList =childrenService.findSourceList(); List<Children> childrenList =childrenService.findSourceList();
ArrayList<TableInfoTreeRep> tableInfoTreeReps = new ArrayList<>(); ArrayList<TableInfoTreeRep> tableInfoTreeReps = new ArrayList<>();
@ -159,7 +171,12 @@ public class TableDataController extends BaseController {
return success(tableInfoTreeReps); return success(tableInfoTreeReps);
} }
/**
*
* @return
*/
@GetMapping("/findTableInfoList") @GetMapping("/findTableInfoList")
@Operation(summary = "根据表名查询表结构", description = "根据表名查询表结构")
public Result findByTableName(){ public Result findByTableName(){
List<Children> childrenList = childrenService.list(); List<Children> childrenList = childrenService.list();
List<TableInfoResp> list = childrenList.stream().filter(children -> children.getAssetId() == 0).map(children -> { List<TableInfoResp> list = childrenList.stream().filter(children -> children.getAssetId() == 0).map(children -> {