Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
350fff15
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,发现更多精彩内容 >>
提交
350fff15
编写于
12月 04, 2020
作者:
O
o2null
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除unit中的InheritControllerList属性
上级
95197e4b
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
108 addition
and
90 deletion
+108
-90
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/Business.java
...in/java/com/x/organization/assemble/control/Business.java
+6
-6
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/factory/UnitFactory.java
.../x/organization/assemble/control/factory/UnitFactory.java
+7
-7
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
...anization/assemble/control/jaxrs/person/ActionDelete.java
+1
-1
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionListPinyinInitial.java
...ssemble/control/jaxrs/person/ActionListPinyinInitial.java
+2
-2
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
...rganization/assemble/control/jaxrs/person/BaseAction.java
+7
-2
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/unit/ActionCreate.java
...rganization/assemble/control/jaxrs/unit/ActionCreate.java
+14
-11
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/unit/ActionEdit.java
.../organization/assemble/control/jaxrs/unit/ActionEdit.java
+37
-31
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/UnitFactory.java
.../x/organization/assemble/express/factory/UnitFactory.java
+5
-5
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
...ization/assemble/express/jaxrs/unit/ActionListObject.java
+6
-2
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitFactory.java
...x/organization/assemble/personal/factory/UnitFactory.java
+5
-5
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/Unit.java
...ty/src/main/java/com/x/organization/core/entity/Unit.java
+18
-18
未找到文件。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/Business.java
浏览文件 @
350fff15
...
...
@@ -53,8 +53,8 @@ public class Business {
public
Business
(
EntityManagerContainer
emc
)
throws
Exception
{
this
.
emc
=
emc
;
this
.
cacheCategory
=
new
CacheCategory
(
Group
.
class
,
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Unit
.
class
,
Unit
Duty
.
class
,
UnitAttribute
.
class
,
Identity
.
class
);
this
.
cacheCategory
=
new
CacheCategory
(
Group
.
class
,
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Unit
.
class
,
UnitDuty
.
class
,
UnitAttribute
.
class
,
Identity
.
class
);
}
public
EntityManagerContainer
entityManagerContainer
()
{
...
...
@@ -128,9 +128,9 @@ public class Business {
public
RoleFactory
role
()
throws
ExceptionRoleFactory
{
if
(
null
==
this
.
role
)
{
try
{
try
{
this
.
role
=
new
RoleFactory
(
this
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
throw
new
ExceptionRoleFactory
(
e
);
}
}
...
...
@@ -214,8 +214,8 @@ public class Business {
return
true
;
}
}
if
(
ListTools
.
isNotEmpty
(
unit
.
getInheritedControllerList
(
)))
{
List
<
Person
>
os
=
this
.
person
().
pick
(
u
nit
.
getInherited
ControllerList
());
for
(
Unit
u
:
unit
().
pick
(
unit
().
listSupNested
(
unit
.
getId
()
)))
{
List
<
Person
>
os
=
this
.
person
().
pick
(
u
.
get
ControllerList
());
List
<
String
>
list
=
ListTools
.
extractProperty
(
os
,
JpaObject
.
DISTINGUISHEDNAME
,
String
.
class
,
true
,
true
);
if
(
ListTools
.
contains
(
list
,
effectivePerson
.
getDistinguishedName
()))
{
return
true
;
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/factory/UnitFactory.java
浏览文件 @
350fff15
...
...
@@ -219,13 +219,13 @@ public class UnitFactory extends AbstractFactory {
// Collections.reverse(names);
names
.
add
(
o
.
getName
());
o
.
setLevelName
(
StringUtils
.
join
(
names
,
PersistenceProperties
.
Unit
.
levelNameSplit
));
List
<
String
>
inheritControllerList
=
new
ArrayList
<>();
for
(
Unit
u
:
list
)
{
if
(
ListTools
.
isNotEmpty
(
u
.
getControllerList
()))
{
inheritControllerList
.
addAll
(
u
.
getControllerList
());
}
}
o
.
setInheritedControllerList
(
ListTools
.
trim
(
inheritControllerList
,
true
,
true
));
//
List<String> inheritControllerList = new ArrayList<>();
//
for (Unit u : list) {
//
if (ListTools.isNotEmpty(u.getControllerList())) {
//
inheritControllerList.addAll(u.getControllerList());
//
}
//
}
//
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
}
}
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
浏览文件 @
350fff15
...
...
@@ -153,7 +153,7 @@ class ActionDelete extends BaseAction {
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());
}
}
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionListPinyinInitial.java
浏览文件 @
350fff15
...
...
@@ -18,6 +18,8 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
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.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -26,8 +28,6 @@ import com.x.base.core.project.tools.StringTools;
import
com.x.organization.assemble.control.Business
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.Person_
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
class
ActionListPinyinInitial
extends
BaseAction
{
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
浏览文件 @
350fff15
package
com.x.organization.assemble.control.jaxrs.person
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -162,12 +163,16 @@ abstract class BaseAction extends StandardJaxrsAction {
if
(
null
!=
person
&&
t
.
getControllerList
().
contains
(
person
.
getId
()))
{
List
<
Identity
>
identities
=
this
.
listIdentity
(
business
,
t
);
List
<
Unit
>
units
=
this
.
listUnit
(
business
,
identities
);
List
<
Unit
>
supUnits
=
new
ArrayList
<>();
for
(
Unit
u
:
units
)
{
supUnits
.
addAll
(
business
.
unit
().
listSupNestedObject
(
u
));
}
units
.
addAll
(
supUnits
);
if
(
ListTools
.
isNotEmpty
(
units
))
{
allowEdit
=
false
;
allowDelete
=
true
;
for
(
Unit
o
:
units
)
{
if
(
o
.
getControllerList
().
contains
(
person
.
getId
())
||
o
.
getInheritedControllerList
().
contains
(
person
.
getId
()))
{
if
(
o
.
getControllerList
().
contains
(
person
.
getId
()))
{
allowEdit
=
true
;
}
else
{
allowDelete
=
false
;
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/unit/ActionCreate.java
浏览文件 @
350fff15
...
...
@@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils;
class
ActionCreate
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
...
@@ -55,7 +55,7 @@ class ActionCreate extends BaseAction {
if
(
this
.
duplicateUniqueWhenNotEmpty
(
business
,
unit
))
{
throw
new
ExceptionDuplicateUnique
(
unit
.
getName
(),
unit
.
getUnique
());
}
if
(
this
.
checkNameInvalid
(
business
,
unit
))
{
if
(
this
.
checkNameInvalid
(
business
,
unit
))
{
throw
new
ExceptionNameInvalid
(
unit
.
getName
());
}
/** 判断同一级别下name不重复 */
...
...
@@ -64,14 +64,14 @@ class ActionCreate extends BaseAction {
}
emc
.
beginTransaction
(
Unit
.
class
);
business
.
unit
().
adjustInherit
(
unit
);
emc
.
persist
(
unit
,
CheckPersistType
.
all
);
emc
.
persist
(
unit
,
CheckPersistType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Unit
.
class
);
/**创建 组织变更org消息通信 */
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
/**
创建 组织变更org消息通信 */
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
orgMessageFactory
.
createMessageCommunicate
(
"add"
,
"unit"
,
unit
,
effectivePerson
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
unit
.
getId
());
result
.
setData
(
wo
);
...
...
@@ -86,11 +86,14 @@ class ActionCreate extends BaseAction {
private
static
final
long
serialVersionUID
=
-
6314932919066148113L
;
// static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class, Unit.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, Unit.pinyin_FIELDNAME,
// Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME,
// Unit.inheritedControllerList_FIELDNAME));
static
WrapCopier
<
Wi
,
Unit
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Unit
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Unit
.
pinyin_FIELDNAME
,
Unit
.
pinyinInitial_FIELDNAME
,
Unit
.
level_FIELDNAME
,
Unit
.
levelName_FIELDNAME
,
Unit
.
inheritedControllerList_FIELDNAME
));
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Unit
.
pinyin_FIELDNAME
,
Unit
.
pinyinInitial_FIELDNAME
,
Unit
.
level_FIELDNAME
,
Unit
.
levelName_FIELDNAME
));
}
}
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/unit/ActionEdit.java
浏览文件 @
350fff15
...
...
@@ -46,7 +46,7 @@ class ActionEdit extends BaseAction {
Unit
unit
=
business
.
unit
().
pick
(
flag
);
Unit
oldUnit
=
unit
;
boolean
checkFlag
=
false
;
if
(
null
==
unit
)
{
throw
new
ExceptionUnitNotExist
(
flag
);
}
...
...
@@ -62,15 +62,16 @@ class ActionEdit extends BaseAction {
unit
=
emc
.
find
(
unit
.
getId
(),
Unit
.
class
);
Gson
gsontool
=
new
Gson
();
String
strOriginalUnit
=
gsontool
.
toJson
(
unit
);
unit
.
setControllerList
(
ListTools
.
extractProperty
(
business
.
person
().
pick
(
ListTools
.
trim
(
unit
.
getControllerList
(),
true
,
true
)),
unit
.
setControllerList
(
ListTools
.
extractProperty
(
business
.
person
().
pick
(
ListTools
.
trim
(
unit
.
getControllerList
(),
true
,
true
)),
JpaObject
.
id_FIELDNAME
,
String
.
class
,
true
,
true
));
Wi
.
copier
.
copy
(
wi
,
unit
);
/** 如果唯一标识不为空,要检查唯一标识是否唯一 */
if
(
this
.
duplicateUniqueWhenNotEmpty
(
business
,
unit
))
{
throw
new
ExceptionDuplicateUnique
(
unit
.
getName
(),
unit
.
getUnique
());
}
if
(
this
.
checkNameInvalid
(
business
,
unit
))
{
if
(
this
.
checkNameInvalid
(
business
,
unit
))
{
throw
new
ExceptionNameInvalid
(
unit
.
getName
());
}
/** 判断同一级别下name不重复 */
...
...
@@ -78,23 +79,23 @@ class ActionEdit extends BaseAction {
throw
new
ExceptionDuplicateName
(
unit
.
getName
());
}
/** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织的组织级别 */
checkFlag
=
this
.
checkUnitTypeName
(
oldUnit
,
unit
);
if
(
checkFlag
)
{
checkFlag
=
this
.
checkUnitTypeName
(
oldUnit
,
unit
);
if
(
checkFlag
)
{
business
.
unit
().
adjustInherit
(
unit
);
}
emc
.
check
(
unit
,
CheckPersistType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Unit
.
class
);
/** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织成员的身份(组织名称,组织级别名称) */
if
(
checkFlag
)
{
if
(
checkFlag
)
{
this
.
updateIdentityUnitNameAndUnitLevelName
(
effectivePerson
,
flag
,
jsonElement
);
}
/**创建 组织变更org消息通信 */
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
orgMessageFactory
.
createMessageCommunicate
(
"modfiy"
,
"unit"
,
strOriginalUnit
,
unit
,
effectivePerson
);
/**
创建 组织变更org消息通信 */
OrgMessageFactory
orgMessageFactory
=
new
OrgMessageFactory
();
orgMessageFactory
.
createMessageCommunicate
(
"modfiy"
,
"unit"
,
strOriginalUnit
,
unit
,
effectivePerson
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
unit
.
getId
());
result
.
setData
(
wo
);
...
...
@@ -111,18 +112,23 @@ class ActionEdit extends BaseAction {
private
static
final
long
serialVersionUID
=
-
7527954993386512109L
;
// static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class, Unit.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, Unit.superior_FIELDNAME, Unit.pinyin_FIELDNAME,
// Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME,
// Unit.inheritedControllerList_FIELDNAME));
// static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class,
// Unit.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, Unit.superior_FIELDNAME,
// Unit.pinyin_FIELDNAME,
// Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME,
// Unit.inheritedControllerList_FIELDNAME));
// static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class, Unit.class, null,
// ListTools.toList(JpaObject.FieldsUnmodify, Unit.pinyin_FIELDNAME, Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME,
// Unit.levelName_FIELDNAME, Unit.inheritedControllerList_FIELDNAME));
static
WrapCopier
<
Wi
,
Unit
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Unit
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Unit
.
pinyin_FIELDNAME
,
Unit
.
pinyinInitial_FIELDNAME
,
Unit
.
level_FIELDNAME
,
Unit
.
level
Name_FIELDNAME
,
Unit
.
inheritedControllerList
_FIELDNAME
));
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Unit
.
pinyin_FIELDNAME
,
Unit
.
pinyinInitial_FIELDNAME
,
Unit
.
level
_FIELDNAME
,
Unit
.
levelName
_FIELDNAME
));
}
//根据组织标志列出身份列表
//
根据组织标志列出身份列表
private
List
<
Identity
>
listIdentityByUnitFlag
(
Business
business
,
Unit
unit
)
throws
Exception
{
//Unit unit = business.unit().pick(unitFlag);
//
Unit unit = business.unit().pick(unitFlag);
if
(
null
==
unit
.
getId
()
||
StringUtils
.
isEmpty
(
unit
.
getId
())
||
null
==
unit
)
{
throw
new
ExceptionUnitNotExist
(
unit
.
getId
());
}
...
...
@@ -135,9 +141,9 @@ class ActionEdit extends BaseAction {
return
os
;
}
//列出所有递归下级组织(包含当前组织)
//
列出所有递归下级组织(包含当前组织)
private
List
<
Unit
>
listUnit
(
Business
business
,
String
flag
)
throws
Exception
{
//Unit unit = business.unit().pick(flag);
//
Unit unit = business.unit().pick(flag);
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Unit
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
@@ -158,17 +164,18 @@ class ActionEdit extends BaseAction {
throw
new
ExceptionUnitNotExist
(
flag
);
}
//所有下级组织
//
所有下级组织
List
<
Unit
>
os
=
business
.
unit
().
listSubNestedObject
(
unit
);
//把当前组织加入到os
//
把当前组织加入到os
List
<
Unit
>
_currentUnitSingleArray
=
new
ArrayList
<
Unit
>();
_currentUnitSingleArray
.
add
(
unit
);
os
=
ListTools
.
add
(
_currentUnitSingleArray
,
true
,
true
,
os
);
return
os
;
}
void
updateIdentityUnitNameAndUnitLevelName
(
EffectivePerson
effectivePerson
,
String
flag
,
JsonElement
jsonElement
)
throws
Exception
{
void
updateIdentityUnitNameAndUnitLevelName
(
EffectivePerson
effectivePerson
,
String
flag
,
JsonElement
jsonElement
)
throws
Exception
{
CacheManager
.
notify
(
Unit
.
class
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
...
...
@@ -185,7 +192,7 @@ class ActionEdit extends BaseAction {
}
/*
* 同时更新unit下的所有身份的UnitLevelName,UnitName
*
*
/
*/
List
<
Unit
>
unitList
=
this
.
listUnit
(
business
,
flag
);
for
(
Unit
u
:
unitList
)
{
...
...
@@ -209,17 +216,16 @@ class ActionEdit extends BaseAction {
}
}
private
boolean
checkUnitTypeName
(
Unit
oldUnit
,
Unit
unit
)
throws
Exception
{
List
<
String
>
oldUnitType
=
oldUnit
.
getTypeList
();
List
<
String
>
unitType
=
unit
.
getTypeList
();
//判断两个list是否相同
if
(
oldUnitType
.
retainAll
(
unitType
)
||
(!
StringUtils
.
equals
(
oldUnit
.
getName
(),
unit
.
getName
()))
||
(!
StringUtils
.
equals
(
oldUnit
.
getSuperior
(),
unit
.
getSuperior
())))
{
// 判断两个list是否相同
if
(
oldUnitType
.
retainAll
(
unitType
)
||
(!
StringUtils
.
equals
(
oldUnit
.
getName
(),
unit
.
getName
()))
||
(!
StringUtils
.
equals
(
oldUnit
.
getSuperior
(),
unit
.
getSuperior
())))
{
return
true
;
}
return
false
;
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/UnitFactory.java
浏览文件 @
350fff15
...
...
@@ -221,11 +221,11 @@ public class UnitFactory extends AbstractFactory {
names
=
names
.
stream
().
sorted
(
Comparator
.
reverseOrder
()).
collect
(
Collectors
.
toList
());
names
.
add
(
o
.
getName
());
o
.
setLevelName
(
StringUtils
.
join
(
names
,
"/"
));
List
<
String
>
inheritControllerList
=
new
ArrayList
<>();
for
(
Unit
u
:
list
)
{
inheritControllerList
.
addAll
(
u
.
getControllerList
());
}
o
.
setInheritedControllerList
(
ListTools
.
trim
(
inheritControllerList
,
true
,
true
));
//
List<String> inheritControllerList = new ArrayList<>();
//
for (Unit u : list) {
//
inheritControllerList.addAll(u.getControllerList());
//
}
//
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
}
}
...
...
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
浏览文件 @
350fff15
...
...
@@ -34,6 +34,7 @@ import javax.persistence.criteria.Root;
class
ActionListObject
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionListObject
.
class
);
@SuppressWarnings
(
"unchecked"
)
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
...
...
@@ -81,8 +82,11 @@ class ActionListObject extends BaseAction {
@FieldDescribe
(
"直接下级身份数量"
)
private
Long
subDirectIdentityCount
=
0L
;
// static WrapCopier<Unit, Wo> copier = WrapCopierFactory.wo(Unit.class, Wo.class, null,
// ListTools.toList(JpaObject.FieldsInvisible,Unit.controllerList_FIELDNAME,Unit.inheritedControllerList_FIELDNAME));
static
WrapCopier
<
Unit
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Unit
.
class
,
Wo
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsInvisible
,
Unit
.
controllerList_FIELDNAME
,
Unit
.
inheritedC
ontrollerList_FIELDNAME
));
ListTools
.
toList
(
JpaObject
.
FieldsInvisible
,
Unit
.
c
ontrollerList_FIELDNAME
));
public
String
getMatchKey
()
{
return
matchKey
;
...
...
@@ -114,7 +118,7 @@ class ActionListObject extends BaseAction {
List
<
Wo
>
wos
=
new
ArrayList
<>();
for
(
String
str
:
wi
.
getUnitList
())
{
Unit
o
=
business
.
unit
().
pick
(
str
);
if
(
o
!=
null
)
{
if
(
o
!=
null
)
{
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setMatchKey
(
str
);
if
(
StringUtils
.
isNotEmpty
(
wo
.
getSuperior
()))
{
...
...
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/factory/UnitFactory.java
浏览文件 @
350fff15
...
...
@@ -210,11 +210,11 @@ public class UnitFactory extends AbstractFactory {
// Collections.reverse(names);
names
.
add
(
o
.
getName
());
o
.
setLevelName
(
StringUtils
.
join
(
names
,
PersistenceProperties
.
Unit
.
levelNameSplit
));
List
<
String
>
inheritControllerList
=
new
ArrayList
<>();
for
(
Unit
u
:
list
)
{
inheritControllerList
.
addAll
(
u
.
getControllerList
());
}
o
.
setInheritedControllerList
(
ListTools
.
trim
(
inheritControllerList
,
true
,
true
));
//
List<String> inheritControllerList = new ArrayList<>();
//
for (Unit u : list) {
//
inheritControllerList.addAll(u.getControllerList());
//
}
//
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
}
}
...
...
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/Unit.java
浏览文件 @
350fff15
...
...
@@ -189,17 +189,17 @@ public class Unit extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
,
citationExists
=
@CitationExist
(
type
=
Person
.
class
))
private
List
<
String
>
controllerList
;
public
static
final
String
inheritedControllerList_FIELDNAME
=
"inheritedControllerList"
;
@FieldDescribe
(
"继承自上级组织的管理人员."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
inheritedControllerList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
inheritedControllerList_FIELDNAME
+
JoinIndexNameSuffix
))
@ElementColumn
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
inheritedControllerList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
inheritedControllerList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
,
citationExists
=
@CitationExist
(
type
=
Person
.
class
))
private
List
<
String
>
inheritedControllerList
;
//
public static final String inheritedControllerList_FIELDNAME = "inheritedControllerList";
//
@FieldDescribe("继承自上级组织的管理人员.")
//
@PersistentCollection(fetch = FetchType.EAGER)
//
@OrderColumn(name = ORDERCOLUMNCOLUMN)
//
@ContainerTable(name = TABLE + ContainerTableNameMiddle
//
+ inheritedControllerList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
//
+ inheritedControllerList_FIELDNAME + JoinIndexNameSuffix))
//
@ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + inheritedControllerList_FIELDNAME)
//
@ElementIndex(name = TABLE + IndexNameMiddle + inheritedControllerList_FIELDNAME + ElementIndexNameSuffix)
//
@CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Person.class))
//
private List<String> inheritedControllerList;
public
static
final
String
dingdingId_FIELDNAME
=
"dingdingId"
;
@FieldDescribe
(
"钉钉部门ID."
)
...
...
@@ -351,13 +351,13 @@ public class Unit extends SliceJpaObject {
this
.
distinguishedName
=
distinguishedName
;
}
public
List
<
String
>
getInheritedControllerList
()
{
return
inheritedControllerList
;
}
public
void
setInheritedControllerList
(
List
<
String
>
inheritedControllerList
)
{
this
.
inheritedControllerList
=
inheritedControllerList
;
}
//
public List<String> getInheritedControllerList() {
//
return inheritedControllerList;
//
}
//
//
public void setInheritedControllerList(List<String> inheritedControllerList) {
//
this.inheritedControllerList = inheritedControllerList;
//
}
public
String
getDescription
()
{
return
description
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录