|
|
|
@ -59,7 +59,9 @@ public class ProductQualifiedService { |
|
|
|
|
if (ObjectUtil.isNotEmpty(cylinderVolume)) { |
|
|
|
|
//气瓶容积
|
|
|
|
|
if (cylinderVolume.equals("L")) { |
|
|
|
|
equipmentRegistryRespVO.setCylinderVolume("70.4"); |
|
|
|
|
//处理识别到上一行的情况
|
|
|
|
|
cylinderVolume = extractManufacturer(texts, fieldMap.get("cylinderVolume"), -1); |
|
|
|
|
equipmentRegistryRespVO.setCylinderVolume(cylinderVolume); |
|
|
|
|
} else { |
|
|
|
|
equipmentRegistryRespVO.setCylinderVolume(cylinderVolume); |
|
|
|
|
} |
|
|
|
@ -75,18 +77,16 @@ public class ProductQualifiedService { |
|
|
|
|
if (recTexts == null || recTexts.isEmpty()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 使用 Stream 查找关键词位置
|
|
|
|
|
int index = IntStream.range(0, recTexts.size()) |
|
|
|
|
.filter(i -> recTexts.get(i).contains(keyword)) |
|
|
|
|
.findFirst() |
|
|
|
|
.orElse(-1); // 未找到返回-1
|
|
|
|
|
|
|
|
|
|
.orElse(-1); |
|
|
|
|
// 检查是否找到关键词,且偏移后不越界
|
|
|
|
|
if (index != -1 && index + offset < recTexts.size()) { |
|
|
|
|
|
|
|
|
|
return recTexts.get(index + offset); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; // 未找到或越界时返回null
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|