Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
f7fbf874
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,发现更多精彩内容 >>
提交
f7fbf874
编写于
9月 03, 2021
作者:
O
o2null
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加已完成工作的snap功能
上级
0d2bafb9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
206 addition
and
16 deletion
+206
-16
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeSnapWorkCompleted.java
...emble/surface/jaxrs/snap/ActionTypeSnapWorkCompleted.java
+55
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java
...ocessplatform/assemble/surface/jaxrs/snap/SnapAction.java
+32
-14
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/ActionRestore.java
...platform/service/processing/jaxrs/snap/ActionRestore.java
+4
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeSnapWorkCompleted.java
...ce/processing/jaxrs/snap/ActionTypeSnapWorkCompleted.java
+95
-0
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_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/ActionTypeSnapWorkCompleted.java
0 → 100644
浏览文件 @
f7fbf874
package
com.x.processplatform.assemble.surface.jaxrs.snap
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_processplatform_service_processing
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
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.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
class
ActionTypeSnapWorkCompleted
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionTypeSnapWorkCompleted
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workCompletedId
)
throws
Exception
{
String
job
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
WorkCompleted
workCompleted
=
emc
.
find
(
workCompletedId
,
WorkCompleted
.
class
);
if
(
null
==
workCompleted
)
{
throw
new
ExceptionEntityNotExist
(
workCompletedId
,
WorkCompleted
.
class
);
}
if
(
BooleanUtils
.
isFalse
(
business
.
canManageApplicationOrProcess
(
effectivePerson
,
workCompleted
.
getApplication
(),
workCompleted
.
getProcess
())))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
workCompleted
);
}
job
=
workCompleted
.
getJob
();
}
Wo
wo
=
ThisApplication
.
context
().
applications
()
.
getQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"snap"
,
"workcompleted"
,
workCompletedId
,
"type"
,
"snapworkcompleted"
),
job
)
.
getData
(
Wo
.
class
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wo
extends
WoId
{
private
static
final
long
serialVersionUID
=
-
2577413577740827608L
;
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java
浏览文件 @
f7fbf874
...
...
@@ -37,7 +37,7 @@ public class SnapAction extends StandardJaxrsAction {
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
SnapAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"对工作进行快照"
,
action
=
ActionTypeSnap
.
class
)
@JaxrsMethodDescribe
(
value
=
"对工作进行快照
.
"
,
action
=
ActionTypeSnap
.
class
)
@GET
@Path
(
"work/{workId}/type/snap"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
@@ -55,7 +55,7 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"对工作进行快照,并标记为废弃"
,
action
=
ActionTypeAbandoned
.
class
)
@JaxrsMethodDescribe
(
value
=
"对工作进行快照,并标记为废弃
.
"
,
action
=
ActionTypeAbandoned
.
class
)
@GET
@Path
(
"work/{workId}/type/abandoned"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
@@ -73,18 +73,35 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"
对已完成工作进行快照,并标记为废弃"
,
action
=
ActionTypeAbandonedWorkComplete
d
.
class
)
@JaxrsMethodDescribe
(
value
=
"
挂起工作"
,
action
=
ActionTypeSuspen
d
.
class
)
@GET
@Path
(
"work
completed/{workCompletedId}/type/abandonedworkcomplete
d"
)
@Path
(
"work
/{workId}/type/suspen
d"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
typeAbandonedWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
typeSuspend
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作标识"
)
@PathParam
(
"workId"
)
String
workId
)
{
ActionResult
<
ActionTypeSuspend
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionTypeSuspend
().
execute
(
effectivePerson
,
workId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"对已完成工作进行快照."
,
action
=
ActionTypeSnapWorkCompleted
.
class
)
@GET
@Path
(
"workcompleted/{workCompletedId}/type/snapworkcompleted"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
typeSnapWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作标识"
)
@PathParam
(
"workCompletedId"
)
String
workCompletedId
)
{
ActionResult
<
ActionType
Abandoned
WorkCompleted
.
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
ActionType
Snap
WorkCompleted
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionType
Abandoned
WorkCompleted
().
execute
(
effectivePerson
,
workCompletedId
);
result
=
new
ActionType
Snap
WorkCompleted
().
execute
(
effectivePerson
,
workCompletedId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
...
...
@@ -92,17 +109,18 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"
挂起工作"
,
action
=
ActionTypeSuspen
d
.
class
)
@JaxrsMethodDescribe
(
value
=
"
对已完成工作进行快照,并标记为废弃."
,
action
=
ActionTypeAbandonedWorkComplete
d
.
class
)
@GET
@Path
(
"work
/{workId}/type/suspen
d"
)
@Path
(
"work
completed/{workCompletedId}/type/abandonedworkcomplete
d"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
typeSuspend
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作标识"
)
@PathParam
(
"workId"
)
String
workId
)
{
ActionResult
<
ActionTypeSuspend
.
Wo
>
result
=
new
ActionResult
<>();
public
void
typeAbandonedWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作标识"
)
@PathParam
(
"workCompletedId"
)
String
workCompletedId
)
{
ActionResult
<
ActionTypeAbandonedWorkCompleted
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionType
Suspend
().
execute
(
effectivePerson
,
work
Id
);
result
=
new
ActionType
AbandonedWorkCompleted
().
execute
(
effectivePerson
,
workCompleted
Id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Snap.java
浏览文件 @
f7fbf874
...
...
@@ -48,6 +48,8 @@ public class Snap extends SliceJpaObject {
public
static
final
String
TYPE_ABANDONEDWORKCOMPLETED
=
"abandonedWorkCompleted"
;
public
static
final
String
TYPE_SNAPWORKCOMPLETED
=
"snapWorkCompleted"
;
public
String
getId
()
{
return
id
;
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionRestore.java
浏览文件 @
f7fbf874
...
...
@@ -72,7 +72,8 @@ class ActionRestore extends BaseAction {
if
(
null
==
snap
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Snap
.
class
);
}
if
(
Objects
.
equals
(
Snap
.
TYPE_ABANDONEDWORKCOMPLETED
,
snap
.
getType
()))
{
if
(
Objects
.
equals
(
Snap
.
TYPE_ABANDONEDWORKCOMPLETED
,
snap
.
getType
())
||
Objects
.
equals
(
Snap
.
TYPE_SNAPWORKCOMPLETED
,
snap
.
getType
()))
{
CompletableFuture
.
allOf
(
deleteItem
(
business
,
snap
.
getJob
()),
deleteWorkCompleted
(
business
,
snap
.
getJob
()),
deleteTask
(
business
,
snap
.
getJob
()),
deleteTaskCompleted
(
business
,
snap
.
getJob
()),
deleteRead
(
business
,
snap
.
getJob
()),
...
...
@@ -89,7 +90,8 @@ class ActionRestore extends BaseAction {
deleteDocumentVersion
(
business
,
snap
.
getJob
())).
get
();
}
emc
.
commit
();
if
(
Objects
.
equals
(
Snap
.
TYPE_ABANDONEDWORKCOMPLETED
,
snap
.
getType
()))
{
if
(
Objects
.
equals
(
Snap
.
TYPE_ABANDONEDWORKCOMPLETED
,
snap
.
getType
())
||
Objects
.
equals
(
Snap
.
TYPE_SNAPWORKCOMPLETED
,
snap
.
getType
()))
{
restoreWorkCompleted
(
business
,
snap
);
}
else
{
restore
(
business
,
snap
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/snap/ActionTypeSnapWorkCompleted.java
0 → 100644
浏览文件 @
f7fbf874
package
com.x.processplatform.service.processing.jaxrs.snap
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
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.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.processplatform.core.entity.content.Attachment
;
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.TaskCompleted
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.query.core.entity.Item
;
class
ActionTypeSnapWorkCompleted
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionTypeSnapWorkCompleted
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workCompletedId
)
throws
Exception
{
String
job
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
WorkCompleted
workCompleted
=
emc
.
find
(
workCompletedId
,
WorkCompleted
.
class
);
if
(
null
==
workCompleted
)
{
throw
new
ExceptionEntityNotExist
(
workCompletedId
,
WorkCompleted
.
class
);
}
job
=
workCompleted
.
getJob
();
}
return
ProcessPlatformExecutorFactory
.
get
(
job
).
submit
(
new
CallableImpl
(
workCompletedId
)).
get
(
300
,
TimeUnit
.
SECONDS
);
}
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
);
WorkCompleted
workCompleted
=
emc
.
find
(
id
,
WorkCompleted
.
class
);
if
(
null
==
workCompleted
)
{
throw
new
ExceptionEntityNotExist
(
id
,
WorkCompleted
.
class
);
}
Snap
snap
=
new
Snap
(
workCompleted
);
List
<
Item
>
items
=
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
<>();
snap
.
setProperties
(
snap
(
business
,
workCompleted
.
getJob
(),
items
,
workCompleted
,
taskCompleteds
,
reads
,
readCompleteds
,
reviews
,
workLogs
,
records
,
attachments
));
snap
.
setType
(
Snap
.
TYPE_SNAPWORKCOMPLETED
);
emc
.
beginTransaction
(
Snap
.
class
);
emc
.
persist
(
snap
,
CheckPersistType
.
all
);
emc
.
commit
();
// clean(business, items, workCompleted, taskCompleteds, reads, readCompleteds, reviews, workLogs, records,
// attachments);
// 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/SnapAction.java
浏览文件 @
f7fbf874
...
...
@@ -104,6 +104,24 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"对已完成工作进行快照"
,
action
=
ActionTypeSnapWorkCompleted
.
class
)
@GET
@Path
(
"workcompleted/{workCompletedId}/type/snapworkcompleted"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
typeSnapWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"已完成工作标识"
)
@PathParam
(
"workCompletedId"
)
String
workCompletedId
)
{
ActionResult
<
ActionTypeSnapWorkCompleted
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionTypeSnapWorkCompleted
().
execute
(
effectivePerson
,
workCompletedId
);
}
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录