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

dev
秋辞未寒 10 months ago
parent 4c5ab7bcaf
commit e67aa57cb3

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

@ -298,8 +298,10 @@ public class SysDeptServiceImpl implements ISysDeptService {
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