Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
eca195c4
提交
eca195c4
编写于
7月 01, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整扩展目录
上级
d944b729
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
186 行增加
和
156 行删除
+186
-156
%DE%ServiceEx.java.ftl
...S_PKGPATH%/core/extensions.service/%DE%ServiceEx.java.ftl
+4
-156
%DE%ServiceExt.java.ftl
..._PKGPATH%/core/extensions/service/%DE%ServiceExt.java.ftl
+182
-0
未找到文件。
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/extensions.service/%DE%ServiceEx.java.ftl
浏览文件 @
eca195c4
...
...
@@ -17,166 +17,14 @@ TARGET=PSDATAENTITY
<#
if
hasServiceEx
&&
(
de
.
getStorageMode
()==
1
||
de
.
getStorageMode
()==
2
||
de
.
getStorageMode
()==
4
||
de
.
getStorageMode
()==
0
)
>
package
${
pub
.
getPKGCodeName
()}.
core
.
extensions
.
service
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
impl
.${
item
.
codeName
}
ServiceImpl
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
item
.
codeName
};
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
transaction
.
annotation
.
Transactional
;
import
org
.
springframework
.
context
.
annotation
.
Primary
;
import
java
.
util
.*;
/**
*
实体
[${
item
.
getLogicName
()}]
自定义服务对象
*
扩展目录已变更,请到
[${
pub
.
getPKGCodeName
()}.
core
.
extensions
.
service
.
xxServiceExt
]
中来进行扩展
*
若您之前有在当前目录下扩展过其它的
service
对象,请将扩展的代码移到新的扩展类中
*/
@
Slf4j
@
Primary
@
Service
(
"${item.codeName}ServiceEx"
)
public
class
${
item
.
codeName
}
ServiceEx
extends
${
item
.
codeName
}
ServiceImpl
{
<#
comment
>
SQL
存储:解决
mybatis
继承
service
批操作报错
</#
comment
>
<#
if
de
.
getStorageMode
()==
1
>
@
Override
protected
Class
currentModelClass
()
{
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
}
</#
if
>
@
Deprecated
public
class
${
item
.
codeName
}
ServiceEx
{
<#
comment
>
输出实体行为
</#
comment
>
<#
if
item
.
getAllPSDEActions
()??>
<#
list
item
.
getAllPSDEActions
()
as
deaction
>
<#
if
deaction
.
isEnableBackend
()>
<#
if
deaction
.
getActionType
()==
'USERCUSTOM'
>
/**
*
自定义行为
[${
deaction
.
getCodeName
()}]
用户扩展
*
@
param
et
*
@
return
*/
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
${
srfmethodname
(
deaction
.
getCodeName
())}(${
item
.
getCodeName
()}
et
)
{
return
super
.${
srfmethodname
(
deaction
.
getCodeName
())}(
et
);
}
</#
if
>
<#
comment
>
输出测试行为
</#
comment
>
<@
outputTestActionDetail
deaction
/>
</#
if
>
</#
list
>
</#
if
>
}
</#
if
>
<#
comment
>
输出测试行为
</#
comment
>
<#
macro
outputTestActionDetail
deaction
>
<#
if
deaction
.
isEnableBackend
()
&&
deaction
.
getTestActionMode
??
&&
deaction
.
getTestActionMode
()??>
<#
if
deaction
.
getTestActionMode
()
==
1
||
deaction
.
getTestActionMode
()
==
3
>
<#
if
(
deaction
.
getActionType
()==
'USERCUSTOM'
)>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
<#
elseif
deaction
.
getActionType
()==
'DELOGIC'
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
'get'
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
testGet
(${
srfjavatype
(
keyfield
.
stdDataType
)}
key
)
{
return
super
.
testGet
(
key
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"createbatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"updatebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"removebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"savebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"create"
>
@
Override
@
Transactional
public
boolean
testCreate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testCreate
(
et
);
}
@
Override
public
void
testCreateBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testCreateBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"update"
>
@
Override
@
Transactional
public
boolean
testUpdate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testUpdate
(
et
);
}
@
Override
public
void
testUpdateBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testUpdateBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"save"
>
@
Override
@
Transactional
public
boolean
testSave
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testSave
(
et
);
}
@
Override
@
Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
testSaveOrUpdate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testSaveOrUpdate
(
et
);
}
@
Override
public
boolean
testSaveBatch
(
Collection
<${
item
.
getCodeName
()}>
list
)
{
return
super
.
testSaveBatch
(
list
);
}
@
Override
public
void
testSaveBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testSaveBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"remove"
>
@
Override
@
Transactional
public
boolean
testRemove
(${
srfjavatype
(
keyfield
.
stdDataType
)}
key
)
{
return
super
.
testRemove
(
key
);
}
@
Override
public
void
testRemoveBatch
(
Collection
<${
srfjavatype
(
keyfield
.
stdDataType
)}>
idList
)
{
super
.
testRemoveBatch
(
idList
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"getdraft"
>
@
Override
public
${
item
.
getCodeName
()}
testGetDraft
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testGetDraft
(
et
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"checkkey"
>
@
Override
public
boolean
testCheckKey
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testCheckKey
(
et
);
}
<#
else
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
</#
if
>
</#
if
>
</#
if
>
</#
macro
>
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/extensions/service/%DE%ServiceExt.java.ftl
0 → 100644
浏览文件 @
eca195c4
<#
ibiztemplate
>
TARGET
=
PSDATAENTITY
</#
ibiztemplate
>
<#
comment
>
判断当前实体是否包含自定义行为
</#
comment
>
<#
assign
hasServiceEx
=
false
>
<#
if
item
.
getAllPSDEActions
()??>
<#
list
item
.
getAllPSDEActions
()
as
deaction
>
<#
if
deaction
.
isEnableBackend
()
&&
deaction
.
getActionType
()==
'USERCUSTOM'
>
<#
assign
hasServiceEx
=
true
>
<#
break
>
<#
elseif
deaction
.
isEnableBackend
()
&&
deaction
.
getTestActionMode
??
&&
deaction
.
getTestActionMode
()??
&&
(
deaction
.
getTestActionMode
()
==
1
||
deaction
.
getTestActionMode
()
==
3
)>
<#
assign
hasServiceEx
=
true
>
<#
break
>
</#
if
>
</#
list
>
</#
if
>
<#
if
hasServiceEx
&&
(
de
.
getStorageMode
()==
1
||
de
.
getStorageMode
()==
2
||
de
.
getStorageMode
()==
4
||
de
.
getStorageMode
()==
0
)
>
package
${
pub
.
getPKGCodeName
()}.
core
.
extensions
.
service
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
service
.
impl
.${
item
.
codeName
}
ServiceImpl
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
${
pub
.
getPKGCodeName
()}.
core
.${
item
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
item
.
codeName
};
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
transaction
.
annotation
.
Transactional
;
import
org
.
springframework
.
context
.
annotation
.
Primary
;
import
java
.
util
.*;
/**
*
实体
[${
item
.
getLogicName
()}]
自定义服务对象
*/
@
Slf4j
@
Primary
@
Service
(
"${item.codeName}ServiceExt"
)
public
class
${
item
.
codeName
}
ServiceExt
extends
${
item
.
codeName
}
ServiceImpl
{
<#
comment
>
SQL
存储:解决
mybatis
继承
service
批操作报错
</#
comment
>
<#
if
de
.
getStorageMode
()==
1
>
@
Override
protected
Class
currentModelClass
()
{
return
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ReflectionKit
.
getSuperClassGenericType
(
this
.
getClass
().
getSuperclass
(),
1
);
}
</#
if
>
<#
comment
>
输出实体行为
</#
comment
>
<#
if
item
.
getAllPSDEActions
()??>
<#
list
item
.
getAllPSDEActions
()
as
deaction
>
<#
if
deaction
.
isEnableBackend
()>
<#
if
deaction
.
getActionType
()==
'USERCUSTOM'
>
/**
*
自定义行为
[${
deaction
.
getCodeName
()}]
用户扩展
*
@
param
et
*
@
return
*/
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
${
srfmethodname
(
deaction
.
getCodeName
())}(${
item
.
getCodeName
()}
et
)
{
return
super
.${
srfmethodname
(
deaction
.
getCodeName
())}(
et
);
}
</#
if
>
<#
comment
>
输出测试行为
</#
comment
>
<@
outputTestActionDetail
deaction
/>
</#
if
>
</#
list
>
</#
if
>
}
</#
if
>
<#
comment
>
输出测试行为
</#
comment
>
<#
macro
outputTestActionDetail
deaction
>
<#
if
deaction
.
isEnableBackend
()
&&
deaction
.
getTestActionMode
??
&&
deaction
.
getTestActionMode
()??>
<#
if
deaction
.
getTestActionMode
()
==
1
||
deaction
.
getTestActionMode
()
==
3
>
<#
if
(
deaction
.
getActionType
()==
'USERCUSTOM'
)>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
<#
elseif
deaction
.
getActionType
()==
'DELOGIC'
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
'get'
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
testGet
(${
srfjavatype
(
keyfield
.
stdDataType
)}
key
)
{
return
super
.
testGet
(
key
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"createbatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"updatebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"removebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"savebatch"
>
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"create"
>
@
Override
@
Transactional
public
boolean
testCreate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testCreate
(
et
);
}
@
Override
public
void
testCreateBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testCreateBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"update"
>
@
Override
@
Transactional
public
boolean
testUpdate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testUpdate
(
et
);
}
@
Override
public
void
testUpdateBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testUpdateBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"save"
>
@
Override
@
Transactional
public
boolean
testSave
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testSave
(
et
);
}
@
Override
@
Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
testSaveOrUpdate
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testSaveOrUpdate
(
et
);
}
@
Override
public
boolean
testSaveBatch
(
Collection
<${
item
.
getCodeName
()}>
list
)
{
return
super
.
testSaveBatch
(
list
);
}
@
Override
public
void
testSaveBatch
(
List
<${
item
.
getCodeName
()}>
list
)
{
super
.
testSaveBatch
(
list
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"remove"
>
@
Override
@
Transactional
public
boolean
testRemove
(${
srfjavatype
(
keyfield
.
stdDataType
)}
key
)
{
return
super
.
testRemove
(
key
);
}
@
Override
public
void
testRemoveBatch
(
Collection
<${
srfjavatype
(
keyfield
.
stdDataType
)}>
idList
)
{
super
.
testRemoveBatch
(
idList
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"getdraft"
>
@
Override
public
${
item
.
getCodeName
()}
testGetDraft
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testGetDraft
(
et
);
}
<#
elseif
deaction
.
getCodeName
()?
lower_case
==
"checkkey"
>
@
Override
public
boolean
testCheckKey
(${
item
.
getCodeName
()}
et
)
{
return
super
.
testCheckKey
(
et
);
}
<#
else
>
@
Override
@
Transactional
public
${
item
.
getCodeName
()}
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(${
item
.
getCodeName
()}
et
)
{
return
super
.
test
${
srfmethodname
(
deaction
.
getCodeName
())?
cap_first
}(
et
);
}
</#
if
>
</#
if
>
</#
if
>
</#
macro
>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录