Commit 58b7488e authored by huyuchen's avatar huyuchen

huyc 部门根节点数值修改

parent 07ebe7a2
......@@ -205,6 +205,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
String userId = "";
if (dn.contains("uid")) {
userId = dn.substring(4, dn.indexOf(",", 1));
dn = dn.substring(dn.indexOf(",", 1) + 1);
}
List<String> list = Arrays.asList(dn.split(",")).stream().filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList());
String deptName = list.get(0).replace("ou=", "");
......@@ -227,21 +228,24 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
if (null != sysDept) {
SysDept sysDeptCount = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
if (null == sysDeptCount) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
this.save(insertSysDept);
if (StringUtils.isEmpty(userId)) {
SysDept insertSysDept = new SysDept();
insertSysDept.setName(deptName);
insertSysDept.setParentId(sysDept.getDeptId());
insertSysDept.setDeptDn(dn);
this.save(insertSysDept);
}
} else {
if (StringUtils.isNotBlank(userId)) {
if (!StringUtils.isEmpty(userId)) {
Map<String,Object> map = new HashMap<>();
map.put("userId",userId);
map.put("deptId",sysDeptCount.getDeptId());
updUserList.add(map);
}else {
sysDeptCount.setName(deptName);
sysDeptCount.setParentId(sysDept.getDeptId());
this.updateDeptById(sysDeptCount);
}
sysDeptCount.setName(deptName);
sysDeptCount.setParentId(sysDept.getDeptId());
this.updateDeptById(sysDeptCount);
}
}
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment