Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibiz-boot-starters
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibiz-boot-starters
提交
c51ad354
提交
c51ad354
编写于
7月 01, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理方法
上级
8221d13f
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
59 行删除
+51
-59
BootServiceImpl.java
...sys/central/plugin/boot/core/runtime/BootServiceImpl.java
+3
-23
IBaseService.java
...bizsys/central/plugin/boot/core/service/IBaseService.java
+48
-36
未找到文件。
ibiz-boot-starter/src/main/java/net/ibizsys/central/plugin/boot/core/runtime/BootServiceImpl.java
浏览文件 @
c51ad354
...
...
@@ -58,8 +58,9 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
private
IBootSystemRuntime
systemRuntime
;
@Override
public
IBootSystemRuntime
getSystemRuntime
()
{
if
(
this
.
systemRuntime
==
null
)
systemRuntime
=
BootSystemRuntime
.
getInstance
();
if
(
this
.
systemRuntime
==
null
)
{
systemRuntime
=
BootSystemRuntime
.
getInstance
();
}
return
this
.
systemRuntime
;
}
...
...
@@ -129,13 +130,6 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
public
Object
executeAction
(
String
strActionName
,
IPSDEAction
iPSDEAction
,
Object
[]
args
)
throws
Throwable
{
if
(
getBaseService
()!=
null
)
{
if
(
args
.
length
>
0
&&
args
[
0
]!=
null
)
{
// if(args[0] instanceof BaseData)
// {
// Method beforeMethod = getBaseService().getServiceMethod("before"+StringAdvUtils.pascalcase(strActionName), args[0].getClass());
// if (beforeMethod != null)
// beforeMethod.invoke(this.getBaseService(), args[0]);
// }
Method
method
=
getBaseService
().
getServiceMethod
(
StringAdvUtils
.
camelcase
(
strActionName
),
args
[
0
].
getClass
());
if
(
method
!=
null
)
{
Object
rt
=
null
;
...
...
@@ -143,14 +137,6 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
else
rt
=
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
// if(args[0] instanceof BaseData)
// {
// Method afterMethod = getBaseService().getServiceMethod("after"+StringAdvUtils.pascalcase(strActionName), args[0].getClass());
// if (afterMethod != null)
// afterMethod.invoke(this.getBaseService(), args[0]);
// }
return
rt
;
}
}
...
...
@@ -186,12 +172,6 @@ public class BootServiceImpl<T extends BaseData, F extends BaseFilter> extends D
if
(
getBaseService
()!=
null
)
{
if
(
args
.
length
>
0
&&
args
[
0
]!=
null
)
{
((
F
)
args
[
0
]).
setDataSet
(
iPSDEDataSet
);
// if(args[0] instanceof BaseFilter)
// {
// Method beforeMethod = getBaseService().getServiceMethod("beforeFetch"+StringAdvUtils.pascalcase(strDataSetName), args[0].getClass());
// if (beforeMethod != null)
// beforeMethod.invoke(this.getBaseService(), args[0]);
// }
Method
method
=
getBaseService
().
getServiceMethod
(
"fetch"
+
StringAdvUtils
.
pascalcase
(
strDataSetName
),
args
[
0
].
getClass
());
if
(
method
!=
null
)
return
method
.
invoke
(
this
.
getBaseService
(),
args
[
0
]);
...
...
ibiz-boot-starter/src/main/java/net/ibizsys/central/plugin/boot/core/service/IBaseService.java
浏览文件 @
c51ad354
...
...
@@ -43,24 +43,38 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
return
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
strActionName
,
iPSDEAction
,
args
,
true
);
}
default
void
callAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
beforeAction
(
strActionName
,
arg
);
forwardAction
(
strActionName
,
arg
);
afterAction
(
strActionName
,
arg
);
}
default
Object
fetchDataSet
(
String
strDataSetName
,
IPSDEDataSet
iPSDEDataSet
,
Object
[]
args
)
throws
Throwable
{
return
this
.
getRuntimeService
().
getDataEntityRuntime
().
fetchDataSet
(
strDataSetName
,
iPSDEDataSet
,
args
,
true
);
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
);
}
default
Object
forwardAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
return
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
strActionName
,
null
,
new
Object
[]{
arg
},
true
);
}
default
Object
executeActionReal
(
IDataEntityRuntimeContext
iDataEntityRuntimeContext
,
String
strActionName
,
IPSDEAction
iPSDEAction
,
Object
[]
args
,
Object
actionData
)
throws
Throwable
{
return
iDataEntityRuntimeContext
.
executeActionReal
(
strActionName
,
iPSDEAction
,
args
,
actionData
);
}
default
Object
fetchDataSetReal
(
IDataEntityRuntimeContext
iDataEntityRuntimeContext
,
String
strDataSetName
,
IPSDEDataSet
iPSDEDataSet
,
Object
[]
args
,
Object
actionData
)
throws
Throwable
{
return
iDataEntityRuntimeContext
.
fetchDataSetReal
(
strDataSetName
,
iPSDEDataSet
,
args
,
actionData
);
default
Object
onRealAction
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
return
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
strActionName
,
null
,
new
Object
[]{
arg
},
null
);
}
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
);
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
);
}
default
Object
fetchDataSet
(
String
strDataSetName
,
IPSDEDataSet
iPSDEDataSet
,
Object
[]
args
)
throws
Throwable
{
return
this
.
getRuntimeService
().
getDataEntityRuntime
().
fetchDataSet
(
strDataSetName
,
iPSDEDataSet
,
args
,
true
);
}
default
void
beforeFetch
(
String
strActionName
,
Object
arg
)
throws
Throwable
{
...
...
@@ -69,45 +83,45 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
beforeMethod
.
invoke
(
this
,
arg
);
}
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
);
default
Object
forwardFetch
(
String
dsName
,
F
arg
)
throws
Throwable
{
return
this
.
getRuntimeService
().
getDataEntityRuntime
().
fetchDataSet
(
dsName
,
arg
.
getDataSet
(),
new
Object
[]{
arg
},
true
);
}
default
Object
fetchDataSetReal
(
IDataEntityRuntimeContext
iDataEntityRuntimeContext
,
String
strDataSetName
,
IPSDEDataSet
iPSDEDataSet
,
Object
[]
args
,
Object
actionData
)
throws
Throwable
{
return
iDataEntityRuntimeContext
.
fetchDataSetReal
(
strDataSetName
,
iPSDEDataSet
,
args
,
actionData
);
}
default
Object
onRealFetch
(
String
dsName
,
F
arg
)
throws
Throwable
{
return
this
.
getDataEntityRuntimeContext
().
fetchDataSetReal
(
"DEFAULT"
,
arg
.
getDataSet
(),
new
Object
[]{
arg
},
null
);
}
default
boolean
create
(
T
dto
)
throws
Throwable
{
beforeAction
(
"Create"
,
dto
);
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"Create"
,
null
,
new
Object
[]{
dto
},
true
);
afterAction
(
"Create"
,
dto
);
callAction
(
"Create"
,
dto
);
return
true
;
}
default
boolean
onCreate
(
T
dto
)
throws
Throwable
{
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"Create"
,
null
,
new
Object
[]{
dto
},
null
);
onRealAction
(
"Create"
,
dto
);
return
true
;
}
default
boolean
update
(
T
dto
)
throws
Throwable
{
beforeAction
(
"Update"
,
dto
);
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"Update"
,
null
,
new
Object
[]{
dto
},
true
);
afterAction
(
"Update"
,
dto
);
callAction
(
"Update"
,
dto
);
return
true
;
}
default
boolean
onUpdate
(
T
dto
)
throws
Throwable
{
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"Update"
,
null
,
new
Object
[]{
dto
},
null
);
onRealAction
(
"Update"
,
dto
);
return
true
;
}
default
boolean
save
(
T
dto
)
throws
Throwable
{
beforeAction
(
"Save"
,
dto
);
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"Save"
,
null
,
new
Object
[]{
dto
},
true
);
afterAction
(
"Save"
,
dto
);
callAction
(
"Save"
,
dto
);
return
true
;
}
default
boolean
onSave
(
T
dto
)
throws
Throwable
{
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"Save"
,
null
,
new
Object
[]{
dto
},
null
);
onRealAction
(
"Save"
,
dto
);
return
true
;
}
...
...
@@ -122,58 +136,56 @@ public interface IBaseService<T extends BaseData, F extends BaseFilter> {
}
default
boolean
remove
(
List
keys
)
throws
Throwable
{
beforeAction
(
"Remove"
,
keys
);
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"Remove"
,
null
,
new
Object
[]{
keys
},
true
);
afterAction
(
"Remove"
,
keys
);
callAction
(
"Remove"
,
keys
);
return
true
;
}
default
boolean
onRemove
(
List
keys
)
throws
Throwable
{
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"Remove"
,
null
,
new
Object
[]{
keys
},
null
);
onRealAction
(
"Remove"
,
keys
);
return
true
;
}
default
<
K
extends
Serializable
>
T
get
(
K
key
)
throws
Throwable
{
T
dto
=
(
T
)
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"Get"
,
null
,
new
Object
[]{
key
},
true
);
T
dto
=
(
T
)
forwardAction
(
"Get"
,
key
);
if
(
dto
!=
null
)
afterAction
(
"Get"
,
dto
);
return
dto
;
}
default
<
K
extends
Serializable
>
T
onGet
(
K
key
)
throws
Throwable
{
return
(
T
)
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"Get"
,
null
,
new
Object
[]{
key
},
null
);
return
(
T
)
onRealAction
(
"Get"
,
key
);
}
default
T
getDraft
(
T
dto
)
throws
Throwable
{
beforeAction
(
"GetDraft"
,
dto
);
T
rtdto
=
(
T
)
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"GetDraft"
,
null
,
new
Object
[]{
dto
},
true
);
T
rtdto
=
(
T
)
forwardAction
(
"GetDraft"
,
dto
);
if
(
dto
!=
null
)
afterAction
(
"GetDraft"
,
rtdto
);
return
rtdto
;
}
default
T
onGetDraft
(
T
dto
)
throws
Throwable
{
return
(
T
)
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"GetDraft"
,
null
,
new
Object
[]{
dto
},
null
);
return
(
T
)
onRealAction
(
"GetDraft"
,
dto
);
}
default
Integer
checkKey
(
T
dto
)
throws
Throwable
{
beforeAction
(
"CheckKey"
,
dto
);
return
(
Integer
)
this
.
getRuntimeService
().
getDataEntityRuntime
().
executeAction
(
"CheckKey"
,
null
,
new
Object
[]{
dto
},
true
);
return
(
Integer
)
forwardAction
(
"CheckKey"
,
dto
);
}
default
Integer
onCheckKey
(
T
dto
)
throws
Throwable
{
return
(
Integer
)
this
.
getDataEntityRuntimeContext
().
executeActionReal
(
"CheckKey"
,
null
,
new
Object
[]{
dto
},
null
);
return
(
Integer
)
onRealAction
(
"CheckKey"
,
dto
);
}
default
Page
<
T
>
fetchDefault
(
F
dto
)
throws
Throwable
{
beforeFetch
(
"Default"
,
dto
);
return
(
Page
)
this
.
getRuntimeService
().
getDataEntityRuntime
().
fetchDataSet
(
"DEFAULT"
,
dto
.
getDataSet
(),
new
Object
[]{
dto
},
true
);
return
(
Page
)
forwardFetch
(
"DEFAULT"
,
dto
);
}
default
Page
<
T
>
onFetchDefault
(
F
dto
)
throws
Throwable
{
return
(
Page
)
this
.
getDataEntityRuntimeContext
().
fetchDataSetReal
(
"DEFAULT"
,
dto
.
getDataSet
(),
new
Object
[]{
dto
},
null
);
return
(
Page
)
onRealFetch
(
"DEFAULT"
,
dto
);
}
default
List
<
T
>
selectDefault
(
F
dto
)
throws
Throwable
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录