Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibiz-boot-starters
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibiz-boot-starters
提交
e9a0b07f
提交
e9a0b07f
编写于
7月 12, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
反射
上级
bca585b2
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
68 行增加
和
30 行删除
+68
-30
BaseData.java
...net/ibizsys/central/plugin/boot/core/domain/BaseData.java
+4
-11
BootServiceImpl.java
...sys/central/plugin/boot/core/runtime/BootServiceImpl.java
+42
-10
IBaseService.java
...bizsys/central/plugin/boot/core/service/IBaseService.java
+22
-9
未找到文件。
ibiz-boot-starter/src/main/java/net/ibizsys/central/plugin/boot/core/domain/BaseData.java
浏览文件 @
e9a0b07f
package
net
.
ibizsys
.
central
.
plugin
.
boot
.
core
.
domain
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.alibaba.fastjson.util.TypeUtils
;
import
com.baomidou.mybatisplus.annotation.TableField
;
...
...
@@ -183,15 +185,7 @@ public class BaseData implements IEntityDTO {
if
(
_allParamMap
==
null
)
_allParamMap
=
new
HashMap
<>();
_allParamMap
.
clear
();
_allParamMap
.
putAll
(
this
.
paramMap
);
getMap
().
keySet
().
forEach
(
key
->{
Object
obj
=
getMap
().
get
(
key
);
if
(
obj
==
null
)
return
;
if
((!
key
.
equals
(
"map"
))&&(!
key
.
equals
(
"_allParamMap"
))&&(!
key
.
equals
(
"paramMap"
)))
_allParamMap
.
put
(
key
.
toString
(),
obj
);
});
focusNull
.
forEach
(
item
->
_allParamMap
.
put
(
item
,
null
));
_allParamMap
.
putAll
(
toMap
());
return
_allParamMap
;
}
...
...
@@ -776,8 +770,7 @@ public class BaseData implements IEntityDTO {
public
Map
<
String
,
Object
>
toMap
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
putAll
(
this
.
paramMap
);
map
.
putAll
(
this
.
getMap
());
map
.
putAll
((
JSONObject
)
JSON
.
toJSON
(
this
));
focusNull
.
forEach
(
item
->
map
.
put
(
item
,
null
));
return
map
;
...
...
ibiz-boot-starter/src/main/java/net/ibizsys/central/plugin/boot/core/runtime/BootServiceImpl.java
浏览文件 @
e9a0b07f
...
...
@@ -19,6 +19,7 @@ import net.ibizsys.runtime.dataentity.service.DEMethodReturnTypes;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.util.Assert
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.HashMap
;
...
...
@@ -134,9 +135,19 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
if
(
method
!=
null
)
{
Object
rt
=
null
;
if
(
iPSDEAction
!=
null
&&
iPSDEAction
.
getPSDEActionReturn
()
!=
null
&&
DEMethodReturnTypes
.
VOID
.
equals
(
iPSDEAction
.
getPSDEActionReturn
().
getType
()))
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
else
rt
=
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
try
{
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
else
{
try
{
rt
=
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
return
rt
;
}
}
...
...
@@ -154,9 +165,20 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
if
(
method
!=
null
)
{
Object
rt
=
null
;
if
(
iPSDEAction
!=
null
&&
iPSDEAction
.
getPSDEActionReturn
()
!=
null
&&
DEMethodReturnTypes
.
VOID
.
equals
(
iPSDEAction
.
getPSDEActionReturn
().
getType
()))
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
else
rt
=
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
{
try
{
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
else
{
try
{
rt
=
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
return
rt
;
}
...
...
@@ -173,8 +195,13 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
if
(
args
.
length
>
0
&&
args
[
0
]!=
null
)
{
((
F
)
args
[
0
]).
setDataSet
(
iPSDEDataSet
);
Method
method
=
getBaseService
().
getServiceMethod
(
"fetch"
+
StringAdvUtils
.
pascalcase
(
strDataSetName
),
args
[
0
].
getClass
());
if
(
method
!=
null
)
return
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
if
(
method
!=
null
)
{
try
{
return
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
}
return
getBaseService
().
fetchDataSet
(
strDataSetName
,
iPSDEDataSet
,
args
);
}
...
...
@@ -188,8 +215,13 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
if
(
args
.
length
>
0
&&
args
[
0
]!=
null
)
{
((
F
)
args
[
0
]).
setDataSet
(
iPSDEDataSet
);
Method
method
=
getBaseService
().
getServiceMethod
(
"onFetch"
+
StringAdvUtils
.
pascalcase
(
strDataSetName
),
args
[
0
].
getClass
());
if
(
method
!=
null
)
return
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
if
(
method
!=
null
)
{
try
{
return
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
}
return
getBaseService
().
fetchDataSetReal
(
iDataEntityRuntimeContext
,
strDataSetName
,
iPSDEDataSet
,
args
,
actionData
);
}
...
...
ibiz-boot-starter/src/main/java/net/ibizsys/central/plugin/boot/core/service/IBaseService.java
浏览文件 @
e9a0b07f
...
...
@@ -11,6 +11,7 @@ import net.ibizsys.model.dataentity.action.IPSDEAction;
import
net.ibizsys.model.dataentity.ds.IPSDEDataSet
;
import
org.springframework.data.domain.Page
;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -50,9 +51,13 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
}
default
void
beforeAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
Method
beforeMethod
=
getServiceMethod
(
"before"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
beforeMethod
!=
null
)
beforeMethod
.
invoke
(
this
,
arg
);
try
{
Method
beforeMethod
=
getServiceMethod
(
"before"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
beforeMethod
!=
null
)
beforeMethod
.
invoke
(
this
,
arg
);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
default
Object
forwardAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
...
...
@@ -68,9 +73,13 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
}
default
void
afterAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
Method
afterMethod
=
getServiceMethod
(
"after"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
afterMethod
!=
null
)
afterMethod
.
invoke
(
this
,
arg
);
try
{
Method
afterMethod
=
getServiceMethod
(
"after"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
afterMethod
!=
null
)
afterMethod
.
invoke
(
this
,
arg
);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
default
Object
fetchDataSet
(
String
strDataSetName
,
IPSDEDataSet
iPSDEDataSet
,
Object
[]
args
)
throws
Throwable
{
...
...
@@ -78,9 +87,13 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
}
default
void
beforeFetch
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
Method
beforeMethod
=
getServiceMethod
(
"beforeFetch"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
beforeMethod
!=
null
)
beforeMethod
.
invoke
(
this
,
arg
);
try
{
Method
beforeMethod
=
getServiceMethod
(
"beforeFetch"
+
StringAdvUtils
.
pascalcase
(
strActionName
),
arg
.
getClass
());
if
(
beforeMethod
!=
null
)
beforeMethod
.
invoke
(
this
,
arg
);
}
catch
(
InvocationTargetException
ex
){
throw
ex
.
getTargetException
();
}
}
default
Object
forwardFetch
(
String
dsName
,
F
arg
)
throws
Throwable
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录