add aha blatt parsing
This commit is contained in:
@@ -60,6 +60,10 @@ class WorkorderBaseController extends TTCrud
|
||||
$translationMap = array_merge(['civil_engineering_photo' => 'Tiefbau_Foto'], $customMap);
|
||||
}
|
||||
|
||||
// Auto-parse AHA if enabled and not yet parsed
|
||||
if ($tenantConfig?->showTechnicalData) {
|
||||
RimoWorkorder::autoParseForWorkorder((int)$this->request->workorderId);
|
||||
}
|
||||
|
||||
$responseDocs = [];
|
||||
$typeCounts = [];
|
||||
@@ -145,45 +149,7 @@ class WorkorderBaseController extends TTCrud
|
||||
* Retrieves technical data (patchposition and AHA Blatt info) for a workorder.
|
||||
*/
|
||||
protected function getTechnicalData(int $workorderId): ?array {
|
||||
$workorder = WorkorderModel::get($workorderId);
|
||||
if (!$workorder || !$workorder->preorderId) return null;
|
||||
|
||||
$preorder = new Preorder($workorder->preorderId);
|
||||
if (!$preorder->id || !$preorder->adb_wohneinheit_id) return null;
|
||||
|
||||
$wohneinheit = $preorder->adb_wohneinheit;
|
||||
if (!$wohneinheit) return null;
|
||||
|
||||
$defaultCluster = '';
|
||||
if ($preorder->adb_hausnummer && $preorder->adb_hausnummer->netzgebiet) {
|
||||
$defaultCluster = $preorder->adb_hausnummer->netzgebiet->extref ?? '';
|
||||
}
|
||||
|
||||
$patchposition = [
|
||||
'equipmentName' => $wohneinheit->getPatchEqString(),
|
||||
'equipmentPort' => $wohneinheit->patch_port,
|
||||
'cluster' => $wohneinheit->patch_cluster ?: $defaultCluster,
|
||||
'shelf' => $wohneinheit->patch_shelf,
|
||||
'module' => $wohneinheit->patch_module,
|
||||
];
|
||||
|
||||
$rimoWorkorders = [];
|
||||
if (is_array($wohneinheit->rimo_workorders) && count($wohneinheit->rimo_workorders)) {
|
||||
foreach ($wohneinheit->rimo_workorders as $wo) {
|
||||
$rimoWorkorders[] = [
|
||||
'id' => $wo->id,
|
||||
'rimoName' => $wo->rimo_name,
|
||||
'rimoId' => $wo->rimo_id,
|
||||
'rimoStatus' => $wo->rimo_status,
|
||||
'downloadUrl' => "/RimoWorkorder/downloadAha?id=" . $wo->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'patchposition' => $patchposition,
|
||||
'rimoWorkorders' => $rimoWorkorders,
|
||||
];
|
||||
return WorkorderModel::getTechnicalData($workorderId);
|
||||
}
|
||||
|
||||
//region BACKGROUND TASKS
|
||||
|
||||
Reference in New Issue
Block a user