İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TpCreator\DocumentProcessors;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class QaTpProcessor extends AbstractTpDocumentProcessor
|
||||
{
|
||||
public function process(
|
||||
array $lineData,
|
||||
array $document,
|
||||
Worksheet $sheet,
|
||||
int $currentRow,
|
||||
int $rowNo,
|
||||
string $fullFolder,
|
||||
string $testPackageNo,
|
||||
bool $override
|
||||
): int {
|
||||
$docPath = $document['path'];
|
||||
|
||||
$allJoints = db("weld_logs")->where("test_package_no", $testPackageNo)->get();
|
||||
$logTypes = array_keys(log_test_types());
|
||||
|
||||
foreach($allJoints as $joint) {
|
||||
$jointArray = (array)$joint;
|
||||
foreach($logTypes as $logType) {
|
||||
if (strpos(strtolower($docPath), $logType) !== false) {
|
||||
$reportNoPrefix = ($logType == "pmi") ? "no_of_testing_report" : $logType . "_report";
|
||||
|
||||
if (!empty($jointArray[$reportNoPrefix])) {
|
||||
$reportNo = $jointArray[$reportNoPrefix];
|
||||
$docDate = $jointArray[$logType . '_test_date'];
|
||||
$search = $this->alternativeGlob("storage/documents/{$docPath}/{$reportNo}.pdf");
|
||||
|
||||
$document['title2'] = $reportNo;
|
||||
|
||||
$translationKey = $logType . "_register_title";
|
||||
$document['title4'] = e2($translationKey);
|
||||
|
||||
$this->addRow($search, $document, $fullFolder, $reportNo, $docDate, $rowNo, $sheet, $currentRow, $override);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $rowNo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user