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