fix: 优化逻辑

This commit is contained in:
tangwei 2026-07-01 18:49:55 +08:00
parent cbb93ec8ec
commit f907785f4a

View File

@ -1103,17 +1103,17 @@ public class FishImportServiceImpl implements IFishImportService {
return null;
}
SdFishDictoryB exactMatch = findFirst(fishDictoryBMapper.selectList(new LambdaQueryWrapper<SdFishDictoryB>()
.select(SdFishDictoryB::getCode, SdFishDictoryB::getName)
.select(SdFishDictoryB::getId, SdFishDictoryB::getName)
.eq(SdFishDictoryB::getName, normalizedName)));
if (exactMatch != null) {
return exactMatch.getCode();
return exactMatch.getId();
}
SdFishDictoryB fuzzyMatch = findFirst(fishDictoryBMapper.selectList(new LambdaQueryWrapper<SdFishDictoryB>()
.select(SdFishDictoryB::getCode, SdFishDictoryB::getName)
.select(SdFishDictoryB::getId, SdFishDictoryB::getName)
.and(wrapper -> wrapper.like(SdFishDictoryB::getName, normalizedName)
.or()
.like(SdFishDictoryB::getAlias, normalizedName))));
return fuzzyMatch == null ? null : fuzzyMatch.getCode();
return fuzzyMatch == null ? null : fuzzyMatch.getId();
}
@Override
@ -1125,11 +1125,11 @@ public class FishImportServiceImpl implements IFishImportService {
}
if (StringUtils.hasText(normalizedCode)) {
SdFishDictoryB exact = findFirst(fishDictoryBMapper.selectList(new LambdaQueryWrapper<SdFishDictoryB>()
.select(SdFishDictoryB::getCode, SdFishDictoryB::getName)
.eq(SdFishDictoryB::getCode, normalizedCode)));
.select(SdFishDictoryB::getId, SdFishDictoryB::getName)
.eq(SdFishDictoryB::getId, normalizedCode)));
// .eq(SdFishDictoryB::getName, normalizedName)));
if (exact != null) {
return exact.getCode();
return exact.getId();
}
}
// if (StringUtils.hasText(normalizedCode)) {