Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
e7992bed
提交
e7992bed
编写于
3月 02, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
动态工作流
上级
b6669324
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
109 行增加
和
8 行删除
+109
-8
%DE%ServiceImpl.java.ftl
.../core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
+53
-8
IBZWFFallback.java.ftl
...ain/java/%SYS_PKGPATH%/util/client/IBZWFFallback.java.ftl
+16
-0
IBZWFFeignClient.java.ftl
.../java/%SYS_PKGPATH%/util/client/IBZWFFeignClient.java.ftl
+14
-0
SearchContextBase.java.ftl
...java/%SYS_PKGPATH%/util/filter/SearchContextBase.java.ftl
+26
-0
未找到文件。
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
浏览文件 @
e7992bed
...
...
@@ -66,6 +66,10 @@ TARGET=PSDATAENTITY
<#
break
>
</#
list
>
</#
if
>
<#
assign
isDynaSys
=
false
>
<#
if
item
.
getDynaInstMode
()??
&&
(
item
.
getDynaInstMode
()?
c
==
'1'
||
item
.
getDynaInstMode
()?
c
==
'2'
)>
<#
assign
isDynaSys
=
true
>
</#
if
>
<#
assign
isDupCheck
=
isDupCheckEntity
(
de
)>
<#
assign
keyfield
=
de
.
getKeyPSDEField
()>
<#
assign
keyfieldPrivateCodeName
=
srfcaseformat
(
keyfield
.
getCodeName
(),
'l_u2lC'
)
>
...
...
@@ -673,17 +677,24 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
*/
@
Override
public
Page
<<#
if
dedataset
.
isEnableGroup
()>
Map
<#
else
>${
item
.
getCodeName
()}</#
if
>>
search
${
dedataset
.
getCodeName
()}(${
item
.
getCodeName
()}
SearchContext
context
)
{
<#
if
item
.
isEnableSQLStorage
()
&&
item
.
getAllPSDEDBTables
()??>
<#--<#
list
item
.
getAllPSDEDBTables
()
as
detable
>-->
<#
if
de
.
hasPSDEWF
()==
true
>
<#
if
item
.
isEnableSQLStorage
()
&&
item
.
getAllPSDEDBTables
()??>
<#--<#
list
item
.
getAllPSDEDBTables
()
as
detable
>-->
<#
if
de
.
hasPSDEWF
()==
true
>
<#
if
isDynaSys
>
Map
<
String
,
Map
<
String
,
Object
>>
businesskeys
=
fillWFTaskContext
(
context
);
<#
else
>
fillWFTaskContext
(
context
);
</#
if
>
</#
if
>
</#
if
>
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<<#
if
dedataset
.
isEnableGroup
()>
Map
<#
else
>${
item
.
getCodeName
()}</#
if
>>
pages
=
baseMapper
.
search
${
dedataset
.
getCodeName
()}(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
<#
if
de
.
hasPSDEWF
()==
true
&&
isDynaSys
>
fillWFParam
(
pages
,
businesskeys
);
</#
if
>
return
new
PageImpl
<<#
if
dedataset
.
isEnableGroup
()>
Map
<#
else
>${
item
.
getCodeName
()}</#
if
>>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
<#--</#
list
>-->
<#
else
>
<#--</#
list
>-->
<#
else
>
return
null
;
</#
if
>
</#
if
>
}
</#
if
>
...
...
@@ -700,8 +711,41 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
*
查询工作流待办
*
@
param
context
*/
private
void
fillWFTaskContext
(${
item
.
getCodeName
()}
SearchContext
context
){
<#
if
isDynaSys
>
private
Map
<
String
,
Map
<
String
,
Object
>>
fillWFTaskContext
(${
item
.
getCodeName
()}
SearchContext
context
){
Map
<
String
,
Map
<
String
,
Object
>>
businessKeys
=
null
;
if
(
!StringUtils.isEmpty(context.getSrfDynaInstId())) {
businessKeys
=
ibzwfFeignClient
.
getDynaBusinesskeysByUserId
(
"${sys.getCodeName()?lower_case}"
,
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
().
getUserid
(),
"${entityName}"
,
context
.
getSrfDynaInstId
());
if
(
!ObjectUtils.isEmpty(businessKeys)){
context
.
getSelectCond
().
in
(
"${keyfield.name?lower_case}"
,
businessKeys
.
keySet
());
}
else
{
context
.
getSelectCond
().
apply
(
"1<>1"
);
}
}
return
businessKeys
;
}
/**
*
填充工作流参数
*
@
param
pages
*
@
param
businesskeys
*/
private
void
fillWFParam
(
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<${
item
.
getCodeName
()}>
pages
,
Map
<
String
,
Map
<
String
,
Object
>>
businesskeys
)
{
if
(
!ObjectUtils.isEmpty(businesskeys)) {
for
(${
item
.
getCodeName
()}
entity
:
pages
.
getRecords
())
{
Object
id
=
entity
.
get
${
srfcaseformat
(
keyfield
.
getCodeName
(),
'l_u2lC'
)?
cap_first
}();
if
(
!ObjectUtils.isEmpty(id) && businesskeys.containsKey(id)) {
Map
<
String
,
Object
>
params
=
businesskeys
.
get
(
id
);
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
params
.
entrySet
())
{
entity
.
set
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
}
}
}
<#
else
>
private
void
fillWFTaskContext
(${
item
.
getCodeName
()}
SearchContext
context
){
if
(
!StringUtils.isEmpty(context.getUserTaskId()) && !StringUtils.isEmpty(context.getProcessDefinitionKey())){
List
<
String
>
businessKeys
=
ibzwfFeignClient
.
getbusinesskeysByUserId
(
"${sys.getCodeName()?lower_case}"
,
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
.
getAuthenticationUser
().
getUserid
(),
"${entityName}"
,
context
.
getProcessDefinitionKey
(),
context
.
getUserTaskId
());
if
(
businessKeys
.
size
()>
0
){
...
...
@@ -713,6 +757,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
}
}
</#
if
>
</#
if
>
<#
comment
>
为当前实体填充父数据(外键值文本、外键值附加数据)
</#
comment
>
<#
if
hasMinorPSDERs
gt
0
>
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/client/IBZWFFallback.java.ftl
浏览文件 @
e7992bed
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
<#
assign
isDynaSys
=
false
>
<#
if
sys
.
getAllPSSystemModules
()??>
<#
list
sys
.
getAllPSSystemModules
()
as
module
>
<#
if
module
.
getDynaInstMode
()??
&&
(
module
.
getDynaInstMode
()?
c
==
'1'
||
module
.
getDynaInstMode
()?
c
==
'2'
)>
<#
assign
isDynaSys
=
true
>
<#
break
>
</#
if
>
</#
list
>
</#
if
>
package
${
pub
.
getPKGCodeName
()}.
util
.
client
;
import
org
.
springframework
.
stereotype
.
Component
;
...
...
@@ -29,4 +38,11 @@ public class IBZWFFallback implements IBZWFFeignClient {
public
JSONObject
wfstart
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
JSONObject
instance
)
{
return
null
;
}
<#
if
isDynaSys
>
@
Override
public
Map
<
String
,
Map
<
String
,
Object
>>
getDynaBusinesskeysByUserId
(
String
system
,
String
userId
,
String
entity
,
String
dynainstid
)
{
return
null
;
}
</#
if
>
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/client/IBZWFFeignClient.java.ftl
浏览文件 @
e7992bed
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
<#
assign
isDynaSys
=
false
>
<#
if
sys
.
getAllPSSystemModules
()??>
<#
list
sys
.
getAllPSSystemModules
()
as
module
>
<#
if
module
.
getDynaInstMode
()??
&&
(
module
.
getDynaInstMode
()?
c
==
'1'
||
module
.
getDynaInstMode
()?
c
==
'2'
)>
<#
assign
isDynaSys
=
true
>
<#
break
>
</#
if
>
</#
list
>
</#
if
>
package
${
pub
.
getPKGCodeName
()}.
util
.
client
;
import
org
.
springframework
.
cloud
.
openfeign
.
FeignClient
;
...
...
@@ -27,4 +36,9 @@ public interface IBZWFFeignClient
JSONObject
wfstart
(@
PathVariable
(
"system"
)
String
system
,
@
PathVariable
(
"appname"
)
String
appname
,
@
PathVariable
(
"entity"
)
String
entity
,
@
PathVariable
(
"businessKey"
)
String
businessKey
,
@
RequestBody
JSONObject
instance
);
<#
if
isDynaSys
>
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{entity}/{dynainstid}/tasks"
)
Map
<
String
,
Map
<
String
,
Object
>>
getDynaBusinesskeysByUserId
(@
PathVariable
(
"system"
)
String
system
,@
PathVariable
(
"userId"
)
String
userId
,
@
PathVariable
(
"entity"
)
String
entity
,@
PathVariable
(
"dynainstid"
)
String
dynainstid
);
</#
if
>
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/filter/SearchContextBase.java.ftl
浏览文件 @
e7992bed
...
...
@@ -8,6 +8,15 @@ TARGET=PSSYSTEM
<#
break
>
</#
if
>
</#
list
>
<#
assign
isDynaSys
=
false
>
<#
if
sys
.
getAllPSSystemModules
()??>
<#
list
sys
.
getAllPSSystemModules
()
as
module
>
<#
if
module
.
getDynaInstMode
()??
&&
(
module
.
getDynaInstMode
()?
c
==
'1'
||
module
.
getDynaInstMode
()?
c
==
'2'
)>
<#
assign
isDynaSys
=
true
>
<#
break
>
</#
if
>
</#
list
>
</#
if
>
package
${
pub
.
getPKGCodeName
()}.
util
.
filter
;
import
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
;
...
...
@@ -86,6 +95,23 @@ public class SearchContextBase implements ISearchContext{
*/
public
BoolQueryBuilder
esCond
=
new
BoolQueryBuilder
();
</#
if
>
<#
if
isDynaSys
>
/**
*
动态实例标识
*/
@
JsonProperty
(
"srfdynainstid"
)
public
String
srfDynaInstId
;
public
String
getSrfDynaInstId
()
{
if
(
StringUtils
.
isEmpty
(
srfDynaInstId
)){
Object
dynainstid
=
params
.
get
(
"srfdynainstid"
);
return
StringUtils
.
isEmpty
(
dynainstid
)?
null
:
String
.
valueOf
(
dynainstid
);
}
else
{
return
srfDynaInstId
;
}
}
</#
if
>
/**
*
获取工作流步骤标识
*/
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录