Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
0809ed4f
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,发现更多精彩内容 >>
提交
0809ed4f
编写于
10月 29, 2020
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
数据中心查询优化修改
上级
fbfad904
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
37 addition
and
11 deletion
+37
-11
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/StatementAction.java
...ry/assemble/designer/jaxrs/statement/StatementAction.java
+1
-1
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionListWithQuery.java
...assemble/surface/jaxrs/statement/ActionListWithQuery.java
+31
-3
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/StatementAction.java
...ery/assemble/surface/jaxrs/statement/StatementAction.java
+5
-7
未找到文件。
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/StatementAction.java
浏览文件 @
0809ed4f
...
...
@@ -145,7 +145,7 @@ public class StatementAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"执行语句V2,可以同时执行查询结果及查询总数."
,
action
=
ActionExecuteV2
.
class
)
@POST
@Path
(
"{flag}/execute/mode/{mode}page/{page}/size/{size}"
)
@Path
(
"{flag}/execute/mode/{mode}
/
page/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
executeV2
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/ActionListWithQuery.java
浏览文件 @
0809ed4f
package
com.x.query.assemble.surface.jaxrs.statement
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.query.assemble.surface.Business
;
...
...
@@ -19,10 +22,11 @@ import java.util.ArrayList;
import
java.util.List
;
class
ActionListWithQuery
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
queryFlag
,
Boolean
justSelect
,
Boolean
hasView
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
queryFlag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Query
query
=
emc
.
flag
(
queryFlag
,
Query
.
class
);
if
(
null
==
query
)
{
throw
new
ExceptionEntityNotExist
(
queryFlag
);
...
...
@@ -34,10 +38,10 @@ class ActionListWithQuery extends BaseAction {
for
(
String
id
:
emc
.
idsEqual
(
Statement
.
class
,
Statement
.
query_FIELDNAME
,
query
.
getId
()))
{
Statement
o
=
business
.
pick
(
id
,
Statement
.
class
);
if
(
null
!=
o
)
{
if
(
BooleanUtils
.
isTrue
(
hasView
)
&&
StringUtils
.
isBlank
(
o
.
getView
())){
if
(
BooleanUtils
.
isTrue
(
wi
.
getHasView
()
)
&&
StringUtils
.
isBlank
(
o
.
getView
())){
continue
;
}
if
(
BooleanUtils
.
isTrue
(
justSelect
)
&&
!
Statement
.
TYPE_SELECT
.
equals
(
o
.
getType
())){
if
(
BooleanUtils
.
isTrue
(
wi
.
getJustSelect
()
)
&&
!
Statement
.
TYPE_SELECT
.
equals
(
o
.
getType
())){
continue
;
}
if
(
business
.
readable
(
effectivePerson
,
o
))
{
...
...
@@ -50,6 +54,30 @@ class ActionListWithQuery extends BaseAction {
}
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"是否只查询select语句."
)
private
Boolean
justSelect
;
@FieldDescribe
(
"是否只查询含有视图的语句."
)
private
Boolean
hasView
;
public
Boolean
getJustSelect
()
{
return
justSelect
;
}
public
void
setJustSelect
(
Boolean
justSelect
)
{
this
.
justSelect
=
justSelect
;
}
public
Boolean
getHasView
()
{
return
hasView
;
}
public
void
setHasView
(
Boolean
hasView
)
{
this
.
hasView
=
hasView
;
}
}
public
static
class
Wo
extends
Statement
{
private
static
final
long
serialVersionUID
=
-
5755898083219447939L
;
...
...
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/jaxrs/statement/StatementAction.java
浏览文件 @
0809ed4f
...
...
@@ -48,20 +48,18 @@ public class StatementAction extends StandardJaxrsAction {
}
@JaxrsMethodDescribe
(
value
=
"根据查询列示语句对象."
,
action
=
ActionListWithQuery
.
class
)
@
GE
T
@
POS
T
@Path
(
"list/query/{queryFlag}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithQuery
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"查询标识"
)
@PathParam
(
"queryFlag"
)
String
queryFlag
,
@JaxrsParameterDescribe
(
"是否只查询select语句"
)
@QueryParam
(
"justSelect"
)
Boolean
justSelect
,
@JaxrsParameterDescribe
(
"是否只查询含有视图的语句"
)
@QueryParam
(
"hasView"
)
Boolean
hasView
)
{
@JaxrsParameterDescribe
(
"查询标识"
)
@PathParam
(
"queryFlag"
)
String
queryFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionListWithQuery
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithQuery
().
execute
(
effectivePerson
,
queryFlag
,
j
ustSelect
,
hasView
);
result
=
new
ActionListWithQuery
().
execute
(
effectivePerson
,
queryFlag
,
j
sonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
...
...
@@ -87,7 +85,7 @@ public class StatementAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"执行语句V2,可以同时执行查询结果及查询总数."
,
action
=
ActionExecuteV2
.
class
)
@POST
@Path
(
"{flag}/execute/mode/{mode}page/{page}/size/{size}"
)
@Path
(
"{flag}/execute/mode/{mode}
/
page/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
executeV2
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录