Update sync status handling in UpdateJunctionSyncStatus hook; enforce required aiProvider field in CAkten entity; adjust microtime values in config and state files
This commit is contained in:
@@ -61,20 +61,24 @@ class UpdateJunctionSyncStatus implements AfterSave, AfterRemove
|
||||
}
|
||||
|
||||
// Fall 3: Relevante Feldänderungen (Datei, Name, Beschreibung, …)
|
||||
if (!$this->hasRelevantChanges($entity)) {
|
||||
if ($this->hasRelevantChanges($entity)) {
|
||||
if (!$entity->get('cAktenId')) {
|
||||
return;
|
||||
}
|
||||
$entity->set('syncStatus', 'unclean');
|
||||
$entity->set('aiSyncStatus', 'unclean');
|
||||
$entity->set('aiParsingStatus', 'unknown');
|
||||
$this->entityManager->saveEntity($entity, ['silent' => true, 'skipHooks' => true]);
|
||||
$this->triggerAkteUpdate($entity->get('cAktenId'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$entity->get('cAktenId')) {
|
||||
return;
|
||||
// Fall 4: aiParsingStatus geändert (z.B. durch externen Parsing-Service)
|
||||
// → Akte neu berechnen, aber KEIN unclean setzen (Inhalt ist unverändert)
|
||||
if ($entity->isAttributeChanged('aiParsingStatus') && $entity->get('cAktenId')) {
|
||||
$this->triggerAkteUpdate($entity->get('cAktenId'));
|
||||
}
|
||||
|
||||
$entity->set('syncStatus', 'unclean');
|
||||
$entity->set('aiSyncStatus', 'unclean');
|
||||
$entity->set('aiParsingStatus', 'unknown');
|
||||
$this->entityManager->saveEntity($entity, ['silent' => true, 'skipHooks' => true]);
|
||||
$this->triggerAkteUpdate($entity->get('cAktenId'));
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$GLOBALS['log']->error('CDokumente UpdateJunctionSyncStatus afterSave Error: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user