Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
86a9e623
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
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,发现更多精彩内容 >>
提交
86a9e623
编写于
1月 21, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复设计搜索,减少线程创建
上级
fd74eeca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
83 deletion
+40
-83
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
...atform/assemble/designer/jaxrs/designer/ActionSearch.java
+15
-29
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
...x/query/service/processing/jaxrs/design/ActionSearch.java
+25
-54
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
浏览文件 @
86a9e623
...
...
@@ -170,42 +170,28 @@ class ActionSearch extends BaseAction {
}
catch
(
Exception
e
){
logger
.
error
(
e
);
}
Executor
executor
=
Executors
.
newFixedThreadPool
(
batchList
.
size
());
List
<
CompletableFuture
<
List
<
Wo
>>>
cfList
=
new
ArrayList
<>();
List
<
Wo
>
resWos
=
new
ArrayList
<>();
for
(
List
<
String
>
partProcessIds
:
batchList
)
{
CompletableFuture
<
List
<
Wo
>>
cf
=
CompletableFuture
.
supplyAsync
(()
->
{
List
<
Wo
>
resWos
=
new
ArrayList
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
List
<
Process
>
processList
=
emc
.
list
(
Process
.
class
,
partProcessIds
);
for
(
Process
process
:
processList
)
{
try
{
Wo
wo
=
doProcessSearch
(
business
,
process
,
wi
);
if
(
wo
!=
null
){
resWos
.
add
(
wo
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
List
<
Process
>
processList
=
emc
.
list
(
Process
.
class
,
partProcessIds
);
for
(
Process
process
:
processList
)
{
try
{
Wo
wo
=
doProcessSearch
(
business
,
process
,
wi
);
if
(
wo
!=
null
){
resWos
.
add
(
wo
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
processList
.
clear
();
processList
=
null
;
}
catch
(
Exception
e
){
logger
.
error
(
e
);
}
return
resWos
;
},
executor
);
cfList
.
add
(
cf
);
}
List
<
Wo
>
woList
=
new
ArrayList
<>();
for
(
CompletableFuture
<
List
<
Wo
>>
cf
:
cfList
){
try
{
woList
.
addAll
(
cf
.
get
(
30
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
){
processList
.
clear
();
processList
=
null
;
}
catch
(
Exception
e
){
logger
.
error
(
e
);
}
}
return
woList
;
return
resWos
;
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
浏览文件 @
86a9e623
...
...
@@ -34,7 +34,7 @@ class ActionSearch extends BaseAction {
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
logger
.
info
(
"{}搜索设计:{}的关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getModuleList
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}搜索设计:{}的关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getModuleList
(),
wi
.
getKeyword
());
if
(
ListTools
.
isNotEmpty
(
wi
.
getModuleList
()))
{
result
.
setData
(
search
(
wi
,
effectivePerson
));
}
else
{
...
...
@@ -92,67 +92,38 @@ class ActionSearch extends BaseAction {
moduleMap
.
put
(
ModuleType
.
service
.
toString
(),
list
);
}
}
Executor
executor
=
Executors
.
newFixedThreadPool
(
5
);
CompletableFuture
<
List
<
WrapDesigner
>>
processPlatformCf
=
searchAsync
(
wi
,
moduleMap
,
ModuleType
.
processPlatform
.
toString
(),
x_processplatform_assemble_designer
.
class
,
executor
);
CompletableFuture
<
List
<
WrapDesigner
>>
portalCf
=
searchAsync
(
wi
,
moduleMap
,
ModuleType
.
portal
.
toString
(),
x_portal_assemble_designer
.
class
,
executor
);
CompletableFuture
<
List
<
WrapDesigner
>>
cmsCf
=
searchAsync
(
wi
,
moduleMap
,
ModuleType
.
cms
.
toString
(),
x_cms_assemble_control
.
class
,
executor
);
CompletableFuture
<
List
<
WrapDesigner
>>
queryCf
=
searchAsync
(
wi
,
moduleMap
,
ModuleType
.
query
.
toString
(),
x_query_assemble_designer
.
class
,
executor
);
CompletableFuture
<
List
<
WrapDesigner
>>
serviceCf
=
searchAsync
(
wi
,
moduleMap
,
ModuleType
.
service
.
toString
(),
x_program_center
.
class
,
executor
);
Wo
wo
=
new
Wo
();
try
{
wo
.
setProcessPlatformList
(
processPlatformCf
.
get
(
200
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
"搜索流程平台设计异常:{}"
,
e
.
getMessage
());
}
try
{
wo
.
setPortalList
(
portalCf
.
get
(
200
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
"搜索门户平台设计异常:{}"
,
e
.
getMessage
());
}
try
{
wo
.
setCmsList
(
cmsCf
.
get
(
200
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
"搜索内容管理平台设计异常:{}"
,
e
.
getMessage
());
}
try
{
wo
.
setQueryList
(
queryCf
.
get
(
200
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
"搜索数据中心平台设计异常:{}"
,
e
.
getMessage
());
}
try
{
wo
.
setServiceList
(
serviceCf
.
get
(
200
,
TimeUnit
.
SECONDS
));
}
catch
(
Exception
e
)
{
logger
.
warn
(
"搜索服务管理平台设计异常:{}"
,
e
.
getMessage
());
}
wo
.
setProcessPlatformList
(
searchApp
(
wi
,
moduleMap
,
ModuleType
.
processPlatform
.
toString
(),
x_processplatform_assemble_designer
.
class
));
wo
.
setPortalList
(
searchApp
(
wi
,
moduleMap
,
ModuleType
.
portal
.
toString
(),
x_portal_assemble_designer
.
class
));
wo
.
setCmsList
(
searchApp
(
wi
,
moduleMap
,
ModuleType
.
cms
.
toString
(),
x_cms_assemble_control
.
class
));
wo
.
setQueryList
(
searchApp
(
wi
,
moduleMap
,
ModuleType
.
query
.
toString
(),
x_query_assemble_designer
.
class
));
wo
.
setServiceList
(
searchApp
(
wi
,
moduleMap
,
ModuleType
.
service
.
toString
(),
x_program_center
.
class
));
return
wo
;
}
private
CompletableFuture
<
List
<
WrapDesigner
>>
searchAsync
(
final
Wi
wi
,
final
Map
<
String
,
List
<
WiDesigner
.
ModuleApp
>>
moduleMap
,
final
String
moduleType
,
final
Class
<?>
applicationClass
,
Executor
executor
){
CompletableFuture
<
List
<
WrapDesigner
>>
cf
=
CompletableFuture
.
supplyAsync
(()
->
{
List
<
WrapDesigner
>
swList
=
null
;
if
(
moduleMap
.
containsKey
(
moduleType
))
{
private
List
<
WrapDesigner
>
searchApp
(
final
Wi
wi
,
final
Map
<
String
,
List
<
WiDesigner
.
ModuleApp
>>
moduleMap
,
final
String
moduleType
,
final
Class
<?>
applicationClass
){
List
<
WrapDesigner
>
swList
=
null
;
if
(
moduleMap
.
containsKey
(
moduleType
))
{
try
{
WiDesigner
wiDesigner
=
new
WiDesigner
();
BeanUtils
.
copyProperties
(
wiDesigner
,
wi
);
wiDesigner
.
setModuleAppList
(
moduleMap
.
get
(
moduleType
));
List
<
WrapDesigner
>
designerList
=
ThisApplication
.
context
().
applications
().
postQuery
(
applicationClass
,
Applications
.
joinQueryUri
(
"designer"
,
"search"
),
wiDesigner
).
getDataAsList
(
WrapDesigner
.
class
);
logger
.
debug
(
"设计搜索关联{}的匹配设计个数:{}"
,
moduleType
,
designerList
.
size
());
getSearchRes
(
wi
,
designerList
);
swList
=
designerList
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
if
(
swList
!=
null
&&
swList
.
size
()
>
2
)
{
try
{
WiDesigner
wiDesigner
=
new
WiDesigner
();
BeanUtils
.
copyProperties
(
wiDesigner
,
wi
);
wiDesigner
.
setModuleAppList
(
moduleMap
.
get
(
moduleType
));
List
<
WrapDesigner
>
designerList
=
ThisApplication
.
context
().
applications
().
postQuery
(
applicationClass
,
Applications
.
joinQueryUri
(
"designer"
,
"search"
),
wiDesigner
).
getDataAsList
(
WrapDesigner
.
class
);
logger
.
info
(
"设计搜索关联{}的匹配设计个数:{}"
,
moduleType
,
designerList
.
size
());
getSearchRes
(
wi
,
designerList
);
swList
=
designerList
;
SortTools
.
desc
(
swList
,
"designerType"
,
"appId"
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
if
(
swList
!=
null
&&
swList
.
size
()
>
2
)
{
try
{
SortTools
.
desc
(
swList
,
"designerType"
,
"appId"
);
}
catch
(
Exception
e
)
{
}
}
}
return
swList
;
},
executor
);
return
cf
;
}
return
swList
;
}
private
void
getSearchRes
(
final
Wi
wi
,
List
<
WrapDesigner
>
designerList
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录