Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
f1d0316c
o2oa
项目概览
weixin_42566577
/
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,发现更多精彩内容 >>
提交
f1d0316c
编写于
5月 14, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add surface
上级
aaf6f4f7
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
416 addition
and
263 deletion
+416
-263
o2server/x_base_core_project/src/main/java/com/x/base/core/project/processplatform/ManualTaskIdentityMatrix.java
...ore/project/processplatform/ManualTaskIdentityMatrix.java
+1
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/TestClient.java
...in/java/com/x/base/core/project/scripting/TestClient.java
+18
-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
+37
-0
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
+261
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Extend.java
...processplatform/assemble/surface/jaxrs/task/V2Extend.java
+50
-48
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java
...ava/com/x/processplatform/core/entity/content/Record.java
+4
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/TaskCompleted.java
.../x/processplatform/core/entity/content/TaskCompleted.java
+3
-3
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/ProcessingAttributes.java
.../x/processplatform/core/express/ProcessingAttributes.java
+5
-10
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2AddBeforeWi.java
.../express/service/processing/jaxrs/task/V2AddBeforeWi.java
+0
-46
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
+15
-2
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2ExtendWi.java
...ore/express/service/processing/jaxrs/task/V2ExtendWi.java
+5
-3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/TaskAction.java
...essplatform/service/processing/jaxrs/task/TaskAction.java
+5
-23
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Add.java
.../processplatform/service/processing/jaxrs/task/V2Add.java
+11
-9
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2AddBefore.java
...ssplatform/service/processing/jaxrs/task/V2AddBefore.java
+0
-116
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Extend.java
...ocessplatform/service/processing/jaxrs/task/V2Extend.java
+1
-1
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/processplatform/ManualTaskIdentityMatrix.java
浏览文件 @
f1d0316c
...
...
@@ -49,7 +49,7 @@ public class ManualTaskIdentityMatrix extends GsonPropertyObject {
public
ManualTaskIdentityMatrix
extend
(
String
identity
,
boolean
replace
,
List
<
String
>
list
)
{
for
(
Row
row
:
matrix
)
{
int
idx
=
row
.
indexOf
(
identity
);
if
(
idx
>
0
)
{
if
(
idx
>
-
1
)
{
row
.
addAll
(
idx
+
1
,
list
);
if
(
replace
)
{
row
.
remove
(
idx
);
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/TestClient.java
0 → 100644
浏览文件 @
f1d0316c
package
com.x.base.core.project.scripting
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptException
;
public
class
TestClient
{
public
static
void
main
(
String
[]
args
)
throws
ScriptException
{
ScriptEngine
engine
=
ScriptingFactory
.
newScriptEngine
();
Object
so
=
engine
.
eval
(
"'aaaa';"
);
Object
ao
=
engine
.
eval
(
"[];"
);
Object
oo
=
engine
.
eval
(
"{};"
);
System
.
out
.
println
(
so
.
getClass
()
+
":"
+
so
.
toString
());
System
.
out
.
println
(
ao
.
getClass
()
+
":"
+
ao
.
toString
());
System
.
out
.
println
(
oo
.
getClass
()
+
":"
+
oo
.
toString
());
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java
浏览文件 @
f1d0316c
...
...
@@ -1055,4 +1055,41 @@ public class TaskAction extends StandardJaxrsAction {
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"V2_在指定待办位置扩充处理人."
,
action
=
V2Extend
.
class
)
@POST
@Path
(
"v2/extend"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v2Extend
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Extend
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2Extend
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"V2_在指定待办位置新增处理人."
,
action
=
V2Add
.
class
)
@POST
@Path
(
"v2/add"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v2Add
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Add
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2Add
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Add.java
0 → 100644
浏览文件 @
f1d0316c
package
com.x.processplatform.assemble.surface.jaxrs.task
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
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.JpaObject
;
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.jaxrs.WrapBoolean
;
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.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.assemble.surface.WorkControl
;
import
com.x.processplatform.core.entity.content.Record
;
import
com.x.processplatform.core.entity.content.RecordProperties.NextManual
;
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.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.V2AddWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapProcessing
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity
;
import
com.x.processplatform.core.express.service.processing.jaxrs.taskcompleted.WrapUpdateNextTaskIdentity
;
public
class
V2Add
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
V2Add
.
class
);
// 当前提交的串号
private
final
String
series
=
StringTools
.
uniqueToken
();
// 新加入的身份列表
private
List
<
String
>
identites
=
new
ArrayList
<>();
// 新创建的待办标识列表
private
List
<
String
>
newTasks
=
new
ArrayList
<>();
// 当前待办转成已办得到的已办id
private
String
taskCompletedId
;
// 已经存在的待办标识列表
private
List
<
String
>
existTaskIds
=
new
ArrayList
<>();
// 输入
private
Wi
wi
;
// 当前执行用户
private
EffectivePerson
effectivePerson
;
// 根据输入得到的待办
private
Task
task
=
null
;
// 当前待办的workLog
private
WorkLog
workLog
=
null
;
// 本环节创建的record
private
Record
concreteRecord
=
null
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
LOGGER
.
isDebugEnabled
())
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
}
this
.
init
(
effectivePerson
,
jsonElement
);
this
.
add
(
this
.
task
,
wi
.
getAfter
(),
wi
.
getReplace
(),
identites
);
if
(
BooleanUtils
.
isTrue
(
wi
.
getReplace
()))
{
taskCompletedId
=
this
.
processingTask
(
this
.
task
);
}
this
.
processingWork
(
this
.
task
);
this
.
createRecord
(
task
,
workLog
);
if
(
StringUtils
.
isNotEmpty
(
taskCompletedId
))
{
this
.
updateTaskCompleted
();
}
this
.
updateTask
();
return
result
();
}
private
void
init
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
this
.
effectivePerson
=
effectivePerson
;
this
.
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
this
.
task
=
emc
.
find
(
wi
.
getTask
(),
Task
.
class
);
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
wi
.
getTask
(),
Task
.
class
);
}
if
(
emc
.
countEqual
(
Work
.
class
,
JpaObject
.
id_FIELDNAME
,
task
.
getWork
())
<
1
)
{
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
this
.
workLog
=
emc
.
firstEqualAndEqual
(
WorkLog
.
class
,
WorkLog
.
job_FIELDNAME
,
task
.
getJob
(),
WorkLog
.
fromActivityToken_FIELDNAME
,
task
.
getActivityToken
());
if
(
null
==
workLog
)
{
throw
new
ExceptionEntityNotExist
(
WorkLog
.
class
);
}
WoControl
control
=
business
.
getControl
(
effectivePerson
,
task
,
WoControl
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
control
.
getAllowReset
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
task
);
}
this
.
existTaskIds
=
emc
.
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
activityToken_FIELDNAME
,
task
.
getActivityToken
());
this
.
identites
=
business
.
organization
().
identity
().
list
(
wi
.
getIdentityList
());
// 在新扩充待办人员中去除已经有待办人员
identites
.
remove
(
task
.
getIdentity
());
if
(
ListTools
.
isEmpty
(
identites
))
{
throw
new
ExceptionIdentityEmpty
();
}
}
}
private
void
add
(
Task
task
,
Boolean
after
,
Boolean
replace
,
List
<
String
>
identites
)
throws
Exception
{
V2AddWi
req
=
new
V2AddWi
();
req
.
setTask
(
task
.
getId
());
req
.
setAfter
(
after
);
req
.
setReplace
(
replace
);
req
.
setIdentityList
(
identites
);
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
"v2"
,
"add"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
resp
.
getValue
()))
{
throw
new
ExceptionExtend
(
task
.
getId
());
}
}
private
String
processingTask
(
Task
task
)
throws
Exception
{
WrapProcessing
req
=
new
WrapProcessing
();
req
.
setProcessingType
(
TaskCompleted
.
PROCESSINGTYPE_EXTEND
);
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
ExceptionTaskProcessing
(
task
.
getId
());
}
else
{
return
resp
.
getId
();
}
}
private
void
processingWork
(
Task
task
)
throws
Exception
{
ProcessingAttributes
req
=
new
ProcessingAttributes
();
req
.
setType
(
ProcessingAttributes
.
TYPE_TASKEXTEND
);
req
.
setSeries
(
this
.
series
);
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
task
.
getWork
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isEmpty
(
resp
.
getId
()))
{
throw
new
ExceptionWorkProcessing
(
task
.
getWork
());
}
}
private
void
createRecord
(
Task
task
,
WorkLog
workLog
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
concreteRecord
=
new
Record
(
workLog
,
task
);
// 校验workCompleted,如果存在,那么说明工作已经完成,标识状态为已经完成.
WorkCompleted
workCompleted
=
emc
.
firstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
task
.
getJob
());
if
(
null
!=
workCompleted
)
{
concreteRecord
.
setCompleted
(
true
);
concreteRecord
.
setWorkCompleted
(
workCompleted
.
getId
());
}
concreteRecord
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
concreteRecord
.
setType
(
Record
.
TYPE_TASKEXTEND
);
recordAdjust
(
business
,
task
,
concreteRecord
);
}
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"record"
,
"job"
,
task
.
getJob
()),
concreteRecord
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionExtend
(
task
.
getId
());
}
}
private
void
recordAdjust
(
Business
business
,
Task
task
,
Record
concreteRecord
)
throws
Exception
{
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>();
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
activity_FIELDNAME
,
task
.
getActivity
());
ids
=
ListUtils
.
subtract
(
ids
,
existTaskIds
);
List
<
Task
>
list
=
business
.
entityManagerContainer
().
fetch
(
ids
,
Task
.
class
,
ListTools
.
toList
(
Task
.
identity_FIELDNAME
,
Task
.
job_FIELDNAME
,
Task
.
work_FIELDNAME
,
Task
.
activity_FIELDNAME
,
Task
.
activityAlias_FIELDNAME
,
Task
.
activityName_FIELDNAME
,
Task
.
activityToken_FIELDNAME
,
Task
.
activityType_FIELDNAME
,
Task
.
identity_FIELDNAME
));
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActivity
,
Collectors
.
toList
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
Task
next
=
o
.
getValue
().
get
(
0
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
next
.
getActivity
());
nextManual
.
setActivityAlias
(
next
.
getActivityAlias
());
nextManual
.
setActivityName
(
next
.
getActivityName
());
nextManual
.
setActivityToken
(
next
.
getActivityToken
());
nextManual
.
setActivityType
(
next
.
getActivityType
());
for
(
Task
t
:
o
.
getValue
())
{
nextManual
.
getTaskIdentityList
().
add
(
t
.
getIdentity
());
nextTaskIdentities
.
add
(
t
.
getIdentity
());
}
concreteRecord
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
});
// 去重
concreteRecord
.
getProperties
().
setNextManualTaskIdentityList
(
ListTools
.
trim
(
nextTaskIdentities
,
true
,
true
));
}
private
void
updateTaskCompleted
()
throws
Exception
{
/* 记录下一处理人信息 */
WrapUpdateNextTaskIdentity
req
=
new
WrapUpdateNextTaskIdentity
();
req
.
getTaskCompletedList
().
add
(
this
.
taskCompletedId
);
req
.
setNextTaskIdentityList
(
concreteRecord
.
getProperties
().
getNextManualTaskIdentityList
());
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"taskcompleted"
,
"next"
,
"task"
,
"identity"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
}
private
void
updateTask
()
throws
Exception
{
/* 记录上一处理人信息 */
if
(
ListTools
.
isNotEmpty
(
newTasks
))
{
WrapUpdatePrevTaskIdentity
req
=
new
WrapUpdatePrevTaskIdentity
();
req
.
setTaskList
(
newTasks
);
req
.
setPrevTaskIdentity
(
task
.
getIdentity
());
req
.
getPrevTaskIdentityList
().
add
(
task
.
getIdentity
());
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
"prev"
,
"task"
,
"identity"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
}
}
private
ActionResult
<
Wo
>
result
()
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
public
static
class
Wi
extends
V2AddWi
{
private
static
final
long
serialVersionUID
=
-
3241215869441470402L
;
}
public
static
class
WoControl
extends
WorkControl
{
private
static
final
long
serialVersionUID
=
-
8781558581462660831L
;
}
public
static
class
Wo
extends
WrapBoolean
{
private
static
final
long
serialVersionUID
=
4883624438858385234L
;
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Extend.java
浏览文件 @
f1d0316c
...
...
@@ -11,6 +11,7 @@ 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.JpaObject
;
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
;
...
...
@@ -30,7 +31,6 @@ import com.x.processplatform.core.entity.content.Record;
import
com.x.processplatform.core.entity.content.RecordProperties.NextManual
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.Task_
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkLog
;
...
...
@@ -55,16 +55,14 @@ public class V2Extend extends BaseAction {
private
List
<
String
>
existTaskIds
=
new
ArrayList
<>();
// 输入
private
Wi
wi
;
// 本操作创建的记录
private
Record
record
;
// 当前执行用户
private
EffectivePerson
effectivePerson
;
// 根据输入得到的待办
private
Task
task
=
null
;
// 根据待办获取的工作
private
Work
work
=
null
;
// 当前待办的workLog
private
WorkLog
workLog
=
null
;
// 本环节创建的record
private
Record
concreteRecord
=
null
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
LOGGER
.
isDebugEnabled
())
{
...
...
@@ -76,7 +74,7 @@ public class V2Extend extends BaseAction {
taskCompletedId
=
this
.
processingTask
(
this
.
task
);
}
this
.
processingWork
(
this
.
task
);
this
.
r
ecord
(
task
,
workLog
);
this
.
createR
ecord
(
task
,
workLog
);
if
(
StringUtils
.
isNotEmpty
(
taskCompletedId
))
{
this
.
updateTaskCompleted
();
}
...
...
@@ -93,8 +91,7 @@ public class V2Extend extends BaseAction {
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
wi
.
getTask
(),
Task
.
class
);
}
this
.
work
=
emc
.
find
(
task
.
getWork
(),
Work
.
class
);
if
(
null
==
work
)
{
if
(
emc
.
countEqual
(
Work
.
class
,
JpaObject
.
id_FIELDNAME
,
task
.
getWork
())
<
1
)
{
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
this
.
workLog
=
emc
.
firstEqualAndEqual
(
WorkLog
.
class
,
WorkLog
.
job_FIELDNAME
,
task
.
getJob
(),
...
...
@@ -106,11 +103,11 @@ public class V2Extend extends BaseAction {
if
(
BooleanUtils
.
isNotTrue
(
control
.
getAllowReset
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
task
);
}
this
.
existTaskIds
=
emc
.
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
activity_FIELDNAME
,
task
.
getActivity
());
this
.
existTaskIds
=
emc
.
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
work_FIELDNAME
,
task
.
getWork
());
this
.
identites
=
business
.
organization
().
identity
().
list
(
wi
.
getIdentityList
());
// 在新扩充待办人员中去除已经有待办人员
this
.
identites
=
ListUtils
.
subtract
(
this
.
identites
,
ListTools
.
toList
(
task
.
getIdentity
()
));
identites
.
remove
(
task
.
getIdentity
(
));
if
(
ListTools
.
isEmpty
(
identites
))
{
throw
new
ExceptionIdentityEmpty
();
}
...
...
@@ -123,8 +120,8 @@ public class V2Extend extends BaseAction {
req
.
setReplace
(
replace
);
req
.
setIdentityList
(
identites
);
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
"extend"
),
req
,
task
.
getJob
())
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
"v2"
,
"extend"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
resp
.
getValue
()))
{
throw
new
ExceptionExtend
(
task
.
getId
());
...
...
@@ -158,58 +155,63 @@ public class V2Extend extends BaseAction {
}
}
private
void
r
ecord
(
Task
task
,
WorkLog
workLog
)
throws
Exception
{
private
void
createR
ecord
(
Task
task
,
WorkLog
workLog
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>(
);
this
.
r
ecord
=
new
Record
(
workLog
,
task
);
Business
business
=
new
Business
(
emc
);
concreteR
ecord
=
new
Record
(
workLog
,
task
);
// 校验workCompleted,如果存在,那么说明工作已经完成,标识状态为已经完成.
WorkCompleted
workCompleted
=
emc
.
firstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
task
.
getJob
());
if
(
null
!=
workCompleted
)
{
r
ecord
.
setCompleted
(
true
);
r
ecord
.
setWorkCompleted
(
workCompleted
.
getId
());
concreteR
ecord
.
setCompleted
(
true
);
concreteR
ecord
.
setWorkCompleted
(
workCompleted
.
getId
());
}
record
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
record
.
setType
(
Record
.
TYPE_RESET
);
List
<
String
>
ids
=
emc
.
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
activity_FIELDNAME
,
task
.
getActivity
());
ids
=
ListUtils
.
subtract
(
ids
,
existTaskIds
);
List
<
Task
>
list
=
emc
.
fetch
(
ids
,
Task
.
class
,
ListTools
.
toList
(
Task
.
identity_FIELDNAME
,
Task
.
job_FIELDNAME
,
Task
.
work_FIELDNAME
,
Task
.
activity_FIELDNAME
,
Task
.
activityAlias_FIELDNAME
,
Task
.
activityName_FIELDNAME
,
Task
.
activityToken_FIELDNAME
,
Task
.
activityType_FIELDNAME
,
Task
.
identity_FIELDNAME
));
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActivity
,
Collectors
.
toList
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
Task
next
=
o
.
getValue
().
get
(
0
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
next
.
getActivity
());
nextManual
.
setActivityAlias
(
next
.
getActivityAlias
());
nextManual
.
setActivityName
(
next
.
getActivityName
());
nextManual
.
setActivityToken
(
next
.
getActivityToken
());
nextManual
.
setActivityType
(
next
.
getActivityType
());
for
(
Task
t
:
o
.
getValue
())
{
nextManual
.
getTaskIdentityList
().
add
(
t
.
getIdentity
());
nextTaskIdentities
.
add
(
t
.
getIdentity
());
}
record
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
});
// 去重
record
.
getProperties
().
setNextManualTaskIdentityList
(
ListTools
.
trim
(
nextTaskIdentities
,
true
,
true
));
concreteRecord
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
concreteRecord
.
setType
(
Record
.
TYPE_TASKEXTEND
);
createRecordAdjust
(
business
,
task
,
concreteRecord
);
}
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"record"
,
"job"
,
task
.
getJob
()),
r
ecord
,
task
.
getJob
())
Applications
.
joinQueryUri
(
"record"
,
"job"
,
task
.
getJob
()),
concreteR
ecord
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionExtend
(
task
.
getId
());
}
}
private
void
createRecordAdjust
(
Business
business
,
Task
task
,
Record
concreteRecord
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
work_FIELDNAME
,
task
.
getWork
());
ids
=
ListUtils
.
subtract
(
ids
,
existTaskIds
);
List
<
Task
>
list
=
business
.
entityManagerContainer
().
fetch
(
ids
,
Task
.
class
,
ListTools
.
toList
(
Task
.
identity_FIELDNAME
,
Task
.
job_FIELDNAME
,
Task
.
work_FIELDNAME
,
Task
.
activity_FIELDNAME
,
Task
.
activityAlias_FIELDNAME
,
Task
.
activityName_FIELDNAME
,
Task
.
activityToken_FIELDNAME
,
Task
.
activityType_FIELDNAME
,
Task
.
identity_FIELDNAME
));
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>();
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActivity
,
Collectors
.
toList
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
Task
next
=
o
.
getValue
().
get
(
0
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
next
.
getActivity
());
nextManual
.
setActivityAlias
(
next
.
getActivityAlias
());
nextManual
.
setActivityName
(
next
.
getActivityName
());
nextManual
.
setActivityToken
(
next
.
getActivityToken
());
nextManual
.
setActivityType
(
next
.
getActivityType
());
for
(
Task
t
:
o
.
getValue
())
{
nextManual
.
getTaskIdentityList
().
add
(
t
.
getIdentity
());
nextTaskIdentities
.
add
(
t
.
getIdentity
());
}
concreteRecord
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
});
// 去重
concreteRecord
.
getProperties
().
setNextManualTaskIdentityList
(
ListTools
.
trim
(
nextTaskIdentities
,
true
,
true
));
}
private
void
updateTaskCompleted
()
throws
Exception
{
/
* 记录下一处理人信息 */
/
/ 记录下一处理人信息
WrapUpdateNextTaskIdentity
req
=
new
WrapUpdateNextTaskIdentity
();
req
.
getTaskCompletedList
().
add
(
this
.
taskCompletedId
);
req
.
setNextTaskIdentityList
(
r
ecord
.
getProperties
().
getNextManualTaskIdentityList
());
req
.
setNextTaskIdentityList
(
concreteR
ecord
.
getProperties
().
getNextManualTaskIdentityList
());
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"taskcompleted"
,
"next"
,
"task"
,
"identity"
),
req
,
task
.
getJob
())
...
...
@@ -217,7 +219,7 @@ public class V2Extend extends BaseAction {
}
private
void
updateTask
()
throws
Exception
{
/
* 记录上一处理人信息 */
/
/ 记录上一处理人信息
if
(
ListTools
.
isNotEmpty
(
newTasks
))
{
WrapUpdatePrevTaskIdentity
req
=
new
WrapUpdatePrevTaskIdentity
();
req
.
setTaskList
(
newTasks
);
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Record.java
浏览文件 @
f1d0316c
...
...
@@ -85,9 +85,12 @@ public class Record extends SliceJpaObject {
/* 外部调用流转 */
public
static
final
String
TYPE_SERVICE
=
"service"
;
/*
待办扩充
*/
/*
扩充待办
*/
public
static
final
String
TYPE_TASKEXTEND
=
"taskExtend"
;
/* 添加待办 */
public
static
final
String
TYPE_TASKADD
=
"taskAdd"
;
/* 定制意见 */
public
static
final
String
TYPE_CUSTOM
=
"custom"
;
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/TaskCompleted.java
浏览文件 @
f1d0316c
...
...
@@ -83,9 +83,7 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
/* 扩充办理人 */
public
static
final
String
PROCESSINGTYPE_EXTEND
=
"extend"
;
/* 前添加处理人 */
public
static
final
String
PROCESSINGTYPE_ADDBEFORE
=
"addBefore"
;
/* 后添加处理人 */
public
static
final
String
PROCESSINGTYPE_ADDAFTER
=
"addAfter"
;
public
static
final
String
PROCESSINGTYPE_ADD
=
"add"
;
public
String
getId
()
{
return
id
;
...
...
@@ -124,6 +122,8 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
case
PROCESSINGTYPE_ROLLBACK:
case
PROCESSINGTYPE_EMPOWER:
case
PROCESSINGTYPE_RESET:
case
PROCESSINGTYPE_EXTEND:
case
PROCESSINGTYPE_ADD:
this
.
joinInquire
=
false
;
break
;
default
:
...
...
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/ProcessingAttributes.java
浏览文件 @
f1d0316c
...
...
@@ -3,6 +3,8 @@ package com.x.processplatform.core.express;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
...
...
@@ -24,8 +26,7 @@ public class ProcessingAttributes extends GsonPropertyObject {
public
static
final
String
TYPE_ROLLBACK
=
"rollback"
;
public
static
final
String
TYPE_SERVICE
=
"service"
;
public
static
final
String
TYPE_TASKEXTEND
=
"taskExtend"
;
public
static
final
String
TYPE_TASKADDBEFORE
=
"taskAddBefore"
;
public
static
final
String
TYPE_TASKADDAFTER
=
"taskAddAfter"
;
public
static
final
String
TYPE_TASKADD
=
"taskAdd"
;
private
Integer
loop
=
1
;
...
...
@@ -77,17 +78,11 @@ public class ProcessingAttributes extends GsonPropertyObject {
}
public
Boolean
ifForceJoinAtArrive
()
{
if
(
this
.
getForceJoinAtArrive
()
&&
loop
==
1
)
{
return
true
;
}
return
false
;
return
BooleanUtils
.
isTrue
(
this
.
getForceJoinAtArrive
())
&&
(
loop
==
1
);
}
public
Boolean
ifForceJoinAtInquire
()
{
if
(
this
.
getForceJoinAtInquire
()
&&
loop
==
1
)
{
return
true
;
}
return
false
;
return
BooleanUtils
.
isTrue
(
this
.
getForceJoinAtInquire
())
&&
(
loop
==
1
);
}
public
Boolean
getForceJoinAtArrive
()
{
...
...
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2AddBeforeWi.java
已删除
100644 → 0
浏览文件 @
aaf6f4f7
package
com.x.processplatform.core.express.service.processing.jaxrs.task
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
public
class
V2AddBeforeWi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
3293122515327864483L
;
@FieldDescribe
(
"身份"
)
private
List
<
String
>
identityList
=
new
ArrayList
<>();
@FieldDescribe
(
"是否执行替换"
)
private
Boolean
replace
;
@FieldDescribe
(
"是否删除"
)
private
String
task
;
public
List
<
String
>
getIdentityList
()
{
return
identityList
;
}
public
void
setIdentityList
(
List
<
String
>
identityList
)
{
this
.
identityList
=
identityList
;
}
public
Boolean
getReplace
()
{
return
replace
;
}
public
void
setReplace
(
Boolean
replace
)
{
this
.
replace
=
replace
;
}
public
String
getTask
()
{
return
task
;
}
public
void
setTask
(
String
task
)
{
this
.
task
=
task
;
}
}
\ No newline at end of file
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2Add
After
Wi.java
→
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2AddWi.java
浏览文件 @
f1d0316c
...
...
@@ -3,16 +3,21 @@ package com.x.processplatform.core.express.service.processing.jaxrs.task;
import
java.util.ArrayList
;
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
V2AddAfter
Wi
extends
GsonPropertyObject
{
public
class
V2Add
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
3293122515327864483L
;
@FieldDescribe
(
"身份"
)
private
List
<
String
>
identityList
=
new
ArrayList
<>();
@FieldDescribe
(
"加入在指定位置之后,否则加入在指定位置之前."
)
private
Boolean
after
;
@FieldDescribe
(
"是否执行替换"
)
private
Boolean
replace
;
...
...
@@ -28,7 +33,7 @@ import com.x.base.core.project.gson.GsonPropertyObject;
}
public
Boolean
getReplace
()
{
return
replace
;
return
BooleanUtils
.
isTrue
(
replace
)
;
}
public
void
setReplace
(
Boolean
replace
)
{
...
...
@@ -43,4 +48,12 @@ import com.x.base.core.project.gson.GsonPropertyObject;
this
.
task
=
task
;
}
public
Boolean
getAfter
()
{
return
BooleanUtils
.
isTrue
(
after
);
}
public
void
setAfter
(
Boolean
after
)
{
this
.
after
=
after
;
}
}
\ No newline at end of file
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/V2ExtendWi.java
浏览文件 @
f1d0316c
...
...
@@ -3,10 +3,12 @@ package com.x.processplatform.core.express.service.processing.jaxrs.task;
import
java.util.ArrayList
;
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
V2ExtendWi
extends
GsonPropertyObject
{
public
class
V2ExtendWi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
3293122515327864483L
;
...
...
@@ -16,7 +18,7 @@ import com.x.base.core.project.gson.GsonPropertyObject;
@FieldDescribe
(
"是否执行替换"
)
private
Boolean
replace
;
@FieldDescribe
(
"
是否删除
"
)
@FieldDescribe
(
"
待办标识
"
)
private
String
task
;
public
List
<
String
>
getIdentityList
()
{
...
...
@@ -28,7 +30,7 @@ import com.x.base.core.project.gson.GsonPropertyObject;
}
public
Boolean
getReplace
()
{
return
replace
;
return
BooleanUtils
.
isTrue
(
replace
)
;
}
public
void
setReplace
(
Boolean
replace
)
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/TaskAction.java
浏览文件 @
f1d0316c
...
...
@@ -284,35 +284,17 @@ public class TaskAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"V2_在指定待办位置
前新增处理人."
,
action
=
V2AddBefore
.
class
)
@JaxrsMethodDescribe
(
value
=
"V2_在指定待办位置
新增处理人."
,
action
=
V2Add
.
class
)
@POST
@Path
(
"v2/add
/before
"
)
@Path
(
"v2/add"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v2Add
Before
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
public
void
v2Add
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
V2Add
Before
.
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
V2Add
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2AddBefore
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"V2_在指定待办位置后新增处理人."
,
action
=
V2AddAfter
.
class
)
@POST
@Path
(
"v2/add/after"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
v2AddAfter
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
V2AddAfter
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2AddAfter
().
execute
(
effectivePerson
,
jsonElement
);
result
=
new
V2Add
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Add
After
.java
→
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Add.java
浏览文件 @
f1d0316c
...
...
@@ -19,11 +19,11 @@ import com.x.base.core.project.processplatform.ManualTaskIdentityMatrix;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2Add
After
Wi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2AddWi
;
class
V2Add
After
extends
BaseAction
{
class
V2Add
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
V2Add
After
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
V2Add
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
...
...
@@ -43,9 +43,8 @@ class V2AddAfter extends BaseAction {
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
return
ProcessPlatformExecutorFactory
.
get
(
task
.
getJob
())
.
submit
(
new
CallableImpl
(
task
.
getWork
(),
task
.
getIdentity
(),
wi
.
getReplace
(),
wi
.
getIdentityList
()))
.
get
(
300
,
TimeUnit
.
SECONDS
);
return
ProcessPlatformExecutorFactory
.
get
(
task
.
getJob
()).
submit
(
new
CallableImpl
(
task
.
getWork
(),
task
.
getIdentity
(),
wi
.
getAfter
(),
wi
.
getReplace
(),
wi
.
getIdentityList
())).
get
(
300
,
TimeUnit
.
SECONDS
);
}
...
...
@@ -68,13 +67,16 @@ class V2AddAfter extends BaseAction {
private
String
identity
;
private
Boolean
after
;
private
Boolean
replace
;
private
List
<
String
>
identities
;
CallableImpl
(
String
id
,
String
identity
,
Boolean
replace
,
List
<
String
>
identities
)
{
CallableImpl
(
String
id
,
String
identity
,
Boolean
after
,
Boolean
replace
,
List
<
String
>
identities
)
{
this
.
id
=
id
;
this
.
identity
=
identity
;
this
.
after
=
after
;
this
.
replace
=
replace
;
this
.
identities
=
identities
;
}
...
...
@@ -85,7 +87,7 @@ class V2AddAfter extends BaseAction {
emc
.
beginTransaction
(
Work
.
class
);
Work
work
=
emc
.
find
(
this
.
id
,
Work
.
class
);
ManualTaskIdentityMatrix
matrix
=
work
.
getManualTaskIdentityMatrix
();
matrix
.
add
After
(
identity
,
replace
,
identities
);
matrix
.
add
(
identity
,
after
,
replace
,
identities
);
work
.
setManualTaskIdentityMatrix
(
matrix
);
emc
.
check
(
work
,
CheckPersistType
.
all
);
emc
.
commit
();
...
...
@@ -101,7 +103,7 @@ class V2AddAfter extends BaseAction {
}
public
static
class
Wi
extends
V2Add
After
Wi
{
public
static
class
Wi
extends
V2AddWi
{
private
static
final
long
serialVersionUID
=
-
3542693358569393097L
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2AddBefore.java
已删除
100644 → 0
浏览文件 @
aaf6f4f7
package
com.x.processplatform.service.processing.jaxrs.task
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
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.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.WrapBoolean
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.processplatform.ManualTaskIdentityMatrix
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.V2AddBeforeWi
;
class
V2AddBefore
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
V2AddBefore
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
final
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
LOGGER
.
isDebugEnabled
())
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
}
Task
task
=
getTask
(
wi
.
getTask
());
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
wi
.
getTask
(),
Task
.
class
);
}
if
(
null
==
this
.
getWork
(
task
.
getWork
()))
{
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
return
ProcessPlatformExecutorFactory
.
get
(
task
.
getJob
())
.
submit
(
new
CallableImpl
(
task
.
getWork
(),
task
.
getIdentity
(),
wi
.
getReplace
(),
wi
.
getIdentityList
()))
.
get
(
300
,
TimeUnit
.
SECONDS
);
}
private
Task
getTask
(
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
return
emc
.
fetch
(
id
,
Task
.
class
,
ListTools
.
toList
(
Task
.
job_FIELDNAME
,
Task
.
identity_FIELDNAME
,
Task
.
work_FIELDNAME
));
}
}
private
Work
getWork
(
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
return
emc
.
fetch
(
id
,
Work
.
class
,
ListTools
.
toList
());
}
}
private
class
CallableImpl
implements
Callable
<
ActionResult
<
Wo
>>
{
private
String
id
;
private
String
identity
;
private
Boolean
replace
;
private
List
<
String
>
identities
;
CallableImpl
(
String
id
,
String
identity
,
Boolean
replace
,
List
<
String
>
identities
)
{
this
.
id
=
id
;
this
.
identity
=
identity
;
this
.
replace
=
replace
;
this
.
identities
=
identities
;
}
@Override
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
emc
.
beginTransaction
(
Work
.
class
);
Work
work
=
emc
.
find
(
this
.
id
,
Work
.
class
);
ManualTaskIdentityMatrix
matrix
=
work
.
getManualTaskIdentityMatrix
();
matrix
.
addBefore
(
identity
,
replace
,
identities
);
work
.
setManualTaskIdentityMatrix
(
matrix
);
emc
.
check
(
work
,
CheckPersistType
.
all
);
emc
.
commit
();
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wi
extends
V2AddBeforeWi
{
private
static
final
long
serialVersionUID
=
-
3542693358569393097L
;
}
public
static
class
Wo
extends
WrapBoolean
{
private
static
final
long
serialVersionUID
=
6457473592503074552L
;
}
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/V2Extend.java
浏览文件 @
f1d0316c
...
...
@@ -86,7 +86,7 @@ class V2Extend extends BaseAction {
Work
work
=
emc
.
find
(
this
.
id
,
Work
.
class
);
ManualTaskIdentityMatrix
matrix
=
work
.
getManualTaskIdentityMatrix
();
matrix
.
extend
(
identity
,
replace
,
identities
);
//
work.setManualTaskIdentityMatrix(matrix);
work
.
setManualTaskIdentityMatrix
(
matrix
);
emc
.
check
(
work
,
CheckPersistType
.
all
);
emc
.
commit
();
}
catch
(
Exception
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录