Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
86fec6a3
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,发现更多精彩内容 >>
提交
86fec6a3
编写于
11月 19, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
管理员维护接口修改
上级
718c4f65
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
199 addition
and
30 deletion
+199
-30
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionManageReset.java
...atform/assemble/surface/jaxrs/read/ActionManageReset.java
+4
-4
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
...ocessplatform/assemble/surface/jaxrs/read/ReadAction.java
+3
-3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java
...mble/surface/jaxrs/readcompleted/ReadCompletedAction.java
+3
-22
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ActionReset.java
...ssplatform/service/processing/jaxrs/read/ActionReset.java
+158
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ExceptionResetEmpty.java
...rm/service/processing/jaxrs/read/ExceptionResetEmpty.java
+12
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ReadAction.java
...essplatform/service/processing/jaxrs/read/ReadAction.java
+19
-1
未找到文件。
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionManageReset.java
浏览文件 @
86fec6a3
...
@@ -41,18 +41,18 @@ class ActionManageReset extends BaseAction {
...
@@ -41,18 +41,18 @@ class ActionManageReset extends BaseAction {
if
(
BooleanUtils
.
isNotTrue
(
control
.
getAllowReadReset
()))
{
if
(
BooleanUtils
.
isNotTrue
(
control
.
getAllowReadReset
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
}
List
<
String
>
identites
=
business
.
organization
().
identity
().
list
(
wi
.
getIdentityList
());
List
<
String
>
identit
i
es
=
business
.
organization
().
identity
().
list
(
wi
.
getIdentityList
());
if
(
identites
.
isEmpty
())
{
if
(
identit
i
es
.
isEmpty
())
{
throw
new
ExceptionEmptyIdentity
();
throw
new
ExceptionEmptyIdentity
();
}
}
wi
.
setIdentityList
(
identites
);
wi
.
setIdentityList
(
identit
i
es
);
emc
.
beginTransaction
(
Read
.
class
);
emc
.
beginTransaction
(
Read
.
class
);
if
(!
StringUtils
.
isEmpty
(
wi
.
getOpinion
()))
{
if
(!
StringUtils
.
isEmpty
(
wi
.
getOpinion
()))
{
read
.
setOpinion
(
wi
.
getOpinion
());
read
.
setOpinion
(
wi
.
getOpinion
());
}
}
emc
.
commit
();
emc
.
commit
();
}
}
ThisApplication
.
context
().
applications
().
p
u
tQuery
(
x_processplatform_service_processing
.
class
,
ThisApplication
.
context
().
applications
().
p
os
tQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"read"
,
read
.
getId
(),
"reset"
),
wi
,
read
.
getJob
());
Applications
.
joinQueryUri
(
"read"
,
read
.
getId
(),
"reset"
),
wi
,
read
.
getJob
());
wo
.
setId
(
read
.
getId
());
wo
.
setId
(
read
.
getId
());
result
.
setData
(
wo
);
result
.
setData
(
wo
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
浏览文件 @
86fec6a3
...
@@ -540,7 +540,7 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -540,7 +540,7 @@ public class ReadAction extends StandardJaxrsAction {
@Path
(
"{id}/reset/manage"
)
@Path
(
"{id}/reset/manage"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageRead
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
manageRe
setRe
ad
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"待阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
@JaxrsParameterDescribe
(
"待阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionManageReset
.
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
ActionManageReset
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
...
@@ -558,7 +558,7 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -558,7 +558,7 @@ public class ReadAction extends StandardJaxrsAction {
@Path
(
"{id}/reset/manage/mockputtopost"
)
@Path
(
"{id}/reset/manage/mockputtopost"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageReadMockPutToPost
(
@Suspended
final
AsyncResponse
asyncResponse
,
public
void
manageRe
setRe
adMockPutToPost
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"待阅标识"
)
@PathParam
(
"id"
)
String
id
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"待阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
JsonElement
jsonElement
)
{
ActionResult
<
ActionManageReset
.
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
ActionManageReset
.
Wo
>
result
=
new
ActionResult
<>();
...
@@ -851,4 +851,4 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -851,4 +851,4 @@ public class ReadAction extends StandardJaxrsAction {
}
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ReadCompletedAction.java
浏览文件 @
86fec6a3
...
@@ -408,11 +408,11 @@ public class ReadCompletedAction extends StandardJaxrsAction {
...
@@ -408,11 +408,11 @@ public class ReadCompletedAction extends StandardJaxrsAction {
}
}
@JaxrsMethodDescribe
(
value
=
"管理修改意见."
,
action
=
ActionManageOpinion
.
class
)
@JaxrsMethodDescribe
(
value
=
"管理修改意见."
,
action
=
ActionManageOpinion
.
class
)
@P
U
T
@P
OS
T
@Path
(
"{id}/opinion/manage"
)
@Path
(
"{id}/opinion/manage"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manage
Dele
te
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
manage
Upda
te
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"已阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
@JaxrsParameterDescribe
(
"已阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionManageOpinion
.
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
ActionManageOpinion
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
...
@@ -425,25 +425,6 @@ public class ReadCompletedAction extends StandardJaxrsAction {
...
@@ -425,25 +425,6 @@ public class ReadCompletedAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
@JaxrsMethodDescribe
(
value
=
"Mock Post To Put."
,
action
=
ActionManageOpinion
.
class
)
@POST
@Path
(
"{id}/opinion/manage/mockputtopost"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageDeleteMockPutToPost
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"已阅标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionManageOpinion
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionManageOpinion
().
execute
(
effectivePerson
,
id
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"列示当前用户的已阅,分页."
,
action
=
ActionListMyPaging
.
class
)
@JaxrsMethodDescribe
(
value
=
"列示当前用户的已阅,分页."
,
action
=
ActionListMyPaging
.
class
)
@GET
@GET
@Path
(
"list/my/paging/{page}/size/{size}"
)
@Path
(
"list/my/paging/{page}/size/{size}"
)
...
@@ -668,4 +649,4 @@ public class ReadCompletedAction extends StandardJaxrsAction {
...
@@ -668,4 +649,4 @@ public class ReadCompletedAction extends StandardJaxrsAction {
}
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ActionReset.java
0 → 100644
浏览文件 @
86fec6a3
package
com.x.processplatform.service.processing.jaxrs.read
;
import
com.google.gson.JsonElement
;
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.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.executor.ProcessPlatformExecutorFactory
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
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.*
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.MessageFactory
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
class
ActionReset
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionReset
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
logger
.
debug
(
effectivePerson
.
getDistinguishedName
());
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
final
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
String
executorSeed
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Read
read
=
emc
.
fetch
(
id
,
Read
.
class
,
ListTools
.
toList
(
Read
.
job_FIELDNAME
));
if
(
null
==
read
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Read
.
class
);
}
executorSeed
=
read
.
getJob
();
}
Callable
<
String
>
callable
=
()
->
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Read
read
=
emc
.
find
(
id
,
Read
.
class
);
if
(
null
==
read
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Read
.
class
);
}
List
<
String
>
identities
=
ListTools
.
trim
(
business
.
organization
().
identity
().
list
(
wi
.
getIdentityList
()),
true
,
true
);
boolean
flag
=
false
;
if
(
identities
.
contains
(
read
.
getIdentity
())){
flag
=
true
;
identities
.
remove
(
read
.
getIdentity
());
}
if
(
identities
.
isEmpty
())
{
throw
new
ExceptionResetEmpty
();
}
Date
now
=
new
Date
();
List
<
Read
>
readList
=
new
ArrayList
<>();
assembleRead
(
identities
,
readList
,
read
,
business
,
now
);
emc
.
beginTransaction
(
Read
.
class
);
emc
.
beginTransaction
(
ReadCompleted
.
class
);
for
(
Read
resetRead
:
readList
){
emc
.
persist
(
resetRead
,
CheckPersistType
.
all
);
}
if
(
flag
)
{
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
()))
{
read
.
setOpinion
(
wi
.
getOpinion
());
}
emc
.
commit
();
}
else
{
Long
duration
=
Config
.
workTime
().
betweenMinutes
(
read
.
getStartTime
(),
now
);
ReadCompleted
readCompleted
=
new
ReadCompleted
(
read
,
now
,
duration
);
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
()))
{
readCompleted
.
setOpinion
(
wi
.
getOpinion
());
}
emc
.
persist
(
readCompleted
,
CheckPersistType
.
all
);
emc
.
remove
(
read
,
CheckRemoveType
.
all
);
emc
.
commit
();
MessageFactory
.
readCompleted_create
(
readCompleted
);
MessageFactory
.
read_to_readCompleted
(
readCompleted
);
}
for
(
Read
resetRead
:
readList
){
MessageFactory
.
read_create
(
resetRead
);
}
wo
.
setId
(
read
.
getId
());
result
.
setData
(
wo
);
}
return
""
;
};
ProcessPlatformExecutorFactory
.
get
(
executorSeed
).
submit
(
callable
).
get
(
300
,
TimeUnit
.
SECONDS
);
return
result
;
}
private
void
assembleRead
(
List
<
String
>
identities
,
List
<
Read
>
readList
,
Read
read
,
Business
business
,
Date
date
)
throws
Exception
{
for
(
String
identity
:
identities
){
String
person
=
business
.
organization
().
person
().
getWithIdentity
(
identity
);
String
unit
=
business
.
organization
().
unit
().
getWithIdentity
(
identity
);
if
(
StringUtils
.
isNotBlank
(
person
))
{
Read
resetRead
=
new
Read
();
read
.
copyTo
(
resetRead
,
Read
.
FieldsUnmodify
);
resetRead
.
setIdentity
(
identity
);
resetRead
.
setPerson
(
person
);
resetRead
.
setUnit
(
unit
);
resetRead
.
setCreatorPerson
(
read
.
getPerson
());
resetRead
.
setCreatorIdentity
(
read
.
getIdentity
());
resetRead
.
setCreatorUnit
(
read
.
getUnit
());
resetRead
.
setStartTime
(
date
);
resetRead
.
setViewed
(
false
);
readList
.
add
(
resetRead
);
}
}
}
private
List
<
ReadCompleted
>
listExist
(
Business
business
,
Read
read
)
throws
Exception
{
return
business
.
entityManagerContainer
().
listEqualAndEqual
(
ReadCompleted
.
class
,
ReadCompleted
.
job_FIELDNAME
,
read
.
getJob
(),
ReadCompleted
.
person_FIELDNAME
,
read
.
getPerson
());
}
public
static
class
CallWrap
{
String
job
;
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"身份"
)
private
List
<
String
>
identityList
;
@FieldDescribe
(
"待阅意见"
)
private
String
opinion
;
public
List
<
String
>
getIdentityList
()
{
return
identityList
;
}
public
void
setIdentityList
(
List
<
String
>
identityList
)
{
this
.
identityList
=
identityList
;
}
public
String
getOpinion
()
{
return
opinion
;
}
public
void
setOpinion
(
String
opinion
)
{
this
.
opinion
=
opinion
;
}
}
public
static
class
Wo
extends
WoId
{
}
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ExceptionResetEmpty.java
0 → 100644
浏览文件 @
86fec6a3
package
com.x.processplatform.service.processing.jaxrs.read
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionResetEmpty
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3439770681867963457L
;
ExceptionResetEmpty
()
{
super
(
"重置处理人为空."
);
}
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/read/ReadAction.java
浏览文件 @
86fec6a3
...
@@ -106,4 +106,22 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -106,4 +106,22 @@ public class ReadAction extends StandardJaxrsAction {
}
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
}
\ No newline at end of file
@JaxrsMethodDescribe
(
value
=
"重置处理人."
,
action
=
ActionReset
.
class
)
@POST
@Path
(
"{id}/reset"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
reset
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionReset
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionReset
().
execute
(
effectivePerson
,
id
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录