提交 32f3c70d 编写于 作者: O o2null

删除unit中的InheritControllerList属性

上级 0776fa1c
...@@ -53,8 +53,8 @@ public class Business { ...@@ -53,8 +53,8 @@ public class Business {
public Business(EntityManagerContainer emc) throws Exception { public Business(EntityManagerContainer emc) throws Exception {
this.emc = emc; this.emc = emc;
this.cacheCategory = new CacheCategory(Group.class, Role.class, Person.class, PersonAttribute.class, this.cacheCategory = new CacheCategory(Group.class, Role.class, Person.class, PersonAttribute.class, Unit.class,
Unit.class, UnitDuty.class, UnitAttribute.class, Identity.class); UnitDuty.class, UnitAttribute.class, Identity.class);
} }
public EntityManagerContainer entityManagerContainer() { public EntityManagerContainer entityManagerContainer() {
...@@ -128,9 +128,9 @@ public class Business { ...@@ -128,9 +128,9 @@ public class Business {
public RoleFactory role() throws ExceptionRoleFactory { public RoleFactory role() throws ExceptionRoleFactory {
if (null == this.role) { if (null == this.role) {
try{ try {
this.role = new RoleFactory(this); this.role = new RoleFactory(this);
} catch (Exception e){ } catch (Exception e) {
throw new ExceptionRoleFactory(e); throw new ExceptionRoleFactory(e);
} }
} }
...@@ -214,8 +214,8 @@ public class Business { ...@@ -214,8 +214,8 @@ public class Business {
return true; return true;
} }
} }
if (ListTools.isNotEmpty(unit.getInheritedControllerList())) { for (Unit u : unit().pick(unit().listSupNested(unit.getId()))) {
List<Person> os = this.person().pick(unit.getInheritedControllerList()); List<Person> os = this.person().pick(u.getControllerList());
List<String> list = ListTools.extractProperty(os, JpaObject.DISTINGUISHEDNAME, String.class, true, true); List<String> list = ListTools.extractProperty(os, JpaObject.DISTINGUISHEDNAME, String.class, true, true);
if (ListTools.contains(list, effectivePerson.getDistinguishedName())) { if (ListTools.contains(list, effectivePerson.getDistinguishedName())) {
return true; return true;
......
...@@ -219,13 +219,13 @@ public class UnitFactory extends AbstractFactory { ...@@ -219,13 +219,13 @@ public class UnitFactory extends AbstractFactory {
// Collections.reverse(names); // Collections.reverse(names);
names.add(o.getName()); names.add(o.getName());
o.setLevelName(StringUtils.join(names, PersistenceProperties.Unit.levelNameSplit)); o.setLevelName(StringUtils.join(names, PersistenceProperties.Unit.levelNameSplit));
List<String> inheritControllerList = new ArrayList<>(); // List<String> inheritControllerList = new ArrayList<>();
for (Unit u : list) { // for (Unit u : list) {
if (ListTools.isNotEmpty(u.getControllerList())) { // if (ListTools.isNotEmpty(u.getControllerList())) {
inheritControllerList.addAll(u.getControllerList()); // inheritControllerList.addAll(u.getControllerList());
} // }
} // }
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true)); // o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
} }
} }
......
...@@ -153,7 +153,7 @@ class ActionDelete extends BaseAction { ...@@ -153,7 +153,7 @@ class ActionDelete extends BaseAction {
List<Unit> os = em.createQuery(cq.select(root).where(p)).getResultList().stream().distinct().collect(Collectors.toList()); List<Unit> os = em.createQuery(cq.select(root).where(p)).getResultList().stream().distinct().collect(Collectors.toList());
for (Unit o : os) { for (Unit o : os) {
o.getControllerList().remove(person.getId()); o.getControllerList().remove(person.getId());
o.getInheritedControllerList().remove(person.getId()); //o.getInheritedControllerList().remove(person.getId());
} }
} }
......
...@@ -18,6 +18,8 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory; ...@@ -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.annotation.FieldDescribe;
import com.x.base.core.project.bean.WrapCopier; import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory; 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.gson.GsonPropertyObject;
import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.http.EffectivePerson;
...@@ -26,8 +28,6 @@ import com.x.base.core.project.tools.StringTools; ...@@ -26,8 +28,6 @@ import com.x.base.core.project.tools.StringTools;
import com.x.organization.assemble.control.Business; import com.x.organization.assemble.control.Business;
import com.x.organization.core.entity.Person; import com.x.organization.core.entity.Person;
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 { class ActionListPinyinInitial extends BaseAction {
......
package com.x.organization.assemble.control.jaxrs.person; package com.x.organization.assemble.control.jaxrs.person;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -162,12 +163,16 @@ abstract class BaseAction extends StandardJaxrsAction { ...@@ -162,12 +163,16 @@ abstract class BaseAction extends StandardJaxrsAction {
if (null != person && t.getControllerList().contains(person.getId())) { if (null != person && t.getControllerList().contains(person.getId())) {
List<Identity> identities = this.listIdentity(business, t); List<Identity> identities = this.listIdentity(business, t);
List<Unit> units = this.listUnit(business, identities); 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)) { if (ListTools.isNotEmpty(units)) {
allowEdit = false; allowEdit = false;
allowDelete = true; allowDelete = true;
for (Unit o : units) { for (Unit o : units) {
if (o.getControllerList().contains(person.getId()) if (o.getControllerList().contains(person.getId())) {
|| o.getInheritedControllerList().contains(person.getId())) {
allowEdit = true; allowEdit = true;
} else { } else {
allowDelete = false; allowDelete = false;
......
...@@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -22,7 +22,7 @@ import org.apache.commons.lang3.StringUtils;
class ActionCreate extends BaseAction { class ActionCreate extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionCreate.class); private static Logger logger = LoggerFactory.getLogger(ActionCreate.class);
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception { ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
ActionResult<Wo> result = new ActionResult<>(); ActionResult<Wo> result = new ActionResult<>();
...@@ -55,7 +55,7 @@ class ActionCreate extends BaseAction { ...@@ -55,7 +55,7 @@ class ActionCreate extends BaseAction {
if (this.duplicateUniqueWhenNotEmpty(business, unit)) { if (this.duplicateUniqueWhenNotEmpty(business, unit)) {
throw new ExceptionDuplicateUnique(unit.getName(), unit.getUnique()); throw new ExceptionDuplicateUnique(unit.getName(), unit.getUnique());
} }
if (this.checkNameInvalid(business,unit)){ if (this.checkNameInvalid(business, unit)) {
throw new ExceptionNameInvalid(unit.getName()); throw new ExceptionNameInvalid(unit.getName());
} }
/** 判断同一级别下name不重复 */ /** 判断同一级别下name不重复 */
...@@ -64,14 +64,14 @@ class ActionCreate extends BaseAction { ...@@ -64,14 +64,14 @@ class ActionCreate extends BaseAction {
} }
emc.beginTransaction(Unit.class); emc.beginTransaction(Unit.class);
business.unit().adjustInherit(unit); business.unit().adjustInherit(unit);
emc.persist(unit,CheckPersistType.all); emc.persist(unit, CheckPersistType.all);
emc.commit(); emc.commit();
CacheManager.notify(Unit.class); CacheManager.notify(Unit.class);
/**创建 组织变更org消息通信 */ /** 创建 组织变更org消息通信 */
OrgMessageFactory orgMessageFactory = new OrgMessageFactory(); OrgMessageFactory orgMessageFactory = new OrgMessageFactory();
orgMessageFactory.createMessageCommunicate("add", "unit", unit, effectivePerson); orgMessageFactory.createMessageCommunicate("add", "unit", unit, effectivePerson);
Wo wo = new Wo(); Wo wo = new Wo();
wo.setId(unit.getId()); wo.setId(unit.getId());
result.setData(wo); result.setData(wo);
...@@ -86,11 +86,14 @@ class ActionCreate extends BaseAction { ...@@ -86,11 +86,14 @@ class ActionCreate extends BaseAction {
private static final long serialVersionUID = -6314932919066148113L; 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, static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class, Unit.class, null,
ListTools.toList(JpaObject.FieldsUnmodify, Unit.pinyin_FIELDNAME, ListTools.toList(JpaObject.FieldsUnmodify, Unit.pinyin_FIELDNAME, Unit.pinyinInitial_FIELDNAME,
Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME));
Unit.inheritedControllerList_FIELDNAME));
} }
} }
...@@ -46,7 +46,7 @@ class ActionEdit extends BaseAction { ...@@ -46,7 +46,7 @@ class ActionEdit extends BaseAction {
Unit unit = business.unit().pick(flag); Unit unit = business.unit().pick(flag);
Unit oldUnit = unit; Unit oldUnit = unit;
boolean checkFlag = false; boolean checkFlag = false;
if (null == unit) { if (null == unit) {
throw new ExceptionUnitNotExist(flag); throw new ExceptionUnitNotExist(flag);
} }
...@@ -62,15 +62,16 @@ class ActionEdit extends BaseAction { ...@@ -62,15 +62,16 @@ class ActionEdit extends BaseAction {
unit = emc.find(unit.getId(), Unit.class); unit = emc.find(unit.getId(), Unit.class);
Gson gsontool = new Gson(); Gson gsontool = new Gson();
String strOriginalUnit = gsontool.toJson(unit); 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)); JpaObject.id_FIELDNAME, String.class, true, true));
Wi.copier.copy(wi, unit); Wi.copier.copy(wi, unit);
/** 如果唯一标识不为空,要检查唯一标识是否唯一 */ /** 如果唯一标识不为空,要检查唯一标识是否唯一 */
if (this.duplicateUniqueWhenNotEmpty(business, unit)) { if (this.duplicateUniqueWhenNotEmpty(business, unit)) {
throw new ExceptionDuplicateUnique(unit.getName(), unit.getUnique()); throw new ExceptionDuplicateUnique(unit.getName(), unit.getUnique());
} }
if (this.checkNameInvalid(business,unit)){ if (this.checkNameInvalid(business, unit)) {
throw new ExceptionNameInvalid(unit.getName()); throw new ExceptionNameInvalid(unit.getName());
} }
/** 判断同一级别下name不重复 */ /** 判断同一级别下name不重复 */
...@@ -78,23 +79,23 @@ class ActionEdit extends BaseAction { ...@@ -78,23 +79,23 @@ class ActionEdit extends BaseAction {
throw new ExceptionDuplicateName(unit.getName()); throw new ExceptionDuplicateName(unit.getName());
} }
/** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织的组织级别 */ /** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织的组织级别 */
checkFlag = this.checkUnitTypeName(oldUnit,unit); checkFlag = this.checkUnitTypeName(oldUnit, unit);
if(checkFlag){ if (checkFlag) {
business.unit().adjustInherit(unit); business.unit().adjustInherit(unit);
} }
emc.check(unit, CheckPersistType.all); emc.check(unit, CheckPersistType.all);
emc.commit(); emc.commit();
CacheManager.notify(Unit.class); CacheManager.notify(Unit.class);
/** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织成员的身份(组织名称,组织级别名称) */ /** 判断是否修改了组织级别或组织名称,如果修改了,需要重新计算当前组织及下属组织成员的身份(组织名称,组织级别名称) */
if(checkFlag){ if (checkFlag) {
this.updateIdentityUnitNameAndUnitLevelName(effectivePerson, flag, jsonElement); this.updateIdentityUnitNameAndUnitLevelName(effectivePerson, flag, jsonElement);
} }
/**创建 组织变更org消息通信 */ /** 创建 组织变更org消息通信 */
OrgMessageFactory orgMessageFactory = new OrgMessageFactory(); OrgMessageFactory orgMessageFactory = new OrgMessageFactory();
orgMessageFactory.createMessageCommunicate("modfiy", "unit",strOriginalUnit, unit, effectivePerson); orgMessageFactory.createMessageCommunicate("modfiy", "unit", strOriginalUnit, unit, effectivePerson);
Wo wo = new Wo(); Wo wo = new Wo();
wo.setId(unit.getId()); wo.setId(unit.getId());
result.setData(wo); result.setData(wo);
...@@ -111,18 +112,23 @@ class ActionEdit extends BaseAction { ...@@ -111,18 +112,23 @@ class ActionEdit extends BaseAction {
private static final long serialVersionUID = -7527954993386512109L; private static final long serialVersionUID = -7527954993386512109L;
// static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class, Unit.class, null, // static WrapCopier<Wi, Unit> copier = WrapCopierFactory.wi(Wi.class,
// ListTools.toList(JpaObject.FieldsUnmodify, Unit.superior_FIELDNAME, Unit.pinyin_FIELDNAME, // Unit.class, null,
// Unit.pinyinInitial_FIELDNAME, Unit.level_FIELDNAME, Unit.levelName_FIELDNAME, // ListTools.toList(JpaObject.FieldsUnmodify, Unit.superior_FIELDNAME,
// Unit.inheritedControllerList_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, 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, ListTools.toList(JpaObject.FieldsUnmodify, Unit.pinyin_FIELDNAME, Unit.pinyinInitial_FIELDNAME,
Unit.levelName_FIELDNAME, Unit.inheritedControllerList_FIELDNAME)); Unit.level_FIELDNAME, Unit.levelName_FIELDNAME));
} }
//根据组织标志列出身份列表 // 根据组织标志列出身份列表
private List<Identity> listIdentityByUnitFlag(Business business, Unit unit) throws Exception { 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) { if (null == unit.getId() || StringUtils.isEmpty(unit.getId()) || null == unit) {
throw new ExceptionUnitNotExist(unit.getId()); throw new ExceptionUnitNotExist(unit.getId());
} }
...@@ -135,9 +141,9 @@ class ActionEdit extends BaseAction { ...@@ -135,9 +141,9 @@ class ActionEdit extends BaseAction {
return os; return os;
} }
//列出所有递归下级组织(包含当前组织) // 列出所有递归下级组织(包含当前组织)
private List<Unit> listUnit(Business business, String flag) throws Exception { 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); EntityManager em = business.entityManagerContainer().get(Unit.class);
CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaBuilder cb = em.getCriteriaBuilder();
...@@ -158,17 +164,18 @@ class ActionEdit extends BaseAction { ...@@ -158,17 +164,18 @@ class ActionEdit extends BaseAction {
throw new ExceptionUnitNotExist(flag); throw new ExceptionUnitNotExist(flag);
} }
//所有下级组织 // 所有下级组织
List<Unit> os = business.unit().listSubNestedObject(unit); List<Unit> os = business.unit().listSubNestedObject(unit);
//把当前组织加入到os // 把当前组织加入到os
List<Unit> _currentUnitSingleArray = new ArrayList<Unit>(); List<Unit> _currentUnitSingleArray = new ArrayList<Unit>();
_currentUnitSingleArray.add(unit); _currentUnitSingleArray.add(unit);
os = ListTools.add(_currentUnitSingleArray, true, true, os); os = ListTools.add(_currentUnitSingleArray, true, true, os);
return 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); CacheManager.notify(Unit.class);
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
Business business = new Business(emc); Business business = new Business(emc);
...@@ -185,7 +192,7 @@ class ActionEdit extends BaseAction { ...@@ -185,7 +192,7 @@ class ActionEdit extends BaseAction {
} }
/* /*
* 同时更新unit下的所有身份的UnitLevelName,UnitName * 同时更新unit下的所有身份的UnitLevelName,UnitName
* */ */
List<Unit> unitList = this.listUnit(business, flag); List<Unit> unitList = this.listUnit(business, flag);
for (Unit u : unitList) { for (Unit u : unitList) {
...@@ -209,17 +216,16 @@ class ActionEdit extends BaseAction { ...@@ -209,17 +216,16 @@ class ActionEdit extends BaseAction {
} }
} }
private boolean checkUnitTypeName(Unit oldUnit, Unit unit) throws Exception { private boolean checkUnitTypeName(Unit oldUnit, Unit unit) throws Exception {
List<String> oldUnitType = oldUnit.getTypeList(); List<String> oldUnitType = oldUnit.getTypeList();
List<String> unitType = unit.getTypeList(); List<String> unitType = unit.getTypeList();
//判断两个list是否相同 // 判断两个list是否相同
if (oldUnitType.retainAll(unitType) || (!StringUtils.equals(oldUnit.getName(), unit.getName())) || (!StringUtils.equals(oldUnit.getSuperior(), unit.getSuperior()))) { if (oldUnitType.retainAll(unitType) || (!StringUtils.equals(oldUnit.getName(), unit.getName()))
|| (!StringUtils.equals(oldUnit.getSuperior(), unit.getSuperior()))) {
return true; return true;
} }
return false; return false;
} }
} }
...@@ -221,11 +221,11 @@ public class UnitFactory extends AbstractFactory { ...@@ -221,11 +221,11 @@ public class UnitFactory extends AbstractFactory {
names = names.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList()); names = names.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList());
names.add(o.getName()); names.add(o.getName());
o.setLevelName(StringUtils.join(names, "/")); o.setLevelName(StringUtils.join(names, "/"));
List<String> inheritControllerList = new ArrayList<>(); // List<String> inheritControllerList = new ArrayList<>();
for (Unit u : list) { // for (Unit u : list) {
inheritControllerList.addAll(u.getControllerList()); // inheritControllerList.addAll(u.getControllerList());
} // }
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true)); // o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
} }
} }
......
...@@ -34,6 +34,7 @@ import javax.persistence.criteria.Root; ...@@ -34,6 +34,7 @@ import javax.persistence.criteria.Root;
class ActionListObject extends BaseAction { class ActionListObject extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionListObject.class); private static Logger logger = LoggerFactory.getLogger(ActionListObject.class);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception { ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
...@@ -81,8 +82,11 @@ class ActionListObject extends BaseAction { ...@@ -81,8 +82,11 @@ class ActionListObject extends BaseAction {
@FieldDescribe("直接下级身份数量") @FieldDescribe("直接下级身份数量")
private Long subDirectIdentityCount = 0L; 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, static WrapCopier<Unit, Wo> copier = WrapCopierFactory.wo(Unit.class, Wo.class, null,
ListTools.toList(JpaObject.FieldsInvisible,Unit.controllerList_FIELDNAME,Unit.inheritedControllerList_FIELDNAME)); ListTools.toList(JpaObject.FieldsInvisible, Unit.controllerList_FIELDNAME));
public String getMatchKey() { public String getMatchKey() {
return matchKey; return matchKey;
...@@ -114,7 +118,7 @@ class ActionListObject extends BaseAction { ...@@ -114,7 +118,7 @@ class ActionListObject extends BaseAction {
List<Wo> wos = new ArrayList<>(); List<Wo> wos = new ArrayList<>();
for (String str : wi.getUnitList()) { for (String str : wi.getUnitList()) {
Unit o = business.unit().pick(str); Unit o = business.unit().pick(str);
if(o!=null){ if (o != null) {
Wo wo = Wo.copier.copy(o); Wo wo = Wo.copier.copy(o);
wo.setMatchKey(str); wo.setMatchKey(str);
if (StringUtils.isNotEmpty(wo.getSuperior())) { if (StringUtils.isNotEmpty(wo.getSuperior())) {
......
...@@ -210,11 +210,11 @@ public class UnitFactory extends AbstractFactory { ...@@ -210,11 +210,11 @@ public class UnitFactory extends AbstractFactory {
// Collections.reverse(names); // Collections.reverse(names);
names.add(o.getName()); names.add(o.getName());
o.setLevelName(StringUtils.join(names, PersistenceProperties.Unit.levelNameSplit)); o.setLevelName(StringUtils.join(names, PersistenceProperties.Unit.levelNameSplit));
List<String> inheritControllerList = new ArrayList<>(); // List<String> inheritControllerList = new ArrayList<>();
for (Unit u : list) { // for (Unit u : list) {
inheritControllerList.addAll(u.getControllerList()); // inheritControllerList.addAll(u.getControllerList());
} // }
o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true)); // o.setInheritedControllerList(ListTools.trim(inheritControllerList, true, true));
} }
} }
......
...@@ -189,17 +189,17 @@ public class Unit extends SliceJpaObject { ...@@ -189,17 +189,17 @@ public class Unit extends SliceJpaObject {
@CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Person.class)) @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Person.class))
private List<String> controllerList; private List<String> controllerList;
public static final String inheritedControllerList_FIELDNAME = "inheritedControllerList"; // public static final String inheritedControllerList_FIELDNAME = "inheritedControllerList";
@FieldDescribe("继承自上级组织的管理人员.") // @FieldDescribe("继承自上级组织的管理人员.")
@PersistentCollection(fetch = FetchType.EAGER) // @PersistentCollection(fetch = FetchType.EAGER)
@OrderColumn(name = ORDERCOLUMNCOLUMN) // @OrderColumn(name = ORDERCOLUMNCOLUMN)
@ContainerTable(name = TABLE + ContainerTableNameMiddle // @ContainerTable(name = TABLE + ContainerTableNameMiddle
+ inheritedControllerList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle // + inheritedControllerList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
+ inheritedControllerList_FIELDNAME + JoinIndexNameSuffix)) // + inheritedControllerList_FIELDNAME + JoinIndexNameSuffix))
@ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + inheritedControllerList_FIELDNAME) // @ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + inheritedControllerList_FIELDNAME)
@ElementIndex(name = TABLE + IndexNameMiddle + inheritedControllerList_FIELDNAME + ElementIndexNameSuffix) // @ElementIndex(name = TABLE + IndexNameMiddle + inheritedControllerList_FIELDNAME + ElementIndexNameSuffix)
@CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Person.class)) // @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Person.class))
private List<String> inheritedControllerList; // private List<String> inheritedControllerList;
public static final String dingdingId_FIELDNAME = "dingdingId"; public static final String dingdingId_FIELDNAME = "dingdingId";
@FieldDescribe("钉钉部门ID.") @FieldDescribe("钉钉部门ID.")
...@@ -351,13 +351,13 @@ public class Unit extends SliceJpaObject { ...@@ -351,13 +351,13 @@ public class Unit extends SliceJpaObject {
this.distinguishedName = distinguishedName; this.distinguishedName = distinguishedName;
} }
public List<String> getInheritedControllerList() { // public List<String> getInheritedControllerList() {
return inheritedControllerList; // return inheritedControllerList;
} // }
//
public void setInheritedControllerList(List<String> inheritedControllerList) { // public void setInheritedControllerList(List<String> inheritedControllerList) {
this.inheritedControllerList = inheritedControllerList; // this.inheritedControllerList = inheritedControllerList;
} // }
public String getDescription() { public String getDescription() {
return description; return description;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册