Sfoglia il codice sorgente

ssg323, parallel threads axicoid cleanup

master
Dukai Károly 3 anni fa
parent
commit
7431d0472d
3 ha cambiato i file con 20 aggiunte e 2 eliminazioni
  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 Vedi File



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

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

+ 11
- 0
modules/custom/arlista/src/Factory/AxicoIdFactory.php Vedi File

} }
return null; 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 Vedi File

$existingAxicoIdIsNotRevoked = $existingAxicoIdEntity->getRevoked() < 1; $existingAxicoIdIsNotRevoked = $existingAxicoIdEntity->getRevoked() < 1;
$existingAxicoIdEntity->close(); $existingAxicoIdEntity->close();
$existingAxicoIdEntity = $this->getAxicoIdFactory()->update($existingAxicoIdEntity); $existingAxicoIdEntity = $this->getAxicoIdFactory()->update($existingAxicoIdEntity);
$this->getAxicoIdFactory()->updatePair($existingAxicoIdEntity);
$result['axicoIdContinued']++; $result['axicoIdContinued']++;


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

Loading…
Annulla
Salva