From b551449bff959557dd365fa9c34407bb5f65d74e Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Mon, 22 Jun 2026 23:47:08 +0000 Subject: [PATCH] Deploy Inicial do SteelCheck com Docker Build Automatizado --- components/ReportDisplay.tsx | 402 +++++++++++++++++------------- relat_rio_t_cnico_steelcheck.html | 381 ++++++++++++++++++++++++++++ services/aiService.ts | 7 +- types.ts | 1 + 4 files changed, 618 insertions(+), 173 deletions(-) create mode 100644 relat_rio_t_cnico_steelcheck.html diff --git a/components/ReportDisplay.tsx b/components/ReportDisplay.tsx index cdf6ecb..4527442 100644 --- a/components/ReportDisplay.tsx +++ b/components/ReportDisplay.tsx @@ -1,7 +1,5 @@ - import React from 'react'; import type { ReportData, ComplianceItem } from '../types'; -import { CheckCircleIcon, XCircleIcon, InfoIcon } from './Icons'; interface ReportDisplayProps { report: ReportData; @@ -11,209 +9,273 @@ const statusClass = (status: 'OK' | 'FALHA' | 'CONFORME' | 'NÃO CONFORME') => { switch (status) { case 'OK': case 'CONFORME': - return 'text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20 dark:text-emerald-400 border border-emerald-200 dark:border-emerald-800'; + return 'text-emerald-600 bg-emerald-50 dark:bg-emerald-900/30 dark:text-emerald-400 border border-emerald-200 dark:border-emerald-800'; case 'FALHA': case 'NÃO CONFORME': - return 'text-red-600 bg-red-50 dark:bg-red-900/20 dark:text-red-400 border border-red-200 dark:border-red-800'; + return 'text-red-600 bg-red-50 dark:bg-red-900/30 dark:text-red-400 border border-red-200 dark:border-red-800'; default: return 'text-slate-600 bg-slate-50 dark:bg-slate-800/50 dark:text-slate-400 border border-slate-200 dark:border-slate-700'; } }; const statusIcon = (status: 'OK' | 'FALHA') => { - return status === 'OK' - ? - : ; + return status === 'OK' ? ( + + ) : ( + + ); }; - -const ComplianceTableRow: React.FC<{ item: ComplianceItem; headerLabel: string }> = ({ item, headerLabel }) => ( - - - {headerLabel} - {item.property || item.element || item.test} - - - Norma - {item.norm} - - - Certificado - {item.certificate} - - - Status - - {statusIcon(item.status)} - {item.status} - - - -); - export const ReportDisplay: React.FC = ({ report }) => { const identification = report?.identification || {}; const compliance = report?.compliance || { status: 'NÃO CONFORME', mechanical: [], chemical: [], otherTests: [] }; - const overPerformance = report?.overPerformance || []; const equivalents = report?.equivalents || []; const confidence = report?.confidence || 0; return ( -
-
-
-
-

Relatório Técnico de Qualidade

-

Análise de conformidade normativa assistida por IA

-
- -
-

Grau de Confiança da Análise

-
- {confidence} - % -
-
-
- - {/* Identification Section */} -
-
-

1. Dados de Identificação

-
-
-
    - {Object.entries(identification).map(([key, value]) => ( -
  • - {key.replace(/([A-Z])/g, ' $1')} - {value} -
  • - ))} -
-
-
- - {/* Compliance Section */} -
-
-

2. Verificação de Conformidade

-
- {compliance.status} -
-
- -
+
+ + {/* Cabeçalho (Header) */} +
+
-

- - Análise de Propriedades Mecânicas -

-
- - - - - - - - - - - {compliance.mechanical.map((item, i) => )} - -
PropriedadeNormaCertificadoStatus
+ {/* Logo SteelCheck com visual geométrico */} +
+ STEEL CHECK + IA Quality Report +
+

Relatório Técnico de Qualidade

+

Análise de conformidade normativa assistida por inteligência artificial

+
+ +
+ {/* Status Global de Conformidade */} +
+ Status Geral +
+ + {compliance.status} +
+
+ + {/* Score de Confiança da IA */} +
+ Confiança da Análise +
+ {confidence}% IA-Score +
+
+
-
-

- - Análise de Composição Química (%) -

-
- - - - - - - - - - - {compliance.chemical.map((item, i) => )} - -
ElementoNormaCertificadoStatus
-
-
- {compliance.otherTests.length > 0 && ( + {/* Conteúdo Principal */} +
+ + {/* Seção 1: Dados de Identificação */} +
+

+ + 1. Identificação do Produto e Lote +

+
-

- - Outros Testes -

+ Produto + {identification.product || '-'} +
+
+ Norma de Referência + {identification.standards || '-'} +
+
+ Fabricante + {identification.manufacturer || '-'} +
+
+ Nº do Certificado + #{identification.certificateNumber || '-'} +
+
+ Data de Emissão + {identification.certificateDate || '-'} +
+
+ Lote analisado + {identification.batches || '-'} +
+
+ Corrida (Heat) + {identification.heats || '-'} +
+
+ Massa Total + {identification.quantity || '-'} +
+
+
+ + {/* Seção 2: Verificação de Conformidade */} +
+ + {/* Propriedades Mecânicas (Esquerda) */} +
+

+ + 2. Propriedades Mecânicas +

+
- - - - - - - +
TesteNormaCertificadoStatus
+ + + + + + - - {compliance.otherTests.map((item, i) => )} + + {compliance.mechanical.map((item, i) => { + const isPositive = item.differencePercentage?.startsWith('+'); + const diffColor = isPositive ? 'text-emerald-600 dark:text-emerald-400' : 'text-rose-600 dark:text-rose-400'; + return ( + + + + + + + ); + })} + {compliance.mechanical.length === 0 && ( + + + + )} + +
PropriedadeCertificado% Rel.Status
+ {item.property} + {item.certificate} + {item.differencePercentage ? ( + {item.differencePercentage} + ) : -} + + + {statusIcon(item.status)} {item.status} + +
Nenhum dado mecânico identificado
+
+
+ * Limites de conformidade validados conforme parâmetros da norma {identification.standards || '-'}. +
+
+
+ + {/* Composição Química (Direita) */} +
+

+ + 3. Composição Química (%) +

+
+
+ + + + + + + + + + + {compliance.chemical.map((item, i) => ( + + + + + + + ))} + {compliance.chemical.length === 0 && ( + + + + )}
Elem.Norma de ReferênciaValor CertificadoStatus
{item.element}{item.norm}{item.certificate} + + {item.status} + +
Nenhum dado químico identificado
- )} -
-
- - {/* Over-Performance Section */} - {compliance.status === 'CONFORME' && overPerformance.length > 0 && ( -
-
-

3. Destaques de Desempenho

-
-

Este material excede os requisitos mínimos normativos nos seguintes aspectos:

-
- {overPerformance.map((item, i) => ( -
-
- -
-
- {item.property} - {item.value} superior ao mínimo. -
+ + + {/* Seção 3: Equivalências Internacionais */} +
+

+ + 4. Matriz de Equivalências Internacionais +

+
+ {equivalents.length > 0 ? ( + equivalents.map((item, i) => ( +
+ {item.system} + {item.norm}
- ))} -
+ )) + ) : ( +
Nenhuma equivalência normativa identificada no documento.
+ )}
-
- )} + - {/* Equivalents Section */} -
-
-

4. Normas Equivalentes

-
-
-

Equivalências internacionais para {identification.standards}:

-
- {equivalents.map((item, i) => ( -
-

{item.system}

-

{item.norm}

-
- ))} + {/* Nota de Inteligência Artificial */} +
+
+ + +
+
+

Laudo Assistido por Inteligência Artificial

+

+ Os dados certificados deste lote foram analisados em tempo real contra as bibliotecas normativas globais de siderurgia. O status global é classificado como {compliance.status}. +

+
+
+ + + + {/* Rodapé (Footer) */} +
+
+ ID Relatório: ST-{identification.certificateNumber || 'N/A'}/{new Date().getFullYear()} + + SteelCheck Systems
-
+ + {/* QR Code Placeholder para visual de Autenticidade */} +
+ Para validar o certificado
Acesse via QR Code
+ + + + + + + + + + + + + +
+
); }; diff --git a/relat_rio_t_cnico_steelcheck.html b/relat_rio_t_cnico_steelcheck.html new file mode 100644 index 0000000..75cd9e1 --- /dev/null +++ b/relat_rio_t_cnico_steelcheck.html @@ -0,0 +1,381 @@ + + + + + + SteelCheck — Relatório Técnico de Qualidade + + + + + + + + + + + + + +
+
+

Visualização do Documento

+

Otimizado para impressão direta em papel A4 (1 página)

+
+ +
+ + +
+ + +
+
+
+ +
+ STEEL CHECK + IA Quality Report +
+

Relatório Técnico de Qualidade

+

Análise de conformidade normativa assistida por inteligência artificial

+
+ +
+ +
+ Status Geral +
+ + CONFORME +
+
+ + +
+ Confiança da Análise +
+ 95% IA-Score +
+
+
+
+
+ + +
+ + +
+

+ + 1. Identificação do Produto e Lote +

+
+
+ Produto + Bobina Grossa (Hot Rolled) +
+
+ Norma de Referência + ASTM-A572-50-T1 +
+
+ Fabricante + USIMINAS +
+
+ Nº do Certificado + #999039 +
+
+ Data de Emissão + 04/07/2022 +
+
+ Lote analisado + 117006 +
+
+ Corrida (Heat) + 04490370 +
+
+ Massa Total + 15,655 t +
+
+
+ + +
+ + +
+

+ + 2. Propriedades Mecânicas +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
PropriedadeCertificadoStatus
+ YS (Yield Strength) + 455 MPa + + OK + +
+ TS (Tensile Strength) + 527 MPa + + OK + +
+ El (Elongation) + 21% + + OK + +
+ +
+ * Limites de conformidade validados conforme parâmetros exigidos pela norma de teste ASTM-A572-50-T1. +
+
+
+ + +
+

+ + 3. Composição Química (%) +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Elem.Norma de ReferênciaValor CertificadoStatus
C (Carbono)ASTM-A572-50-T10,09% + OK +
Si (Silício)ASTM-A572-50-T10,01% + OK +
Mn (Manganês)ASTM-A572-50-T10,98% + OK +
P (Fósforo)ASTM-A572-50-T10,016% + OK +
S (Enxofre)ASTM-A572-50-T10,004% + OK +
Al (Alumínio)ASTM-A572-50-T10,028% + OK +
+
+
+
+ + +
+

+ + 4. Matriz de Equivalências Internacionais +

+
+
+ União Europeia (EN) + S355J2 +
+
+ Alemanha (DIN) + St52-3 +
+
+ Japão (JIS) + SS400 +
+
+ Brasil (NBR Equivalente) + A572 Grau 50 +
+
+
+ + +
+ +
+ + + +
+
+

Laudo Assistido por Inteligência Artificial

+

+ Os dados certificados deste lote foram analisados em tempo real contra as bibliotecas normativas globais de siderurgia. Nenhuma anomalia metalúrgica ou desvio químico foi encontrado para os requisitos do ASTM-A572-50-T1. +

+
+
+ +
+ + + + +
+ + + \ No newline at end of file diff --git a/services/aiService.ts b/services/aiService.ts index b4bca42..7109439 100644 --- a/services/aiService.ts +++ b/services/aiService.ts @@ -81,8 +81,9 @@ const reportSchema = { norm: { type: Type.STRING, description: "Valor exigido pela norma (ex: Mín: 350 MPa)." }, certificate: { type: Type.STRING, description: "Valor encontrado no certificado." }, status: { type: Type.STRING, enum: ["OK", "FALHA"], description: "Status da propriedade." }, + differencePercentage: { type: Type.STRING, description: "Calculated percentage difference compared to theoretical normative material (e.g., '+15%' or '-5%'). Only for mechanical properties." } }, - required: ["property", "norm", "certificate", "status"] + required: ["property", "norm", "certificate", "status", "differencePercentage"] } }, chemical: { @@ -152,7 +153,7 @@ Execute: 1. **Extração de Dados (OCR):** Extraia todos os dados primários do certificado. 2. **Identificação de Normas:** Identifique a(s) norma(s) que o certificado alega atender. 3. **Análise de Conformidade:** Compare os resultados com os requisitos mínimos e máximos das normas. Determine status como "OK" ou "FALHA" para cada item e "CONFORME" ou "NÃO CONFORME" geral. -4. **Análise de Superdesempenho:** Se "CONFORME", calcule o quanto excede os requisitos (ex: "18% acima do mínimo"). +4. **Propriedades Mecânicas (mechanical):** Tabela de propriedades extraídas (ex: Yield Strength, Tensile Strength, Alongamento). Para CADA propriedade, calcule o percentual de quanto o material analisado é superior (ex: "+15%") ou inferior (ex: "-5%") em resistência ao material normativo teórico, e preencha no campo "differencePercentage". 5. **Análise de Equivalência:** Liste materiais equivalentes de outras normas (EN, DIN, JIS, NBR, etc.). 6. **Grau de Confiança:** Forneça um % de confiança baseado na qualidade do documento. @@ -164,7 +165,7 @@ Retorne APENAS o objeto JSON, sem formatação adicional, seguindo EXATAMENTE es }, "compliance": { "status": "CONFORME ou NÃO CONFORME", - "mechanical": [ { "property": "", "norm": "", "certificate": "", "status": "OK ou FALHA" } ], + "mechanical": [ { "property": "", "norm": "", "certificate": "", "status": "OK ou FALHA", "differencePercentage": "+X% ou -X%" } ], "chemical": [ { "element": "", "norm": "", "certificate": "", "status": "OK ou FALHA" } ], "otherTests": [ { "test": "", "norm": "", "certificate": "", "status": "OK ou FALHA" } ] }, diff --git a/types.ts b/types.ts index a518c1c..3d91e2a 100644 --- a/types.ts +++ b/types.ts @@ -17,6 +17,7 @@ export interface ComplianceItem { norm: string; certificate: string; status: 'OK' | 'FALHA'; + differencePercentage?: string; } export interface ComplianceData {