1、实体导入,已存在表支持重复导入,重复导入将更新原来的表结构
2、加入表单验证配置
This commit is contained in:
@@ -6,10 +6,7 @@ import net.tccn.dbq.Field;
|
||||
import net.tccn.dbq.fbean.FilterType;
|
||||
import net.tccn.dbq.jdbc.api.DbAccount;
|
||||
import net.tccn.dbq.jdbc.api.DbKit;
|
||||
import net.tccn.meta.Filter;
|
||||
import net.tccn.meta.MetaLink;
|
||||
import net.tccn.meta.MetaService;
|
||||
import net.tccn.meta.MetaTable;
|
||||
import net.tccn.meta.*;
|
||||
import net.tccn.plat.DbPlat;
|
||||
import net.tccn.plat.SysPlat;
|
||||
import net.tccn.user.User;
|
||||
@@ -144,6 +141,10 @@ public final class MetaKit {
|
||||
}
|
||||
|
||||
// -----------------------------------
|
||||
public void cleanData() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 别名 查询 MetaTable
|
||||
@@ -201,7 +202,7 @@ public final class MetaKit {
|
||||
Kv<String, MetaTable> metaTables = getMetaTables(metaService, false);
|
||||
|
||||
List<Map<String, String>> shows = metaService.getShows();
|
||||
List<Map<String, String>> edits = metaService.getEdits();
|
||||
List<FromItem> edits = metaService.getEdits();
|
||||
List<Map<String, String>> details = metaService.getDetails();
|
||||
List<Filter> filters = metaService.getFilters();
|
||||
String comment = metaService.getComment();
|
||||
|
||||
18
src/main/java/net/tccn/meta/FromItem.java
Normal file
18
src/main/java/net/tccn/meta/FromItem.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package net.tccn.meta;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: liangxianyou
|
||||
*/
|
||||
@Data
|
||||
public class FromItem {
|
||||
private String col;
|
||||
private String label;
|
||||
private String inType;
|
||||
private String fmt;
|
||||
private List<String> cks;
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class MetaService extends Doc<MetaService> {
|
||||
private String sysPlatId; //平台id
|
||||
|
||||
private List<Map<String,String>> shows = new ArrayList<>();
|
||||
private List<Map<String,String>> edits = new ArrayList<>();
|
||||
private List<FromItem> edits = new ArrayList<>();
|
||||
private List<Map<String,String>> details = new ArrayList<>();
|
||||
private Map<String, String> dels = new HashMap<>();
|
||||
private List<Filter> filters = new ArrayList<>();//{name:"", label:"", checked:true, }
|
||||
|
||||
@@ -4,10 +4,7 @@ import net.tccn.base.JBean;
|
||||
import net.tccn.base.Kv;
|
||||
import net.tccn.base.MetaKit;
|
||||
import net.tccn.dbq.Field;
|
||||
import net.tccn.meta.Filter;
|
||||
import net.tccn.meta.MetaLink;
|
||||
import net.tccn.meta.MetaService;
|
||||
import net.tccn.meta.MetaTable;
|
||||
import net.tccn.meta.*;
|
||||
import net.tccn.plat.SysPlat;
|
||||
import org.redkale.net.http.RestMapping;
|
||||
import org.redkale.net.http.RestParam;
|
||||
@@ -173,7 +170,7 @@ public class MetadataService extends BaseService { //arango
|
||||
}
|
||||
|
||||
@RestMapping(name = "editsave", comment = "表单配置保存")
|
||||
public JBean editSave(String name, List<Map<String, String>> edits, @RestParam(name = "platToken") String token) {
|
||||
public JBean editSave(String name, List<FromItem> edits, @RestParam(name = "platToken") String token) {
|
||||
if (edits == null || edits.size() == 0) return null;
|
||||
|
||||
MetaService metaService = MetaKit.getMetaService(name, token);
|
||||
|
||||
@@ -102,6 +102,26 @@ public class _TableService extends BaseService {
|
||||
}).toArray(MetaTable[]::new);
|
||||
|
||||
MetaKit.save(metaTables);
|
||||
|
||||
// 已经有的表 更新
|
||||
MetaTable[] metaTables2 = tables.stream()
|
||||
.filter(t -> hv.contains(t.getName())) // 去除同名
|
||||
.map(t -> {
|
||||
MetaTable table = MetaKit.getMetaTable(t.getName(), token);
|
||||
|
||||
MetaTable metaTable = MetaTable.toAs(t);
|
||||
|
||||
table.setCatalog(catalog);
|
||||
table.setDbPlatId(dbPlatId);
|
||||
table.setAlias(table.getAlias());// 表别名
|
||||
table.setSysPlatId(platId(token));
|
||||
|
||||
table.setItems(metaTable.getItems());
|
||||
table.setComment(metaTable.getComment());
|
||||
return table;
|
||||
}).toArray(MetaTable[]::new);
|
||||
|
||||
MetaKit.save(metaTables2);
|
||||
}
|
||||
return JBean.OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user