|
|
|
|
@ -112,7 +112,7 @@ public class CertificateOfApprovalService { |
|
|
|
|
productId = extractManufacturer(texts, fieldMap.get("productId"), productIdOffset); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(productId)) { |
|
|
|
|
if (ObjectUtil.isNotEmpty(productId)&&isLengthGreaterThan3(productId)) { |
|
|
|
|
productId = matchAllowedChars(productId); |
|
|
|
|
if (productId != null) { |
|
|
|
|
productId = productId.replaceAll("\\s", ""); |
|
|
|
|
@ -123,7 +123,7 @@ public class CertificateOfApprovalService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String nominalWorkingPressure = extractManufacturer(texts, fieldMap.get("nominalWorkingPressure"), 1); |
|
|
|
|
if (ObjectUtil.isNotEmpty(nominalWorkingPressure)) { |
|
|
|
|
if (ObjectUtil.isNotEmpty(nominalWorkingPressure)&&isAlphaNumeric(nominalWorkingPressure)) { |
|
|
|
|
//公称压力
|
|
|
|
|
equipmentRegistryRespVO.setNominalWorkingPressure(nominalWorkingPressure); |
|
|
|
|
} |
|
|
|
|
@ -150,7 +150,8 @@ public class CertificateOfApprovalService { |
|
|
|
|
return null; |
|
|
|
|
} else { |
|
|
|
|
contractor = matchInstallationUnit(fieldMap.get("contractor"), contractor); |
|
|
|
|
if (contractor != null) { |
|
|
|
|
if (contractor != null && isEndWithOrgSuffix(contractor)) { |
|
|
|
|
|
|
|
|
|
equipmentRegistryRespVO.setContractor(contractor); |
|
|
|
|
} else { |
|
|
|
|
int contractorOffset = 1; |
|
|
|
|
@ -158,7 +159,7 @@ public class CertificateOfApprovalService { |
|
|
|
|
contractorOffset = 1; |
|
|
|
|
} |
|
|
|
|
contractor = extractManufacturer(texts, fieldMap.get("contractor"), contractorOffset); |
|
|
|
|
if (ObjectUtil.isNotEmpty(contractor)) { |
|
|
|
|
if (ObjectUtil.isNotEmpty(contractor) && isEndWithOrgSuffix(contractor)) { |
|
|
|
|
//安装单位
|
|
|
|
|
equipmentRegistryRespVO.setContractor(contractor); |
|
|
|
|
} |
|
|
|
|
@ -166,6 +167,38 @@ public class CertificateOfApprovalService { |
|
|
|
|
} |
|
|
|
|
return equipmentRegistryRespVO; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 判断字符串是否仅由字母和数字组成 |
|
|
|
|
*/ |
|
|
|
|
public static boolean isAlphaNumeric(String input) { |
|
|
|
|
if (StrUtil.isBlank(input)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return input.matches("^[a-zA-Z0-9]+$"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 判断字符串长度是否大于3(即长度 >= 4) |
|
|
|
|
* |
|
|
|
|
* @param input 输入字符串 |
|
|
|
|
* @return 是否长度大于3 |
|
|
|
|
*/ |
|
|
|
|
public static boolean isLengthGreaterThan3(String input) { |
|
|
|
|
return !StrUtil.isBlank(input) && input.length() > 3; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 判断字符串是否以 "公司"、"厂"、"机构" 或 "中心" 结尾 |
|
|
|
|
* |
|
|
|
|
* @param input 输入字符串 |
|
|
|
|
* @return 是否匹配 |
|
|
|
|
*/ |
|
|
|
|
public static boolean isEndWithOrgSuffix(String input) { |
|
|
|
|
if (StrUtil.isBlank(input)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 使用正则表达式判断是否以指定的词结尾
|
|
|
|
|
return input.matches(".*(公司|厂|机构|中心)$"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 检查productId字符串是否仅包含大小写字母、"/" 和 "-" |
|
|
|
|
* @param input 待检查的字符串 |
|
|
|
|
|