Explorar el Código

ssg323, parallel threads axicoid cleanup

master
Dukai Károly hace 3 años
padre
commit
7431d0472d
Se han modificado 3 ficheros con 20 adiciones y 2 borrados
  1. +4
    -0
      modules/custom/arlista/css/arlista.css
  2. +11
    -0
      modules/custom/arlista/src/Factory/AxicoIdFactory.php
  3. +5
    -2
      modules/custom/arlista/src/Factory/ProductFactory.php

+ 4
- 0
modules/custom/arlista/css/arlista.css Ver fichero

@@ -123,4 +123,8 @@ tr.correct-files-uploaded-file.row-for-hiding {

div.form-type-number > label {
min-width: 33%;
}

#uploaded_files_manufacturer_select, #edit-file-excel {
max-width: 32rem;
}

+ 11
- 0
modules/custom/arlista/src/Factory/AxicoIdFactory.php Ver fichero

@@ -595,5 +595,16 @@ class AxicoIdFactory extends AbstractFactory {
}
return null;
}
public function updatePair(AxicoId $axicoId): void {
$this->getConnection()
->update($this->getActiveTable())
->fields([
'next_count' => 0,
])
->condition('current_count', $axicoId->getCurrentCount())
->condition('product_id', NULL, 'IS NULL')
->execute();
}

}

+ 5
- 2
modules/custom/arlista/src/Factory/ProductFactory.php Ver fichero

@@ -523,11 +523,14 @@ class ProductFactory extends AbstractFactory {
$existingAxicoIdIsNotRevoked = $existingAxicoIdEntity->getRevoked() < 1;
$existingAxicoIdEntity->close();
$existingAxicoIdEntity = $this->getAxicoIdFactory()->update($existingAxicoIdEntity);
$this->getAxicoIdFactory()->updatePair($existingAxicoIdEntity);
$result['axicoIdContinued']++;

if ($existingAxicoIdIsNotRevoked) {
if ($product->isComponentBased()) {
$newAxicoIdEntity = $this->getAxicoIdFactory()->createForComponent($component->getParentManufacturerId(), $component->getId());
$newAxicoIdEntity = $this->getAxicoIdFactory()->createForComponent($component->getParentManufacturerId(), $component->getId());
} else {
$newAxicoIdEntity = $this->getAxicoIdFactory()->createForCategory($product->getParentManufacturerId(), $product->getParentCategoryId());
}
@@ -1059,7 +1062,7 @@ class ProductFactory extends AbstractFactory {
$nextGroupAxicoId = $this->getAxicoIdFactory()->findOrCreateNextAxicoIdByManufacturerIdAndComponentId($component->getParentManufacturerId(), $component->getId());
}
$currentCount = $storedAxicoIdEntity->getCurrentCount();
$nextGroupAxicoId->setId(null);
// $nextGroupAxicoId->setId(null);
$nextGroupAxicoId->setCurrentCount($currentCount);
$nextGroupAxicoId->setRevoked($storedAxicoIdEntity->getRevoked());
$this->getAxicoIdFactory()->save($nextGroupAxicoId);

Cargando…
Cancelar
Guardar