fixed: LDAP部门同步的同层级的上级变动bug

This commit is contained in:
xxx 2024-07-05 09:27:23 +08:00
parent 6541c3a191
commit bac04d164f

View File

@ -138,8 +138,10 @@ public class LDAPBus {
Department tmpDepartment = Department tmpDepartment =
departmentService.findOrFail(tmpLdapDepartment.getDepartmentId()); departmentService.findOrFail(tmpLdapDepartment.getDepartmentId());
if (!tmpDepartment.getName().equals(tmpName) if (!tmpDepartment.getName().equals(tmpName)
|| tmpLdapDepartment.getDn().split(",").length || !tmpLdapDepartment
!= dn.split(",").length) { .getDn()
.replace("ou=" + tmpName, "")
.equals(dn.replaceAll("ou=" + tmpName, ""))) {
departmentService.update(tmpDepartment, tmpName, parentId, sort); departmentService.update(tmpDepartment, tmpName, parentId, sort);
} }