Atualização automática - 2026-06-24 11:14:34

This commit is contained in:
2026-06-24 11:14:34 +00:00
parent 69ca30eae1
commit 27090f37c2
+8 -5
View File
@@ -19,10 +19,13 @@ function parseThickness(productDesc: string): number {
const cleanDesc = productDesc.replace(/,/g, '.'); const cleanDesc = productDesc.replace(/,/g, '.');
// Try to find the pattern "num x num x num" (Thickness x Width x Length) const matchDimensions = cleanDesc.match(/(\d+(?:\.\d+)?)\s*(?:x|X|\*)\s*(\d+(?:\.\d+)?)\s*(?:x|X|\*)\s*(\d+(?:\.\d+)?)/);
const matchDimensions = cleanDesc.match(/(\d+(?:\.\d+)?)\s*(?:x|X|\*)\s*\d+(?:\.\d+)?\s*(?:x|X|\*)\s*\d+(?:\.\d+)?/);
if (matchDimensions) { if (matchDimensions) {
return parseFloat(matchDimensions[1]); const dim1 = parseFloat(matchDimensions[1]);
const dim2 = parseFloat(matchDimensions[2]);
const dim3 = parseFloat(matchDimensions[3]);
// The thickness is almost always the smallest dimension of a plate
return Math.min(dim1, dim2, dim3);
} }
const match = cleanDesc.match(/(\d+(\.\d+)?)\s*(mm)/i); const match = cleanDesc.match(/(\d+(\.\d+)?)\s*(mm)/i);
@@ -161,7 +164,7 @@ export function validateCertificateAgainstStandard(extractedReport: ReportData,
if (normStr.length > 0) { if (normStr.length > 0) {
item.norm = normStr.join(' - '); item.norm = normStr.join(' - ');
} else { } else {
item.norm = 'Não especificado'; item.norm = '-';
} }
item.status = status; item.status = status;
@@ -209,7 +212,7 @@ export function validateCertificateAgainstStandard(extractedReport: ReportData,
if (normStr.length > 0) { if (normStr.length > 0) {
item.norm = normStr.join(' - '); item.norm = normStr.join(' - ');
} else { } else {
item.norm = 'Não especificado'; item.norm = '-';
} }
item.status = status; item.status = status;