|
@@ -26,6 +26,7 @@ import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.CachePut;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -281,9 +282,11 @@ public class SysPrivilegeServiceImpl extends ServiceImpl<SysPrivilegeMapper, Sys
|
|
|
}
|
|
|
if (v.getParentId() > 0 && v.getType() == PrivilegeEnum.MENU) {
|
|
|
map.get(v.getParentId()).getChildren().add(v);
|
|
|
- Collections.sort(map.get(v.getParentId()).getChildren());
|
|
|
deleteKeys.add(k);
|
|
|
}
|
|
|
+ if (Objects.nonNull(map.get(v.getParentId())) && !CollectionUtils.isEmpty(map.get(v.getParentId()).getChildren())) {
|
|
|
+ Collections.sort(map.get(v.getParentId()).getChildren());
|
|
|
+ }
|
|
|
});
|
|
|
for (Long key : deleteKeys) {
|
|
|
map.remove(key);
|