Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
c1aadc5c
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
c1aadc5c
编写于
7月 27, 2021
作者:
Z
zhourui
2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复获取组织时使用多线程导致的线程相互等待
上级
11192086
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
45 deletion
+48
-45
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
...ization/assemble/express/jaxrs/unit/ActionListObject.java
+48
-45
未找到文件。
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
浏览文件 @
c1aadc5c
...
...
@@ -112,49 +112,15 @@ class ActionListObject extends BaseAction {
}
// private List<Wo> list(Business business, Wi wi) throws Exception {
// List<Wo> wos = new ArrayList<>();
// for (String str : wi.getUnitList()) {
// Unit o = business.unit().pick(str);
// if (o != null) {
// Wo wo = Wo.copier.copy(o);
// wo.setMatchKey(str);
// if (StringUtils.isNotEmpty(wo.getSuperior())) {
// Unit superior = business.unit().pick(wo.getSuperior());
// if (null != superior) {
// wo.setSuperior(superior.getDistinguishedName());
// }
// }
// wo.setSubDirectIdentityCount(this.countSubDirectIdentity(business, wo));
// wo.setSubDirectUnitCount(this.countSubDirectUnit(business, wo));
// wos.add(wo);
// }
// }
// return wos;
//}
private
List
<
Wo
>
list
(
Wi
wi
)
throws
InterruptedException
,
ExecutionException
{
private
List
<
Wo
>
list
(
Wi
wi
)
throws
Exception
{
List
<
Wo
>
wos
=
new
ArrayList
<>();
List
<
CompletableFuture
<
Wo
>>
futures
=
new
ArrayList
<>();
for
(
String
str
:
wi
.
getUnitList
())
{
futures
.
add
(
future
(
str
));
}
for
(
CompletableFuture
<
Wo
>
future
:
futures
)
{
wos
.
add
(
future
.
get
());
}
return
ListTools
.
trim
(
wos
,
true
,
false
);
}
private
CompletableFuture
<
Wo
>
future
(
String
name
)
{
return
CompletableFuture
.
supplyAsync
(()
->
{
Wo
wo
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Unit
o
=
business
.
unit
().
pick
(
name
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
for
(
String
str
:
wi
.
getUnitList
())
{
Unit
o
=
business
.
unit
().
pick
(
str
);
if
(
o
!=
null
)
{
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setMatchKey
(
name
);
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setMatchKey
(
str
);
if
(
StringUtils
.
isNotEmpty
(
wo
.
getSuperior
()))
{
Unit
superior
=
business
.
unit
().
pick
(
wo
.
getSuperior
());
if
(
null
!=
superior
)
{
...
...
@@ -163,14 +129,51 @@ class ActionListObject extends BaseAction {
}
wo
.
setSubDirectIdentityCount
(
this
.
countSubDirectIdentity
(
business
,
wo
));
wo
.
setSubDirectUnitCount
(
this
.
countSubDirectUnit
(
business
,
wo
));
wos
.
add
(
wo
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
return
wo
;
}
);
return
wo
s
;
}
}
// private List<Wo> list(Wi wi) throws InterruptedException, ExecutionException {
// List<Wo> wos = new ArrayList<>();
//
// List<CompletableFuture<Wo>> futures = new ArrayList<>();
// for (String str : wi.getUnitList()) {
// futures.add(future(str));
// }
// for (CompletableFuture<Wo> future : futures) {
// wos.add(future.get());
// }
// return ListTools.trim(wos, true, false);
// }
//
// private CompletableFuture<Wo> future(String name) {
// return CompletableFuture.supplyAsync(() -> {
// Wo wo = null;
// try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
// Business business = new Business(emc);
// Unit o = business.unit().pick(name);
// if (o != null) {
// wo = Wo.copier.copy(o);
// wo.setMatchKey(name);
// if (StringUtils.isNotEmpty(wo.getSuperior())) {
// Unit superior = business.unit().pick(wo.getSuperior());
// if (null != superior) {
// wo.setSuperior(superior.getDistinguishedName());
// }
// }
// wo.setSubDirectIdentityCount(this.countSubDirectIdentity(business, wo));
// wo.setSubDirectUnitCount(this.countSubDirectUnit(business, wo));
// }
// } catch (Exception e) {
// logger.error(e);
// }
// return wo;
// });
// }
//
private
Long
countSubDirectUnit
(
Business
business
,
Wo
wo
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Unit
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
liyi_hz2008
@liyi_hz2008
mentioned in commit
90e0069c
·
7月 27, 2021
mentioned in commit
90e0069c
mentioned in commit 90e0069cfeafd3bfb1b7b3b50f0012fdd151d443
开关提交列表
liyi_hz2008
@liyi_hz2008
mentioned in commit
e7ba6955
·
7月 27, 2021
mentioned in commit
e7ba6955
mentioned in commit e7ba69557d3a9fc98fbb7b2bd7710a15adf1e639
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录