fix(系统设置): 修复文件管理中针对跟目录id的判断方法

This commit is contained in:
song-tianyang 2023-11-20 16:26:07 +08:00 committed by 建国
parent 314a6fbfd4
commit 467942fc59
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje
*/
protected void checkDataValidity(FileModule fileModule) {
FileModuleExample example = new FileModuleExample();
if (!StringUtils.equals(fileModule.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
if (!StringUtils.equalsIgnoreCase(fileModule.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
//检查父ID是否存在
example.createCriteria().andIdEqualTo(fileModule.getParentId());
if (fileModuleMapper.countByExample(example) == 0) {

View File

@ -59,7 +59,7 @@ public abstract class ModuleTreeService {
while (CollectionUtils.isNotEmpty(traverseList) && traverseList.size() != lastSize) {
List<BaseTreeNode> notMatchedList = new ArrayList<>();
for (BaseTreeNode treeNode : traverseList) {
if (StringUtils.equals(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
if (StringUtils.equalsIgnoreCase(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
BaseTreeNode node = new BaseTreeNode(treeNode.getId(), treeNode.getName(), treeNode.getType(), treeNode.getParentId());
baseTreeNodeList.add(node);
baseTreeNodeMap.put(treeNode.getId(), node);