İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\RegisterCreator\DocumentProcessors;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class NaksConsumablesInspectionProcessor extends AbstractDocumentProcessor
|
||||
{
|
||||
public function process(array $weldLogData, array $document, Worksheet $sheet, int &$currentRow, array $settings): int
|
||||
{
|
||||
$this->initialize($weldLogData, $document, $sheet, $currentRow, $settings);
|
||||
|
||||
$lotNumbers = array_filter([
|
||||
$weldLogData['welding_materials_1_lot_no'] ?? '',
|
||||
$weldLogData['welding_materials_2_lot_no'] ?? '',
|
||||
$weldLogData['welding_materials_3_lot_no'] ?? ''
|
||||
]);
|
||||
|
||||
$placeholderReplacer = new \App\Services\RegisterCreator\PlaceholderReplacer();
|
||||
|
||||
foreach ($lotNumbers as $lotNo) {
|
||||
$normalized = $this->normalizeSearchTerm($lotNo);
|
||||
$search = $this->searchFiles("storage/documents/{$document['path']}/*{$normalized}*.pdf");
|
||||
$document['title2'] = $lotNo;
|
||||
$this->document = $document;
|
||||
$documentDate = $placeholderReplacer->getLatestDate($weldLogData, $this->registerColumnBased);
|
||||
|
||||
$newRow = $this->addRowToExcel($search, $lotNo, $documentDate);
|
||||
if ($newRow > $currentRow) { $currentRow = $newRow; }
|
||||
}
|
||||
return $currentRow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user