Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
2ff63852
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
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,发现更多精彩内容 >>
提交
2ff63852
编写于
9月 29, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改logLevel为String,允许设置legLeve
上级
5a86ac4a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
145 addition
and
27 deletion
+145
-27
o2server/x_base_core_project/src/main/java/com/x/base/core/container/LogLevel.java
...ect/src/main/java/com/x/base/core/container/LogLevel.java
+0
-5
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DataServer.java
.../main/java/com/x/base/core/project/config/DataServer.java
+8
-10
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSource.java
...va/com/x/base/core/project/config/ExternalDataSource.java
+8
-7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSources.java
...a/com/x/base/core/project/config/ExternalDataSources.java
+8
-4
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Snap.java
.../java/com/x/processplatform/core/entity/content/Snap.java
+2
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeAbandoned.java
...rm/service/processing/jaxrs/snap/ActionTypeAbandoned.java
+100
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeSuspend.java
...form/service/processing/jaxrs/snap/ActionTypeSuspend.java
+1
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/SnapAction.java
...essplatform/service/processing/jaxrs/snap/SnapAction.java
+18
-0
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/container/LogLevel.java
已删除
100644 → 0
浏览文件 @
5a86ac4a
package
com.x.base.core.container
;
public
enum
LogLevel
{
FATAL
,
ERROR
,
WARN
,
INFO
,
TRACE
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DataServer.java
浏览文件 @
2ff63852
...
...
@@ -6,7 +6,6 @@ import java.util.List;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.LogLevel
;
import
com.x.base.core.project.annotation.FieldDescribe
;
public
class
DataServer
extends
ConfigObject
{
...
...
@@ -21,8 +20,7 @@ public class DataServer extends ConfigObject {
private
static
final
String
DEFAULT_STATFILTER
=
"mergeStat"
;
private
static
final
Integer
DEFAULT_SLOWSQLMILLIS
=
2000
;
private
static
final
Integer
DEFAULT_LOCKTIMEOUT
=
120000
;
private
static
final
String
DEFAULT_LOGLEVEL
=
"WARN"
;
public
static
DataServer
defaultInstance
()
{
return
new
DataServer
();
...
...
@@ -38,7 +36,7 @@ public class DataServer extends ConfigObject {
this
.
jmxEnable
=
DEFAULT_JMXENABLE
;
this
.
maxTotal
=
DEFAULT_MAXTOTAL
;
this
.
maxIdle
=
DEFAULT_MAXIDLE
;
this
.
logLevel
=
LogLevel
.
WARN
;
this
.
logLevel
=
DEFAULT_LOGLEVEL
;
this
.
statEnable
=
DEFAULT_STATENABLE
;
this
.
statFilter
=
DEFAULT_STATFILTER
;
this
.
slowSqlMillis
=
DEFAULT_SLOWSQLMILLIS
;
...
...
@@ -59,8 +57,8 @@ public class DataServer extends ConfigObject {
private
Boolean
jmxEnable
;
@FieldDescribe
(
"H2数据库缓存大小,设置H2用于作为缓存的内存大小,以M作为单位,这里默认为512M."
)
private
Integer
cacheSize
;
@FieldDescribe
(
"默认日志级别"
)
private
LogLevel
logLevel
=
LogLevel
.
WARN
;
@FieldDescribe
(
"默认日志级别
,FATAL, ERROR, WARN, INFO, TRACE. 完成的配置为DefaultLevel=WARN, Tool=TRACE, Enhance=TRACE, METADATA=TRACE, Runtime=TRACE, Query=TRACE, DataCache=TRACE, JDBC=TRACE, SQL=TRACE
"
)
private
String
logLevel
;
@FieldDescribe
(
"最大使用连接数"
)
private
Integer
maxTotal
;
@FieldDescribe
(
"最大空闲连接数"
)
...
...
@@ -73,13 +71,13 @@ public class DataServer extends ConfigObject {
private
Integer
slowSqlMillis
;
@FieldDescribe
(
"默认锁超时时间()毫秒)."
)
private
Integer
lockTimeout
;
public
Integer
getLockTimeout
()
{
return
(
null
==
this
.
lockTimeout
||
this
.
lockTimeout
<
1
)
?
DEFAULT_LOCKTIMEOUT
:
this
.
lockTimeout
;
}
public
LogLevel
getLogLevel
()
{
return
this
.
logLevel
==
null
?
LogLevel
.
WARN
:
this
.
logLevel
;
public
String
getLogLevel
()
{
return
StringUtils
.
isEmpty
(
this
.
logLevel
)
?
DEFAULT_LOGLEVEL
:
this
.
logLevel
;
}
public
Integer
getSlowSqlMillis
()
{
...
...
@@ -178,7 +176,7 @@ public class DataServer extends ConfigObject {
this
.
cacheSize
=
cacheSize
;
}
public
void
setLogLevel
(
LogLevel
logLevel
)
{
public
void
setLogLevel
(
String
logLevel
)
{
this
.
logLevel
=
logLevel
;
}
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSource.java
浏览文件 @
2ff63852
...
...
@@ -6,7 +6,6 @@ import java.util.List;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.LogLevel
;
import
com.x.base.core.container.factory.SlicePropertiesBuilder
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.tools.Crypto
;
...
...
@@ -27,7 +26,7 @@ public class ExternalDataSource extends ConfigObject {
this
.
dictionary
=
""
;
this
.
maxTotal
=
DEFAULT_MAXTOTAL
;
this
.
maxIdle
=
DEFAULT_MAXIDLE
;
this
.
logLevel
=
LogLevel
.
WARN
;
this
.
logLevel
=
DEFAULT_LOGLEVEL
;
this
.
statEnable
=
DEFAULT_STATENABLE
;
this
.
statFilter
=
DEFAULT_STATFILTER
;
this
.
slowSqlMillis
=
DEFAULT_SLOWSQLMILLIS
;
...
...
@@ -64,8 +63,8 @@ public class ExternalDataSource extends ConfigObject {
private
List
<
String
>
includes
;
@FieldDescribe
(
"在此节点上不存储的类,和includes一起设置实际存储的类,可以使用通配符*"
)
private
List
<
String
>
excludes
;
@FieldDescribe
(
"默认日志级别"
)
private
LogLevel
logLevel
=
LogLevel
.
WARN
;
@FieldDescribe
(
"默认日志级别
,FATAL, ERROR, WARN, INFO, TRACE. 完成的配置为DefaultLevel=WARN, Tool=TRACE, Enhance=TRACE, METADATA=TRACE, Runtime=TRACE, Query=TRACE, DataCache=TRACE, JDBC=TRACE, SQL=TRACE
"
)
private
String
logLevel
=
DEFAULT_LOGLEVEL
;
public
static
final
Integer
DEFAULT_MAXTOTAL
=
50
;
...
...
@@ -77,8 +76,10 @@ public class ExternalDataSource extends ConfigObject {
public
static
final
Integer
DEFAULT_SLOWSQLMILLIS
=
2000
;
public
LogLevel
getLogLevel
()
{
return
this
.
logLevel
==
null
?
LogLevel
.
WARN
:
this
.
logLevel
;
public
static
final
String
DEFAULT_LOGLEVEL
=
"WARN"
;
public
String
getLogLevel
()
{
return
StringUtils
.
isEmpty
(
this
.
logLevel
)
?
DEFAULT_LOGLEVEL
:
this
.
logLevel
;
}
public
String
getDriverClassName
()
throws
Exception
{
...
...
@@ -182,7 +183,7 @@ public class ExternalDataSource extends ConfigObject {
this
.
maxTotal
=
maxTotal
;
}
public
void
setLogLevel
(
LogLevel
logLevel
)
{
public
void
setLogLevel
(
String
logLevel
)
{
this
.
logLevel
=
logLevel
;
}
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSources.java
浏览文件 @
2ff63852
...
...
@@ -85,10 +85,14 @@ public class ExternalDataSources extends CopyOnWriteArrayList<ExternalDataSource
if
(
BooleanUtils
.
isTrue
(
o
.
getEnable
()))
{
String
n
=
"s"
+
(
""
+
(
1000
+
idx
)).
substring
(
1
);
if
(
StringUtils
.
equals
(
n
,
name
))
{
String
value
=
o
.
getLogLevel
().
toString
();
return
"DefaultLevel=WARN, Tool="
+
value
+
", Enhance="
+
value
+
", METADATA="
+
value
+
", Runtime="
+
value
+
", Query="
+
value
+
", DataCache="
+
value
+
", JDBC="
+
value
+
", SQL="
+
value
;
String
value
=
o
.
getLogLevel
();
if
(
StringUtils
.
contains
(
value
,
"="
))
{
return
value
;
}
else
{
return
"DefaultLevel=WARN, Tool="
+
value
+
", Enhance="
+
value
+
", METADATA="
+
value
+
", Runtime="
+
value
+
", Query="
+
value
+
", DataCache="
+
value
+
", JDBC="
+
value
+
", SQL="
+
value
;
}
}
}
}
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Snap.java
浏览文件 @
2ff63852
...
...
@@ -42,6 +42,8 @@ public class Snap extends SliceJpaObject {
public
static
final
String
TYPE_SUSPEND
=
"suspend"
;
public
static
final
String
TYPE_ABANDONED
=
"abandoned"
;
public
String
getId
()
{
return
id
;
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeAbandoned.java
0 → 100644
浏览文件 @
2ff63852
package
com.x.processplatform.service.processing.jaxrs.snap
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.config.Communicate.Clean
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.executor.ProcessPlatformExecutorFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.DocumentVersion
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.ReadCompleted
;
import
com.x.processplatform.core.entity.content.Record
;
import
com.x.processplatform.core.entity.content.Review
;
import
com.x.processplatform.core.entity.content.Snap
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.query.core.entity.Item
;
class
ActionTypeAbandoned
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionTypeAbandoned
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workId
)
throws
Exception
{
String
job
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Work
work
=
emc
.
fetch
(
workId
,
Work
.
class
,
ListTools
.
toList
(
Work
.
job_FIELDNAME
));
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
workId
,
Work
.
class
);
}
job
=
work
.
getJob
();
}
return
ProcessPlatformExecutorFactory
.
get
(
job
).
submit
(
new
CallableImpl
(
workId
)).
get
();
}
public
class
CallableImpl
implements
Callable
<
ActionResult
<
Wo
>>
{
private
String
id
;
public
CallableImpl
(
String
id
)
{
this
.
id
=
id
;
}
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Work
work
=
emc
.
find
(
id
,
Work
.
class
);
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Work
.
class
);
}
Snap
snap
=
new
Snap
(
work
);
List
<
Item
>
items
=
new
ArrayList
<>();
List
<
Work
>
works
=
new
ArrayList
<>();
List
<
Task
>
tasks
=
new
ArrayList
<>();
List
<
TaskCompleted
>
taskCompleteds
=
new
ArrayList
<>();
List
<
Read
>
reads
=
new
ArrayList
<>();
List
<
ReadCompleted
>
readCompleteds
=
new
ArrayList
<>();
List
<
Review
>
reviews
=
new
ArrayList
<>();
List
<
WorkLog
>
workLogs
=
new
ArrayList
<>();
List
<
Record
>
records
=
new
ArrayList
<>();
List
<
Attachment
>
attachments
=
new
ArrayList
<>();
List
<
DocumentVersion
>
documentVersions
=
new
ArrayList
<>();
snap
.
setProperties
(
snap
(
business
,
work
.
getJob
(),
items
,
works
,
tasks
,
taskCompleteds
,
reads
,
readCompleteds
,
reviews
,
workLogs
,
records
,
attachments
,
documentVersions
));
snap
.
setType
(
Snap
.
TYPE_ABANDONED
);
emc
.
beginTransaction
(
Snap
.
class
);
emc
.
persist
(
snap
,
CheckPersistType
.
all
);
emc
.
commit
();
clean
(
business
,
items
,
works
,
tasks
,
taskCompleteds
,
reads
,
readCompleteds
,
reviews
,
workLogs
,
records
,
attachments
,
documentVersions
);
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setId
(
snap
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
}
}
public
static
class
Wo
extends
WoId
{
private
static
final
long
serialVersionUID
=
-
2577413577740827608L
;
}
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeSuspend.java
浏览文件 @
2ff63852
...
...
@@ -76,7 +76,7 @@ class ActionTypeSuspend extends BaseAction {
List
<
DocumentVersion
>
documentVersions
=
new
ArrayList
<>();
snap
.
setProperties
(
snap
(
business
,
work
.
getJob
(),
items
,
works
,
tasks
,
taskCompleteds
,
reads
,
readCompleteds
,
reviews
,
workLogs
,
records
,
attachments
,
documentVersions
));
snap
.
setType
(
Snap
.
TYPE_S
NAP
);
snap
.
setType
(
Snap
.
TYPE_S
USPEND
);
emc
.
beginTransaction
(
Snap
.
class
);
emc
.
persist
(
snap
,
CheckPersistType
.
all
);
emc
.
commit
();
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/SnapAction.java
浏览文件 @
2ff63852
...
...
@@ -65,6 +65,24 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"废弃工作"
,
action
=
ActionTypeAbandoned
.
class
)
@GET
@Path
(
"work/{workId}/type/abandoned"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
typeAbandoned
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作标识"
)
@PathParam
(
"workId"
)
String
workId
)
{
ActionResult
<
ActionTypeAbandoned
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionTypeAbandoned
().
execute
(
effectivePerson
,
workId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"删除快照"
,
action
=
ActionDelete
.
class
)
@DELETE
@Path
(
"{id}"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录