Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
2e903dbd
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e903dbd
编写于
10月 29, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复自定义表的getter方法setter方法命名错误的bug
上级
eca73892
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
45 deletion
+53
-45
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
.../com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
+15
-15
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/StringTools.java
.../main/java/com/x/base/core/project/tools/StringTools.java
+26
-22
o2server/x_console/src/main/java/com/x/server/console/action/HttpStatus.java
...src/main/java/com/x/server/console/action/HttpStatus.java
+3
-3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/ActionGetWorkOrWorkCompleted.java
...e/surface/jaxrs/control/ActionGetWorkOrWorkCompleted.java
+4
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
.../surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
+5
-3
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
浏览文件 @
2e903dbd
...
...
@@ -16,7 +16,6 @@ import javax.persistence.OrderColumn;
import
javax.persistence.Table
;
import
javax.persistence.Temporal
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.PersistentMap
;
import
org.apache.openjpa.persistence.jdbc.ContainerTable
;
...
...
@@ -42,6 +41,7 @@ import com.x.base.core.entity.annotation.ContainerEntity;
import
com.x.base.core.entity.dynamic.DynamicEntity.Field
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
public
class
DynamicEntityBuilder
{
...
...
@@ -196,10 +196,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
typeClass
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
.
addAnnotation
(
this
.
checkPersist
(
field
)).
addAnnotation
(
column
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
typeClass
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
typeClass
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -222,10 +222,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
.
addAnnotation
(
this
.
checkPersist
(
field
)).
addAnnotation
(
column
).
addAnnotation
(
temporal
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
Date
.
class
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
Date
.
class
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -249,10 +249,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
.
addAnnotation
(
this
.
checkPersist
(
field
)).
addAnnotation
(
column
).
addAnnotation
(
temporal
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
Date
.
class
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
Date
.
class
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -276,10 +276,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
.
addAnnotation
(
this
.
checkPersist
(
field
)).
addAnnotation
(
column
).
addAnnotation
(
temporal
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
Date
.
class
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
Date
.
class
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -365,10 +365,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
list_type
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
containerTable
).
addAnnotation
(
elementIndex
)
.
addAnnotation
(
persistentCollection
).
addAnnotation
(
orderColumn
).
addAnnotation
(
elementColumn
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
list_type
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
list_type
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -401,10 +401,10 @@ public class DynamicEntityBuilder {
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
String
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
lob
).
addAnnotation
(
basic
).
addAnnotation
(
column
)
.
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
String
.
class
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
String
.
class
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
@@ -467,9 +467,9 @@ public class DynamicEntityBuilder {
.
addAnnotation
(
keyColumn
).
addAnnotation
(
elementColumn
).
addAnnotation
(
elementIndex
)
.
addAnnotation
(
keyIndex
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
StringTools
.
getMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
map_type
).
addStatement
(
"return this."
+
field
.
getName
()).
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitaliz
e
(
field
.
getName
()))
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
StringTools
.
setMethodNam
e
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
map_type
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/StringTools.java
浏览文件 @
2e903dbd
package
com.x.base.core.project.tools
;
import
static
java
.
util
.
Locale
.
ENGLISH
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStreamReader
;
import
java.lang.reflect.Field
;
...
...
@@ -29,6 +31,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.commons.lang3.reflect.FieldUtils
;
import
org.slf4j.helpers.MessageFormatter
;
import
com.alibaba.druid.sql.visitor.functions.Char
;
public
class
StringTools
{
// 脚本文本
...
...
@@ -365,28 +369,6 @@ public class StringTools {
public
static
boolean
matchWildcard
(
String
str
,
String
pattern
)
{
return
Objects
.
toString
(
str
,
""
).
matches
(
Objects
.
toString
(
pattern
,
""
).
replace
(
"?"
,
".?"
).
replace
(
"*"
,
".*?"
));
// if (StringUtils.isNotEmpty(str) && StringUtils.isNotEmpty(pattern) &&
// StringUtils.contains(pattern, "*")) {
// if (StringUtils.equals(pattern, "*")) {
// return true;
// }
// if (StringUtils.startsWith(pattern, "*")) {
// return StringUtils.endsWith(str, StringUtils.substringAfter(pattern, "*"));
// }
// if (StringUtils.endsWith(pattern, "*")) {
// return StringUtils.startsWith(str, StringUtils.substringBeforeLast(pattern,
// "*"));
// }
// String[] parts = StringUtils.split(pattern, "*", 2);
// if (StringUtils.startsWith(str, parts[0]) && StringUtils.endsWith(str,
// parts[1])) {
// return true;
// } else {
// return false;
// }
// } else {
// return StringUtils.equals(str, pattern);
// }
}
public
static
List
<
String
>
includesExcludesWithWildcard
(
List
<
String
>
list
,
Collection
<
String
>
includes
,
...
...
@@ -544,4 +526,26 @@ public class StringTools {
return
result
.
toArray
(
new
String
[
result
.
size
()]);
}
public
static
String
getMethodName
(
String
name
)
{
return
methodName
(
"get"
,
name
);
}
public
static
String
setMethodName
(
String
name
)
{
return
methodName
(
"set"
,
name
);
}
private
static
String
methodName
(
String
getOrSet
,
String
name
)
{
if
(
StringUtils
.
isEmpty
(
name
)
||
StringUtils
.
isEmpty
(
getOrSet
))
{
return
name
;
}
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getOrSet
);
if
((
name
.
length
()
>
1
)
&&
(
StringUtils
.
isAllLowerCase
(
name
.
substring
(
0
,
1
))
&&
StringUtils
.
isAllUpperCase
(
name
.
substring
(
1
,
2
))))
{
sb
.
append
(
name
);
}
else
{
sb
.
append
(
StringUtils
.
capitalize
(
name
));
}
return
sb
.
toString
();
}
}
\ No newline at end of file
o2server/x_console/src/main/java/com/x/server/console/action/HttpStatus.java
浏览文件 @
2e903dbd
...
...
@@ -38,7 +38,7 @@ public class HttpStatus extends Thread {
bean
.
getDaemonThreadCount
(),
deadLockedCount
));
if
(
BooleanUtils
.
isTrue
(
Servers
.
centerServerIsRunning
()))
{
String
file
=
"centerServer_"
+
DateTools
.
compact
(
new
Date
())
+
".txt"
;
list
.
add
(
String
.
format
(
" +++ center server thread pool size:%d, idle:%d, detail:%
d
."
,
list
.
add
(
String
.
format
(
" +++ center server thread pool size:%d, idle:%d, detail:%
s
."
,
Servers
.
centerServer
.
getThreadPool
().
getThreads
(),
Servers
.
centerServer
.
getThreadPool
().
getIdleThreads
(),
file
));
try
(
FileOutputStream
stream
=
new
FileOutputStream
(
new
File
(
Config
.
dir_logs
(
true
),
file
));
...
...
@@ -48,7 +48,7 @@ public class HttpStatus extends Thread {
}
if
(
BooleanUtils
.
isTrue
(
Servers
.
applicationServerIsRunning
()))
{
String
file
=
"applicationServer_"
+
DateTools
.
compact
(
new
Date
())
+
".txt"
;
list
.
add
(
String
.
format
(
" +++ application server thread pool size:%d, idle:%d, detail:%
d
."
,
list
.
add
(
String
.
format
(
" +++ application server thread pool size:%d, idle:%d, detail:%
s
."
,
Servers
.
applicationServer
.
getThreadPool
().
getThreads
(),
Servers
.
applicationServer
.
getThreadPool
().
getIdleThreads
(),
file
));
try
(
FileOutputStream
stream
=
new
FileOutputStream
(
new
File
(
Config
.
dir_logs
(
true
),
file
));
...
...
@@ -58,7 +58,7 @@ public class HttpStatus extends Thread {
}
if
(
BooleanUtils
.
isTrue
(
Servers
.
webServerIsRunning
()))
{
String
file
=
"webServer_"
+
DateTools
.
compact
(
new
Date
())
+
".txt"
;
list
.
add
(
String
.
format
(
" +++ web server thread pool size:%d, idle:%d, detail:%
d
."
,
list
.
add
(
String
.
format
(
" +++ web server thread pool size:%d, idle:%d, detail:%
s
."
,
Servers
.
webServer
.
getThreadPool
().
getThreads
(),
Servers
.
webServer
.
getThreadPool
().
getIdleThreads
(),
file
));
try
(
FileOutputStream
stream
=
new
FileOutputStream
(
new
File
(
Config
.
dir_logs
(
true
),
file
));
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/ActionGetWorkOrWorkCompleted.java
浏览文件 @
2e903dbd
...
...
@@ -56,8 +56,10 @@ class ActionGetWorkOrWorkCompleted extends BaseAction {
if
(
null
!=
work
)
{
wo
=
this
.
work
(
business
,
effectivePerson
,
work
);
}
else
{
wo
=
this
.
workCompleted
(
business
,
effectivePerson
,
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
));
WorkCompleted
workCompleted
=
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
);
if
(
null
!=
workCompleted
)
{
wo
=
this
.
workCompleted
(
business
,
effectivePerson
,
workCompleted
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
浏览文件 @
2e903dbd
...
...
@@ -43,6 +43,7 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
CompletableFuture
<
Wo
>
_wo
=
CompletableFuture
.
supplyAsync
(()
->
{
...
...
@@ -52,10 +53,11 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
if
(
null
!=
work
)
{
wo
=
this
.
work
(
business
,
effectivePerson
,
work
);
}
else
{
wo
=
this
.
workCompleted
(
business
,
effectivePerson
,
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
));
WorkCompleted
workCompleted
=
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
);
if
(
null
!=
workCompleted
)
{
wo
=
this
.
workCompleted
(
business
,
effectivePerson
,
workCompleted
);
}
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录