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