Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
f7dd7c00
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,发现更多精彩内容 >>
提交
f7dd7c00
编写于
7月 06, 2021
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除人员时增加cache的通知
上级
f3a5f4f0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
20 deletion
+33
-20
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
...anization/assemble/control/jaxrs/person/ActionDelete.java
+33
-20
未找到文件。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
浏览文件 @
f7dd7c00
...
...
@@ -37,6 +37,7 @@ import com.x.organization.core.entity.*;
class
ActionDelete
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionDelete
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
...
@@ -90,12 +91,19 @@ class ActionDelete extends BaseAction {
emc
.
remove
(
person
,
CheckRemoveType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Person
.
class
);
CacheManager
.
notify
(
Identity
.
class
);
CacheManager
.
notify
(
Unit
.
class
);
CacheManager
.
notify
(
UnitDuty
.
class
);
CacheManager
.
notify
(
PersonAttribute
.
class
);
CacheManager
.
notify
(
Custom
.
class
);
CacheManager
.
notify
(
Group
.
class
);
CacheManager
.
notify
(
Role
.
class
);
/** 通知x_collect_service_transmit同步数据到collect */
business
.
instrument
().
collect
().
person
();
/**创建 组织变更org消息通信 */
//
createMessageCommunicate(person,
effectivePerson);
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
/**
创建 组织变更org消息通信 */
//
createMessageCommunicate(person,
effectivePerson);
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
orgMessageFactory
.
createMessageCommunicate
(
"delete"
,
"person"
,
person
,
effectivePerson
);
Wo
wo
=
new
Wo
();
...
...
@@ -127,7 +135,8 @@ class ActionDelete extends BaseAction {
CriteriaQuery
<
UnitDuty
>
cq
=
cb
.
createQuery
(
UnitDuty
.
class
);
Root
<
UnitDuty
>
root
=
cq
.
from
(
UnitDuty
.
class
);
Predicate
p
=
root
.
get
(
UnitDuty_
.
identityList
).
in
(
ids
);
List
<
UnitDuty
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
UnitDuty
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
for
(
UnitDuty
o
:
os
)
{
o
.
getIdentityList
().
removeAll
(
ids
);
}
...
...
@@ -139,11 +148,13 @@ class ActionDelete extends BaseAction {
CriteriaQuery
<
Unit
>
cq
=
cb
.
createQuery
(
Unit
.
class
);
Root
<
Unit
>
root
=
cq
.
from
(
Unit
.
class
);
Predicate
p
=
cb
.
isMember
(
person
.
getId
(),
root
.
get
(
Unit_
.
controllerList
));
//p = cb.or(cb.isMember(person.getId(), root.get(Unit_.inheritedControllerList)));
List
<
Unit
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
// p = cb.or(cb.isMember(person.getId(),
// root.get(Unit_.inheritedControllerList)));
List
<
Unit
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
for
(
Unit
o
:
os
)
{
o
.
getControllerList
().
remove
(
person
.
getId
());
//o.getInheritedControllerList().remove(person.getId());
//
o.getInheritedControllerList().remove(person.getId());
}
}
...
...
@@ -153,7 +164,8 @@ class ActionDelete extends BaseAction {
CriteriaQuery
<
Person
>
cq
=
cb
.
createQuery
(
Person
.
class
);
Root
<
Person
>
root
=
cq
.
from
(
Person
.
class
);
Predicate
p
=
cb
.
isMember
(
person
.
getId
(),
root
.
get
(
Person_
.
controllerList
));
List
<
Person
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
Person
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
for
(
Person
o
:
os
)
{
o
.
getControllerList
().
remove
(
person
.
getId
());
}
...
...
@@ -220,9 +232,9 @@ class ActionDelete extends BaseAction {
}
}
/**创建 组织变更org消息通信 */
/**
创建 组织变更org消息通信 */
private
boolean
createMessageCommunicate
(
Person
person
,
EffectivePerson
effectivePerson
)
{
try
{
try
{
Gson
gson
=
new
Gson
();
String
strPerson
=
gson
.
toJson
(
person
);
OrgMessage
orgMessage
=
new
OrgMessage
();
...
...
@@ -237,23 +249,24 @@ class ActionDelete extends BaseAction {
OrgBodyMessage
orgBodyMessage
=
new
OrgBodyMessage
();
orgBodyMessage
.
setOriginalData
(
strPerson
);
orgMessage
.
setBody
(
gson
.
toJson
(
orgBodyMessage
));
orgMessage
.
setBody
(
gson
.
toJson
(
orgBodyMessage
));
Applications
applications
=
new
Applications
();
String
path
=
"org/create"
;
//String address = "http://127.0.0.1:20020/x_message_assemble_communicate/jaxrs/org/create";
//ActionResponse resp = CipherConnectionAction.post(false, address, body);
String
path
=
"org/create"
;
// String address =
// "http://127.0.0.1:20020/x_message_assemble_communicate/jaxrs/org/create";
// ActionResponse resp = CipherConnectionAction.post(false, address, body);
ActionResponse
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_message_assemble_communicate
.
class
,
path
,
orgMessage
);
ActionResponse
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
x_message_assemble_communicate
.
class
,
path
,
orgMessage
);
String
mess
=
resp
.
getMessage
();
String
data
=
resp
.
getData
().
toString
();
return
true
;
}
catch
(
Exception
e
)
{
logger
.
print
(
e
.
toString
());
return
false
;
}
}
catch
(
Exception
e
)
{
logger
.
print
(
e
.
toString
());
return
false
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录