.
This commit is contained in:
@@ -373,21 +373,11 @@ public class MetaKit {
|
||||
MetaService metaService = getMetaService(name, token);
|
||||
|
||||
Kv<String, MetaTable> tables = getMetaTables(metaService, true);
|
||||
List<String> exports = metaService.getExports();
|
||||
List<Map<String,String>> exports = metaService.getExports();
|
||||
|
||||
Kv kv = Kv.of();
|
||||
//从 meta-table 中得到字段label
|
||||
exports.forEach(x -> {
|
||||
try {
|
||||
String[] arr = x.split("[.]");
|
||||
MetaTable table = tables.get(arr[0]);
|
||||
|
||||
Optional<Field> any = table.getItems().stream().filter(y -> y.getName().equals(arr[1])).findAny();
|
||||
Field field = any.get();
|
||||
kv.put(x, field.getLabel());
|
||||
} catch (Exception e) {
|
||||
new IllegalArgumentException(String.format("字段信息处理异常:[%s]", x), e);
|
||||
}
|
||||
kv.put(x.get("col"), x.get("lable"));
|
||||
});
|
||||
return kv;
|
||||
}
|
||||
@@ -476,7 +466,7 @@ public class MetaKit {
|
||||
String alias = col.split("[.]")[0];
|
||||
return alias;
|
||||
}),
|
||||
metaService.getExports().stream().map(x -> x.split("[.]")[0]),
|
||||
metaService.getExports().stream().map(x -> x.get("col").split("[.]")[0]),
|
||||
metaService.getShows().stream().map(x -> x.get("col").split("[.]")[0])/*, todo: xxx
|
||||
metaService.getEdits().stream().map(x -> x.split("[.]")[0])*/
|
||||
);
|
||||
|
||||
@@ -23,12 +23,8 @@ public class MetaService extends Doc<MetaService> {
|
||||
private List<Map> edits = new ArrayList<>();
|
||||
private List<String> details = new ArrayList<>();
|
||||
private List<Map> filters = new ArrayList<>();
|
||||
private List<String> exports = new ArrayList<>();
|
||||
private List<Map<String,String>> exports = new ArrayList<>();
|
||||
|
||||
//待组装数据
|
||||
//private MetaTable metaTable;
|
||||
//private List<MetaLink> metaLinks;//[{alias:"b", table:"dept", link:[mk,lk]}, xxxx]
|
||||
//private Map<String, MetaTable> tables;
|
||||
//-------------------------------------------
|
||||
|
||||
public String getName() {
|
||||
@@ -95,35 +91,11 @@ public class MetaService extends Doc<MetaService> {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public List<String> getExports() {
|
||||
public List<Map<String, String>> getExports() {
|
||||
return exports;
|
||||
}
|
||||
|
||||
public void setExports(List<String> exports) {
|
||||
public void setExports(List<Map<String, String>> exports) {
|
||||
this.exports = exports;
|
||||
}
|
||||
|
||||
/*public MetaTable getMetaTable() {
|
||||
return metaTable;
|
||||
}
|
||||
|
||||
public void setMetaTable(MetaTable metaTable) {
|
||||
this.metaTable = metaTable;
|
||||
}*/
|
||||
|
||||
/*public List<MetaLink> getMetaLinks() {
|
||||
return metaLinks;
|
||||
}
|
||||
|
||||
public void setMetaLinks(List<MetaLink> metaLinks) {
|
||||
this.metaLinks = metaLinks;
|
||||
}*/
|
||||
|
||||
/*public Map<String, MetaTable> getTables() {
|
||||
return tables;
|
||||
}
|
||||
|
||||
public void setTables(Map<String, MetaTable> tables) {
|
||||
this.tables = tables;
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -160,16 +160,16 @@ public class MetadataService extends BaseService { //arango
|
||||
return JBean.OK;
|
||||
}
|
||||
|
||||
@RestMapping(name = "exportsort", comment = "导出字段排序保存")
|
||||
public List<String> exportSort(String serviceKey , List<String> items, @RestParam(name = "platToken") String token) {
|
||||
if (items == null || items.size() == 0) return null;
|
||||
@RestMapping(name = "exportsave", comment = "导出配置保存")
|
||||
public JBean exportSave(String name , List<Map<String,String>> exports, @RestParam(name = "platToken") String token) {
|
||||
if (exports == null || exports.size() == 0) return null;
|
||||
|
||||
MetaService metaService = MetaKit.getMetaService(serviceKey, token);
|
||||
metaService.setExports(items);
|
||||
MetaService metaService = MetaKit.getMetaService(name, token);
|
||||
metaService.setExports(exports);
|
||||
metaService.update();
|
||||
|
||||
MetaKit.reload(metaService);
|
||||
return items;
|
||||
return JBean.OK;
|
||||
}
|
||||
|
||||
@RestMapping(name = "importsort", comment = "导入字段保存")
|
||||
|
||||
Reference in New Issue
Block a user