Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
43353ae4
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,发现更多精彩内容 >>
提交
43353ae4
编写于
9月 29, 2020
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程平台管理员分页查询接口修改,解决数据量大慢的问题
上级
2e7e7e31
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
31 addition
and
591 deletion
+31
-591
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionManageListFilterPaging.java
...mble/surface/jaxrs/read/ActionManageListFilterPaging.java
+5
-101
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionManageListFilterPaging.java
...ace/jaxrs/readcompleted/ActionManageListFilterPaging.java
+5
-103
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionManageListFilterPaging.java
...mble/surface/jaxrs/task/ActionManageListFilterPaging.java
+5
-112
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/ActionManageListFilterPaging.java
...ace/jaxrs/taskcompleted/ActionManageListFilterPaging.java
+6
-82
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListFilterPaging.java
...mble/surface/jaxrs/work/ActionManageListFilterPaging.java
+5
-100
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListFilterPaging.java
...ace/jaxrs/workcompleted/ActionManageListFilterPaging.java
+5
-93
未找到文件。
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -34,15 +34,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
Read
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
Read
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
Read
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
Read
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -51,8 +46,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
Read
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -138,98 +132,8 @@ class ActionManageListFilterPaging extends BaseAction {
cb
.
like
(
root
.
get
(
Read_
.
creatorUnit
),
"%"
+
key
+
"%"
)));
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
Read_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Read
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Read
>
root
=
cq
.
from
(
Read
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
person
),
wi
.
getPerson
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Read_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Read_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Read_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
person_ids
))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
person
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
work
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Read_
.
job
).
in
(
wi
.
getJobList
()));
}
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
(
StringUtils
.
isNotEmpty
(
wi
.
getKey
()))
{
String
key
=
StringUtils
.
trim
(
StringUtils
.
replace
(
wi
.
getKey
(),
"\u3000"
,
" "
));
if
(
StringUtils
.
isNotEmpty
(
key
))
{
key
=
StringUtils
.
replaceEach
(
key
,
new
String
[]
{
"?"
,
"%"
},
new
String
[]
{
""
,
""
});
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
like
(
root
.
get
(
Read_
.
title
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Read_
.
opinion
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Read_
.
serial
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Read_
.
creatorPerson
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
Read_
.
creatorUnit
),
"%"
+
key
+
"%"
)));
}
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -36,15 +36,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
ReadCompleted
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
ReadCompleted
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
ReadCompleted
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
ReadCompleted
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -53,8 +48,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
ReadCompleted
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -142,100 +136,8 @@ class ActionManageListFilterPaging extends BaseAction {
cb
.
like
(
root
.
get
(
ReadCompleted_
.
creatorUnit
),
"%"
+
key
+
"%"
)));
}
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
ReadCompleted_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
ReadCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
ReadCompleted
>
root
=
cq
.
from
(
ReadCompleted
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
person
),
wi
.
getPerson
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
ReadCompleted_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
ReadCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
ReadCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
person_ids
))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
person
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
work
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
ReadCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getKey
()))
{
String
key
=
StringUtils
.
trim
(
StringUtils
.
replace
(
wi
.
getKey
(),
"\u3000"
,
" "
));
if
(
StringUtils
.
isNotEmpty
(
key
))
{
key
=
StringUtils
.
replaceEach
(
key
,
new
String
[]
{
"?"
,
"%"
},
new
String
[]
{
""
,
""
});
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
like
(
root
.
get
(
ReadCompleted_
.
title
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
ReadCompleted_
.
opinion
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
ReadCompleted_
.
serial
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
ReadCompleted_
.
creatorPerson
),
"%"
+
key
+
"%"
),
cb
.
like
(
root
.
get
(
ReadCompleted_
.
creatorUnit
),
"%"
+
key
+
"%"
)));
}
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -36,15 +36,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
BooleanUtils
.
isTrue
(
business
.
canManageApplication
(
effectivePerson
,
null
)))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
Task
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
Task
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
Task
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
Task
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -53,8 +48,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
Task
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Task
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -151,109 +145,8 @@ class ActionManageListFilterPaging extends BaseAction {
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Task_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
Task_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Task
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Task
>
root
=
cq
.
from
(
Task
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
person
),
wi
.
getPerson
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
()))
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Task_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
()))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Task_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
()))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Task_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
person_ids
))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
person
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
work
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Task_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getExpireTime
()))
{
int
expireTime
=
0
;
try
{
expireTime
=
Integer
.
parseInt
(
wi
.
getExpireTime
());
}
catch
(
NumberFormatException
e
)
{
}
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Task_
.
expireTime
),
DateTools
.
getAdjustTimeDay
(
null
,
0
,
-
expireTime
,
0
,
0
)));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getUrgeTime
()))
{
int
urgeTime
=
0
;
try
{
urgeTime
=
Integer
.
parseInt
(
wi
.
getUrgeTime
());
}
catch
(
NumberFormatException
e
)
{
}
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Task_
.
urgeTime
),
DateTools
.
getAdjustTimeDay
(
null
,
0
,
-
urgeTime
,
0
,
0
)));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Task_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -35,15 +35,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
TaskCompleted
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
TaskCompleted
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
TaskCompleted
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
TaskCompleted
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -52,79 +47,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
TaskCompleted
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
TaskCompleted
>
cq
=
cb
.
createQuery
(
TaskCompleted
.
class
);
Root
<
TaskCompleted
>
root
=
cq
.
from
(
TaskCompleted
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
person
),
wi
.
getPerson
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
TaskCompleted_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
work
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
TaskCompleted_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
TaskCompleted_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
TaskCompleted_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
TaskCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -202,7 +125,8 @@ class ActionManageListFilterPaging extends BaseAction {
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
TaskCompleted_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -35,15 +35,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
Work
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
Work
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
Work
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
Work
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -52,8 +47,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
Work
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Work
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -136,96 +130,7 @@ class ActionManageListFilterPaging extends BaseAction {
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Work_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
Work_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Work
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Work
>
root
=
cq
.
from
(
Work
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
null
!=
wi
.
getWorkThroughManual
()){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workThroughManual
),
wi
.
getWorkThroughManual
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getWorkCreateType
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workCreateType
),
wi
.
getWorkCreateType
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
id
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Work_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Work_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
person_ids
))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
creatorPerson
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkStatusList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
workStatus
).
in
(
wi
.
getWorkStatusList
()));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Work_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListFilterPaging.java
浏览文件 @
43353ae4
...
...
@@ -35,15 +35,10 @@ class ActionManageListFilterPaging extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
Integer
adjustPage
=
this
.
adjustPage
(
page
);
Integer
adjustPageSize
=
this
.
adjustSize
(
size
);
List
<
WorkCompleted
>
os
=
this
.
list
(
effectivePerson
,
business
,
adjustPage
,
adjustPageSize
,
wi
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
WorkCompleted
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
WorkCompleted
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
this
.
count
(
effectivePerson
,
business
,
wi
));
result
.
setCount
(
emc
.
count
(
WorkCompleted
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<
Wo
>());
result
.
setCount
(
0L
);
...
...
@@ -52,8 +47,7 @@ class ActionManageListFilterPaging extends BaseAction {
}
}
private
List
<
WorkCompleted
>
list
(
EffectivePerson
effectivePerson
,
Business
business
,
Integer
adjustPage
,
Integer
adjustPageSize
,
Wi
wi
)
throws
Exception
{
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
WorkCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -127,89 +121,7 @@ class ActionManageListFilterPaging extends BaseAction {
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue10
),
wi
.
getStringValue10
()));
}
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
WorkCompleted_
.
startTime
)));
return
em
.
createQuery
(
cq
).
setFirstResult
((
adjustPage
-
1
)
*
adjustPageSize
).
setMaxResults
(
adjustPageSize
)
.
getResultList
();
}
private
Long
count
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
WorkCompleted
.
class
);
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
WorkCompleted
>
root
=
cq
.
from
(
WorkCompleted
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
wi
.
getApplicationList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
application
).
in
(
wi
.
getApplicationList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isFalse
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
WorkCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
WorkCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
person_ids
))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
creatorPerson
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
id
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStartTimeMonthList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
startTimeMonth
).
in
(
wi
.
getStartTimeMonthList
()));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
WorkCompleted_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue10
),
wi
.
getStringValue10
()));
}
return
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录