优化:1、mtable、mlink、mservice、qtask 展示的排序最新展示到前面
2、其他修改
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="para" class="col-sm-2 required">数据平台</label>
|
<label for="para" class="col-sm-2 required">数据平台</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select v-model="row.dbPlatId" class="form-control">
|
<select v-model="row.dbid" class="form-control">
|
||||||
<option></option>
|
<option></option>
|
||||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -137,13 +137,13 @@
|
|||||||
{
|
{
|
||||||
name: "QTask", url: "/qtask", nodes: [
|
name: "QTask", url: "/qtask", nodes: [
|
||||||
{url:"/qtask/list.html", name:"QTask", icon:"icon-cube-alt"},
|
{url:"/qtask/list.html", name:"QTask", icon:"icon-cube-alt"},
|
||||||
{url:"/qtask/debug.html", name:"QTask-Debug", icon:"icon-bug"},
|
/*{url:"/qtask/debug.html", name:"QTask-Debug", icon:"icon-bug"},*/
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "平台管理", url: "/plat/db.html", nodes: [
|
name: "平台管理", url: "/plat/db.html", nodes: [
|
||||||
{url:"/plat/db.html", name:"数据中心", icon: "icon-database"},
|
{url:"/plat/db.html", name:"数据源", icon: "icon-database"},
|
||||||
{url:"/plat/index.html", name:"业务平台", icon:"icon-server"},
|
{url:"/plat/index.html", name:"应用平台", icon:"icon-server"},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{name: "关于", url: "/single", nodes: [
|
{name: "关于", url: "/single", nodes: [
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
{url:"/single/metaFlow.html", name:"MetaKit使用", icon:"icon-server"},
|
{url:"/single/metaFlow.html", name:"MetaKit使用", icon:"icon-server"},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
name: "其他服务", url: "/plat/db.html", nodes: [
|
name: "其他服务", url: "/plat/db.html", nodes: [
|
||||||
{url:"/oth/index.html", name:"业务平台管理", icon: "icon-database"},
|
{url:"/oth/index.html", name:"业务平台管理", icon: "icon-database"},
|
||||||
{url:"/oth/file.html", name:"文件服务", icon: "icon-database"},
|
{url:"/oth/file.html", name:"文件服务", icon: "icon-database"},
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
{url:"/weixin/templateMessage.html", name:"模板消息", icon:"icon-server"},
|
{url:"/weixin/templateMessage.html", name:"模板消息", icon:"icon-server"},
|
||||||
{url:"/weixin/timer.html", name:"Timer", icon:"icon-server"},
|
{url:"/weixin/timer.html", name:"Timer", icon:"icon-server"},
|
||||||
]
|
]
|
||||||
}
|
}*/
|
||||||
],
|
],
|
||||||
menus: {},
|
menus: {},
|
||||||
page: {},
|
page: {},
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-xs-3">
|
<div class="col-xs-3">
|
||||||
<button @click="createService()" class="btn btn-primary" type="button"> 新建业务</button>
|
<button @click="createService({})" class="btn btn-primary" type="button"> 新建业务</button>
|
||||||
<hr>
|
<hr>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -82,8 +82,8 @@
|
|||||||
<td>{{item.name}}</td>
|
<td>{{item.name}}</td>
|
||||||
<td>{{item.comment}}</td>
|
<td>{{item.comment}}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:">编辑</a>
|
<a @click="createService(item)" href="javascript:">编辑</a>
|
||||||
<a href="javascript:">删除</a>
|
<!--<a href="javascript:">删除</a>-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
<div class="base-info">字段信息</div>
|
<div class="base-info">字段信息</div>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
<td v-show="status==3 || status==4 || status==5 || status==6 || status=='detail' || status=='edit'"><input type="checkbox"></td>
|
||||||
<th v-show="status==1"></th>
|
<th v-show="status==1"></th>
|
||||||
<th>数据字段</th>
|
<th>数据字段</th>
|
||||||
<th>注释</th>
|
<th>注释</th>
|
||||||
@@ -1105,8 +1105,8 @@
|
|||||||
red.showMsg();
|
red.showMsg();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createService() {
|
createService(row) {
|
||||||
this.createRow = {}
|
this.createRow = row
|
||||||
if (this.tables.length == 0) {
|
if (this.tables.length == 0) {
|
||||||
tableLinkList().then(res => {
|
tableLinkList().then(res => {
|
||||||
this.tables = res
|
this.tables = res
|
||||||
@@ -1116,7 +1116,7 @@
|
|||||||
},
|
},
|
||||||
saveService() {
|
saveService() {
|
||||||
serviceSave({service: this.createRow}).then(res => {
|
serviceSave({service: this.createRow}).then(res => {
|
||||||
red.showOk("创建成功, 请对业务进行配置")
|
red.showOk(this.createRow['servid'] ? "操作成功" : "创建成功, 请对业务进行配置")
|
||||||
$('#createServiceDia').modal('hide')
|
$('#createServiceDia').modal('hide')
|
||||||
|
|
||||||
this.service = this.createRow.name
|
this.service = this.createRow.name
|
||||||
@@ -1133,7 +1133,7 @@
|
|||||||
},
|
},
|
||||||
dealTableName(item) {
|
dealTableName(item) {
|
||||||
let table = this.serviceDetail['tables'][item]
|
let table = this.serviceDetail['tables'][item]
|
||||||
return `[${table.alias}] ${table.name} (${table.comment})`
|
return `[${table.alias}] ${table.tablename} (${table.comment})`
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -185,7 +185,7 @@
|
|||||||
<label class="col-md-1 col-sm-1" style="padding-bottom: 10px;padding-top: 5px;">数据源选择</label>
|
<label class="col-md-1 col-sm-1" style="padding-bottom: 10px;padding-top: 5px;">数据源选择</label>
|
||||||
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
|
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
|
||||||
<select class="form-control" v-model="dbPlat">
|
<select class="form-control" v-model="dbPlat">
|
||||||
<option v-for="item in dbPlats" :value="item" v-text="item.name"></option>
|
<option v-for="item in dbPlats" :value="item" v-text="item.dbname"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
|
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
<!-- || tableData[item]['hv']==1 -->
|
<!-- || tableData[item]['hv']==1 -->
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
v-model="ckTable"
|
v-model="ckTable"
|
||||||
:value="tableData[item]['name']"
|
:value="tableData[item]['tablename']"
|
||||||
:disabled="item=='表说明' || item=='表名称'"
|
:disabled="item=='表说明' || item=='表名称'"
|
||||||
>
|
>
|
||||||
<a :class="[{hv: tableData[item]['hv']==1 }]" href="javascript:;" @click="tableName=item" data-target="#tab3Content1" data-toggle="tab" v-text="item"></a>
|
<a :class="[{hv: tableData[item]['hv']==1 }]" href="javascript:;" @click="tableName=item" data-target="#tab3Content1" data-toggle="tab" v-text="item"></a>
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
tableData: {},
|
tableData: {},
|
||||||
tableArr: [],
|
tableArr: [],
|
||||||
dbPlat: red.getData("dbPlat",{}),
|
dbPlat: red.getData("dbPlat",{}),
|
||||||
dbid: red.getData("dbPlatId",''),
|
dbid: red.getData("dbid",''),
|
||||||
catalog: '',
|
catalog: '',
|
||||||
tableName: '',
|
tableName: '',
|
||||||
ckTable: [],
|
ckTable: [],
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
dbPlat(v) {
|
dbPlat(v) {
|
||||||
this.dbPlatId = v['key']
|
this.dbid = v['dbid']
|
||||||
this.catalogs = v['catalogs']
|
this.catalogs = v['catalogs']
|
||||||
},
|
},
|
||||||
catalog() {
|
catalog() {
|
||||||
@@ -332,7 +332,7 @@
|
|||||||
|
|
||||||
//cache
|
//cache
|
||||||
red.setData("dbPlat", this.dbPlat)
|
red.setData("dbPlat", this.dbPlat)
|
||||||
red.setData("dbPlatId", this.dbPlatId)
|
red.setData("dbid", this.dbid)
|
||||||
red.setData("catalog", this.catalog)
|
red.setData("catalog", this.catalog)
|
||||||
},
|
},
|
||||||
tableName() {
|
tableName() {
|
||||||
@@ -391,8 +391,8 @@
|
|||||||
},
|
},
|
||||||
//------从mysql导入使用的相关方法-------
|
//------从mysql导入使用的相关方法-------
|
||||||
loadTables() { // 查询table列表
|
loadTables() { // 查询table列表
|
||||||
let [dbPlatId, catalog] = [this.dbPlatId, this.catalog]
|
let [dbid, catalog] = [this.dbid, this.catalog]
|
||||||
sheetMySql({dbPlatId, catalog}).then(res => { // 数据转换
|
sheetMySql({dbid, catalog}).then(res => { // 数据转换
|
||||||
this.tableData = res
|
this.tableData = res
|
||||||
let tableArr = []
|
let tableArr = []
|
||||||
let ckTable = []
|
let ckTable = []
|
||||||
@@ -413,7 +413,7 @@
|
|||||||
this.tableInfo = this.tableData[this.tableName]
|
this.tableInfo = this.tableData[this.tableName]
|
||||||
|
|
||||||
if (!this.tableInfo['load']) {
|
if (!this.tableInfo['load']) {
|
||||||
tableInfo({dbPlatId: this.dbPlatId, catalog: this.catalog, tableName: this.tableName}).then(res => {
|
tableInfo({dbid: this.dbid, catalog: this.catalog, tableName: this.tableName}).then(res => {
|
||||||
res['hv'] = this.tableData[this.tableName]['hv']
|
res['hv'] = this.tableData[this.tableName]['hv']
|
||||||
res['load'] = 1
|
res['load'] = 1
|
||||||
|
|
||||||
@@ -424,8 +424,8 @@
|
|||||||
},
|
},
|
||||||
saveTable() { // 保存数据
|
saveTable() { // 保存数据
|
||||||
if (this.cate == 'mysql') {
|
if (this.cate == 'mysql') {
|
||||||
let [dbPlatId, catalog, tableArr] = [this.dbPlatId, this.catalog, this.ckTable]
|
let [dbid, catalog, tableArr] = [this.dbid, this.catalog, this.ckTable]
|
||||||
saveTable({dbPlatId, catalog, tableArr}).then(res => {
|
saveTable({dbid, catalog, tableArr}).then(res => {
|
||||||
red.showOk()
|
red.showOk()
|
||||||
this.loadTables()
|
this.loadTables()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default" type="button">数据平台</button>
|
<button class="btn btn-default" type="button">数据平台</button>
|
||||||
</span>
|
</span>
|
||||||
<select class="form-control" v-model="filter.dbPlatId" style="width: 150px;">
|
<select class="form-control" v-model="filter.dbid" style="width: 150px;">
|
||||||
<option></option>
|
<option></option>
|
||||||
<option v-for="item in dbPlats" :value="item.key">{{item.name}}</option>
|
<option v-for="item in dbPlats" :value="item.key">{{item.name}}</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
},
|
},
|
||||||
dbPlats:[],
|
dbPlats:[],
|
||||||
list:{rows:[{name:"user", comment:"[用户表]", dataCount: 23}]},
|
list:{rows:[{name:"user", comment:"[用户表]", dataCount: 23}]},
|
||||||
filter: {dbPlatId: "", catalog: "", name: ""},
|
filter: {dbid: "", catalog: "", name: ""},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filter: {
|
filter: {
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
catalogs: function () {
|
catalogs: function () {
|
||||||
var dbPlats = this.dbPlats;
|
var dbPlats = this.dbPlats;
|
||||||
for (i in dbPlats) {
|
for (i in dbPlats) {
|
||||||
if (dbPlats[i].key == this.filter.dbPlatId) {
|
if (dbPlats[i].key == this.filter.dbid) {
|
||||||
return dbPlats[i]["catalogs"]
|
return dbPlats[i]["catalogs"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,13 +79,15 @@
|
|||||||
<table :class="['table','table-bordered']">
|
<table :class="['table','table-bordered']">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 100px">表名</th>
|
<th style="width: 100px">表名</th>
|
||||||
<td><span class="label label-outline" title="表别名alias">{{row.alias}}</span> {{row.name}}</td>
|
<td><span class="label label-outline" title="表别名alias">{{row.alias}}</span> {{row.tablename}}</td>
|
||||||
<th>数据平台</th>
|
<th>数据平台</th>
|
||||||
<td>{{dealDbPlatName(row)}}</td>
|
<td>{{dealDbPlatName(row)}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>描述</th>
|
<th>描述</th>
|
||||||
<td>{{row.comment}}</td>
|
<td>{{row.comment}}</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@@ -169,7 +171,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name" class="col-md-2">表名</label>
|
<label for="name" class="col-md-2">表名</label>
|
||||||
<div class="col-md-4 col-sm-8">
|
<div class="col-md-4 col-sm-8">
|
||||||
<input v-model="row.name" class="form-control" id="name" placeholder="请输入Table名称">
|
<input v-model="row.tablename" class="form-control" id="name" placeholder="请输入Table名称">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -184,7 +186,7 @@
|
|||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select v-model="row.dbid" class="form-control">
|
<select v-model="row.dbid" class="form-control">
|
||||||
<option></option>
|
<option></option>
|
||||||
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
|
<option v-for="item in dbPlats" :value="item.dbid" v-text="item.dbname"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
@@ -514,8 +516,8 @@
|
|||||||
dealDbPlatName(row) {
|
dealDbPlatName(row) {
|
||||||
let name = ""
|
let name = ""
|
||||||
this.dbPlats.forEach(function (item) {
|
this.dbPlats.forEach(function (item) {
|
||||||
if (item.key == row.dbPlatId) {
|
if (item.dbid === row.dbid) {
|
||||||
name = item.name
|
name = item.dbname
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
name += "." + row.catalog
|
name += "." + row.catalog
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<row class="plat">
|
<row class="plat">
|
||||||
|
<!-- head -->
|
||||||
|
<div class="col-md-12" style="margin-bottom: 5px">
|
||||||
|
<h3 v-text="cfg.title" class="pull-left"></h3>
|
||||||
|
<button @click="edit({})" class="btn btn-primary pull-right" type="button"> 新增数据平台 </button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||||
@@ -30,18 +35,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- head -->
|
|
||||||
<div class="col-md-11">
|
|
||||||
<h3 v-text="cfg.title"></h3>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-1">
|
|
||||||
<div class="input-group pull-right" style="padding-top: 10px">
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button @click="edit({})" class="btn btn-primary" type="button"> 新增数据平台 </button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<table class="table table-bordered table-hover">
|
<table class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -149,7 +142,7 @@
|
|||||||
el: ".plat",
|
el: ".plat",
|
||||||
data: {
|
data: {
|
||||||
cfg: {
|
cfg: {
|
||||||
title: "数据中心 管理",
|
title: "数据源 管理",
|
||||||
cols: [
|
cols: [
|
||||||
{col: "dbname", label: "数据平台名称"},
|
{col: "dbname", label: "数据平台名称"},
|
||||||
{col: "url", label: "数据平台连接地址"},
|
{col: "url", label: "数据平台连接地址"},
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
<row class="plat">
|
<row class="plat">
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<div class="col-md-11">
|
<div class="col-md-12" style="margin-bottom: 5px">
|
||||||
<h3 v-text="cfg.title"></h3>
|
<h3 v-text="cfg.title" class="pull-left"></h3>
|
||||||
</div>
|
<button @click="edit({})" class="btn btn-primary pull-right" type="button"> 新增业务平台 </button>
|
||||||
<div class="col-md-1">
|
|
||||||
<div class="input-group pull-right" style="padding-top: 10px">
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button @click="edit({})" class="btn btn-primary" type="button"> 新增业务平台 </button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -82,7 +75,7 @@
|
|||||||
el: ".plat",
|
el: ".plat",
|
||||||
data: {
|
data: {
|
||||||
cfg: {
|
cfg: {
|
||||||
title: "业务平台 管理",
|
title: "应用平台 管理",
|
||||||
cols: [
|
cols: [
|
||||||
{col: "platname", label: "业务名称"},
|
{col: "platname", label: "业务名称"},
|
||||||
{col: "plattoken", label: "Token"},
|
{col: "plattoken", label: "Token"},
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class Kv<K, V> extends LinkedHashMap<K, V> {
|
|||||||
return new Kv();
|
return new Kv();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Kv of(Object k, Object v) {
|
public static Kv<String, Object> of(Object k, Object v) {
|
||||||
return new Kv().set(k, v);
|
return new Kv().set(k, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ public class Kv<K, V> extends LinkedHashMap<K, V> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 将obj 属性映射到Kv 中
|
// 将obj 属性映射到Kv 中
|
||||||
public static Kv toKv(Object m, String... fields) {
|
public static Kv<String, Object> toKv(Object m, String... fields) {
|
||||||
Kv kv = Kv.of();
|
Kv kv = Kv.of();
|
||||||
if (m == null) {
|
if (m == null) {
|
||||||
return kv;
|
return kv;
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ public class ParseMysql implements Parser {
|
|||||||
|
|
||||||
Predicate<Kv<String, MTable>> sameDbFun = (kv) -> {
|
Predicate<Kv<String, MTable>> sameDbFun = (kv) -> {
|
||||||
int dbid = 0;
|
int dbid = 0;
|
||||||
for (MTable metaTable : kv.values()) {
|
for (MTable mTable : kv.values()) {
|
||||||
if (dbid == 0) {
|
if (dbid == 0) {
|
||||||
dbid = metaTable.getDbid();
|
dbid = mTable.getDbid();
|
||||||
} else if (dbid != metaTable.getDbid()) {
|
} else if (dbid != mTable.getDbid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
|||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "mtable", comment = "TABLE记录表")
|
@Table(name = "mtable", comment = "TABLE记录表")
|
||||||
@Cacheable(value = true, interval = 60 * 60 * 1000, direct = true)
|
//@Cacheable(value = true, interval = 60 * 60 * 1000, direct = true)
|
||||||
public class MTable extends BaseEntity {
|
public class MTable extends BaseEntity {
|
||||||
@Id
|
@Id
|
||||||
@Column(comment = "[表ID]")
|
@Column(comment = "[表ID]")
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.redkale.net.http.RestMapping;
|
|||||||
import org.redkale.net.http.RestParam;
|
import org.redkale.net.http.RestParam;
|
||||||
import org.redkale.net.http.RestService;
|
import org.redkale.net.http.RestService;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -28,16 +29,18 @@ public class MetadataService extends BaseService { //arango
|
|||||||
(isEmpty(name) || x.getTablename().contains(name)) &&
|
(isEmpty(name) || x.getTablename().contains(name)) &&
|
||||||
(isEmpty(token) || x.getPlatid().equals(platId(token))) &&
|
(isEmpty(token) || x.getPlatid().equals(platId(token))) &&
|
||||||
(isEmpty(x.getStatus()) || x.getStatus() != 9)
|
(isEmpty(x.getStatus()) || x.getStatus() != 9)
|
||||||
).map(x -> Kv.of("tablename", x.getTablename())
|
).map(x -> Kv.of("tablename", x.getTablename())
|
||||||
.set("comment", x.getComment())
|
.set("comment", x.getComment())
|
||||||
.set("catalog", x.getCatalog())
|
.set("catalog", x.getCatalog())
|
||||||
.set("alias", x.getAlias())
|
.set("alias", x.getAlias())
|
||||||
.set("dbid", x.getDbid())
|
.set("dbid", x.getDbid())
|
||||||
.set("linkCount", MetaKit.getMetaLinks().stream().filter(link -> { // 关联表数量
|
.set("tableid", x.getTableid())
|
||||||
String[] tables = link.getTables();
|
.set("linkCount", MetaKit.getMetaLinks().stream().filter(link -> { // 关联表数量
|
||||||
return x.getAlias().equals(tables[0]) || x.getAlias().equals(tables[1]);
|
String[] tables = link.getTables();
|
||||||
}).count())
|
return x.getAlias().equals(tables[0]) || x.getAlias().equals(tables[1]);
|
||||||
).collect(Collectors.toList());
|
}).count())
|
||||||
|
).sorted(Comparator.comparing(x -> -x.getInt("tableid")))
|
||||||
|
.collect(Collectors.toList());
|
||||||
return jBean.setBody(list);
|
return jBean.setBody(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,6 +51,7 @@ public class MetadataService extends BaseService { //arango
|
|||||||
|
|
||||||
List<MService> list = MetaKit.getMetaServices().stream()
|
List<MService> list = MetaKit.getMetaServices().stream()
|
||||||
.filter(x -> platId(token).equals(x.getPlatid()))
|
.filter(x -> platId(token).equals(x.getPlatid()))
|
||||||
|
.sorted(Comparator.comparing(MService::getServid).reversed())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
jBean.setBody(list);
|
jBean.setBody(list);
|
||||||
|
|
||||||
@@ -234,6 +238,7 @@ public class MetadataService extends BaseService { //arango
|
|||||||
Kv kv = Kv.of("tablename", x.getTablename())
|
Kv kv = Kv.of("tablename", x.getTablename())
|
||||||
.set("comment", x.getComment())
|
.set("comment", x.getComment())
|
||||||
.set("alias", x.getAlias())
|
.set("alias", x.getAlias())
|
||||||
|
.set("tableid", x.getTableid())
|
||||||
.set("linkCount", 0);
|
.set("linkCount", 0);
|
||||||
|
|
||||||
//关联表数量
|
//关联表数量
|
||||||
@@ -244,7 +249,8 @@ public class MetadataService extends BaseService { //arango
|
|||||||
kv.set("linkCount", count);
|
kv.set("linkCount", count);
|
||||||
|
|
||||||
return kv;
|
return kv;
|
||||||
}).collect(Collectors.toList());
|
}).sorted(Comparator.comparingInt(x -> -x.getInt("tableid")))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
return jBean.setBody(list);
|
return jBean.setBody(list);
|
||||||
}
|
}
|
||||||
@@ -263,6 +269,7 @@ public class MetadataService extends BaseService { //arango
|
|||||||
.set("comment", linkTable.getComment())
|
.set("comment", linkTable.getComment())
|
||||||
.set("linkSize", x.getLinks().size())
|
.set("linkSize", x.getLinks().size())
|
||||||
.set("links", x.getLinks());
|
.set("links", x.getLinks());
|
||||||
|
|
||||||
return kv;
|
return kv;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user