@CacheConfig(cacheNames="tableCache") @Transactional(rollbackFor=java.lang.Exception.class) @Service public class CoreTablesServiceImpl extends BaseServiceImpl<CoreTables> implements CoreTablesService
| 限定符和类型 | 类和说明 |
|---|---|
class |
CoreTablesServiceImpl.ListComparator |
| 构造器和说明 |
|---|
CoreTablesServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
CoreTables |
addEntity(CoreTables entity)
新增实体并返回实体
|
boolean |
checkTableDataFilterCnd(java.lang.String rwid,
java.lang.String condition)
校验数据过滤条件
|
void |
DragTable(CoreTables coreTables)
表拖拽
|
java.io.File |
exportDb2ModelZip(java.lang.String outPutDir,
java.lang.String condition)
导出数据库的所有表成模型 zip文件 如果同时存在的物料表列与模型列会把模型的列信息带优先取出
|
java.io.File |
exportModelZip(java.util.List<CoreTables> tbs,
java.lang.String outPutDir)
导出模型文件
|
java.io.File |
exportModelZip(java.util.List<CoreTables> tbs,
java.lang.String outPutDir,
java.lang.String FileName)
导出模型文件
|
java.io.File |
exportModelZip(java.lang.String outPutDir)
根据模型表导出模型zip压缩文件
|
java.util.List<CoreTables> |
findListByTableNames(java.util.List<java.lang.String> namesList)
通过表名查询表模型
|
java.util.List<CoreTables> |
findListExt(java.util.Map<java.lang.String,java.lang.Object> params)
查询扩展,可以查询多个rwid
|
CoreTables |
fromFile(java.lang.String filePath)
从文件反序列化成表模型对象
|
java.util.Map<java.lang.String,java.net.URL> |
getCreatedTablesByModelFile(java.util.List<java.net.URL> urls)
根据模型文件获取已创建的表
|
CoreTables |
getEntity(java.lang.String id)
根据Id获取实体
|
java.util.List<java.util.LinkedHashMap<java.lang.String,java.lang.Object>> |
getTableData(java.lang.String tableName,
PageParams page)
获取指定表的数据
|
java.util.List<java.util.LinkedHashMap<java.lang.String,java.lang.Object>> |
getTableDataById(java.lang.String tableName,
java.lang.String rwid)
根据主键rwid得到指定表的数据
|
java.util.List<CoreTables> |
getTableModel()
获取表所有对象
|
java.util.List<CoreTables> |
getTableModel(java.lang.String[] tbIds)
获取表对象 根据给定的表rwid集合
|
java.util.List<CoreTables> |
getTableModelAndBigfieldFiles(java.util.List<CoreTables> tbs,
java.lang.String bigfieldFileDir)
根据指定的表id集合获取表模型,并将表模型中的大字段数据保存到bigfieldFileDir目录下
|
java.util.List<CoreTables> |
getTableModelFromDbStructure() |
void |
importModelFile(java.net.URL fileUrl)
导入模型文件
|
void |
importModelZip(java.lang.String zipFileName)
导入模型文件
|
RetVo |
initSystem()
初始化系统
|
RetVo |
initSystem(java.util.List<java.lang.String> modelNames)
初始化系统
|
java.lang.Boolean |
isExistsTableName(java.lang.String tbId,
java.lang.String tableName)
查询表名是否存在
|
java.util.List<CoreTables> |
isSyncTableModelToDB(java.util.List<CoreTables> tables)
判断是否表模型是否同步
|
java.lang.Boolean |
isSyncTableModelToDB(java.lang.String tbId)
判断表是否创建且表结构中的列是否都创建
|
int |
modify(CoreTables entity)
更新实体
|
void |
modifyModelType(CoreTables oldTable,
CoreTables table)
修改表模型类型
|
int |
modifySysSortValueNotNull()
更新系统排序字段值不为空
|
CoreTables |
modifyToDB(java.lang.String tbId)
更新数据库
|
int |
removeById(java.lang.String id)
删除实体
|
void |
resetDataSource()
读取配置文件 重新启动数据库链接 TO DO 这个函数没作用暂时保留
|
void |
saveJdbc(CoreJdbcVo jdbc)
保存jdbc设置
|
void |
scanModel()
* 扫描模型与数据结构的差异,并执行更新 1.数据库不存在表 创建 2.数据库存在表 1)检查字段差异 不存在字段 新增字段 存在字段 比较类型,长度
并尝试修改表结构 (各个数据库的修改限制规则不一,只要没报错误就说明修改成功) 2)记录差异 不存在记录 新增 存在记录 就更新记录
|
void |
setSysInitVersion(java.lang.String version) |
void |
syncTableModle()
校验数据库模型的与数据库结构完整性
|
add, confirm, findAll, findList, removeByIds, saveJdbc, startProcess, startProcessclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsaveJdbcadd, confirm, findAll, findList, removeByIds, startProcess, startProcesspublic static final java.lang.String INIT_FILENAME
public static final java.lang.String INIT_MAIN_FILE
public static final java.lang.String EXP_DBALLMODEL_FILENAME
public static final java.lang.String EXP_MODEL_EXI
public static final java.lang.String INIT_MODEL_MAIN_EXI
@Autowired CoreTablesMapper coreTablesMapper
@Autowired CoreTablesColumnService coreTablesColumnService
@Autowired CoreTablesIndexService coreTablesIndexService
@Autowired CoreTablesLinkService coreTablesLinkService
@Autowired CoreDictionaryMapper coreDictionaryMapper
@Autowired CoreTablesColumnMapper coreTablesColumnMapper
@Autowired CoreTablesIndexMapper coreTablesIndexMapper
@Autowired CoreTablesLinkMapper coreTablesLinkMapper
@Autowired CoreDbService coreDbService
@Autowired CoreSqlBuilderServiceImpl sqlBuilderService
@Autowired SqlExecutor sqlExecutor
static java.lang.String CORE_DEFAULT_COLUMNS
static java.lang.String CORE_DEFAULT_TREE_COLUMNS
public static java.lang.String INIT_SYS_VERSION_RWID
java.util.List<java.lang.String> baseModel
static final java.util.List<java.lang.String> SORT_LIST
static final java.lang.String MSG_FORMAT
static final java.lang.String PROCESS_FORMAT
@Cacheable(key="#id") public CoreTables getEntity(java.lang.String id) throws java.lang.Exception
BaseServicegetEntity 在接口中 BaseService<CoreTables>getEntity 在类中 BaseServiceImpl<CoreTables>id - 实体idjava.lang.Exception - 出错会抛出异常@CacheEvict(allEntries=true,
beforeInvocation=true)
public int modify(CoreTables entity)
throws java.lang.Exception
BaseServicemodify 在接口中 BaseService<CoreTables>modify 在类中 BaseServiceImpl<CoreTables>entity - 实体对象java.lang.Exception - 出错会抛出异常public void modifyModelType(CoreTables oldTable, CoreTables table) throws java.lang.Exception
CoreTablesServicemodifyModelType 在接口中 CoreTablesServiceoldTable - 旧表模型实体table - 新表模型实体java.lang.Exception - 出错会抛出异常public CoreTables addEntity(CoreTables entity) throws java.lang.Exception
BaseServiceaddEntity 在接口中 BaseService<CoreTables>addEntity 在类中 BaseServiceImpl<CoreTables>entity - 实体对象java.lang.Exception - 出错会抛出异常@CacheEvict(allEntries=true,
beforeInvocation=true)
public int removeById(java.lang.String id)
throws java.lang.Exception
BaseServiceremoveById 在接口中 BaseService<CoreTables>removeById 在类中 BaseServiceImpl<CoreTables>id - 实体idjava.lang.Exception - 出错会抛出异常@CacheEvict(allEntries=true,
beforeInvocation=true)
public CoreTables modifyToDB(java.lang.String tbId)
throws freemarker.template.TemplateNotFoundException,
freemarker.template.MalformedTemplateNameException,
freemarker.core.ParseException,
java.io.IOException,
freemarker.template.TemplateException,
java.sql.SQLException,
java.lang.Exception
CoreTablesServicemodifyToDB 在接口中 CoreTablesServicetbId - 表模型的idjava.lang.Exception - 出错会抛出异常freemarker.template.TemplateNotFoundExceptionfreemarker.template.MalformedTemplateNameExceptionfreemarker.core.ParseExceptionjava.io.IOExceptionfreemarker.template.TemplateExceptionjava.sql.SQLExceptionpublic void syncTableModle()
CoreTablesServicesyncTableModle 在接口中 CoreTablesServicepublic java.util.List<CoreTables> getTableModel() throws java.lang.Exception
CoreTablesServicegetTableModel 在接口中 CoreTablesServicejava.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> getTableModel(java.lang.String[] tbIds) throws java.lang.Exception
CoreTablesServicegetTableModel 在接口中 CoreTablesServicetbIds - 表rwid集合java.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> getTableModelAndBigfieldFiles(java.util.List<CoreTables> tbs, java.lang.String bigfieldFileDir) throws java.lang.Exception
CoreTablesServicegetTableModelAndBigfieldFiles 在接口中 CoreTablesServicetbs - 需要导出的表模型集合bigfieldFileDir - 保存大字段数据文件的路径 大字段数据文件的全路径:bigfieldFileDir + 表名_bigfield
+ 每行的rwid前两位 + rwid_列名.txtjava.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> getTableModelFromDbStructure() throws java.lang.Exception
java.lang.Exception - 出错会抛出异常public void importModelZip(java.lang.String zipFileName)
throws java.lang.Exception
CoreTablesServiceimportModelZip 在接口中 CoreTablesServicezipFileName - 输入文件路径java.lang.Exception - 出错会抛出异常public CoreTables fromFile(java.lang.String filePath) throws java.lang.Exception
CoreTablesServicefromFile 在接口中 CoreTablesServicefilePath - 文件路径java.lang.Exception - 出错会抛出异常public java.io.File exportModelZip(java.lang.String outPutDir)
throws java.lang.Exception
CoreTablesServiceexportModelZip 在接口中 CoreTablesServiceoutPutDir - 输出目录java.io.IOException - 出错抛出异常java.lang.Exception - 出错会抛出异常public java.io.File exportModelZip(java.util.List<CoreTables> tbs, java.lang.String outPutDir) throws java.lang.Exception
CoreTablesServiceexportModelZip 在接口中 CoreTablesServicetbs - 表模型listoutPutDir - 输出目录java.lang.Exception - 出错会抛出异常public java.io.File exportModelZip(java.util.List<CoreTables> tbs, java.lang.String outPutDir, java.lang.String FileName) throws java.lang.Exception
CoreTablesServiceexportModelZip 在接口中 CoreTablesServicetbs - 表模型listoutPutDir - 输出目录FileName - 文件名称java.lang.Exception - 出错会抛出异常public java.io.File exportDb2ModelZip(java.lang.String outPutDir,
java.lang.String condition)
throws java.lang.Exception
CoreTablesServiceexportDb2ModelZip 在接口中 CoreTablesServiceoutPutDir - 输出目录condition - 条件过滤 sql where 后面的条件java.lang.Exception - 出错会抛出异常java.io.IOException - 出错抛出异常public RetVo initSystem() throws java.lang.Exception
CoreTablesServiceinitSystem 在接口中 CoreTablesServicejava.lang.Exception - 出错会抛出异常public RetVo initSystem(java.util.List<java.lang.String> modelNames) throws java.lang.Exception
CoreTablesServiceinitSystem 在接口中 CoreTablesServicemodelNames - 指定的模型名列表 如果是null或者长度是零说明无过滤条件。全部模型都初始化java.lang.Exception - 出错会抛出异常public void importModelFile(java.net.URL fileUrl)
throws java.lang.Exception
importModelFile 在接口中 CoreTablesServicefileUrl - 文件路径java.lang.Exception - 出错会抛出异常@Transactional(propagation=REQUIRED)
public void resetDataSource()
throws java.sql.SQLException
CoreTablesServiceresetDataSource 在接口中 CoreTablesServicejava.sql.SQLException - 出错抛出数据库异常@Transactional(propagation=REQUIRED) public void saveJdbc(CoreJdbcVo jdbc) throws java.lang.Exception
CoreTablesServicesaveJdbc 在接口中 CoreTablesServicejdbc - CoreJdbcVojava.lang.Exception - 出错会抛出异常public void scanModel()
throws java.lang.Exception
CoreTablesServicescanModel 在接口中 CoreTablesServicejava.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> isSyncTableModelToDB(java.util.List<CoreTables> tables) throws java.lang.Exception
CoreTablesServiceisSyncTableModelToDB 在接口中 CoreTablesServicetables - 表模型listjava.lang.Exception - 出错会抛出异常public java.lang.Boolean isSyncTableModelToDB(java.lang.String tbId)
throws java.lang.Exception
CoreTablesServiceisSyncTableModelToDB 在接口中 CoreTablesServicetbId - 表模型idjava.lang.Exception - 出错会抛出异常public java.lang.Boolean isExistsTableName(java.lang.String tbId,
java.lang.String tableName)
throws java.lang.Exception
CoreTablesServiceisExistsTableName 在接口中 CoreTablesServicetbId - 不为空时,过滤该表tableName - 表模型表编号java.lang.Exception - 出错会抛出异常public int modifySysSortValueNotNull()
throws java.lang.Exception
CoreTablesServicemodifySysSortValueNotNull 在接口中 CoreTablesServicejava.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> findListExt(java.util.Map<java.lang.String,java.lang.Object> params) throws java.lang.Exception
CoreTablesServicefindListExt 在接口中 CoreTablesServiceparams - 参数java.lang.Exception - 出错会抛出异常public boolean checkTableDataFilterCnd(java.lang.String rwid,
java.lang.String condition)
throws java.lang.Exception
CoreTablesServicecheckTableDataFilterCnd 在接口中 CoreTablesServicerwid - 表模型RWIDcondition - where关键字之后的过滤条件java.lang.Exception - 出错会抛出异常 过滤条件不正确,则会抛出相应异常public void setSysInitVersion(java.lang.String version)
throws java.lang.Exception
setSysInitVersion 在接口中 CoreTablesServiceversion - 版本号java.lang.Exception - 出错会抛出异常public java.util.Map<java.lang.String,java.net.URL> getCreatedTablesByModelFile(java.util.List<java.net.URL> urls)
throws java.lang.Exception
CoreTablesServicegetCreatedTablesByModelFile 在接口中 CoreTablesServiceurls - 路径java.lang.Exception - 出错会抛出异常public java.util.List<CoreTables> findListByTableNames(java.util.List<java.lang.String> namesList) throws java.lang.Exception
CoreTablesServicefindListByTableNames 在接口中 CoreTablesServicenamesList - 表名listjava.lang.Exception - 出错会抛出异常public void DragTable(CoreTables coreTables) throws java.lang.Exception
CoreTablesServiceDragTable 在接口中 CoreTablesServicecoreTables - 表模型java.lang.Exception - 出错会抛出异常public java.util.List<java.util.LinkedHashMap<java.lang.String,java.lang.Object>> getTableDataById(java.lang.String tableName,
java.lang.String rwid)
CoreTablesServicegetTableDataById 在接口中 CoreTablesServicetableName - 表名rwid - 主键值public java.util.List<java.util.LinkedHashMap<java.lang.String,java.lang.Object>> getTableData(java.lang.String tableName,
PageParams page)
CoreTablesServicegetTableData 在接口中 CoreTablesServicetableName - 表名page - 分页的参数