|
|
@@ -54,6 +54,7 @@ public class ADSyncService {
|
|
|
//判断是否需要更新组织
|
|
|
if("离职".equals(employee.getEm_class())){
|
|
|
deleteUser(employee.getEm_adid(),connection);
|
|
|
+ baseDao.updateByCondition("employee","em_adid=null","em_code='"+employee.getEm_code()+"'");
|
|
|
}
|
|
|
Optional<HrOrg> orgOptional = orgList.stream().filter(org -> org.getOr_code().equals(employee.getOrcode())).findFirst();
|
|
|
logger.info("同步用户更新:{}",employee.getEm_name());
|
|
|
@@ -62,6 +63,7 @@ public class ADSyncService {
|
|
|
logger.info("同步用户更新:oldpath{},newpath{}",getUserOUPath(employee.getEm_adid()),newOUPath);
|
|
|
if(employee.getEm_code().equals("ADMIN") && !getUserOUPath(employee.getEm_adid()).equals(newOUPath)){
|
|
|
moveUser(employee.getEm_adid(),"CN="+employee.getEm_name()+","+newOUPath,connection);
|
|
|
+ baseDao.updateByCondition("employee","em_adid='CN="+employee.getEm_name()+","+newOUPath+"'","em_code='"+employee.getEm_code()+"'");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -228,7 +230,6 @@ public class ADSyncService {
|
|
|
//添加组织
|
|
|
addOrg(org, connection);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -236,6 +237,7 @@ public class ADSyncService {
|
|
|
for(String orgDn : orgDns){
|
|
|
String orgDescription = orgDn.substring(orgDn.indexOf(";")+1);
|
|
|
if(StringUtil.hasText(orgDescription)){
|
|
|
+ //未成功匹配的组织资料
|
|
|
if(!orgList.stream().anyMatch(org -> !"已禁用".equals(org.getOr_status()) && org.getOr_code().equals(orgDescription))){
|
|
|
//删除AD域组织
|
|
|
deleteOrg(orgDn.split(";")[0], connection);
|