|
|
@@ -278,6 +278,27 @@ class AsyncValidateLoadArchivesController extends Controller
|
|
|
$finalFiles = [];
|
|
|
|
|
|
try {
|
|
|
+ // Verificar estado de archivos antes de procesarlos
|
|
|
+ $tempFiles = [$form['temp_files']['excel'], $form['temp_files']['zip']];
|
|
|
+ foreach ($form['individual_temp_files'] as $tempFile) {
|
|
|
+ $tempFiles[] = $tempFile['temp_id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($tempFiles as $tempId) {
|
|
|
+ $tempIdDec = $this->encryptionController->decrypt($tempId);
|
|
|
+ if ($tempIdDec) {
|
|
|
+ $tempFile = DB::table('S002V01TARTE')->where('ARTE_IDAR', $tempIdDec)->first();
|
|
|
+ if ($tempFile && $tempFile->ARTE_ESTA === 'Eliminado') {
|
|
|
+ return $this->responseController->makeResponse(
|
|
|
+ true,
|
|
|
+ 'La acción no puede completarse porque uno o más archivos han sido eliminados lógicamente.',
|
|
|
+ [],
|
|
|
+ 400
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Move Excel to final
|
|
|
$excelFinal = $this->moveToFinal($form['temp_files']['excel'], $form['linea'], $idUser);
|
|
|
if (!$excelFinal) {
|
|
|
@@ -327,6 +348,11 @@ class AsyncValidateLoadArchivesController extends Controller
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ // Validar estado del archivo temporal
|
|
|
+ if ($tempFile->ARTE_ESTA === 'Eliminado') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
$result = $this->documentManagementController->moveFinalFile($line, 'ADSI', 'LA', $tempFile, $idUser);
|
|
|
return $result[0] ? $result[1] : false;
|
|
|
|