Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
54df2ce6
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,发现更多精彩内容 >>
提交
54df2ce6
编写于
5月 31, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加addManualTaskIdentityMatrix返回
上级
9fd288b5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
220 addition
and
116 deletion
+220
-116
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/RecordBuilder.java
...com/x/processplatform/assemble/surface/RecordBuilder.java
+38
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
...latform/assemble/surface/jaxrs/task/ActionProcessing.java
+5
-47
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionEmptyOption.java
...orm/assemble/surface/jaxrs/task/ExceptionEmptyOption.java
+13
-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
+87
-43
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
.../processplatform/assemble/surface/jaxrs/task/V2Reset.java
+26
-11
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2AddManualTaskIdentityMatrix.java
...ble/surface/jaxrs/work/V2AddManualTaskIdentityMatrix.java
+25
-10
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/work/V2AddManualTaskIdentityMatrixWo.java
...rocessing/jaxrs/work/V2AddManualTaskIdentityMatrixWo.java
+20
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/V2AddManualTaskIdentityMatrix.java
.../processing/jaxrs/work/V2AddManualTaskIdentityMatrix.java
+6
-5
未找到文件。
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/RecordBuilder.java
浏览文件 @
54df2ce6
...
...
@@ -17,6 +17,7 @@ import com.x.base.core.project.x_processplatform_service_processing;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.processplatform.assemble.surface.jaxrs.task.ExceptionWorkProcessing
;
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
;
...
...
@@ -134,6 +135,43 @@ public class RecordBuilder {
rec
.
getProperties
().
setNextManualTaskIdentityList
(
new
ArrayList
<>(
identities
));
}
public
static
Record
ofTaskEmpower
(
Task
task
,
String
empowerFromIdentity
,
String
empowerFromPerson
,
String
empowerFromUnit
)
{
Record
o
=
new
Record
();
o
.
setType
(
Record
.
TYPE_EMPOWER
);
o
.
setApplication
(
task
.
getApplication
());
o
.
setProcess
(
task
.
getProcess
());
o
.
setJob
(
task
.
getJob
());
o
.
setCompleted
(
false
);
o
.
setWork
(
task
.
getWork
());
o
.
setFromActivity
(
task
.
getActivity
());
o
.
setFromActivityAlias
(
task
.
getActivityAlias
());
o
.
setFromActivityName
(
task
.
getActivityName
());
o
.
setFromActivityToken
(
task
.
getActivityToken
());
o
.
setFromActivityType
(
task
.
getActivityType
());
o
.
setArrivedActivity
(
task
.
getActivity
());
o
.
setArrivedActivityAlias
(
task
.
getActivityAlias
());
o
.
setArrivedActivityName
(
task
.
getActivityName
());
o
.
setArrivedActivityToken
(
task
.
getActivityToken
());
o
.
setArrivedActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
setEmpowerToPerson
(
task
.
getPerson
());
o
.
getProperties
().
setEmpowerToIdentity
(
task
.
getIdentity
());
o
.
getProperties
().
setEmpowerToUnit
(
task
.
getUnit
());
o
.
setIdentity
(
task
.
getEmpowerFromIdentity
());
o
.
setPerson
(
empowerFromPerson
);
o
.
setUnit
(
empowerFromUnit
);
o
.
getProperties
().
setElapsed
(
0L
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
task
.
getActivity
());
nextManual
.
setActivityAlias
(
task
.
getActivityAlias
());
nextManual
.
setActivityName
(
task
.
getActivityName
());
nextManual
.
setActivityToken
(
task
.
getActivityToken
());
nextManual
.
setActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
o
.
getProperties
().
getNextManualTaskIdentityList
().
add
(
task
.
getIdentity
());
return
o
;
}
public
static
String
processing
(
Record
r
)
throws
Exception
{
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
false
,
x_processplatform_service_processing
.
class
,
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
浏览文件 @
54df2ce6
...
...
@@ -30,6 +30,7 @@ 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.RecordBuilder
;
import
com.x.processplatform.assemble.surface.TaskBuilder
;
import
com.x.processplatform.assemble.surface.TaskCompletedBuilder
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
...
...
@@ -442,61 +443,18 @@ class ActionProcessing extends BaseAction {
}
if
(!
empowerTasks
.
isEmpty
())
{
List
<
Record
>
empowerRecords
=
new
ArrayList
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
for
(
Task
o
:
empowerTasks
)
{
empowerRecords
.
add
(
createEmpowerRecord
(
business
,
o
));
}
}
for
(
Record
r
:
empowerRecords
)
{
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"record"
,
"job"
,
this
.
work
.
getJob
()),
r
,
this
.
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionWorkProcessing
(
this
.
work
.
getId
());
Record
r
=
RecordBuilder
.
ofTaskEmpower
(
o
,
task
.
getEmpowerFromIdentity
(),
business
.
organization
().
person
().
getWithIdentity
(
task
.
getEmpowerFromIdentity
()),
business
.
organization
().
unit
().
getWithIdentity
(
task
.
getEmpowerFromIdentity
()));
RecordBuilder
.
processing
(
r
);
}
}
}
}
private
Record
createEmpowerRecord
(
Business
business
,
Task
task
)
throws
Exception
{
Record
o
=
new
Record
();
o
.
setType
(
Record
.
TYPE_EMPOWER
);
o
.
setApplication
(
task
.
getApplication
());
o
.
setProcess
(
task
.
getProcess
());
o
.
setJob
(
task
.
getJob
());
o
.
setCompleted
(
false
);
o
.
setWork
(
task
.
getWork
());
o
.
setFromActivity
(
task
.
getActivity
());
o
.
setFromActivityAlias
(
task
.
getActivityAlias
());
o
.
setFromActivityName
(
task
.
getActivityName
());
o
.
setFromActivityToken
(
task
.
getActivityToken
());
o
.
setFromActivityType
(
task
.
getActivityType
());
o
.
setArrivedActivity
(
task
.
getActivity
());
o
.
setArrivedActivityAlias
(
task
.
getActivityAlias
());
o
.
setArrivedActivityName
(
task
.
getActivityName
());
o
.
setArrivedActivityToken
(
task
.
getActivityToken
());
o
.
setArrivedActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
setEmpowerToPerson
(
task
.
getPerson
());
o
.
getProperties
().
setEmpowerToIdentity
(
task
.
getIdentity
());
o
.
getProperties
().
setEmpowerToUnit
(
task
.
getUnit
());
o
.
setIdentity
(
task
.
getEmpowerFromIdentity
());
o
.
setPerson
(
business
.
organization
().
person
().
getWithIdentity
(
o
.
getIdentity
()));
o
.
setUnit
(
business
.
organization
().
unit
().
getWithIdentity
(
o
.
getIdentity
()));
o
.
getProperties
().
setElapsed
(
0L
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
task
.
getActivity
());
nextManual
.
setActivityAlias
(
task
.
getActivityAlias
());
nextManual
.
setActivityName
(
task
.
getActivityName
());
nextManual
.
setActivityToken
(
task
.
getActivityToken
());
nextManual
.
setActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
o
.
getProperties
().
getNextManualTaskIdentityList
().
add
(
task
.
getIdentity
());
return
o
;
}
public
static
class
Wo
extends
ProcessingWo
{
private
static
final
long
serialVersionUID
=
-
1771383649634969945L
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionEmptyOption.java
0 → 100644
浏览文件 @
54df2ce6
package
com.x.processplatform.assemble.surface.jaxrs.task
;
import
com.x.base.core.project.exception.LanguagePromptException
;
class
ExceptionEmptyOption
extends
LanguagePromptException
{
private
static
final
long
serialVersionUID
=
-
5515077418025884395L
;
ExceptionEmptyOption
()
{
super
(
"otpion empty."
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Add.java
浏览文件 @
54df2ce6
...
...
@@ -2,7 +2,9 @@ package com.x.processplatform.assemble.surface.jaxrs.task;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
...
...
@@ -22,13 +24,14 @@ 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.
processplatform.ManualTaskIdentityMatrix
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.RecordBuilder
;
import
com.x.processplatform.assemble.surface.TaskBuilder
;
import
com.x.processplatform.assemble.surface.TaskCompletedBuilder
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.assemble.surface.WorkControl
;
import
com.x.processplatform.core.entity.content.Record
;
...
...
@@ -40,9 +43,9 @@ 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
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWo
;
public
class
V2Add
extends
BaseAction
{
...
...
@@ -65,13 +68,17 @@ public class V2Add extends BaseAction {
private
WorkLog
workLog
=
null
;
// 本环节创建的record
private
Record
rec
=
null
;
// 执行前已经存在的已办
private
List
<
TaskCompleted
>
taskCompleteds
;
// 返回的ManualTaskIdentityMatrix
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
LOGGER
.
isDebugEnabled
())
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
}
this
.
init
(
effectivePerson
,
id
,
jsonElement
);
this
.
add
(
this
.
task
,
wi
.
getOptionList
(),
wi
.
getRemove
());
this
.
manualTaskIdentityMatrix
=
this
.
add
(
this
.
task
,
wi
.
getOptionList
(),
wi
.
getRemove
());
if
(
BooleanUtils
.
isTrue
(
wi
.
getRemove
()))
{
taskCompletedId
=
this
.
processingTask
(
this
.
task
);
}
...
...
@@ -91,9 +98,10 @@ public class V2Add extends BaseAction {
RecordBuilder
.
processing
(
rec
);
if
(
StringUtils
.
isNotEmpty
(
taskCompletedId
))
{
this
.
updateTaskCompleted
();
TaskCompletedBuilder
.
updateNextTaskIdentity
(
this
.
taskCompletedId
,
rec
.
getProperties
().
getNextManualTaskIdentityList
(),
task
.
getJob
());
}
this
.
updateTask
(
);
TaskBuilder
.
updatePrevTaskIdentity
(
this
.
newTaskIds
,
this
.
taskCompleteds
,
this
.
task
);
return
result
();
}
...
...
@@ -112,14 +120,13 @@ public class V2Add extends BaseAction {
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
(
id
,
Task
.
class
);
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
if
(
emc
.
countEqual
(
Work
.
class
,
JpaObject
.
id_FIELDNAME
,
task
.
getWork
())
<
1
)
{
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
this
.
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
this
.
initFilterOptionIdentities
(
business
,
wi
,
task
.
getWork
()
);
this
.
initCheckOptionIdentities
(
wi
);
this
.
workLog
=
emc
.
firstEqualAndEqual
(
WorkLog
.
class
,
WorkLog
.
job_FIELDNAME
,
task
.
getJob
(),
WorkLog
.
fromActivityToken_FIELDNAME
,
task
.
getActivityToken
());
if
(
null
==
workLog
)
{
...
...
@@ -131,21 +138,47 @@ public class V2Add extends BaseAction {
}
this
.
existTaskIds
=
emc
.
idsEqualAndEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
work_FIELDNAME
,
task
.
getWork
());
this
.
taskCompleteds
=
business
.
entityManagerContainer
().
listEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
activityToken_FIELDNAME
,
task
.
getActivityToken
());
}
}
private
void
initFilterOptionIdentities
(
Business
business
,
Wi
wi
,
String
workId
)
throws
Exception
{
Work
work
=
business
.
entityManagerContainer
().
find
(
workId
,
Work
.
class
);
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
workId
,
Task
.
class
);
}
List
<
String
>
identities
=
work
.
getManualTaskIdentityMatrix
().
flat
();
for
(
Option
option
:
wi
.
getOptionList
())
{
Iterator
<
String
>
iterator
=
option
.
getIdentityList
().
iterator
();
while
(
iterator
.
hasNext
())
{
if
(
identities
.
contains
(
iterator
.
next
()))
{
iterator
.
remove
();
}
}
}
}
private
void
initCheckOptionIdentities
(
Wi
wi
)
throws
Exception
{
Optional
<
List
<
String
>>
optional
=
wi
.
getOptionList
().
stream
().
map
(
Option:
:
getIdentityList
)
.
filter
(
o
->
!
o
.
isEmpty
()).
findAny
();
if
(
optional
.
isEmpty
())
{
throw
new
ExceptionEmptyOption
();
}
}
private
void
add
(
Task
task
,
List
<
V2AddManualTaskIdentityMatrixWi
.
Option
>
options
,
Boolean
remove
)
throws
Exception
{
private
ManualTaskIdentityMatrix
add
(
Task
task
,
List
<
V2AddManualTaskIdentityMatrixWi
.
Option
>
options
,
Boolean
remove
)
throws
Exception
{
V2AddManualTaskIdentityMatrixWi
req
=
new
V2AddManualTaskIdentityMatrixWi
();
req
.
setIdentity
(
task
.
getIdentity
());
req
.
setOptionList
(
options
);
req
.
setRemove
(
remove
);
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
task
.
getWork
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
resp
.
getValue
()))
{
throw
new
ExceptionAdd
(
task
.
getId
());
}
return
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
task
.
getWork
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
task
.
getJob
())
.
getData
(
V2AddManualTaskIdentityMatrixWo
.
class
).
getManualTaskIdentityMatrix
();
}
private
String
processingTask
(
Task
task
)
throws
Exception
{
...
...
@@ -175,35 +208,36 @@ public class V2Add extends BaseAction {
}
}
private
void
updateTaskCompleted
()
throws
Exception
{
// 记录下一处理人信息
WrapUpdateNextTaskIdentity
req
=
new
WrapUpdateNextTaskIdentity
();
req
.
getTaskCompletedList
().
add
(
this
.
taskCompletedId
);
req
.
setNextTaskIdentityList
(
rec
.
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
(
this
.
newTaskIds
))
{
WrapUpdatePrevTaskIdentity
req
=
new
WrapUpdatePrevTaskIdentity
();
req
.
setTaskList
(
this
.
newTaskIds
);
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 void updateTaskCompleted() throws Exception {
//
// 记录下一处理人信息
//
WrapUpdateNextTaskIdentity req = new WrapUpdateNextTaskIdentity();
//
req.getTaskCompletedList().add(this.taskCompletedId);
//
req.setNextTaskIdentityList(rec.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(this.newTaskIds)) {
//
WrapUpdatePrevTaskIdentity req = new WrapUpdatePrevTaskIdentity();
//
req.setTaskList(this.newTaskIds);
//
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
()
throws
InstantiationException
,
IllegalAccessException
,
IllegalArgumentException
,
InvocationTargetException
,
NoSuchMethodException
,
SecurityException
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
Wo
.
copier
.
copy
(
this
.
rec
);
wo
.
setManualTaskIdentityMatrix
(
this
.
manualTaskIdentityMatrix
);
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -249,6 +283,16 @@ public class V2Add extends BaseAction {
static
WrapCopier
<
Record
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Record
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
public
ManualTaskIdentityMatrix
getManualTaskIdentityMatrix
()
{
return
manualTaskIdentityMatrix
;
}
public
void
setManualTaskIdentityMatrix
(
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
)
{
this
.
manualTaskIdentityMatrix
=
manualTaskIdentityMatrix
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
浏览文件 @
54df2ce6
...
...
@@ -20,7 +20,6 @@ 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.processplatform.ManualTaskIdentityMatrix
;
...
...
@@ -45,6 +44,7 @@ import com.x.processplatform.core.express.service.processing.jaxrs.task.Processi
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
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWo
;
public
class
V2Reset
extends
BaseAction
{
...
...
@@ -66,10 +66,11 @@ public class V2Reset extends BaseAction {
private
String
taskCompletedId
;
private
Wi
wi
;
private
EffectivePerson
effectivePerson
;
// 返回的ManualTaskIdentityMatrix
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
this
.
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
this
.
effectivePerson
=
effectivePerson
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
@@ -85,7 +86,7 @@ public class V2Reset extends BaseAction {
}
this
.
reset
(
this
.
task
,
(!
wi
.
getKeep
()),
identities
,
manual
);
this
.
manualTaskIdentityMatrix
=
reset
(
this
.
task
,
(!
wi
.
getKeep
()),
identities
,
manual
);
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
())
||
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
()))
{
updateTask
(
wi
.
getOpinion
(),
wi
.
getRouteName
());
...
...
@@ -114,7 +115,9 @@ public class V2Reset extends BaseAction {
if
(!
taskCompleteds
.
isEmpty
())
{
TaskBuilder
.
updatePrevTaskIdentity
(
newTaskIds
,
taskCompleteds
,
this
.
task
);
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
Wo
.
copier
.
copy
(
rec
);
wo
.
setManualTaskIdentityMatrix
(
this
.
manualTaskIdentityMatrix
);
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -172,7 +175,8 @@ public class V2Reset extends BaseAction {
}
}
private
void
reset
(
Task
task
,
boolean
remove
,
List
<
String
>
identities
,
Manual
manual
)
throws
Exception
{
private
ManualTaskIdentityMatrix
reset
(
Task
task
,
boolean
remove
,
List
<
String
>
identities
,
Manual
manual
)
throws
Exception
{
V2AddManualTaskIdentityMatrixWi
req
=
new
V2AddManualTaskIdentityMatrixWi
();
req
.
setIdentity
(
task
.
getIdentity
());
req
.
setRemove
(
remove
);
...
...
@@ -187,13 +191,13 @@ public class V2Reset extends BaseAction {
List
<
V2AddManualTaskIdentityMatrixWi
.
Option
>
optionList
=
new
ArrayList
<>();
optionList
.
add
(
option
);
req
.
setOptionList
(
optionList
);
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
task
.
getWork
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
resp
.
getValue
()))
{
throw
new
ExceptionReset
(
task
.
getId
()
);
}
return
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
task
.
getWork
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
task
.
getJob
())
.
getData
(
V2AddManualTaskIdentityMatrixWo
.
class
).
getManualTaskIdentityMatrix
(
);
}
private
void
processingWork
()
throws
Exception
{
...
...
@@ -225,6 +229,17 @@ public class V2Reset extends BaseAction {
static
WrapCopier
<
Record
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Record
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
public
void
setManualTaskIdentityMatrix
(
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
)
{
this
.
manualTaskIdentityMatrix
=
manualTaskIdentityMatrix
;
}
public
ManualTaskIdentityMatrix
getManualTaskIdentityMatrix
()
{
return
manualTaskIdentityMatrix
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2AddManualTaskIdentityMatrix.java
浏览文件 @
54df2ce6
...
...
@@ -19,9 +19,9 @@ 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.processplatform.ManualTaskIdentityMatrix
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.RecordBuilder
;
...
...
@@ -35,6 +35,7 @@ import com.x.processplatform.core.entity.element.ActivityType;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWo
;
class
V2AddManualTaskIdentityMatrix
extends
BaseAction
{
...
...
@@ -53,6 +54,8 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
private
WorkLog
workLog
;
// work活动
private
Manual
manual
;
// 返回的ManualTaskIdentityMatrix
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
LOGGER
.
isDebugEnabled
())
{
...
...
@@ -60,7 +63,7 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
}
this
.
init
(
effectivePerson
,
id
,
jsonElement
);
this
.
add
(
wi
.
getOptionList
(),
wi
.
getRemove
());
this
.
manualTaskIdentityMatrix
=
add
(
wi
.
getOptionList
(),
wi
.
getRemove
());
this
.
processingWork
(
work
);
...
...
@@ -75,6 +78,7 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
Wo
.
copier
.
copy
(
rec
);
wo
.
setManualTaskIdentityMatrix
(
this
.
manualTaskIdentityMatrix
);
result
.
setData
(
wo
);
return
result
;
...
...
@@ -103,18 +107,19 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
}
}
private
void
add
(
List
<
V2AddManualTaskIdentityMatrixWi
.
Option
>
options
,
Boolean
remove
)
throws
Exception
{
private
ManualTaskIdentityMatrix
add
(
List
<
V2AddManualTaskIdentityMatrixWi
.
Option
>
options
,
Boolean
remove
)
throws
Exception
{
V2AddManualTaskIdentityMatrixWi
req
=
new
V2AddManualTaskIdentityMatrixWi
();
req
.
setIdentity
(
identity
);
req
.
setOptionList
(
options
);
req
.
setRemove
(
remove
);
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
work
.
getId
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
work
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
resp
.
getValue
()))
{
throw
new
ExceptionAddManualTaskIdentityMatrix
(
work
.
getId
()
);
}
return
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
"v2"
,
work
.
getId
(),
"add"
,
"manual"
,
"task"
,
"identity"
,
"matrix"
),
req
,
work
.
getJob
())
.
getData
(
V2AddManualTaskIdentityMatrixWo
.
class
).
getManualTaskIdentityMatrix
(
);
}
private
void
processingWork
(
Work
work
)
throws
Exception
{
...
...
@@ -148,6 +153,16 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
static
WrapCopier
<
Record
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Record
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
public
ManualTaskIdentityMatrix
getManualTaskIdentityMatrix
()
{
return
manualTaskIdentityMatrix
;
}
public
void
setManualTaskIdentityMatrix
(
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
)
{
this
.
manualTaskIdentityMatrix
=
manualTaskIdentityMatrix
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/work/V2AddManualTaskIdentityMatrixWo.java
0 → 100644
浏览文件 @
54df2ce6
package
com.x.processplatform.core.express.service.processing.jaxrs.work
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.processplatform.ManualTaskIdentityMatrix
;
public
class
V2AddManualTaskIdentityMatrixWo
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8631082471633729236L
;
private
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
;
public
ManualTaskIdentityMatrix
getManualTaskIdentityMatrix
()
{
return
manualTaskIdentityMatrix
;
}
public
void
setManualTaskIdentityMatrix
(
ManualTaskIdentityMatrix
manualTaskIdentityMatrix
)
{
this
.
manualTaskIdentityMatrix
=
manualTaskIdentityMatrix
;
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/V2AddManualTaskIdentityMatrix.java
浏览文件 @
54df2ce6
...
...
@@ -16,13 +16,13 @@ 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.Work
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWi
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2AddManualTaskIdentityMatrixWo
;
import
com.x.processplatform.service.processing.Business
;
class
V2AddManualTaskIdentityMatrix
extends
BaseAction
{
...
...
@@ -77,6 +77,7 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
@Override
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
ManualTaskIdentityMatrix
matrix
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
emc
.
beginTransaction
(
Work
.
class
);
...
...
@@ -84,7 +85,7 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Work
.
class
);
}
ManualTaskIdentityMatrix
matrix
=
work
.
getManualTaskIdentityMatrix
();
matrix
=
work
.
getManualTaskIdentityMatrix
();
for
(
V2AddManualTaskIdentityMatrixWi
.
Option
option
:
optionList
)
{
List
<
String
>
identities
=
business
.
organization
().
identity
().
list
(
option
.
getIdentityList
());
if
(!
ListTools
.
isEmpty
(
identities
))
{
...
...
@@ -102,7 +103,7 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
wo
.
set
Value
(
true
);
wo
.
set
ManualTaskIdentityMatrix
(
matrix
);
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -115,9 +116,9 @@ class V2AddManualTaskIdentityMatrix extends BaseAction {
}
public
static
class
Wo
extends
WrapBoolean
{
public
static
class
Wo
extends
V2AddManualTaskIdentityMatrixWo
{
private
static
final
long
serialVersionUID
=
-
8882214104176786739
L
;
private
static
final
long
serialVersionUID
=
-
1377290527826280418
L
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录