Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
8c0db791
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,发现更多精彩内容 >>
提交
8c0db791
编写于
5月 27, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
task add task reset 添加 opinion和routeName
上级
bc52bc38
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
267 addition
and
38 deletion
+267
-38
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionEdit.java
...ocessplatform/assemble/surface/jaxrs/task/ActionEdit.java
+32
-14
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
...latform/assemble/surface/jaxrs/task/ActionProcessing.java
+1
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionProcessingTask.java
.../assemble/surface/jaxrs/task/ExceptionProcessingTask.java
+2
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionUpdateTask.java
...form/assemble/surface/jaxrs/task/ExceptionUpdateTask.java
+13
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java
...ocessplatform/assemble/surface/jaxrs/task/TaskAction.java
+3
-3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Add.java
.../x/processplatform/assemble/surface/jaxrs/task/V2Add.java
+32
-16
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
.../processplatform/assemble/surface/jaxrs/task/V2Reset.java
+18
-1
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2AddWi.java
...m/core/express/service/processing/jaxrs/task/V2AddWi.java
+35
-0
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2EditWi.java
.../core/express/service/processing/jaxrs/task/V2EditWi.java
+36
-0
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2ResetWi.java
...core/express/service/processing/jaxrs/task/V2ResetWi.java
+23
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/TaskAction.java
...essplatform/service/processing/jaxrs/task/TaskAction.java
+19
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Edit.java
...processplatform/service/processing/jaxrs/task/V2Edit.java
+53
-0
未找到文件。
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionEdit.java
浏览文件 @
8c0db791
package
com.x.processplatform.assemble.surface.jaxrs.task
;
import
org.apache.commons.lang3.StringUtils
;
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.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.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2EditWi
;
class
ActionEdit
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
Task
task
=
null
;
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
task
=
emc
.
find
(
id
,
Task
.
class
);
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
if
(
effectivePerson
.
isNotPerson
(
task
.
getPerson
())
&&
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
task
);
}
emc
.
beginTransaction
(
Task
.
class
);
task
.
setRouteName
(
wi
.
getRouteName
());
task
.
setOpinion
(
wi
.
getOpinion
());
emc
.
check
(
task
,
CheckPersistType
.
all
);
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setId
(
task
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
())
||
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
()))
{
updateTask
(
task
,
wi
.
getOpinion
(),
wi
.
getRouteName
());
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
wo
.
setId
(
id
);
result
.
setData
(
wo
);
return
result
;
}
private
void
updateTask
(
Task
task
,
String
opinion
,
String
routeName
)
throws
Exception
{
V2EditWi
req
=
new
V2EditWi
();
req
.
setOpinion
(
opinion
);
req
.
setRouteName
(
routeName
);
WoId
resp
=
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
()),
req
,
task
.
getJob
()).
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
ExceptionUpdateTask
(
task
.
getId
());
}
}
public
static
class
Wo
extends
WoId
{
private
static
final
long
serialVersionUID
=
8340104077391192781L
;
}
public
static
class
Wi
extends
Task
{
public
static
class
Wi
extends
V2EditWi
{
private
static
final
long
serialVersionUID
=
-
4726539076530209219L
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
浏览文件 @
8c0db791
...
...
@@ -282,7 +282,7 @@ class ActionProcessing extends BaseAction {
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
Exception
TaskProcessing
(
task
.
getId
());
throw
new
Exception
ProcessingTask
(
task
.
getId
());
}
else
{
/* 获得已办id */
return
resp
.
getId
();
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/Exception
TaskProcessing
.java
→
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/Exception
ProcessingTask
.java
浏览文件 @
8c0db791
...
...
@@ -2,11 +2,11 @@ package com.x.processplatform.assemble.surface.jaxrs.task;
import
com.x.base.core.project.exception.LanguagePromptException
;
class
Exception
TaskProcessing
extends
LanguagePromptException
{
class
Exception
ProcessingTask
extends
LanguagePromptException
{
private
static
final
long
serialVersionUID
=
3674258561301135294L
;
Exception
TaskProcessing
(
String
work
)
{
Exception
ProcessingTask
(
String
work
)
{
super
(
"记录处理失败, work: {}."
,
work
);
}
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionUpdateTask.java
0 → 100644
浏览文件 @
8c0db791
package
com.x.processplatform.assemble.surface.jaxrs.task
;
import
com.x.base.core.project.exception.LanguagePromptException
;
class
ExceptionUpdateTask
extends
LanguagePromptException
{
private
static
final
long
serialVersionUID
=
3674258561301135294L
;
ExceptionUpdateTask
(
String
task
)
{
super
(
"更新待办失败, task: {}."
,
task
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java
浏览文件 @
8c0db791
...
...
@@ -950,7 +950,7 @@ public class TaskAction extends StandardJaxrsAction {
@Path
(
"v2/{id}/reset/mockputtopost"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v
2ResetMockPutToPost
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
V
2ResetMockPutToPost
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Reset
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
...
...
@@ -1062,7 +1062,7 @@ public class TaskAction extends StandardJaxrsAction {
@Path
(
"v2/{id}/add"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v
2Add
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
V
2Add
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Add
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
...
...
@@ -1075,4 +1075,4 @@ public class TaskAction extends StandardJaxrsAction {
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/task/V2Add.java
浏览文件 @
8c0db791
...
...
@@ -17,7 +17,6 @@ import com.x.base.core.project.x_processplatform_service_processing;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
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
;
...
...
@@ -38,10 +37,11 @@ import com.x.processplatform.core.entity.content.WorkCompleted;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.ProcessingWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2AddWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2EditWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity
;
import
com.x.processplatform.core.express.service.processing.jaxrs.taskcompleted.WrapUpdateNextTaskIdentity
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi.Option
;
public
class
V2Add
extends
BaseAction
{
...
...
@@ -74,6 +74,11 @@ public class V2Add extends BaseAction {
if
(
BooleanUtils
.
isTrue
(
wi
.
getRemove
()))
{
taskCompletedId
=
this
.
processingTask
(
this
.
task
);
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
())
||
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
()))
{
updateTask
(
wi
.
getOpinion
(),
wi
.
getRouteName
());
}
this
.
processingWork
(
this
.
task
);
this
.
createRecord
(
task
,
workLog
);
if
(
StringUtils
.
isNotEmpty
(
taskCompletedId
))
{
...
...
@@ -83,6 +88,17 @@ public class V2Add extends BaseAction {
return
result
();
}
private
void
updateTask
(
String
opinion
,
String
routeName
)
throws
Exception
{
V2EditWi
req
=
new
V2EditWi
();
req
.
setOpinion
(
opinion
);
req
.
setRouteName
(
routeName
);
WoId
resp
=
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
()),
req
,
task
.
getJob
()).
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
ExceptionUpdateTask
(
task
.
getId
());
}
}
private
void
init
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
...
...
@@ -131,7 +147,7 @@ public class V2Add extends BaseAction {
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
Exception
TaskProcessing
(
task
.
getId
());
throw
new
Exception
ProcessingTask
(
task
.
getId
());
}
else
{
return
resp
.
getId
();
}
...
...
@@ -235,30 +251,30 @@ public class V2Add extends BaseAction {
return
result
;
}
public
static
class
Wi
extends
GsonPropertyObject
{
public
static
class
Wi
extends
V2AddWi
{
private
static
final
long
serialVersionUID
=
-
6251874269093504136L
;
@FieldDescribe
(
"
操作
"
)
private
List
<
Option
>
optionList
;
@FieldDescribe
(
"
路由名称
"
)
private
String
routeName
;
@FieldDescribe
(
"
是否删除指定待办身份
"
)
private
Boolean
remove
;
@FieldDescribe
(
"
意见
"
)
private
String
opinion
;
public
List
<
Option
>
getOptionList
()
{
return
optionList
;
public
String
getRouteName
()
{
return
routeName
;
}
public
void
set
OptionList
(
List
<
Option
>
optionList
)
{
this
.
optionList
=
optionList
;
public
void
set
RouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
Boolean
getRemove
()
{
return
remove
;
public
String
getOpinion
()
{
return
opinion
;
}
public
void
set
Remove
(
Boolean
remove
)
{
this
.
remove
=
remove
;
public
void
set
Opinion
(
String
opinion
)
{
this
.
opinion
=
opinion
;
}
}
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
浏览文件 @
8c0db791
...
...
@@ -39,6 +39,7 @@ import com.x.processplatform.core.entity.element.Manual;
import
com.x.processplatform.core.entity.element.ManualMode
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.ProcessingWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2EditWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2ResetWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi
;
...
...
@@ -78,10 +79,15 @@ public class V2Reset extends BaseAction {
if
(
BooleanUtils
.
isNotTrue
(
control
.
getAllowReset
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
this
.
task
);
}
}
this
.
reset
(
this
.
task
,
(!
wi
.
getKeep
()),
identities
,
manual
);
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
())
||
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
()))
{
updateTask
(
wi
.
getOpinion
(),
wi
.
getRouteName
());
}
if
(
BooleanUtils
.
isNotTrue
(
wi
.
getKeep
()))
{
this
.
processingTask
();
}
...
...
@@ -137,6 +143,17 @@ public class V2Reset extends BaseAction {
}
private
void
updateTask
(
String
opinion
,
String
routeName
)
throws
Exception
{
V2EditWi
req
=
new
V2EditWi
();
req
.
setOpinion
(
opinion
);
req
.
setRouteName
(
routeName
);
WoId
resp
=
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
()),
req
,
task
.
getJob
()).
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
ExceptionUpdateTask
(
task
.
getId
());
}
}
private
void
processingTask
()
throws
Exception
{
ProcessingWi
req
=
new
ProcessingWi
();
req
.
setProcessingType
(
TaskCompleted
.
PROCESSINGTYPE_RESET
);
...
...
@@ -145,7 +162,7 @@ public class V2Reset extends BaseAction {
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
Exception
TaskProcessing
(
task
.
getId
());
throw
new
Exception
ProcessingTask
(
task
.
getId
());
}
else
{
// 获得已办id
this
.
taskCompletedId
=
resp
.
getId
();
...
...
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2AddWi.java
0 → 100644
浏览文件 @
8c0db791
package
com.x.processplatform.core.express.service.processing.jaxrs.task
;
import
java.util.List
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi.Option
;
public
class
V2AddWi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8631082471633729236L
;
@FieldDescribe
(
"操作"
)
private
List
<
Option
>
optionList
;
@FieldDescribe
(
"是否删除指定待办身份"
)
private
Boolean
remove
;
public
List
<
Option
>
getOptionList
()
{
return
optionList
;
}
public
void
setOptionList
(
List
<
Option
>
optionList
)
{
this
.
optionList
=
optionList
;
}
public
Boolean
getRemove
()
{
return
remove
;
}
public
void
setRemove
(
Boolean
remove
)
{
this
.
remove
=
remove
;
}
}
\ No newline at end of file
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2EditWi.java
0 → 100644
浏览文件 @
8c0db791
package
com.x.processplatform.core.express.service.processing.jaxrs.task
;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
public
class
V2EditWi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8631082471633729236L
;
@FieldDescribe
(
"路由名称"
)
private
String
routeName
;
@FieldDescribe
(
"意见"
)
private
String
opinion
;
public
String
getRouteName
()
{
return
routeName
;
}
public
void
setRouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
String
getOpinion
()
{
return
opinion
;
}
public
void
setOpinion
(
String
opinion
)
{
this
.
opinion
=
opinion
;
}
}
\ No newline at end of file
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2ResetWi.java
浏览文件 @
8c0db791
...
...
@@ -10,6 +10,13 @@ import com.x.base.core.project.gson.GsonPropertyObject;
public
class
V2ResetWi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8631082471633729236L
;
@FieldDescribe
(
"路由名称"
)
private
String
routeName
;
@FieldDescribe
(
"意见"
)
private
String
opinion
;
@FieldDescribe
(
"保留自身待办."
)
private
Boolean
keep
;
...
...
@@ -33,4 +40,20 @@ public class V2ResetWi extends GsonPropertyObject {
this
.
keep
=
keep
;
}
public
String
getRouteName
()
{
return
routeName
;
}
public
void
setRouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
String
getOpinion
()
{
return
opinion
;
}
public
void
setOpinion
(
String
opinion
)
{
this
.
opinion
=
opinion
;
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/TaskAction.java
浏览文件 @
8c0db791
...
...
@@ -270,7 +270,7 @@ public class TaskAction extends StandardJaxrsAction {
@Path
(
"v2/{id}/remove"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
V
2Remove
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
v
2Remove
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
V2Remove
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
...
...
@@ -282,4 +282,22 @@ public class TaskAction extends StandardJaxrsAction {
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"更新待办中的办理意见以及路由决策."
,
action
=
V2Edit
.
class
)
@PUT
@Path
(
"{id}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v2Edit
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Edit
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2Edit
().
execute
(
effectivePerson
,
id
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
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/task/V2Edit.java
0 → 100644
浏览文件 @
8c0db791
package
com.x.processplatform.service.processing.jaxrs.task
;
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.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.core.entity.content.Task
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2EditWi
;
public
class
V2Edit
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
V2Edit
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
LOGGER
.
isDebugEnabled
())
{
LOGGER
.
debug
(
"execute:{}, id:{}."
,
effectivePerson:
:
getDistinguishedName
,
()
->
id
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
emc
.
beginTransaction
(
Task
.
class
);
task
.
setRouteName
(
wi
.
getRouteName
());
task
.
setOpinion
(
wi
.
getOpinion
());
emc
.
check
(
task
,
CheckPersistType
.
all
);
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setId
(
task
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
WoId
{
private
static
final
long
serialVersionUID
=
1363997520866820672L
;
}
public
static
class
Wi
extends
V2EditWi
{
private
static
final
long
serialVersionUID
=
-
4726539076530209219L
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录