fix (farm): 物种库维护
- 新增 物种库二级树
This commit is contained in:
@@ -384,10 +384,15 @@ public class SpeciesLibraryServiceImpl implements SpeciesLibraryService {
|
|||||||
wrapperX.orderByDesc(TwoDictDO::getId);
|
wrapperX.orderByDesc(TwoDictDO::getId);
|
||||||
List<TwoDictDO> allDicts = twoDictMapper.selectList(wrapperX);
|
List<TwoDictDO> allDicts = twoDictMapper.selectList(wrapperX);
|
||||||
|
|
||||||
// 查找匹配的节点
|
List<TwoDictDO> matchedDicts = null;
|
||||||
List<TwoDictDO> matchedDicts = allDicts.stream().filter(dict -> dict.getName().equals(req.getName())).collect(Collectors.toList());
|
if (req.getName() != null) {
|
||||||
if (matchedDicts.isEmpty()) {
|
// 查找匹配的节点
|
||||||
return Collections.emptyList();
|
matchedDicts = allDicts.stream().filter(dict -> dict.getName().equals(req.getName())).collect(Collectors.toList());
|
||||||
|
if (matchedDicts.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
matchedDicts = allDicts;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建完整的树结构用于查询
|
// 构建完整的树结构用于查询
|
||||||
|
|||||||
Reference in New Issue
Block a user