mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
update 优化代码小改动的逻辑性错误
This commit is contained in:
parent
90fd44e4bb
commit
de668f65cc
@ -72,6 +72,11 @@ public interface SystemConstants {
|
|||||||
*/
|
*/
|
||||||
Long SUPER_ADMIN_ID = 1L;
|
Long SUPER_ADMIN_ID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根部门祖级列表
|
||||||
|
*/
|
||||||
|
String ROOT_DEPT_ANCESTORS = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认部门 ID
|
* 默认部门 ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.constant.Constants;
|
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.domain.dto.DeptDTO;
|
import org.dromara.common.core.domain.dto.DeptDTO;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
@ -351,7 +350,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
// 如果部门状态为启用,且部门祖级列表不为空,且部门祖级列表不等于根部门祖级列表(如果部门祖级列表不等于根部门祖级列表,则说明存在上级部门)
|
// 如果部门状态为启用,且部门祖级列表不为空,且部门祖级列表不等于根部门祖级列表(如果部门祖级列表不等于根部门祖级列表,则说明存在上级部门)
|
||||||
if (SystemConstants.NORMAL.equals(dept.getStatus())
|
if (SystemConstants.NORMAL.equals(dept.getStatus())
|
||||||
&& StringUtils.isNotEmpty(dept.getAncestors())
|
&& StringUtils.isNotEmpty(dept.getAncestors())
|
||||||
&& !StringUtils.equals(Constants.TOP_PARENT_ID.toString(), dept.getAncestors())) {
|
&& !StringUtils.equals(SystemConstants.ROOT_DEPT_ANCESTORS, dept.getAncestors())) {
|
||||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||||
updateParentDeptStatusNormal(dept);
|
updateParentDeptStatusNormal(dept);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,8 +96,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
|||||||
@Override
|
@Override
|
||||||
public void deleteDictDataByIds(List<Long> dictCodes) {
|
public void deleteDictDataByIds(List<Long> dictCodes) {
|
||||||
List<SysDictData> list = baseMapper.selectByIds(dictCodes);
|
List<SysDictData> list = baseMapper.selectByIds(dictCodes);
|
||||||
list.forEach(x -> CacheUtils.evict(CacheNames.SYS_DICT, x.getDictType()));
|
|
||||||
baseMapper.deleteByIds(dictCodes);
|
baseMapper.deleteByIds(dictCodes);
|
||||||
|
list.forEach(x -> CacheUtils.evict(CacheNames.SYS_DICT, x.getDictType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -138,10 +138,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
if (assigned) {
|
if (assigned) {
|
||||||
throw new ServiceException(String.format("%1$s已分配,不能删除", x.getDictName()));
|
throw new ServiceException(String.format("%1$s已分配,不能删除", x.getDictName()));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
baseMapper.deleteByIds(dictIds);
|
||||||
|
list.forEach(x -> {
|
||||||
CacheUtils.evict(CacheNames.SYS_DICT, x.getDictType());
|
CacheUtils.evict(CacheNames.SYS_DICT, x.getDictType());
|
||||||
CacheUtils.evict(CacheNames.SYS_DICT_TYPE, x.getDictType());
|
CacheUtils.evict(CacheNames.SYS_DICT_TYPE, x.getDictType());
|
||||||
});
|
});
|
||||||
baseMapper.deleteByIds(dictIds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user