提交 9a8476aa 作者: obcy

【fix空指针】

上级 33e159f8
...@@ -12,6 +12,7 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -12,6 +12,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -72,6 +73,9 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi ...@@ -72,6 +73,9 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@Override @Override
public List<DictTreeVO> dictItemTreeList(List<String> dictIds) { public List<DictTreeVO> dictItemTreeList(List<String> dictIds) {
List<DictTreeVO> itemList = baseMapper.dictItemList(dictIds); List<DictTreeVO> itemList = baseMapper.dictItemList(dictIds);
if (CollectionUtils.isEmpty(itemList)) {
return new ArrayList<>();
}
List<DictTreeVO> tree = TreeUtil.tree(itemList, "0"); List<DictTreeVO> tree = TreeUtil.tree(itemList, "0");
tree.forEach(e -> e.setPid(e.getDictId())); tree.forEach(e -> e.setPid(e.getDictId()));
return tree; return tree;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论