Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
112a5d24
提交
112a5d24
编写于
3月 17, 2021
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充定时任务参数设置
上级
8b7a0aa9
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
209 行增加
和
13 行删除
+209
-13
%ITEM%JobHandler.java.ftl
...ava/%SYS_PKGPATH%/core/util/job/%ITEM%JobHandler.java.ftl
+3
-3
RuleUtils.java.ftl
...rc/main/java/%SYS_PKGPATH%/util/helper/RuleUtils.java.ftl
+113
-10
Setting.java.ftl
.../src/main/java/%SYS_PKGPATH%/util/helper/Setting.java.ftl
+93
-0
未找到文件。
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/util/job/%ITEM%JobHandler.java.ftl
浏览文件 @
112a5d24
...
...
@@ -30,9 +30,9 @@ public class ${item.codeName}JobHandler implements IJobsHandler {
@
Override
public
JobsResponse
execute
(
String
tenantId
,
String
param
)
throws
JobsException
{
<#
if
hasDEAction
>
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
codeName
}
entity
=
new
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
codeName
}(
);
entity
.
set
(
"tenantid"
,
tenantId
);
entity
.
set
(
"param"
,
param
);
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
codeName
}
entity
=
Setting
.
getEntity
(
param
,
new
${
pub
.
getPKGCodeName
()}.
core
.${
de
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
de
.
codeName
}()
);
entity
.
set
(
"tenantid"
,
tenantId
);
entity
.
set
(
"param"
,
param
);
${
srfcaseformat
(
de
.
getCodeName
(),
'l_u2lC'
)}
Service
.${
srfmethodname
(
deaction
.
getCodeName
())}(
entity
);
</#
if
>
log
.
info
(
"执行 DemoJobHandler tenantId="
+
tenantId
+
",param="
+
param
);
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/helper/RuleUtils.java.ftl
浏览文件 @
112a5d24
...
...
@@ -3,7 +3,6 @@ TARGET=PSSYSTEM
</#
ibiztemplate
>
package
${
pub
.
getPKGCodeName
()}.
util
.
helper
;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
EntityBase
;
import
java
.
lang
.
reflect
.
Method
;
import
java
.
math
.
BigDecimal
;
...
...
@@ -315,6 +314,13 @@ public class RuleUtils
}
public
static
boolean
ge
(
Object
exp
,
Object
finalObject
)
{
if
(
ObjectUtils
.
isEmpty
(
exp
)){
return
false
;
}
if
(
ObjectUtils
.
isEmpty
(
finalObject
)){
return
false
;
}
return
(
!(lt(exp, finalObject)));
}
...
...
@@ -324,6 +330,12 @@ public class RuleUtils
}
public
static
boolean
le
(
Object
exp
,
Object
finalObject
)
{
if
(
ObjectUtils
.
isEmpty
(
exp
)){
return
false
;
}
if
(
ObjectUtils
.
isEmpty
(
finalObject
)){
return
false
;
}
return
(
!(gt(exp, finalObject)));
}
...
...
@@ -333,6 +345,15 @@ public class RuleUtils
}
public
static
boolean
notin
(
Object
expObj
,
Object
finalObject
)
{
if
(
ObjectUtils
.
isEmpty
(
finalObject
))
return
true
;
if
(
ObjectUtils
.
isEmpty
(
expObj
))
return
false
;
String
tvs
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
tvs
)){
return
false
;
}
return
(
!in(expObj,finalObject));
}
public
static
boolean
in
(
Object
expObj
,
Object
object
,
String
members
)
...
...
@@ -343,7 +364,8 @@ public class RuleUtils
{
if
(
ObjectUtils
.
isEmpty
(
finalObject
))
return
false
;
if
(
ObjectUtils
.
isEmpty
(
expObj
))
return
false
;
String
tvs
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
tvs
)){
return
false
;
...
...
@@ -400,6 +422,16 @@ public class RuleUtils
}
public
static
boolean
notmatchor
(
Object
expObj
,
Object
obj
)
{
if
(
ObjectUtils
.
isEmpty
(
obj
)){
return
true
;
}
if
(
ObjectUtils
.
isEmpty
(
expObj
)){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
exp
)){
return
false
;
}
return
(
!matchor(expObj,obj));
}
...
...
@@ -409,6 +441,16 @@ public class RuleUtils
}
public
static
boolean
notmatchand
(
Object
expObj
,
Object
finalObject
)
{
if
(
ObjectUtils
.
isEmpty
(
finalObject
)){
return
true
;
}
if
(
ObjectUtils
.
isEmpty
(
expObj
)){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
exp
)){
return
false
;
}
return
(
!matchand(expObj,finalObject));
}
...
...
@@ -418,9 +460,12 @@ public class RuleUtils
}
public
static
boolean
matchor
(
Object
expObj
,
Object
obj
)
{
if
(
obj
==
null
){
if
(
ObjectUtils
.
isEmpty
(
obj
)
){
return
false
;
}
if
(
ObjectUtils
.
isEmpty
(
expObj
)){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
exp
)){
return
false
;
...
...
@@ -441,8 +486,11 @@ public class RuleUtils
public
static
boolean
leftmatchor
(
Object
expObj
,
Object
obj
)
{
if
(
obj
==
null
){
return
false
;
if
(
ObjectUtils
.
isEmpty
(
obj
)){
return
false
;
}
if
(
ObjectUtils
.
isEmpty
(
expObj
)){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
exp
)){
...
...
@@ -465,8 +513,11 @@ public class RuleUtils
public
static
boolean
rightmatchor
(
Object
expObj
,
Object
obj
)
{
if
(
obj
==
null
){
return
false
;
if
(
ObjectUtils
.
isEmpty
(
obj
)){
return
false
;
}
if
(
ObjectUtils
.
isEmpty
(
expObj
)){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
if
(
StringUtils
.
isEmpty
(
exp
)){
...
...
@@ -493,10 +544,10 @@ public class RuleUtils
}
public
static
boolean
matchand
(
Object
expObj
,
Object
obj
)
{
if
(
obj
==
null
){
return
false
;
if
(
ObjectUtils
.
isEmpty
(
obj
)
){
return
false
;
}
if
(
expObj
==
null
){
if
(
ObjectUtils
.
isEmpty
(
expObj
)
){
return
false
;
}
String
exp
=
expObj
.
toString
().
trim
();
...
...
@@ -583,4 +634,56 @@ public class RuleUtils
}
return
acts
;
}
public
static
boolean
inc2s
(
String
tvs
,
Object
finalObject
)
{
if
(
ObjectUtils
.
isEmpty
(
finalObject
))
return
false
;
if
(
StringUtils
.
isEmpty
(
tvs
))
return
false
;
if
(
finalObject
instanceof
String
)
{
tvs
=
"s:"
+
tvs
;
}
else
return
false
;
List
acts
=
parseTvs
(
tvs
);
for
(
Iterator
localIterator
=
acts
.
iterator
();
localIterator
.
hasNext
();)
{
Object
act
=
localIterator
.
next
();
if
(
equal
(
c2s
(
act
.
toString
()),
c2s
(
finalObject
.
toString
())))
return
true
;
}
return
false
;
}
public
static
String
c2s
(
String
str
)
{
if
(
str
==
null
)
return
null
;
if
(
str
.
length
()<
300
)
{
str
=
str
.
trim
();//
1234567890()【】〔
2018
〕
str
=
str
.
replace
(
"1"
,
"1"
).
replace
(
"2"
,
"2"
).
replace
(
"3"
,
"3"
).
replace
(
"4"
,
"4"
).
replace
(
"5"
,
"5"
).
replace
(
"6"
,
"6"
).
replace
(
"7"
,
"7"
)
.
replace
(
"8"
,
"8"
).
replace
(
"9"
,
"9"
).
replace
(
"0"
,
"0"
)
.
replace
(
"("
,
"〔"
).
replace
(
")"
,
"〕"
)
.
replace
(
"("
,
"〔"
).
replace
(
")"
,
"〕"
)
.
replace
(
"【"
,
"〔"
).
replace
(
"】"
,
"〕"
)
.
replace
(
"["
,
"〔"
).
replace
(
"]"
,
"〕"
);
}
return
str
;
}
public
static
boolean
notinc2s
(
String
tvs
,
Object
finalObject
)
{
return
(
!inc2s(tvs,finalObject));
}
}
\ No newline at end of file
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/helper/Setting.java.ftl
0 → 100644
浏览文件 @
112a5d24
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
package
${
pub
.
getPKGCodeName
()}.
util
.
helper
;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
EntityBase
;
import
com
.
alibaba
.
fastjson
.
JSON
;
import
com
.
alibaba
.
fastjson
.
JSONArray
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
lombok
.
Getter
;
import
lombok
.
NoArgsConstructor
;
import
lombok
.
Setter
;
import
lombok
.
experimental
.
Accessors
;
import
org
.
springframework
.
util
.
StringUtils
;
import
java
.
io
.
IOException
;
import
java
.
io
.
StringReader
;
import
java
.
util
.*;
@
Getter
@
Setter
@
NoArgsConstructor
@
Accessors
(
chain
=
true
)
public
class
Setting
{
private
String
property
;
private
String
value
;
public
static
String
getValue
(
String
configString
,
String
propertyName
)
{
return
DataObject
.
getStringValue
(
getMap
(
configString
).
get
(
propertyName
),
""
);
}
public
static
<
T
extends
EntityBase
>
T
getEntity
(
String
configString
,
T
entityBase
)
{
if
(
entityBase
!=null) {
Map
map
=
getMap
(
configString
);
map
.
keySet
().
forEach
(
key
->{
entityBase
.
set
(
key
.
toString
(),
map
.
get
(
key
));
});
}
return
entityBase
;
}
public
static
Map
getMap
(
String
configString
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"param"
,
configString
);
if
(
!(StringUtils.isEmpty(configString)))
{
try
{
Object
obj
=
JSON
.
parse
(
configString
);
if
(
obj
==
null
)
return
map
;
else
if
(
obj
instanceof
JSONArray
)
{
List
<
Setting
>
settings
=
JSONArray
.
parseArray
(
configString
,
Setting
.
class
);
for
(
Setting
setting
:
settings
)
map
.
put
(
setting
.
getProperty
(),
setting
.
getValue
());
}
else
if
(
obj
instanceof
JSONObject
)
{
JSONObject
jo
=
(
JSONObject
)
obj
;
jo
.
keySet
().
forEach
(
key
->{
map
.
put
(
key
,
jo
.
get
(
key
));
});
}
}
catch
(
Exception
ex
)
{
if
(
configString
.
indexOf
(
"="
)>
0
)
{
Properties
proper
=
new
Properties
();
try
{
proper
.
load
(
new
StringReader
(
configString
));
//
把字符串转为
reader
}
catch
(
IOException
e
)
{
}
Enumeration
enum1
=
proper
.
propertyNames
();
while
(
enum1
.
hasMoreElements
())
{
String
strKey
=
(
String
)
enum1
.
nextElement
();
String
strValue
=
proper
.
getProperty
(
strKey
);
map
.
put
(
strKey
,
strValue
);
}
}
}
}
return
map
;
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录