Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
c4bc7fe2
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4bc7fe2
编写于
7月 02, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
record已经完成workCompleted判断
上级
e917b606
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
51 addition
and
26 deletion
+51
-26
o2server/x_base_core_project/src/main/java/com/x/base/core/container/EntityManagerContainer.java
...ava/com/x/base/core/container/EntityManagerContainer.java
+12
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionReference.java
...platform/assemble/surface/jaxrs/task/ActionReference.java
+5
-6
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
.../processplatform/assemble/surface/jaxrs/task/V2Reset.java
+21
-13
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2AddSplit.java
...ocessplatform/assemble/surface/jaxrs/work/V2AddSplit.java
+0
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2Reroute.java
...rocessplatform/assemble/surface/jaxrs/work/V2Reroute.java
+13
-5
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/container/EntityManagerContainer.java
浏览文件 @
c4bc7fe2
...
...
@@ -631,6 +631,18 @@ public class EntityManagerContainer extends EntityManagerContainerBasic {
return
os
.
isEmpty
()
?
null
:
os
.
get
(
0
);
}
public
<
T
extends
JpaObject
>
T
firstEqualOrEqual
(
Class
<
T
>
cls
,
String
attribute
,
Object
value
,
String
otherAttribute
,
Object
otherValue
)
throws
Exception
{
EntityManager
em
=
this
.
get
(
cls
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
T
>
cq
=
cb
.
createQuery
(
cls
);
Root
<
T
>
root
=
cq
.
from
(
cls
);
cq
.
select
(
root
)
.
where
(
cb
.
or
(
cb
.
equal
(
root
.
get
(
attribute
),
value
),
cb
.
equal
(
root
.
get
(
otherAttribute
),
otherValue
)));
List
<
T
>
os
=
em
.
createQuery
(
cq
).
setMaxResults
(
1
).
getResultList
();
return
os
.
stream
().
findFirst
().
orElse
(
null
);
}
public
<
T
extends
JpaObject
>
Long
count
(
Class
<
T
>
cls
)
throws
Exception
{
EntityManager
em
=
this
.
get
(
cls
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionReference.java
浏览文件 @
c4bc7fe2
...
...
@@ -35,24 +35,23 @@ class ActionReference extends BaseAction {
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
if
(
effectivePerson
.
isNotPerson
(
effectivePerson
.
getDistinguishedName
())
&&
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
task
);
}
Wo
wo
=
new
Wo
();
/
** 组装 Task 信息 */
/
/ 组装 Task 信息
wo
.
setTask
(
WoTask
.
copier
.
copy
(
task
));
Work
work
=
emc
.
find
(
task
.
getWork
(),
Work
.
class
);
/
** 组装 Work */
/
/ 组装 Work
if
(
null
!=
work
)
{
wo
.
setWork
(
WoWork
.
copier
.
copy
(
work
));
// wrap.put("work", workOutCopier.copy(work));
/** 组装 Attachment */
// 组装 Attachment
wo
.
setAttachmentList
(
this
.
listAttachment
(
business
,
work
));
}
wo
.
setWorkCompletedList
(
this
.
listWorkCompleted
(
business
,
task
));
/
** 装载WorkLog 信息 */
/
/ 装载WorkLog 信息
wo
.
setWorkLogList
(
this
.
listWorkLog
(
business
,
task
));
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/V2Reset.java
浏览文件 @
c4bc7fe2
...
...
@@ -4,11 +4,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.x.base.core.project.logger.Audit
;
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
;
...
...
@@ -23,6 +18,7 @@ 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.Audit
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
...
...
@@ -35,6 +31,7 @@ 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.V2ResetWi
;
...
...
@@ -42,6 +39,10 @@ import com.x.processplatform.core.express.service.processing.jaxrs.task.WrapProc
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity
;
import
com.x.processplatform.core.express.service.processing.jaxrs.taskcompleted.WrapUpdateNextTaskIdentity
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
public
class
V2Reset
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2Reset
.
class
);
...
...
@@ -184,6 +185,13 @@ public class V2Reset extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>();
this
.
record
=
new
Record
(
workLog
,
task
);
// 校验workCompleted,如果存在,那么说明工作已经完成,标识状态为已经完成.
WorkCompleted
workCompleted
=
emc
.
firstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
task
.
getJob
());
if
(
null
!=
workCompleted
)
{
record
.
setCompleted
(
true
);
record
.
setWorkCompleted
(
workCompleted
.
getId
());
}
record
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
record
.
setType
(
Record
.
TYPE_RESET
);
List
<
String
>
ids
=
emc
.
idsEqual
(
Task
.
class
,
Task
.
job_FIELDNAME
,
work
.
getJob
());
...
...
@@ -192,19 +200,19 @@ public class V2Reset extends BaseAction {
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
));
if
(
wi
.
getKeep
(
))
{
/
* 不排除自己,那么把自己再加进去 */
if
(
BooleanUtils
.
isTrue
(
wi
.
getKeep
()
))
{
/
/ 不排除自己,那么把自己再加进去
list
.
add
(
task
);
}
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActivity
,
Collectors
.
toList
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
Task
task
=
o
.
getValue
().
get
(
0
);
Task
next
=
o
.
getValue
().
get
(
0
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
task
.
getActivity
());
nextManual
.
setActivityAlias
(
task
.
getActivityAlias
());
nextManual
.
setActivityName
(
task
.
getActivityName
());
nextManual
.
setActivityToken
(
task
.
getActivityToken
());
nextManual
.
setActivityType
(
task
.
getActivityType
());
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
());
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2AddSplit.java
浏览文件 @
c4bc7fe2
...
...
@@ -158,8 +158,6 @@ class V2AddSplit extends BaseAction {
ProcessingAttributes
processingAttributes
=
new
ProcessingAttributes
();
processingAttributes
.
setType
(
ProcessingAttributes
.
TYPE_ADDSPLIT
);
processingAttributes
.
setSeries
(
series
);
// 不需要从arrived开始,已经设置好全部状态.
// processingAttributes.setForceJoinAtArrive(true);
WoId
processingResp
=
ThisApplication
.
context
().
applications
()
.
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
id
,
"processing"
),
processingAttributes
,
work
.
getJob
())
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2Reroute.java
浏览文件 @
c4bc7fe2
...
...
@@ -4,11 +4,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.x.base.core.project.logger.Audit
;
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
;
...
...
@@ -23,6 +18,7 @@ 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.Audit
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
...
...
@@ -35,12 +31,17 @@ 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.entity.element.Activity
;
import
com.x.processplatform.core.entity.element.ActivityType
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.service.processing.jaxrs.work.V2RerouteWi
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
V2Reroute
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2Reroute
.
class
);
...
...
@@ -127,6 +128,13 @@ class V2Reroute extends BaseAction {
Business
business
=
new
Business
(
emc
);
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>();
record
=
new
Record
(
workLog
);
// 校验workCompleted,如果存在,那么说明工作已经完成,标识状态为已经完成.
WorkCompleted
workCompleted
=
emc
.
firstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
workLog
.
getJob
());
if
(
null
!=
workCompleted
)
{
record
.
setCompleted
(
true
);
record
.
setWorkCompleted
(
workCompleted
.
getId
());
}
record
.
setPerson
(
effectivePerson
.
getDistinguishedName
());
record
.
setType
(
Record
.
TYPE_REROUTE
);
record
.
setArrivedActivity
(
destinationActivity
.
getId
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录