Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
7dbf3108
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,发现更多精彩内容 >>
提交
7dbf3108
编写于
7月 08, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
内容管理文档查询速度优化
上级
a89a65fe
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
16 deletion
+42
-16
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPaging.java
...ntrol/jaxrs/document/ActionQueryListWithFilterPaging.java
+13
-2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
.../jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
+29
-14
未找到文件。
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPaging.java
浏览文件 @
7dbf3108
...
@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.jaxrs.document;
...
@@ -2,6 +2,7 @@ package com.x.cms.assemble.control.jaxrs.document;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
...
@@ -11,6 +12,7 @@ import com.x.base.core.project.logger.LoggerFactory;
...
@@ -11,6 +12,7 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.cms.core.entity.Document
;
import
com.x.cms.core.entity.Document
;
import
com.x.cms.core.express.tools.filter.QueryFilter
;
import
com.x.cms.core.express.tools.filter.QueryFilter
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -47,7 +49,7 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
...
@@ -47,7 +49,7 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
}
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderField
()
))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderField
()
))
{
wi
.
setOrderField
(
"
create
Time"
);
wi
.
setOrderField
(
"
publish
Time"
);
}
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderType
()
))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderType
()
))
{
...
@@ -84,7 +86,7 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
...
@@ -84,7 +86,7 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
}
}
}
}
if
(
check
)
{
if
(
check
&&
!
BooleanUtils
.
isTrue
(
wi
.
getJustData
())
)
{
// 从Review表中查询符合条件的对象总数
// 从Review表中查询符合条件的对象总数
try
{
try
{
if
(
isManager
)
{
if
(
isManager
)
{
...
@@ -172,7 +174,16 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
...
@@ -172,7 +174,16 @@ public class ActionQueryListWithFilterPaging extends BaseAction {
}
}
public
static
class
Wi
extends
WrapInDocumentFilter
{
public
static
class
Wi
extends
WrapInDocumentFilter
{
@FieldDescribe
(
"仅返回数据不查询总数,默认false"
)
private
Boolean
justData
;
public
Boolean
getJustData
()
{
return
justData
;
}
public
void
setJustData
(
Boolean
justData
)
{
this
.
justData
=
justData
;
}
}
}
public
static
class
Wo
extends
WrapOutDocumentList
{
public
static
class
Wo
extends
WrapOutDocumentList
{
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
浏览文件 @
7dbf3108
...
@@ -19,6 +19,7 @@ import com.x.cms.core.entity.Review;
...
@@ -19,6 +19,7 @@ import com.x.cms.core.entity.Review;
import
com.x.cms.core.entity.Review_
;
import
com.x.cms.core.entity.Review_
;
import
com.x.cms.core.express.tools.CriteriaBuilderTools
;
import
com.x.cms.core.express.tools.CriteriaBuilderTools
;
import
com.x.cms.core.express.tools.filter.QueryFilter
;
import
com.x.cms.core.express.tools.filter.QueryFilter
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
...
@@ -38,41 +39,44 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
...
@@ -38,41 +39,44 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Wo
>
wos
=
new
ArrayList
<>();
List
<
Wo
>
wos
=
new
ArrayList
<>();
Business
business
=
new
Business
(
null
);
Business
business
=
new
Business
(
null
);
if
(!
business
.
isManager
(
effectivePerson
))
{
if
(!
business
.
isManager
(
effectivePerson
))
{
result
.
setCount
(
0L
);
result
.
setCount
(
0L
);
result
.
setData
(
wos
);
result
.
setData
(
wos
);
return
result
;
return
result
;
}
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
StringUtils
.
isEmpty
(
wi
.
getDocumentType
()
))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getDocumentType
()
))
{
wi
.
setDocumentType
(
"信息"
);
wi
.
setDocumentType
(
"信息"
);
}
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderField
()
))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderField
()
))
{
wi
.
setOrderField
(
"createTime"
);
wi
.
setOrderField
(
"publishTime"
);
}
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderType
()
))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getOrderType
()
))
{
wi
.
setOrderType
(
"DESC"
);
wi
.
setOrderType
(
"DESC"
);
}
}
if
(
ListTools
.
isEmpty
(
wi
.
getStatusList
()
))
{
if
(
ListTools
.
isEmpty
(
wi
.
getStatusList
()
))
{
List
<
String
>
status
=
new
ArrayList
<>();
List
<
String
>
status
=
new
ArrayList
<>();
status
.
add
(
"published"
);
status
.
add
(
"published"
);
wi
.
setStatusList
(
status
);
wi
.
setStatusList
(
status
);
}
}
QueryFilter
queryFilter
=
wi
.
getQueryFilter
();
QueryFilter
queryFilter
=
wi
.
getQueryFilter
();
String
personName
=
wi
.
getPerson
();
String
personName
=
wi
.
getPerson
();
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
()))
{
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
()))
{
personName
=
business
.
organization
().
person
().
get
(
wi
.
getPerson
());
personName
=
business
.
organization
().
person
().
get
(
wi
.
getPerson
());
if
(
StringUtils
.
isBlank
(
personName
))
{
if
(
StringUtils
.
isBlank
(
personName
))
{
personName
=
wi
.
getPerson
();
personName
=
wi
.
getPerson
();
}
}
}
}
Long
total
=
documentQueryService
.
countWithCondition
(
personName
,
queryFilter
,
wi
.
getAuthor
());
Long
total
=
0L
;
if
(!
BooleanUtils
.
isTrue
(
wi
.
getJustData
())){
total
=
documentQueryService
.
countWithCondition
(
personName
,
queryFilter
,
wi
.
getAuthor
());
}
List
<
Document
>
searchResultList
=
documentQueryService
.
listPagingWithCondition
(
personName
,
wi
.
getOrderField
(),
wi
.
getOrderType
(),
queryFilter
,
page
,
size
,
wi
.
getAuthor
());
List
<
Document
>
searchResultList
=
documentQueryService
.
listPagingWithCondition
(
personName
,
wi
.
getOrderField
(),
wi
.
getOrderType
(),
queryFilter
,
page
,
size
,
wi
.
getAuthor
());
Wo
wo
=
null
;
Wo
wo
=
null
;
for
(
Document
document
:
searchResultList
)
{
for
(
Document
document
:
searchResultList
)
{
...
@@ -110,6 +114,9 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
...
@@ -110,6 +114,9 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
@FieldDescribe
(
"是否查询指定用户可编辑的文档,如果为true则person字段必填,默认为否"
)
@FieldDescribe
(
"是否查询指定用户可编辑的文档,如果为true则person字段必填,默认为否"
)
private
Boolean
isAuthor
;
private
Boolean
isAuthor
;
@FieldDescribe
(
"仅返回数据不查询总数,默认false"
)
private
Boolean
justData
;
public
String
getPerson
()
{
public
String
getPerson
()
{
return
person
;
return
person
;
}
}
...
@@ -125,6 +132,14 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
...
@@ -125,6 +132,14 @@ public class ActionQueryListWithFilterPagingAdmin extends BaseAction {
public
void
setAuthor
(
Boolean
author
)
{
public
void
setAuthor
(
Boolean
author
)
{
isAuthor
=
author
;
isAuthor
=
author
;
}
}
public
Boolean
getJustData
()
{
return
justData
;
}
public
void
setJustData
(
Boolean
justData
)
{
this
.
justData
=
justData
;
}
}
}
public
static
class
Wo
extends
WrapOutDocumentList
{
public
static
class
Wo
extends
WrapOutDocumentList
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录