【统一认证】组织更新叶子结点修改
This commit is contained in:
+5
-3
@@ -295,6 +295,7 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
|
|||||||
String parentId = "";
|
String parentId = "";
|
||||||
String[] unitCodes = levelPath.split("\\|");
|
String[] unitCodes = levelPath.split("\\|");
|
||||||
for (String unitCode : unitCodes) {
|
for (String unitCode : unitCodes) {
|
||||||
|
//判断是否为顶级组织
|
||||||
if (StringUtils.isBlank(unitCode) || "00000100".equals(unitCode)) {
|
if (StringUtils.isBlank(unitCode) || "00000100".equals(unitCode)) {
|
||||||
parentId = sysDepartService.getOne(new LambdaQueryWrapper<SysDepart>()
|
parentId = sysDepartService.getOne(new LambdaQueryWrapper<SysDepart>()
|
||||||
.and(wrapper ->
|
.and(wrapper ->
|
||||||
@@ -343,17 +344,18 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (save) {
|
if (save) {
|
||||||
// 仅在父节点为叶子节点时更新为非叶子节点
|
|
||||||
SysDepart parentDepart = sysDepartService.getOne(new LambdaQueryWrapper<SysDepart>()
|
SysDepart parentDepart = sysDepartService.getOne(new LambdaQueryWrapper<SysDepart>()
|
||||||
.eq(SysDepart::getId, parentId)
|
.eq(SysDepart::getId, parentId)
|
||||||
);
|
);
|
||||||
if (parentDepart != null && !parentDepart.getIzLeaf().equals(1)) {
|
// 判断父级组织是否为叶子结点,0不是叶子节点,1是叶子节点,是则更新为非叶子结点
|
||||||
|
if (parentDepart != null && parentDepart.getIzLeaf().equals(1)) {
|
||||||
sysDepartService.update(new LambdaUpdateWrapper<SysDepart>()
|
sysDepartService.update(new LambdaUpdateWrapper<SysDepart>()
|
||||||
.eq(SysDepart::getId, parentId)
|
.eq(SysDepart::getId, parentId)
|
||||||
.set(SysDepart::getIzLeaf, "1")
|
.set(SysDepart::getIzLeaf, CommonConstant.NOT_LEAF)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 父id赋值
|
||||||
parentId = depart.getId();
|
parentId = depart.getId();
|
||||||
orgId = depart.getId();
|
orgId = depart.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user