Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
f5f07221
提交
f5f07221
编写于
3月 09, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
etl
上级
f79dff9a
变更
9
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
210 行增加
和
61 行删除
+210
-61
RuleEngineExService.java
.../ibizlab/core/extensions/service/RuleEngineExService.java
+0
-3
DataObj.java
.../java/cn/ibizlab/core/lite/extensions/domain/DataObj.java
+2
-5
CommonEntityService.java
...lab/core/lite/extensions/service/CommonEntityService.java
+10
-7
DbEntityService.java
...ibizlab/core/lite/extensions/service/DbEntityService.java
+88
-17
LiteDataService.java
...ibizlab/core/lite/extensions/service/LiteDataService.java
+12
-12
MongoEntityService.java
...zlab/core/lite/extensions/service/MongoEntityService.java
+13
-9
20200624042755_changelog.xml
...esources/liquibase/changelog/20200624042755_changelog.xml
+42
-0
20210309115218_changelog.xml
...esources/liquibase/changelog/20210309115218_changelog.xml
+36
-0
DstCoreResource.java
.../java/cn/ibizlab/api/rest/extensions/DstCoreResource.java
+7
-8
未找到文件。
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/RuleEngineExService.java
浏览文件 @
f5f07221
...
...
@@ -7,7 +7,6 @@ import cn.ibizlab.core.extensions.util.MQConsumeMsgListenerProcessor;
import
cn.ibizlab.core.lite.extensions.domain.EntityObj
;
import
cn.ibizlab.core.lite.extensions.domain.Setting
;
import
cn.ibizlab.core.lite.extensions.model.DataModel
;
import
cn.ibizlab.core.lite.extensions.service.DbEntityService
;
import
cn.ibizlab.core.lite.extensions.service.LiteDataCallback
;
import
cn.ibizlab.core.lite.extensions.service.LiteDataService
;
import
cn.ibizlab.core.lite.extensions.service.LiteModelService
;
...
...
@@ -50,8 +49,6 @@ public class RuleEngineExService extends RuleEngineServiceImpl {
public
static
final
String
Setting_ResultDataSource
=
"resultDataSource"
;
public
static
final
String
Setting_ResultTableName
=
"resultTableName"
;
@Autowired
private
DbEntityService
dbEntityService
;
@Autowired
private
IRuleItemService
ruleItemService
;
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/domain/DataObj.java
浏览文件 @
f5f07221
...
...
@@ -10,13 +10,10 @@ import org.springframework.util.ObjectUtils;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.TimeZone
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
public
class
DataObj
<
K
,
V
>
extends
Concurrent
HashMap
<
K
,
V
>
{
public
class
DataObj
<
K
,
V
>
extends
HashMap
<
K
,
V
>
{
public
String
getRowKey
()
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/service/CommonEntityService.java
浏览文件 @
f5f07221
...
...
@@ -10,17 +10,20 @@ import java.util.List;
public
interface
CommonEntityService
{
List
<
EntityObj
>
selectBase
(
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
selectCore
(
EntityModel
entityModel
,
QueryFilter
filter
);
Integer
selectCount
(
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
selectBase
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
selectCore
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
);
Integer
selectCount
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
search
(
String
dataSet
,
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
search
(
String
d
sName
,
String
d
ataSet
,
EntityModel
entityModel
,
QueryFilter
filter
);
List
<
EntityObj
>
search
(
String
dsName
,
String
sql
,
QueryFilter
filter
);
boolean
saveBatch
(
EntityModel
entityModel
,
List
<
EntityObj
>
list
);
boolean
save
(
EntityModel
entityModel
,
EntityObj
entityObj
);
EntityObj
get
(
EntityModel
entityModel
,
EntityObj
entityObj
);
void
cursorRead
(
String
dsName
,
EntityModel
entityModel
,
String
sql
,
QueryFilter
filter
,
LiteDataCallback
callback
);
boolean
saveBatch
(
String
dsName
,
EntityModel
entityModel
,
List
<
EntityObj
>
list
);
boolean
save
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
);
EntityObj
get
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
);
void
processList
(
DataModel
dataModel
,
Timestamp
lastModify
,
LiteDataCallback
callback
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/service/DbEntityService.java
浏览文件 @
f5f07221
...
...
@@ -40,19 +40,20 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public
List
<
EntityObj
>
selectBase
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
search
(
"BASE"
,
entityModel
,
filter
);
public
List
<
EntityObj
>
selectBase
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
search
(
dsName
,
"BASE"
,
entityModel
,
filter
);
}
@Override
public
List
<
EntityObj
>
selectCore
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
search
(
"CORE"
,
entityModel
,
filter
);
public
List
<
EntityObj
>
selectCore
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
search
(
dsName
,
"CORE"
,
entityModel
,
filter
);
}
@Override
public
Integer
selectCount
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
Integer
selectCount
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
String
sql
=
entityModel
.
getSqlSegment
(
"COUNT"
);
String
dsName
=
entityModel
.
getDsName
();
if
(
StringUtils
.
isEmpty
(
dsName
))
dsName
=
entityModel
.
getDsName
();
try
{
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
...
...
@@ -74,13 +75,13 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
}
@Override
public
List
<
EntityObj
>
search
(
String
dataSet
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
List
<
EntityObj
>
search
(
String
d
sName
,
String
d
ataSet
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
String
sql
=
entityModel
.
getSqlSegment
(
dataSet
);
if
(
StringUtils
.
isEmpty
(
sql
))
return
new
ArrayList
<>();
else
return
search
(
entityModel
.
getDsName
()
,
sql
,
filter
);
return
search
(
dsName
,
sql
,
filter
);
}
@Override
...
...
@@ -147,10 +148,76 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
}
@Override
public
boolean
saveBatch
(
EntityModel
entityModel
,
List
<
EntityObj
>
list
)
{
public
void
cursorRead
(
String
dsName
,
EntityModel
entityModel
,
String
sql
,
QueryFilter
filter
,
LiteDataCallback
callback
)
{
if
(
StringUtils
.
isEmpty
(
dsName
))
dsName
=
entityModel
.
getDsName
();
if
(
StringUtils
.
isEmpty
(
sql
))
sql
=
entityModel
.
getSqlSegment
(
"BASE"
);
Integer
total
=
this
.
selectCount
(
dsName
,
entityModel
,
filter
);
callback
.
total
(
total
);
//没有业务数据时,不进行后续操作
if
(
total
==
0
){
return
;
}
MyBatisCursorItemReader
myMyBatisCursorItemReader
=
new
MyBatisCursorItemReader
();
try
{
myMyBatisCursorItemReader
.
setSqlSessionFactory
(
sqlSessionFactory
);
myMyBatisCursorItemReader
.
setQueryId
(
"cn.ibizlab.core.extensions.mapper.DbEntityMapper.search"
);
DbEntitySearchContext
context
=
new
DbEntitySearchContext
();
context
.
setFilter
(
filter
);
QueryWrapper
qw
=
context
.
getSelectCond
();
if
(!
StringUtils
.
isEmpty
(
filter
.
getCustSqlSegment
()))
qw
.
apply
(
filter
.
getCustSqlSegment
());
Map
<
String
,
Object
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"sql"
,
sql
);
paramsMap
.
put
(
"ew"
,
qw
);
myMyBatisCursorItemReader
.
setParameterValues
(
paramsMap
);
// 设置sql传入参数
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
myMyBatisCursorItemReader
.
open
(
new
ExecutionContext
());
// 开启游标
//DynamicDataSourceContextHolder.poll();
List
<
EntityObj
>
datas
=
new
ArrayList
<>();
EntityObj
rowdata
;
while
((
rowdata
=
(
EntityObj
)
myMyBatisCursorItemReader
.
read
())
!=
null
)
{
datas
.
add
(
rowdata
);
if
(
datas
.
size
()
>=
processSize
){
boolean
rt
=
callback
.
processData
(
datas
);
datas
.
clear
();
if
(!
rt
)
break
;
}
}
if
(
datas
.
size
()
>
0
){
callback
.
processData
(
datas
);
datas
.
clear
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
try
{
dstDataSourceService
.
initDataSource
(
entityModel
.
getDsName
());
DynamicDataSourceContextHolder
.
push
(
entityModel
.
getDsName
());
myMyBatisCursorItemReader
.
close
();
// 关闭游标
}
catch
(
Exception
ex
)
{
//log.error(ex.getMessage());
}
DynamicDataSourceContextHolder
.
poll
();
}
}
@Override
public
boolean
saveBatch
(
String
dsName
,
EntityModel
entityModel
,
List
<
EntityObj
>
list
)
{
try
{
if
(
StringUtils
.
isEmpty
(
dsName
))
dsName
=
entityModel
.
getDsName
();
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
list
.
forEach
(
entityObj
->
{
entityObj
.
keySet
().
forEach
(
key
->
{
...
...
@@ -170,10 +237,12 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
}
@Override
public
boolean
save
(
EntityModel
entityModel
,
EntityObj
entityObj
)
{
public
boolean
save
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
)
{
try
{
dstDataSourceService
.
initDataSource
(
entityModel
.
getDsName
());
DynamicDataSourceContextHolder
.
push
(
entityModel
.
getDsName
());
if
(
StringUtils
.
isEmpty
(
dsName
))
dsName
=
entityModel
.
getDsName
();
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
entityObj
.
keySet
().
forEach
(
key
->
{
if
(!
key
.
toUpperCase
().
equals
(
key
))
entityObj
.
put
(
key
.
toUpperCase
(),
entityObj
.
get
(
key
));
...
...
@@ -190,7 +259,9 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public
EntityObj
get
(
EntityModel
entityModel
,
EntityObj
entityObj
)
{
public
EntityObj
get
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
)
{
if
(
StringUtils
.
isEmpty
(
dsName
))
dsName
=
entityModel
.
getDsName
();
QueryFilter
filter
=
QueryFilter
.
createQuery
();
entityModel
.
getKeyFields
().
forEach
(
item
->{
Object
val
=
entityObj
.
get
(
item
.
getColumnName
());
...
...
@@ -199,7 +270,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
filter
.
eq
(
item
.
getColumnName
().
toUpperCase
(),
val
);
}
});
List
<
EntityObj
>
list
=
this
.
selectBase
(
entityModel
,
filter
);
List
<
EntityObj
>
list
=
this
.
selectBase
(
dsName
,
entityModel
,
filter
);
if
(
list
.
size
()==
1
)
entityObj
.
putAll
(
list
.
get
(
0
));
return
entityObj
;
...
...
@@ -221,7 +292,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
//记录处理的总业务数据量
String
sql
=
entityModel
.
getSqlSegment
(
"CORE"
);
Integer
total
=
this
.
selectCount
(
entityModel
,
filter
);
Integer
total
=
this
.
selectCount
(
entityModel
.
getDsName
(),
entityModel
,
filter
);
callback
.
total
(
total
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/service/LiteDataService.java
浏览文件 @
f5f07221
...
...
@@ -56,31 +56,31 @@ public class LiteDataService {
}
public
boolean
saveBatch
(
String
systemId
,
String
entityName
,
List
<
EntityObj
>
list
)
{
public
boolean
saveBatch
(
String
systemId
,
String
entityName
,
String
dsName
,
List
<
EntityObj
>
list
)
{
EntityModel
entityModel
=
liteModelService
.
getEntityModel
(
systemId
,
entityName
);
splitList
(
list
,
500
).
forEach
(
objs
->{
getEntityService
(
entityModel
.
getDsName
()).
saveBatch
(
entityModel
,
objs
);
getEntityService
(
entityModel
.
getDsName
()).
saveBatch
(
dsName
,
entityModel
,
objs
);
});
return
true
;
}
public
boolean
save
(
String
systemId
,
String
entityName
,
EntityObj
entityObj
)
{
public
boolean
save
(
String
systemId
,
String
entityName
,
String
dsName
,
EntityObj
entityObj
)
{
EntityModel
entityModel
=
liteModelService
.
getEntityModel
(
systemId
,
entityName
);
return
getEntityService
(
entityModel
.
getDsName
()).
save
(
entityModel
,
entityObj
);
return
getEntityService
(
entityModel
.
getDsName
()).
save
(
dsName
,
entityModel
,
entityObj
);
}
public
EntityObj
get
(
String
systemId
,
String
entityName
,
EntityObj
entityObj
)
{
public
EntityObj
get
(
String
systemId
,
String
entityName
,
String
dsName
,
EntityObj
entityObj
)
{
EntityModel
entityModel
=
liteModelService
.
getEntityModel
(
systemId
,
entityName
);
return
getEntityService
(
entityModel
.
getDsName
()).
get
(
entityModel
,
entityObj
);
return
getEntityService
(
entityModel
.
getDsName
()).
get
(
dsName
,
entityModel
,
entityObj
);
}
public
List
<
EntityObj
>
search
(
String
systemId
,
String
entityName
,
QueryFilter
filter
)
{
return
search
(
systemId
,
entityName
,
"BASE"
,
filter
);
public
List
<
EntityObj
>
search
(
String
systemId
,
String
entityName
,
String
dsName
,
QueryFilter
filter
)
{
return
search
(
systemId
,
entityName
,
"BASE"
,
dsName
,
filter
);
}
public
List
<
EntityObj
>
search
(
String
systemId
,
String
entityName
,
String
dataset
,
QueryFilter
filter
)
{
public
List
<
EntityObj
>
search
(
String
systemId
,
String
entityName
,
String
dataset
,
String
dsName
,
QueryFilter
filter
)
{
EntityModel
entityModel
=
liteModelService
.
getEntityModel
(
systemId
,
entityName
);
return
getEntityService
(
entityModel
.
getDsName
()).
search
(
dataset
,
entityModel
,
filter
);
return
getEntityService
(
entityModel
.
getDsName
()).
search
(
d
sName
,
d
ataset
,
entityModel
,
filter
);
}
...
...
@@ -126,7 +126,7 @@ public class LiteDataService {
List
<
ModelObj
>
rt
=
new
ArrayList
<>();
List
<
EntityObj
>
factEntityList
=
new
ArrayList
<>();
if
(
fillPropertys
==
null
||
fillPropertys
.
size
()
==
0
||
fillPropertys
.
contains
(
dataModel
.
getFactPorperty
().
getPropertyName
()))
splitList
(
kEntityObjs
,
1000
).
forEach
(
list
->
factEntityList
.
addAll
(
getEntityService
(
entityModel
.
getDsName
()).
selectBase
(
entityModel
,
QueryFilter
.
createQuery
().
cust
(
dataModel
.
lookup
(
list
)))));
splitList
(
kEntityObjs
,
1000
).
forEach
(
list
->
factEntityList
.
addAll
(
getEntityService
(
entityModel
.
getDsName
()).
selectBase
(
entityModel
.
getDsName
(),
entityModel
,
QueryFilter
.
createQuery
().
cust
(
dataModel
.
lookup
(
list
)))));
factEntityList
.
forEach
(
entityObj
->
rt
.
add
(
new
ModelObj
().
setDataModel
(
dataModel
).
setFactEntity
(
entityObj
.
setProperty
(
dataModel
.
getFactPorperty
()))));
fillEntityObj
(
dataModel
,
fillPropertys
,
rt
);
...
...
@@ -144,7 +144,7 @@ public class LiteDataService {
EntityModel
entityModel
=
property
.
getEntityModel
();
List
<
EntityObj
>
entityObjs
=
new
ArrayList
<>();
if
(
fillPropertys
==
null
||
fillPropertys
.
size
()
==
0
||
fillPropertys
.
contains
(
property
.
getPropertyName
()))
splitList
(
modelObjs
,
1000
).
forEach
(
list
->
entityObjs
.
addAll
(
getEntityService
(
entityModel
.
getDsName
()).
selectBase
(
entityModel
,
QueryFilter
.
createQuery
().
cust
(
property
.
lookup
(
list
)))));
splitList
(
modelObjs
,
1000
).
forEach
(
list
->
entityObjs
.
addAll
(
getEntityService
(
entityModel
.
getDsName
()).
selectBase
(
entityModel
.
getDsName
(),
entityModel
,
QueryFilter
.
createQuery
().
cust
(
property
.
lookup
(
list
)))));
entityObjs
.
forEach
(
entityObj
->
{
entityObj
.
setProperty
(
property
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/service/MongoEntityService.java
浏览文件 @
f5f07221
...
...
@@ -13,24 +13,24 @@ import java.util.Set;
@Service
public
class
MongoEntityService
implements
CommonEntityService
{
@Override
public
List
<
EntityObj
>
selectBase
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
List
<
EntityObj
>
selectBase
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
null
;
}
@Override
public
List
<
EntityObj
>
selectCore
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
List
<
EntityObj
>
selectCore
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
null
;
}
@Override
public
Integer
selectCount
(
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
Integer
selectCount
(
String
dsName
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
null
;
}
@Override
public
List
<
EntityObj
>
search
(
String
dataSet
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
public
List
<
EntityObj
>
search
(
String
d
sName
,
String
d
ataSet
,
EntityModel
entityModel
,
QueryFilter
filter
)
{
return
null
;
}
...
...
@@ -40,21 +40,25 @@ public class MongoEntityService implements CommonEntityService{
}
@Override
public
boolean
saveBatch
(
EntityModel
entityModel
,
List
<
EntityObj
>
list
)
{
public
void
cursorRead
(
String
dsName
,
EntityModel
entityModel
,
String
sql
,
QueryFilter
filter
,
LiteDataCallback
callback
)
{
}
@Override
public
boolean
saveBatch
(
String
dsName
,
EntityModel
entityModel
,
List
<
EntityObj
>
list
)
{
return
false
;
}
@Override
public
boolean
save
(
EntityModel
entityModel
,
EntityObj
entityObj
)
{
public
boolean
save
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
)
{
return
false
;
}
@Override
public
EntityObj
get
(
EntityModel
entityModel
,
EntityObj
entityObj
)
{
public
EntityObj
get
(
String
dsName
,
EntityModel
entityModel
,
EntityObj
entityObj
)
{
return
null
;
}
@Override
public
void
processList
(
DataModel
dataModel
,
Timestamp
lastModify
,
LiteDataCallback
callback
)
{
...
...
ibzdst-core/src/main/resources/liquibase/changelog/20200624042755_changelog.xml
0 → 100644
浏览文件 @
f5f07221
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro=
"http://www.liquibase.org/xml/ns/pro"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"
>
<changeSet
author=
"mac (generated)"
id=
"1592972881575-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"IBZDICTCATALOG"
/>
</not>
</preConditions>
<createTable
tableName=
"IBZDICTCATALOG"
>
<column
name=
"CID"
type=
"VARCHAR(100)"
>
<constraints
nullable=
"false"
primaryKey=
"true"
primaryKeyName=
"PK_DICT_CATALOG_CID"
/>
</column>
<column
name=
"CCODE"
type=
"VARCHAR(100)"
/>
<column
name=
"CNAME"
type=
"VARCHAR(100)"
/>
<column
name=
"CGROUP"
type=
"VARCHAR(100)"
/>
<column
name=
"MEMO"
type=
"VARCHAR(255)"
/>
<column
name=
"ENABLE"
type=
"INT"
/>
<column
name=
"UPDATEDATE"
type=
"TIMESTAMP"
/>
<column
name=
"CREATEDATE"
type=
"TIMESTAMP"
/>
</createTable>
<createTable
tableName=
"IBZDICTOPTION"
>
<column
name=
"VKEY"
type=
"VARCHAR(100)"
>
<constraints
nullable=
"false"
primaryKey=
"true"
primaryKeyName=
"PK_DICT_OPTION_VKEY"
/>
</column>
<column
name=
"CID"
type=
"VARCHAR(100)"
/>
<column
name=
"CNAME"
type=
"VARCHAR(100)"
/>
<column
name=
"VAL"
type=
"VARCHAR(40)"
/>
<column
name=
"LABEL"
type=
"VARCHAR(100)"
/>
<column
name=
"PVAL"
type=
"VARCHAR(40)"
/>
<column
name=
"VFILTER"
type=
"VARCHAR(500)"
/>
<column
name=
"CLS"
type=
"VARCHAR(500)"
/>
<column
name=
"ICONCLS"
type=
"VARCHAR(255)"
/>
<column
name=
"DISABLED"
type=
"INT"
/>
<column
name=
"EXPIRED"
type=
"INT"
/>
<column
name=
"SHOWORDER"
type=
"INT"
/>
<column
name=
"EXTENSION"
type=
"VARCHAR(1000)"
/>
<column
name=
"UPDATEDATE"
type=
"TIMESTAMP"
/>
<column
name=
"CREATEDATE"
type=
"TIMESTAMP"
/>
</createTable>
<addForeignKeyConstraint
baseColumnNames=
"CID"
baseTableName=
"IBZDICTOPTION"
constraintName=
"DER1N_DICT_OPTION_DICT_CATALOG"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CID"
referencedTableName=
"IBZDICTCATALOG"
validate=
"true"
/>
</changeSet>
</databaseChangeLog>
ibzdst-core/src/main/resources/liquibase/changelog/20210309115218_changelog.xml
0 → 100644
浏览文件 @
f5f07221
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro=
"http://www.liquibase.org/xml/ns/pro"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.9.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd"
>
<changeSet
author=
"mac (generated)"
id=
"1615290744065-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"IBZTABLESYNC"
/>
</not>
</preConditions>
<createTable
tableName=
"IBZTABLESYNC"
>
<column
name=
"SYNCID"
type=
"VARCHAR(100)"
>
<constraints
nullable=
"false"
primaryKey=
"true"
primaryKeyName=
"PK_ETL_TABLE_SYNC_SYNCID"
/>
</column>
<column
name=
"SYNCNAME"
type=
"VARCHAR(100)"
/>
<column
name=
"SRCENTITYID"
type=
"VARCHAR(100)"
/>
<column
name=
"SRCENTITYNAME"
type=
"VARCHAR(100)"
/>
<column
name=
"SRCDSID"
type=
"VARCHAR(100)"
/>
<column
name=
"SRCEXP"
type=
"CLOB"
/>
<column
name=
"ENTITYID"
type=
"VARCHAR(100)"
/>
<column
name=
"ENTITYNAME"
type=
"VARCHAR(100)"
/>
<column
name=
"DSID"
type=
"VARCHAR(100)"
/>
<column
name=
"SYSTEMID"
type=
"VARCHAR(100)"
/>
<column
name=
"MAPPINGCFG"
type=
"CLOB"
/>
<column
name=
"SYNCGROUP"
type=
"VARCHAR(200)"
/>
<column
name=
"RUNORDER"
type=
"INT"
/>
<column
name=
"RUNCRON"
type=
"VARCHAR(100)"
/>
<column
name=
"ETLTIMESTAMP"
type=
"TIMESTAMP"
/>
<column
name=
"LASTRUNTIME"
type=
"TIMESTAMP"
/>
<column
name=
"LASTENDTIME"
type=
"TIMESTAMP"
/>
<column
name=
"LASTRUNRESULT"
type=
"VARCHAR(20)"
/>
<column
name=
"LASTREAD"
type=
"BIGINT"
/>
<column
name=
"LASTWRITE"
type=
"BIGINT"
/>
<column
name=
"ISENABLE"
type=
"INT"
/>
<column
name=
"UPDATEDATE"
type=
"TIMESTAMP"
/>
</createTable>
</changeSet>
</databaseChangeLog>
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/DstCoreResource.java
浏览文件 @
f5f07221
...
...
@@ -5,7 +5,6 @@ import cn.ibizlab.core.lite.domain.MetaField;
import
cn.ibizlab.core.lite.extensions.domain.*
;
import
cn.ibizlab.core.lite.extensions.model.DataModel
;
import
cn.ibizlab.core.lite.extensions.model.Property
;
import
cn.ibizlab.core.lite.extensions.service.DbEntityService
;
import
cn.ibizlab.core.lite.extensions.service.LiteDataService
;
import
cn.ibizlab.core.lite.extensions.service.LiteModelService
;
import
cn.ibizlab.util.client.IBZDictFeignClient
;
...
...
@@ -186,24 +185,24 @@ public class DstCoreResource {
for
(
String
key
:
params
.
keySet
())
{
entityObj
.
set
(
key
.
toUpperCase
(),
params
.
get
(
key
)[
0
]);
}
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
get
(
system
,
entity
,
entityObj
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
get
(
system
,
entity
,
entityObj
.
getStringValue
(
"link"
),
entityObj
));
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dst/{system}/entitys/{entity}/search{dataset}"
)
public
ResponseEntity
<
List
<
EntityObj
>>
searchEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
value
=
"dataset"
,
required
=
false
)
String
dataset
,
@RequestBody
QueryFilter
filter
)
{
public
ResponseEntity
<
List
<
EntityObj
>>
searchEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
value
=
"dataset"
,
required
=
false
)
String
dataset
,
@Request
Param
(
value
=
"link"
,
required
=
false
)
String
link
,
@Request
Body
QueryFilter
filter
)
{
if
(
StringUtils
.
isEmpty
(
dataset
))
dataset
=
"BASE"
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
search
(
system
,
entity
,
filter
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
search
(
system
,
entity
,
link
,
filter
));
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dst/{system}/entitys/{entity}/save"
)
public
ResponseEntity
<
Boolean
>
saveEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@RequestBody
EntityObj
entityObj
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
save
(
system
,
entity
,
entityObj
));
public
ResponseEntity
<
Boolean
>
saveEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@Request
Param
(
value
=
"link"
,
required
=
false
)
String
link
,
@Request
Body
EntityObj
entityObj
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
save
(
system
,
entity
,
link
,
entityObj
));
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dst/{system}/entitys/{entity}/batch"
)
public
ResponseEntity
<
Boolean
>
saveEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@RequestBody
List
<
EntityObj
>
list
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
saveBatch
(
system
,
entity
,
list
));
public
ResponseEntity
<
Boolean
>
saveEntity
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@RequestBody
List
<
EntityObj
>
list
,
@RequestParam
(
value
=
"link"
,
required
=
false
)
String
link
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
liteDataService
.
saveBatch
(
system
,
entity
,
li
nk
,
li
st
));
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dst/sysapps"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录