提交 917c1ba2 编写于 作者: O o2null

Merge branch 'feature/人员身份唯一编码根据组织编码和人员唯一编码生成' into 'wrdp'

[人员组织]人员身份唯一编码根据组织编码和人员唯一编码生成

See merge request o2oa/o2oa!4549
......@@ -64,6 +64,9 @@ class ActionCreate extends BaseAction {
}
Identity identity = new Identity();
Wi.copier.copy(wi, identity);
if(StringUtils.isBlank(wi.getUnique())){
identity.setUnique(unit.getUnique()+"_"+person.getUnique());
}
/** 如果唯一标识不为空,要检查唯一标识是否唯一 */
if (this.uniqueDuplicateWhenNotEmpty(business, identity)) {
throw new ExceptionDuplicateUnique(identity.getName(), identity.getUnique());
......
......@@ -434,6 +434,7 @@ public class SyncOrganization {
EntityManagerContainer emc = business.entityManagerContainer();
emc.beginTransaction(Identity.class);
Identity identity = new Identity();
identity.setUnique(unit.getUnique()+"_"+person.getUnique());
identity.setName(person.getName());
identity.setPerson(person.getId());
identity.setUnit(unit.getId());
......
......@@ -410,6 +410,7 @@ public class SyncOrganization {
EntityManagerContainer emc = business.entityManagerContainer();
emc.beginTransaction(Identity.class);
Identity identity = new Identity();
identity.setUnique(unit.getUnique()+"_"+person.getUnique());
identity.setName(person.getName());
identity.setPerson(person.getId());
identity.setUnit(unit.getId());
......
......@@ -198,6 +198,7 @@ public class SyncOrganization {
EntityManagerContainer emc = business.entityManagerContainer();
emc.beginTransaction(Identity.class);
Identity identity = new Identity();
identity.setUnique(unit.getUnique()+"_"+person.getUnique());
identity.setName(person.getName());
identity.setPerson(person.getId());
identity.setUnit(unit.getId());
......
......@@ -409,6 +409,7 @@ public class SyncOrganization {
EntityManagerContainer emc = business.entityManagerContainer();
emc.beginTransaction(Identity.class);
Identity identity = new Identity();
identity.setUnique(unit.getUnique()+"_"+person.getUnique());
identity.setName(person.getName());
identity.setPerson(person.getId());
identity.setUnit(unit.getId());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册