|
@@ -6,10 +6,19 @@ use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
|
|
+use Exception;
|
|
|
|
|
|
|
|
-use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
-use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
|
|
|
|
|
|
+use PhpOffice\PhpSpreadsheet\Shared\Date;
|
|
|
|
|
+
|
|
|
|
|
+// Importaciones de controladores necesarios
|
|
|
|
|
+use App\Http\Controllers\ResponseController;
|
|
|
|
|
+use App\Http\Controllers\EncryptionController;
|
|
|
|
|
+use App\Http\Controllers\FunctionsController;
|
|
|
|
|
+use App\Http\Controllers\ResourcesController;
|
|
|
|
|
+use App\Http\Controllers\DocumentManagementController;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class TemplatesManagementController extends Controller {
|
|
class TemplatesManagementController extends Controller {
|
|
|
|
|
|
|
@@ -212,7 +221,7 @@ private function extractAcronymMappings($spreadsheet) {
|
|
|
// 2. Procesar hoja CARGA DE EQUIPOS si existe
|
|
// 2. Procesar hoja CARGA DE EQUIPOS si existe
|
|
|
if ($cargaSheet) {
|
|
if ($cargaSheet) {
|
|
|
$highestRow = $cargaSheet->getHighestRow();
|
|
$highestRow = $cargaSheet->getHighestRow();
|
|
|
- \Log::debug("Procesando CARGA DE EQUIPOS. Filas: $highestRow");
|
|
|
|
|
|
|
+ Log::debug("Procesando CARGA DE EQUIPOS. Filas: $highestRow");
|
|
|
|
|
|
|
|
for ($row = 9; $row <= $highestRow; $row++) {
|
|
for ($row = 9; $row <= $highestRow; $row++) {
|
|
|
// Mapeo de equipos
|
|
// Mapeo de equipos
|
|
@@ -231,9 +240,9 @@ private function extractAcronymMappings($spreadsheet) {
|
|
|
$mappings['carga']['modelos'][$modelAcronym] = $modelFull;
|
|
$mappings['carga']['modelos'][$modelAcronym] = $modelFull;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- \Log::debug('Mapeos CARGA modelos: ' . json_encode($mappings['carga']['modelos']));
|
|
|
|
|
|
|
+ Log::debug('Mapeos CARGA modelos: ' . json_encode($mappings['carga']['modelos']));
|
|
|
} else {
|
|
} else {
|
|
|
- \Log::warning('Hoja CARGA DE EQUIPOS no encontrada en el archivo');
|
|
|
|
|
|
|
+ Log::warning('Hoja CARGA DE EQUIPOS no encontrada en el archivo');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 3. Procesar hoja LRU (usando el mismo método robusto)
|
|
// 3. Procesar hoja LRU (usando el mismo método robusto)
|
|
@@ -276,7 +285,7 @@ private function getCellValue($worksheet, $column, $row) {
|
|
|
// Manejar cualquier tipo de dato
|
|
// Manejar cualquier tipo de dato
|
|
|
return trim($cell->getFormattedValue());
|
|
return trim($cell->getFormattedValue());
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
|
- \Log::error("Error leyendo celda $column$row: " . $e->getMessage());
|
|
|
|
|
|
|
+ Log::error("Error leyendo celda $column$row: " . $e->getMessage());
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|