update 优化 根部门祖级列表常量和备注,以避免歧义

master
秋辞未寒 10 months ago
parent 78abb617ce
commit 2746af21f0

@ -72,4 +72,9 @@ public interface SystemConstants {
*/
Long SUPER_ADMIN_ID = 1L;
/**
*
*/
String ROOT_DEPT_ANCESTORS = "0";
}

@ -323,8 +323,10 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
dept.setAncestors(oldDept.getAncestors());
}
int result = baseMapper.updateById(dept);
if (SystemConstants.NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
&& !StringUtils.equals(SystemConstants.NORMAL, dept.getAncestors())) {
// 如果部门状态为启用,且部门祖级列表不为空,且部门祖级列表不等于根部门祖级列表(如果部门祖级列表不等于根部门祖级列表,则说明存在上级部门)
if (SystemConstants.NORMAL.equals(dept.getStatus())
&& StringUtils.isNotEmpty(dept.getAncestors())
&& !StringUtils.equals(SystemConstants.ROOT_DEPT_ANCESTORS, dept.getAncestors())) {
// 如果该部门是启用状态,则启用该部门的所有上级部门
updateParentDeptStatusNormal(dept);
}

Loading…
Cancel
Save