Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
3c5030a3
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c5030a3
编写于
3月 27, 2020
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加流程版本管理功能,新建流程工单的时候自动查找启用版本的流程
上级
808c7b86
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
435 addition
and
14 deletion
+435
-14
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/MessageFactory.java
...m/x/processplatform/assemble/designer/MessageFactory.java
+0
-6
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEnable.java
...latform/assemble/designer/jaxrs/process/ActionEnable.java
+1
-0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionUpgrade.java
...atform/assemble/designer/jaxrs/process/ActionUpgrade.java
+1
-1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionUpgradeAll.java
...orm/assemble/designer/jaxrs/process/ActionUpgradeAll.java
+1
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
...form/assemble/surface/factory/element/ProcessFactory.java
+3
-5
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetWithProcessWithApplication.java
...ce/jaxrs/process/ActionGetWithProcessWithApplication.java
+5
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcess.java
...urface/jaxrs/work/ActionCreateWithApplicationProcess.java
+3
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcessForce.java
...e/jaxrs/work/ActionCreateWithApplicationProcessForce.java
+380
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
...ocessplatform/assemble/surface/jaxrs/work/WorkAction.java
+41
-2
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/MessageFactory.java
浏览文件 @
3c5030a3
...
...
@@ -42,10 +42,4 @@ public class MessageFactory {
title
=
StringTools
.
utf8SubString
(
title
,
JpaObject
.
length_255B
);
MessageConnector
.
send
(
MessageConnector
.
TYPE_PROCESS_DELETE
,
title
,
""
,
process
);
}
public
static
void
process_upgrade
(
Process
process
)
throws
Exception
{
String
title
=
"升级流程平台流程:"
+
process
.
getName
();
title
=
StringTools
.
utf8SubString
(
title
,
JpaObject
.
length_255B
);
MessageConnector
.
send
(
MessageConnector
.
TYPE_PROCESS_UPDATE
,
title
,
""
,
process
);
}
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEnable.java
浏览文件 @
3c5030a3
...
...
@@ -55,6 +55,7 @@ class ActionEnable extends BaseAction {
}
}
emc
.
commit
();
cacheNotify
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionUpgrade.java
浏览文件 @
3c5030a3
...
...
@@ -101,7 +101,7 @@ class ActionUpgrade extends BaseAction {
Wo
wo
=
new
Wo
();
wo
.
setId
(
newProcess
.
getId
());
result
.
setData
(
wo
);
MessageFactory
.
process_up
grad
e
(
newProcess
);
MessageFactory
.
process_up
dat
e
(
newProcess
);
return
result
;
}
}
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionUpgradeAll.java
浏览文件 @
3c5030a3
...
...
@@ -29,6 +29,7 @@ class ActionUpgradeAll extends BaseAction {
}
}
emc
.
commit
();
cacheNotify
();
}
wo
.
setValue
(
true
);
}
else
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
浏览文件 @
3c5030a3
...
...
@@ -79,7 +79,7 @@ public class ProcessFactory extends ElementFactory {
o
=
(
Process
)
element
.
getObjectValue
();
}
}
else
{
o
=
this
.
restrict
Enabled
Process
(
application
.
getId
(),
flag
);
o
=
this
.
restrictProcess
(
application
.
getId
(),
flag
);
if
(
null
!=
o
)
{
this
.
entityManagerContainer
().
get
(
Process
.
class
).
detach
(
o
);
cache
.
put
(
new
Element
(
cacheKey
,
o
));
...
...
@@ -141,7 +141,7 @@ public class ProcessFactory extends ElementFactory {
o
=
(
Process
)
element
.
getObjectValue
();
}
}
else
{
o
=
this
.
restrict
Enabled
Process
(
application
.
getId
(),
flag
);
o
=
this
.
restrictProcess
(
application
.
getId
(),
flag
);
if
(
null
!=
o
)
{
cache
.
put
(
new
Element
(
cacheKey
,
o
));
}
...
...
@@ -226,7 +226,7 @@ public class ProcessFactory extends ElementFactory {
return
null
;
}
public
Process
restrict
Enabled
Process
(
String
application
,
String
flag
)
throws
Exception
{
public
Process
restrictProcess
(
String
application
,
String
flag
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Process
>
cq
=
cb
.
createQuery
(
Process
.
class
);
...
...
@@ -235,8 +235,6 @@ public class ProcessFactory extends ElementFactory {
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
Process_
.
id
),
flag
),
cb
.
equal
(
root
.
get
(
Process_
.
name
),
flag
),
cb
.
equal
(
root
.
get
(
Process_
.
alias
),
flag
)));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
Process_
.
editionNumber
)));
List
<
Process
>
list
=
em
.
createQuery
(
cq
).
getResultList
();
if
(
list
!=
null
&&
!
list
.
isEmpty
()){
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetWithProcessWithApplication.java
浏览文件 @
3c5030a3
...
...
@@ -11,6 +11,8 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
public
class
ActionGetWithProcessWithApplication
extends
BaseAction
{
...
...
@@ -26,6 +28,9 @@ public class ActionGetWithProcessWithApplication extends BaseAction {
if
(
null
==
process
)
{
throw
new
ExceptionEntityNotExist
(
flag
,
Process
.
class
);
}
if
(
StringUtils
.
isNotEmpty
(
process
.
getEdition
())
&&
BooleanUtils
.
isFalse
(
process
.
getEditionEnable
())){
process
=
business
.
process
().
pickEnabled
(
process
.
getApplication
(),
process
.
getEdition
());
}
Wo
wo
=
Wo
.
copier
.
copy
(
process
);
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcess.java
浏览文件 @
3c5030a3
...
...
@@ -72,6 +72,9 @@ class ActionCreateWithApplicationProcess extends BaseAction {
if
(
null
==
process
)
{
throw
new
ExceptionProcessNotExist
(
processFlag
);
}
if
(
StringUtils
.
isNotEmpty
(
process
.
getEdition
())
&&
BooleanUtils
.
isFalse
(
process
.
getEditionEnable
())){
process
=
business
.
process
().
pickEnabled
(
process
.
getApplication
(),
process
.
getEdition
());
}
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcessForce.java
0 → 100644
浏览文件 @
3c5030a3
package
com.x.processplatform.assemble.surface.jaxrs.work
;
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.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
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.http.TokenType
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Audit
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.organization.Unit
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.SortTools
;
import
com.x.base.core.project.x_processplatform_service_processing
;
import
com.x.organization.core.express.Organization
;
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.*
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
/*
* 根据应用名称和流程名称进行创建,和直接用process创建基本相同
* */
class
ActionCreateWithApplicationProcessForce
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreateWithApplicationProcessForce
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
applicationFlag
,
String
processFlag
,
JsonElement
jsonElement
)
throws
Exception
{
Audit
audit
=
logger
.
audit
(
effectivePerson
);
/* 新建工作id */
String
workId
=
""
;
/* 已存在草稿id */
String
lastestWorkId
=
""
;
String
identity
=
null
;
List
<
Wo
>
wos
=
new
ArrayList
<>();
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
identity
=
this
.
decideCreatorIdentity
(
business
,
effectivePerson
,
wi
);
Application
application
=
business
.
application
().
pick
(
applicationFlag
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
applicationFlag
);
}
Process
process
=
business
.
process
().
pick
(
application
,
processFlag
);
if
(
null
==
process
)
{
throw
new
ExceptionProcessNotExist
(
processFlag
);
}
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
if
(!
business
.
application
().
allowRead
(
effectivePerson
,
roles
,
identities
,
units
,
application
))
{
throw
new
ExceptionApplicationAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
application
.
getId
());
}
if
(
BooleanUtils
.
isTrue
(
wi
.
getLatest
()))
{
/* 判断是否是要直接打开之前创建的草稿,草稿的判断标准:有待办无任何已办 */
lastestWorkId
=
this
.
latest
(
business
,
process
,
identity
);
workId
=
lastestWorkId
;
}
if
(
StringUtils
.
isEmpty
(
workId
))
{
WoId
woId
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_processplatform_service_processing
.
class
,
"work/process/"
+
URLEncoder
.
encode
(
process
.
getId
(),
DefaultCharset
.
name
),
wi
.
getData
())
.
getData
(
WoId
.
class
);
workId
=
woId
.
getId
();
}
}
/* 设置Work信息 */
if
(
BooleanUtils
.
isFalse
(
wi
.
getLatest
())
||
(
StringUtils
.
isEmpty
(
lastestWorkId
)))
{
/* 如果不是草稿那么需要进行设置 */
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Organization
organization
=
business
.
organization
();
emc
.
beginTransaction
(
Work
.
class
);
Work
work
=
emc
.
find
(
workId
,
Work
.
class
);
if
(
null
==
work
)
{
throw
new
ExceptionWorkNotExist
(
workId
);
}
work
.
setTitle
(
wi
.
getTitle
());
work
.
setCreatorIdentity
(
identity
);
work
.
setCreatorPerson
(
organization
.
person
().
getWithIdentity
(
identity
));
work
.
setCreatorUnit
(
organization
.
unit
().
getWithIdentity
(
identity
));
if
(
StringUtils
.
isNotEmpty
(
work
.
getCreatorUnit
()))
{
Unit
unit
=
organization
.
unit
().
getObject
(
work
.
getCreatorUnit
());
work
.
setCreatorUnitLevelName
(
unit
.
getLevelName
());
}
emc
.
commit
();
}
/* 驱动工作 */
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
"work/"
+
URLEncoder
.
encode
(
workId
,
DefaultCharset
.
name
)
+
"/processing"
,
null
);
}
else
{
/* 如果是草稿,准备后面的直接打开 */
workId
=
lastestWorkId
;
}
/* 拼装返回结果 */
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Work
work
=
emc
.
find
(
workId
,
Work
.
class
);
if
(
null
==
work
)
{
throw
new
ExceptionWorkNotExist
(
workId
);
}
List
<
String
>
ids
=
business
.
workLog
().
listWithFromActivityTokenForwardNotConnected
(
work
.
getActivityToken
());
/* 先取得没有结束的WorkLog */
List
<
WorkLog
>
list
=
emc
.
list
(
WorkLog
.
class
,
ids
);
wos
=
this
.
refercenceWorkLog
(
business
,
list
);
/* 标识当前用户的待办 */
for
(
Wo
o
:
wos
)
{
o
.
setCurrentTaskIndex
(-
1
);
for
(
int
i
=
0
;
i
<
o
.
getTaskList
().
size
();
i
++)
{
WoTask
t
=
o
.
getTaskList
().
get
(
i
);
if
(
StringUtils
.
equals
(
effectivePerson
.
getDistinguishedName
(),
t
.
getPerson
()))
{
o
.
setCurrentTaskIndex
(
i
);
}
}
}
audit
.
log
(
null
,
"填单"
);
}
result
.
setData
(
wos
);
return
result
;
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"直接打开指定人员已经有的草稿,草稿判断:工作没有已办,只有一条此人的待办."
)
private
Boolean
latest
;
@FieldDescribe
(
"标题."
)
private
String
title
;
@FieldDescribe
(
"启动人员身份."
)
private
String
identity
;
@FieldDescribe
(
"工作数据."
)
private
JsonElement
data
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getIdentity
()
{
return
identity
;
}
public
void
setIdentity
(
String
identity
)
{
this
.
identity
=
identity
;
}
public
JsonElement
getData
()
{
return
data
;
}
public
void
setData
(
JsonElement
data
)
{
this
.
data
=
data
;
}
public
Boolean
getLatest
()
{
return
latest
;
}
public
void
setLatest
(
Boolean
latest
)
{
this
.
latest
=
latest
;
}
}
public
static
class
Wo
extends
WorkLog
{
private
static
final
long
serialVersionUID
=
1307569946729101786L
;
static
WrapCopier
<
WorkLog
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
WorkLog
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
@FieldDescribe
(
"排序号"
)
private
Long
rank
;
@FieldDescribe
(
"已办对象"
)
private
List
<
WoTaskCompleted
>
taskCompletedList
;
@FieldDescribe
(
"待办对象"
)
private
List
<
WoTask
>
taskList
;
@FieldDescribe
(
"当前待办序号"
)
private
Integer
currentTaskIndex
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
public
Integer
getCurrentTaskIndex
()
{
return
currentTaskIndex
;
}
public
void
setCurrentTaskIndex
(
Integer
currentTaskIndex
)
{
this
.
currentTaskIndex
=
currentTaskIndex
;
}
public
List
<
WoTask
>
getTaskList
()
{
return
taskList
;
}
public
void
setTaskList
(
List
<
WoTask
>
taskList
)
{
this
.
taskList
=
taskList
;
}
public
List
<
WoTaskCompleted
>
getTaskCompletedList
()
{
return
taskCompletedList
;
}
public
void
setTaskCompletedList
(
List
<
WoTaskCompleted
>
taskCompletedList
)
{
this
.
taskCompletedList
=
taskCompletedList
;
}
}
public
static
class
WoTask
extends
Task
{
private
static
final
long
serialVersionUID
=
2279846765261247910L
;
static
WrapCopier
<
Task
,
WoTask
>
copier
=
WrapCopierFactory
.
wo
(
Task
.
class
,
WoTask
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
Long
rank
;
private
WorkControl
control
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
public
WorkControl
getControl
()
{
return
control
;
}
public
void
setControl
(
WorkControl
control
)
{
this
.
control
=
control
;
}
}
public
static
class
WoTaskCompleted
extends
TaskCompleted
{
private
static
final
long
serialVersionUID
=
-
7253999118308715077L
;
public
static
WrapCopier
<
TaskCompleted
,
WoTaskCompleted
>
copier
=
WrapCopierFactory
.
wo
(
TaskCompleted
.
class
,
WoTaskCompleted
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
private
Long
rank
;
private
WorkControl
control
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
public
WorkControl
getControl
()
{
return
control
;
}
public
void
setControl
(
WorkControl
control
)
{
this
.
control
=
control
;
}
}
private
List
<
Wo
>
refercenceWorkLog
(
Business
business
,
List
<
WorkLog
>
list
)
throws
Exception
{
List
<
Wo
>
os
=
new
ArrayList
<>();
for
(
WorkLog
o
:
list
)
{
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
if
(
BooleanUtils
.
isNotTrue
(
o
.
getConnected
()))
{
this
.
referenceTask
(
business
,
wo
);
}
else
{
/** 已经完成的不会有待办,返回一个空数组 */
wo
.
setTaskList
(
new
ArrayList
<
WoTask
>());
}
this
.
referenceTaskCompleted
(
business
,
wo
);
os
.
add
(
wo
);
}
SortTools
.
asc
(
os
,
false
,
"arrivedTime"
);
return
os
;
}
private
String
decideCreatorIdentity
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
if
(
TokenType
.
cipher
.
equals
(
effectivePerson
.
getTokenType
()))
{
return
business
.
organization
().
identity
().
get
(
wi
.
getIdentity
());
}
else
if
(
StringUtils
.
isNotEmpty
(
wi
.
getIdentity
()))
{
List
<
String
>
identities
=
business
.
organization
().
identity
()
.
listWithPerson
(
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isEmpty
(
identities
))
{
throw
new
ExceptionNoneIdentity
(
effectivePerson
.
getDistinguishedName
());
}
else
if
(
identities
.
size
()
==
1
)
{
return
identities
.
get
(
0
);
}
else
{
/* 有多个身份需要逐一判断是否包含. */
for
(
String
o
:
identities
)
{
if
(
StringUtils
.
equals
(
o
,
wi
.
getIdentity
()))
{
return
o
;
}
}
}
}
else
{
List
<
String
>
list
=
business
.
organization
().
identity
()
.
listWithPerson
(
effectivePerson
.
getDistinguishedName
());
if
(!
list
.
isEmpty
())
{
return
list
.
get
(
0
);
}
}
throw
new
Exception
(
"decideCreatorIdentity error:"
+
wi
.
toString
());
}
private
void
referenceTask
(
Business
business
,
Wo
wo
)
throws
Exception
{
List
<
String
>
ids
=
business
.
task
().
listWithActivityToken
(
wo
.
getFromActivityToken
());
List
<
WoTask
>
list
=
WoTask
.
copier
.
copy
(
business
.
entityManagerContainer
().
list
(
Task
.
class
,
ids
));
SortTools
.
asc
(
list
,
false
,
"startTime"
);
wo
.
setTaskList
(
list
);
}
private
void
referenceTaskCompleted
(
Business
business
,
Wo
wo
)
throws
Exception
{
List
<
String
>
ids
=
business
.
taskCompleted
().
listWithActivityToken
(
wo
.
getFromActivityToken
());
List
<
WoTaskCompleted
>
list
=
WoTaskCompleted
.
copier
.
copy
(
business
.
entityManagerContainer
().
list
(
TaskCompleted
.
class
,
ids
));
Collections
.
sort
(
list
,
new
Comparator
<
WoTaskCompleted
>()
{
public
int
compare
(
WoTaskCompleted
o1
,
WoTaskCompleted
o2
)
{
return
ObjectUtils
.
compare
(
o1
.
getCompletedTime
(),
o2
.
getCompletedTime
(),
true
);
}
});
/* 补充召回 */
List
<
WoTaskCompleted
>
results
=
new
ArrayList
<>();
for
(
WoTaskCompleted
o
:
list
)
{
results
.
add
(
o
);
if
(
o
.
getProcessingType
().
equals
(
ProcessingType
.
retract
))
{
WoTaskCompleted
retract
=
new
WoTaskCompleted
();
o
.
copyTo
(
retract
);
retract
.
setRouteName
(
"撤回"
);
retract
.
setOpinion
(
"撤回"
);
retract
.
setStartTime
(
retract
.
getRetractTime
());
retract
.
setCompletedTime
(
retract
.
getRetractTime
());
results
.
add
(
retract
);
}
}
wo
.
setTaskCompletedList
(
results
);
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
浏览文件 @
3c5030a3
...
...
@@ -204,7 +204,7 @@ public class WorkAction extends StandardJaxrsAction {
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"process/{processFlag}"
)
@JaxrsMethodDescribe
(
value
=
"创建工作."
,
action
=
ActionCreate
.
class
)
@JaxrsMethodDescribe
(
value
=
"创建工作
(创建启动版本的流程)
."
,
action
=
ActionCreate
.
class
)
public
void
create
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"流程标识"
)
@PathParam
(
"processFlag"
)
String
processFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionCreate
.
Wo
>>
result
=
new
ActionResult
<>();
...
...
@@ -218,7 +218,25 @@ public class WorkAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"创建工作."
,
action
=
ActionCreateWithApplicationProcess
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"process/{processFlag}/force"
)
@JaxrsMethodDescribe
(
value
=
"创建工作(强制创建存在的流程)."
,
action
=
ActionCreateForce
.
class
)
public
void
createForce
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"流程标识"
)
@PathParam
(
"processFlag"
)
String
processFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionCreateForce
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionCreateForce
().
execute
(
effectivePerson
,
processFlag
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"创建工作(创建启动版本的流程)."
,
action
=
ActionCreateWithApplicationProcess
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
...
...
@@ -239,6 +257,27 @@ public class WorkAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"创建工作(强制创建存在的流程)."
,
action
=
ActionCreateWithApplicationProcessForce
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"application/{applicationFlag}/process/{processFlag}/force"
)
public
void
createWithApplicationProcessForce
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationFlag"
)
String
applicationFlag
,
@JaxrsParameterDescribe
(
"流程标识"
)
@PathParam
(
"processFlag"
)
String
processFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionCreateWithApplicationProcessForce
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionCreateWithApplicationProcessForce
().
execute
(
effectivePerson
,
applicationFlag
,
processFlag
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"删除工作,需要应用管理权限或者是工作的创建者。"
,
action
=
ActionDelete
.
class
)
@DELETE
@Path
(
"{id}"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录