|
|
|
@ -124,6 +124,109 @@ public class ProductQualifiedService { |
|
|
|
|
} |
|
|
|
|
return equipmentRegistryRespVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public EquipmentRegistryRespVO getCertificateOfApprovalTwo(List<String> texts, String postfix) { |
|
|
|
|
boolean productQualified = texts.stream().anyMatch(t -> t.equals("工作压力")); |
|
|
|
|
Map<String, String> fieldMap = new HashMap<>(); |
|
|
|
|
if (productQualified) { |
|
|
|
|
fieldMap = fieldMappingService.getCertificateMapping("工作压力", texts); |
|
|
|
|
} else { |
|
|
|
|
fieldMap = fieldMappingService.getCertificateMapping("公称工作压力:", texts); |
|
|
|
|
} |
|
|
|
|
EquipmentRegistryRespVO equipmentRegistryRespVO = new EquipmentRegistryRespVO(); |
|
|
|
|
equipmentRegistryRespVO.setEquipmentType("特种气瓶"); |
|
|
|
|
equipmentRegistryRespVO.setProductName("车用气瓶"); |
|
|
|
|
equipmentRegistryRespVO.setCylinderQuantity("1"); |
|
|
|
|
int productIdOffset = 1; |
|
|
|
|
if (!postfix.equals("pdf")) { |
|
|
|
|
productIdOffset = 1; |
|
|
|
|
} |
|
|
|
|
// String productId = extractManufacturer(texts, fieldMap.get("productId"), productIdOffset);
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(productId)&&isLengthGreaterThan3(productId)) {
|
|
|
|
|
// productId = matchAllowedChars(productId);
|
|
|
|
|
// if (productId != null) {
|
|
|
|
|
// productId = productId.replaceAll("\\s", "");
|
|
|
|
|
// if (StrUtil.contains(productId, "瓶号")) {
|
|
|
|
|
// // 移除"瓶号"并返回
|
|
|
|
|
// productId = StrUtil.removePrefix(productId, "瓶号");
|
|
|
|
|
// }
|
|
|
|
|
// equipmentRegistryRespVO.setProductId(productId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//充装介质
|
|
|
|
|
boolean hasFillingMedium = texts.stream().anyMatch(t -> t.contains("液化天然气") || t.contains("LNG")); |
|
|
|
|
if (hasFillingMedium) { |
|
|
|
|
equipmentRegistryRespVO.setFillingMedium("LNG"); |
|
|
|
|
} else { |
|
|
|
|
equipmentRegistryRespVO.setFillingMedium("CNG"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int nominalWorkingPressureOffset = 1; |
|
|
|
|
if (!postfix.equals("pdf")) { |
|
|
|
|
nominalWorkingPressureOffset = 2; |
|
|
|
|
} |
|
|
|
|
String nominalWorkingPressure = extractManufacturer(texts, fieldMap.get("nominalWorkingPressure"), 0); |
|
|
|
|
if (nominalWorkingPressure != null) { |
|
|
|
|
nominalWorkingPressure = matchWaterVolume(fieldMap.get("nominalWorkingPressure"), nominalWorkingPressure, "MPa"); |
|
|
|
|
if (nominalWorkingPressure != null && isAlphaNumeric(nominalWorkingPressure)) { |
|
|
|
|
equipmentRegistryRespVO.setNominalWorkingPressure(nominalWorkingPressure); |
|
|
|
|
} else { |
|
|
|
|
nominalWorkingPressure = extractManufacturer(texts, fieldMap.get("nominalWorkingPressure"), nominalWorkingPressureOffset); |
|
|
|
|
if (ObjectUtil.isNotEmpty(nominalWorkingPressure)) { |
|
|
|
|
if (nominalWorkingPressure.equals("MPa")) { |
|
|
|
|
nominalWorkingPressure = extractManufacturer(texts, fieldMap.get("nominalWorkingPressure"), 2); |
|
|
|
|
} |
|
|
|
|
if (isAlphaNumeric(nominalWorkingPressure)) { |
|
|
|
|
//气瓶公称工作压力
|
|
|
|
|
equipmentRegistryRespVO.setNominalWorkingPressure(nominalWorkingPressure); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// int cylinderVolumeOffset = 1;
|
|
|
|
|
// if (!postfix.equals("pdf")) {
|
|
|
|
|
// cylinderVolumeOffset = 1;
|
|
|
|
|
// }
|
|
|
|
|
// String cylinderVolume = extractManufacturer(texts, fieldMap.get("cylinderVolume"), 0);
|
|
|
|
|
// if (cylinderVolume != null) {
|
|
|
|
|
// cylinderVolume = matchWaterVolume(fieldMap.get("cylinderVolume"), cylinderVolume, "L");
|
|
|
|
|
// if (cylinderVolume != null) {
|
|
|
|
|
// return equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// } else {
|
|
|
|
|
// cylinderVolume = extractManufacturer(texts, fieldMap.get("cylinderVolume"), cylinderVolumeOffset);
|
|
|
|
|
// if (isNumeric(cylinderVolume) || isNumericL(cylinderVolume)) {
|
|
|
|
|
// return equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// } else {
|
|
|
|
|
// if (cylinderVolume != null && cylinderVolume.equals("L")) {
|
|
|
|
|
// //处理识别到上一行的情况
|
|
|
|
|
// cylinderVolume = extractManufacturer(texts, fieldMap.get("cylinderVolume"), -1);
|
|
|
|
|
// if (isNumeric(cylinderVolume)) {
|
|
|
|
|
// return equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// cylinderVolume = extractManufacturer(texts, "实测水容机: ", 1);
|
|
|
|
|
// if (isNumeric(cylinderVolume) || isNumericL(cylinderVolume)) {
|
|
|
|
|
// return equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//兜底方案,检测是否有符合特征的值
|
|
|
|
|
// cylinderVolume = matchTexts(texts);
|
|
|
|
|
// if (cylinderVolume != null) {
|
|
|
|
|
// equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// } else {
|
|
|
|
|
// cylinderVolume = extractManufacturer(texts, fieldMap.get("cylinderVolume"), -1);
|
|
|
|
|
// if (isNumeric(cylinderVolume)) {
|
|
|
|
|
// return equipmentRegistryRespVO.setCylinderVolume(cylinderVolume);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
return equipmentRegistryRespVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断字符串是否符合: |
|
|
|
|
* - 纯数字(含小数) |
|
|
|
|