Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
b48b84a4
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,发现更多精彩内容 >>
提交
b48b84a4
编写于
2月 16, 2022
作者:
R
Ray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update filter with completed
上级
47c5f0a2
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
122 addition
and
465 deletion
+122
-465
o2server/configSample/components.json
o2server/configSample/components.json
+2
-2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/bean/NameValueCountPair.java
...java/com/x/base/core/project/bean/NameValueCountPair.java
+2
-5
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java
...emble/surface/jaxrs/read/ActionFilterAttributeFilter.java
+29
-115
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java
...face/jaxrs/readcompleted/ActionFilterAttributeFilter.java
+33
-158
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/ActionFilterAttributeFilter.java
...face/jaxrs/taskcompleted/ActionFilterAttributeFilter.java
+56
-185
未找到文件。
o2server/configSample/components.json
浏览文件 @
b48b84a4
...
...
@@ -131,8 +131,8 @@
"dentyList"
:
[]
},
{
"name"
:
"
Tas
kCenter"
,
"path"
:
"process.
TaskC
enter"
,
"name"
:
"
Wor
kCenter"
,
"path"
:
"process.
workc
enter"
,
"title"
:
"办公中心"
,
"iconPath"
:
"appicon.png"
,
"orderNumber"
:
13.0
,
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/bean/NameValueCountPair.java
浏览文件 @
b48b84a4
...
...
@@ -32,11 +32,8 @@ public class NameValueCountPair {
return
false
;
}
NameValueCountPair
other
=
(
NameValueCountPair
)
obj
;
if
((
Objects
.
equals
(
this
.
getCount
(),
other
.
getCount
()))
&&
(
Objects
.
equals
(
this
.
getName
(),
other
.
getName
()))
&&
(
Objects
.
equals
(
this
.
getValue
(),
other
.
getValue
())))
{
return
true
;
}
return
false
;
return
(
Objects
.
equals
(
this
.
getCount
(),
other
.
getCount
()))
&&
(
Objects
.
equals
(
this
.
getName
(),
other
.
getName
()))
&&
(
Objects
.
equals
(
this
.
getValue
(),
other
.
getValue
()));
}
public
Object
getValue
()
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionFilterAttributeFilter.java
浏览文件 @
b48b84a4
...
...
@@ -34,16 +34,17 @@ class ActionFilterAttributeFilter extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
Predicate
p
=
predicate
(
effectivePerson
,
business
,
wi
);
Wo
wo
=
new
Wo
();
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
effectivePerson
,
wi
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
effectivePerson
,
wi
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
effectivePerson
,
wi
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
effectivePerson
,
wi
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
effectivePerson
,
wi
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
effectivePerson
,
wi
));
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
p
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
p
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
p
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
p
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
p
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
p
));
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -189,8 +190,7 @@ class ActionFilterAttributeFilter extends BaseAction {
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
Predicate
predicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -211,9 +211,23 @@ class ActionFilterAttributeFilter extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
// completed对象按单值处理
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
boolean
value
=
BooleanUtils
.
isTrue
(
wi
.
getCompletedList
().
get
(
0
));
if
(
value
)
{
p
=
cb
.
and
(
p
,
cb
.
isTrue
(
root
.
get
(
Read_
.
completed
)));
}
else
{
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Read_
.
completed
)),
cb
.
isFalse
(
root
.
get
(
Read_
.
completed
))));
}
}
return
p
;
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
cq
.
select
(
root
.
get
(
Read_
.
application
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -238,31 +252,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Read_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
Read_
.
process
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -287,31 +281,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Read_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
Read_
.
creatorUnit
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -330,31 +304,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Read_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
Read_
.
activityName
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -373,31 +327,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Read_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
Read_
.
startTimeMonth
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -416,31 +350,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Boolean
>
cq
=
cb
.
createQuery
(
Boolean
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Read_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
Read_
.
completed
)).
where
(
p
);
List
<
Boolean
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionFilterAttributeFilter.java
浏览文件 @
b48b84a4
...
...
@@ -27,7 +27,6 @@ import com.x.base.core.project.tools.ListTools;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.ReadCompleted
;
import
com.x.processplatform.core.entity.content.ReadCompleted_
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
...
...
@@ -35,17 +34,18 @@ class ActionFilterAttributeFilter extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
Predicate
p
=
predicate
(
effectivePerson
,
business
,
wi
);
Wo
wo
=
new
Wo
();
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
effectivePerson
,
wi
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
effectivePerson
,
wi
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
effectivePerson
,
wi
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
effectivePerson
,
wi
));
wo
.
getCompletedTimeMonthList
().
addAll
(
this
.
listCompletedTimeMonthPair
(
business
,
effectivePerson
,
wi
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
effectivePerson
,
wi
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
effectivePerson
,
wi
));
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
p
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
p
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
p
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
p
));
wo
.
getCompletedTimeMonthList
().
addAll
(
this
.
listCompletedTimeMonthPair
(
business
,
p
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
p
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
p
));
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -213,8 +213,7 @@ class ActionFilterAttributeFilter extends BaseAction {
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
Predicate
predicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -238,12 +237,26 @@ class ActionFilterAttributeFilter extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
// completed对象按单值处理
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
boolean
value
=
BooleanUtils
.
isTrue
(
wi
.
getCompletedList
().
get
(
0
));
if
(
value
)
{
p
=
cb
.
and
(
p
,
cb
.
isTrue
(
root
.
get
(
ReadCompleted_
.
completed
)));
}
else
{
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
ReadCompleted_
.
completed
)),
cb
.
isFalse
(
root
.
get
(
ReadCompleted_
.
completed
))));
}
}
return
p
;
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
cq
.
select
(
root
.
get
(
ReadCompleted_
.
application
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
;
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
for
(
String
str
:
os
)
{
if
(
StringUtils
.
isNotEmpty
(
str
))
{
...
...
@@ -265,34 +278,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
process
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -316,34 +306,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
creatorUnit
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -361,34 +328,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
activityName
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -406,34 +350,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
startTimeMonth
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -451,34 +372,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listCompletedTimeMonthPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCompletedTimeMonthPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
completedTimeMonth
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -496,34 +394,11 @@ class ActionFilterAttributeFilter extends BaseAction {
return
wos
;
}
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Boolean
>
cq
=
cb
.
createQuery
(
Boolean
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
ReadCompleted_
.
completed
)).
where
(
p
);
List
<
Boolean
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/ActionFilterAttributeFilter.java
浏览文件 @
b48b84a4
...
...
@@ -34,17 +34,18 @@ class ActionFilterAttributeFilter extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
Predicate
p
=
predicate
(
effectivePerson
,
business
,
wi
);
Wo
wo
=
new
Wo
();
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
effectivePerson
,
wi
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
effectivePerson
,
wi
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
effectivePerson
,
wi
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
effectivePerson
,
wi
));
wo
.
getCompletedTimeMonthList
().
addAll
(
this
.
listCompletedTimeMonthPair
(
business
,
effectivePerson
,
wi
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
effectivePerson
,
wi
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
effectivePerson
,
wi
));
wo
.
getApplicationList
().
addAll
(
this
.
listApplicationPair
(
business
,
p
));
wo
.
getProcessList
().
addAll
(
this
.
listProcessPair
(
business
,
p
));
wo
.
getCreatorUnitList
().
addAll
(
this
.
listCreatorUnitPair
(
business
,
p
));
wo
.
getStartTimeMonthList
().
addAll
(
this
.
listStartTimeMonthPair
(
business
,
p
));
wo
.
getCompletedTimeMonthList
().
addAll
(
this
.
listCompletedTimeMonthPair
(
business
,
p
));
wo
.
getActivityNameList
().
addAll
(
this
.
listActivityNamePair
(
business
,
p
));
wo
.
getCompletedList
().
addAll
(
this
.
listCompletedPair
(
business
,
p
));
result
.
setData
(
wo
);
return
result
;
}
...
...
@@ -212,8 +213,7 @@ class ActionFilterAttributeFilter extends BaseAction {
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
Predicate
predicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -239,9 +239,24 @@ class ActionFilterAttributeFilter extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
// completed对象按单值处理
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
boolean
value
=
BooleanUtils
.
isTrue
(
wi
.
getCompletedList
().
get
(
0
));
if
(
value
)
{
p
=
cb
.
and
(
p
,
cb
.
isTrue
(
root
.
get
(
TaskCompleted_
.
completed
)));
}
else
{
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
completed
)),
cb
.
isFalse
(
root
.
get
(
TaskCompleted_
.
completed
))));
}
}
return
p
;
}
private
List
<
NameValueCountPair
>
listApplicationPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
cq
.
select
(
root
.
get
(
TaskCompleted_
.
application
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -259,42 +274,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listProcessPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
process
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -312,42 +303,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCreatorUnitPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
creatorUnit
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -359,42 +326,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listActivityNamePair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
activityName
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -406,42 +349,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listStartTimeMonthPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
startTimeMonth
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -453,42 +372,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listCompletedTimeMonthPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCompletedTimeMonthPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
completedTimeMonth
)).
where
(
p
);
List
<
String
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
@@ -500,42 +395,18 @@ class ActionFilterAttributeFilter extends BaseAction {
wos
.
add
(
o
);
}
}
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
{
return
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
));
})).
collect
(
Collectors
.
toList
());
wos
=
wos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
NameValueCountPair:
:
getName
,
(
s1
,
s2
)
->
Objects
.
toString
(
s1
,
""
).
compareTo
(
Objects
.
toString
(
s2
,
""
))))
.
collect
(
Collectors
.
toList
());
return
wos
;
}
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
EffectivePerson
effectivePerson
,
Wi
wi
)
throws
Exception
{
private
List
<
NameValueCountPair
>
listCompletedPair
(
Business
business
,
Predicate
p
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Boolean
>
cq
=
cb
.
createQuery
(
Boolean
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
effectivePerson
.
getDistinguishedName
());
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
latest
),
true
),
cb
.
isNull
(
root
.
get
(
TaskCompleted_
.
latest
))));
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completedTimeMonth
).
in
(
wi
.
getCompletedTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCompletedList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
completed
).
in
(
wi
.
getCompletedList
()));
}
cq
.
select
(
root
.
get
(
TaskCompleted_
.
completed
)).
where
(
p
);
List
<
Boolean
>
os
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
NameValueCountPair
>
wos
=
new
ArrayList
<>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录