İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\RegisterCreator\DocumentProcessors;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class DrawingsProcessor extends AbstractDocumentProcessor
|
||||
{
|
||||
/**
|
||||
* Process drawings documents
|
||||
*/
|
||||
public function process(
|
||||
array $weldLogData,
|
||||
array $document,
|
||||
Worksheet $sheet,
|
||||
int &$currentRow,
|
||||
array $settings
|
||||
): int {
|
||||
$this->initialize($weldLogData, $document, $sheet, $currentRow, $settings);
|
||||
|
||||
$this->log("Processing Drawings");
|
||||
|
||||
$lineIdentifier = $weldLogData[$this->registerColumnBased];
|
||||
$normalized = $this->normalizeSearchTerm($lineIdentifier);
|
||||
$search = $this->searchFiles("{$document['path']}/*{$normalized}*.pdf");
|
||||
|
||||
$placeholderReplacer = new \App\Services\RegisterCreator\PlaceholderReplacer();
|
||||
$documentDate = $placeholderReplacer->getLatestDate($weldLogData, $this->registerColumnBased);
|
||||
|
||||
// Use the new ExcelRowHandler service method
|
||||
$newRow = $this->addRowToExcel(
|
||||
$search,
|
||||
$lineIdentifier,
|
||||
$documentDate
|
||||
);
|
||||
|
||||
if ($newRow > $currentRow) {
|
||||
$currentRow = $newRow;
|
||||
}
|
||||
|
||||
return $currentRow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user