fix (farm): 物种库维护

- 新增 物种库二级树
This commit is contained in:
达富斌
2025-09-06 23:07:44 +08:00
parent 7efb338777
commit cf0e87afb8

View File

@@ -384,10 +384,15 @@ public class SpeciesLibraryServiceImpl implements SpeciesLibraryService {
wrapperX.orderByDesc(TwoDictDO::getId);
List<TwoDictDO> allDicts = twoDictMapper.selectList(wrapperX);
// 查找匹配的节点
List<TwoDictDO> matchedDicts = allDicts.stream().filter(dict -> dict.getName().equals(req.getName())).collect(Collectors.toList());
if (matchedDicts.isEmpty()) {
return Collections.emptyList();
List<TwoDictDO> matchedDicts = null;
if (req.getName() != null) {
// 查找匹配的节点
matchedDicts = allDicts.stream().filter(dict -> dict.getName().equals(req.getName())).collect(Collectors.toList());
if (matchedDicts.isEmpty()) {
return Collections.emptyList();
}
} else {
matchedDicts = allDicts;
}
// 构建完整的树结构用于查询