提交 9b4d05e5 编写于 作者: O o2null

Merge branch 'feature/trans' into 'wrdp'

增加pickIdentityWithName

See merge request o2oa/o2oa!4416
{
"unitLevelOrderNumberDigits": 10.0,
"pickPersonWithName": false,
"pickIdentityWithName": false,
"###unitLevelOrderNumberDigits": "unit中unitLevelOrderNumber扩充位数,\u003c\u003d0不扩充.###",
"###pickPersonWithName": "人员识别过程中过程为先查找 distinguishedName 再查找中间的 unique 如果还是没有查找到是否要通过那么进行查找.###",
"###pickIdentityWithName": "身份识别过程中过程为先查找 distinguishedName 再查找中间的 unique 如果还是没有查找到是否要通过那么进行查找.###"
}
\ No newline at end of file
......@@ -55,8 +55,9 @@ public class CreateConfigSample {
classes.add(WeLink.class);
classes.add(WorkTime.class);
classes.add(ZhengwuDingding.class);
classes.add(Organization.class);
classes.add(Cache.class);
//classes.add(Web.class);
// classes.add(Web.class);
Collections.sort(classes, new Comparator<Class<?>>() {
public int compare(Class<?> c1, Class<?> c2) {
......
......@@ -17,6 +17,7 @@ public class Organization extends ConfigObject {
public static final Integer DEFAULT_UNITLEVELORDERNUMBERDIGITS = 10;
public static final Boolean DEFAULT_PICKPERSONWITHNAME = false;
public static final Boolean DEFAULT_PICKIDENTITYWITHNAME = false;
public static Organization defaultInstance() {
return new Organization();
......@@ -25,9 +26,12 @@ public class Organization extends ConfigObject {
@FieldDescribe("unit中unitLevelOrderNumber扩充位数,<=0不扩充.")
private Integer unitLevelOrderNumberDigits = DEFAULT_UNITLEVELORDERNUMBERDIGITS;
@FieldDescribe("人员识别过程中过程为先查找 distinguishedName 再查找中间的 unique 如果还是没有查找到是否要通过那么进行查找.")
@FieldDescribe("zhangsan@123@P人员识别过程中过程为先查找 distinguishedName 再查找中间的 unique 如果还是没有查找到是否要通过名称进行查找.")
private Boolean pickPersonWithName = DEFAULT_PICKPERSONWITHNAME;
@FieldDescribe("zhangsan@456@I身份识别过程中过程为先查找 distinguishedName 再查找中间的 unique 如果还是没有查找到是否要通过名称进行查找.")
private Boolean pickIdentityWithName = DEFAULT_PICKIDENTITYWITHNAME;
public Integer getUnitLevelOrderNumberDigits() {
return NumberTools.nullOrLessThan(this.unitLevelOrderNumberDigits, 1) ? DEFAULT_UNITLEVELORDERNUMBERDIGITS
: this.unitLevelOrderNumberDigits;
......@@ -37,6 +41,10 @@ public class Organization extends ConfigObject {
return BooleanUtils.isTrue(this.pickPersonWithName);
}
public Boolean getPickIdentityWithName() {
return BooleanUtils.isTrue(this.pickIdentityWithName);
}
public void save() throws Exception {
File file = new File(Config.base(), Config.PATH_CONFIG_ORGANIZATION);
FileUtils.write(file, XGsonBuilder.toJson(this), DefaultCharset.charset);
......
......@@ -70,7 +70,7 @@ public class IdentityFactory extends AbstractFactory {
this.entityManagerContainer().get(Identity.class).detach(o);
}
}
if (null == o) {
if ((null == o) && BooleanUtils.isTrue(Config.organization().getPickIdentityWithName())) {
EntityManager em = this.entityManagerContainer().get(Identity.class);
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Identity> cq = cb.createQuery(Identity.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册