feat: add DMED comparador library with TXT and XLS processing

- Implemented TXT processor for DMED files, extracting RPPSS records.
- Added XLS processor for Prosoft reports, supporting both XLS and XLSX formats.
- Created a comparison tool to identify discrepancies between TXT and XLS data.
- Developed a GUI using eframe for user-friendly interaction.
- Included detailed README documentation for setup and usage instructions.
- Added error handling for file processing and improved data extraction methods.
- Implemented tests for data processing functions and utilities.
- Introduced a build script for Windows resource management.
- Added example scripts for basic and complete comparisons.
- Included a report generation feature for discrepancies found during comparisons.
This commit is contained in:
FelipeCN
2026-01-30 10:42:23 -03:00
parent fab1c26445
commit 3a888a058f
14 changed files with 5570 additions and 353 deletions
+46
View File
@@ -0,0 +1,46 @@
// Script de teste rápido - execute com: cargo run --example teste_xls
use dmed::xls::processar_xls;
fn main() {
println!("=== TESTE DO PROCESSADOR XLS/XLSX ===\n");
let arquivo = "RELATORIO_PROSOFT_MOD_51.xls";
println!("📂 Tentando abrir: {}", arquivo);
println!("️ Suporta .xls e .xlsx (detecção automática)\n");
match processar_xls(arquivo) {
Ok(pessoas) => {
println!("✓ Arquivo processado com sucesso!");
println!("Total de registros únicos: {}\n", pessoas.len());
println!("=== Primeiros 10 registros ===");
for (i, pessoa) in pessoas.iter().take(10).enumerate() {
println!("{}. CPF: {} - R$ {:.2}",
i + 1,
pessoa.cpf,
pessoa.valor
);
}
// Estatísticas
let total_valor: f64 = pessoas.iter().map(|p| p.valor).sum();
let maior_valor = pessoas.iter()
.max_by(|a, b| a.valor.partial_cmp(&b.valor).unwrap())
.unwrap();
println!("\n=== Estatísticas ===");
println!("Total de valores: R$ {:.2}", total_valor);
println!("Maior valor: R$ {:.2} (CPF: {})", maior_valor.valor, maior_valor.cpf);
}
Err(e) => {
println!("✗ Erro ao processar arquivo: {}", e);
println!("\n💡 Dica:");
println!(" 1. Certifique-se que o arquivo existe na pasta do projeto");
println!(" 2. Nome esperado: RELATORIO_PROSOFT_MOD_51.xls");
println!(" 3. Formato: Excel .xls ou .xlsx (ambos são suportados)");
println!(" 4. Mesmo que a extensão seja .xls, pode ser .xlsx internamente");
}
}
}