Jelajahi Sumber

Merge branch 'ftth#15' into 'master'

Auto Discovery ONU + Bug between ONUs and Vlans.

Closes #14 and #15

See merge request interlink-sa/flowdat3/modules/ftth!127
Maximiliano Schvindt 6 tahun lalu
induk
melakukan
8ba05984d9

File diff ditekan karena terlalu besar
+ 3 - 3
app/DoctrineMigrations/src/template.yml


+ 3 - 4
src/FTTHBundle/Command/AutodiscoveryONUCommand.php

@@ -76,6 +76,8 @@ class AutodiscoveryONUCommand extends ContainerAwareCommand
                     if(is_null($nap)) {$output->writeln("NAP with slot: {$slot} and link: {$link} in OLT id: {$oltid} doesn't exist - continue");continue;}
                     
                     $modelName = "FiberHome-{$model}";
+                    if($model == 'HG260') $modelName = "VSolution-HG323";
+                    
                     $onuModel = $em->getRepository(ONUModel::class)->findOneByName($modelName);
                     if(is_null($onuModel)) {$output->writeln("ONU MODEL ({$modelName}) doesn't exist - continue");continue;}
                     
@@ -83,10 +85,7 @@ class AutodiscoveryONUCommand extends ContainerAwareCommand
                     $onu = $em->getRepository(ONU::class)->findOneByPonSerialNumber($psn);
                     if($onu) {$output->writeln("ONU ({$psn}) exist - continue");continue;}
                     
-                    $onu = $em->getRepository(ONU::class)->findOneBy(array('olt' => $olt, 'nap' => $nap, 'position' => $index));
-                    if($onu) {$output->writeln("ONU({$onu->getPonSerialNumber()}) in OLT({$olt->getName()}) > NAP({$nap->getName()} {$slot}/{$link}) > Position ($index) exist - continue");continue;}
-
-                    $output->writeln("OK with PSN - OLT - NAP - POSITION - PROFILE, so we create the ONU");
+                    $output->writeln("OK with PSN - OLT - NAP - PROFILE, so we create the ONU");
 
                     $newOnu = new ONU();
                     $newOnu->setPonSerialNumber($psn);

+ 1 - 1
src/FTTHBundle/Entity/ONU.php

@@ -197,7 +197,7 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
     /**
      * Se agrega para casos en que tenga varias vlans
      *
-     * @ORM\ManyToMany(targetEntity="\FTTHBundle\Entity\VLanID", cascade={"all"})
+     * @ORM\ManyToMany(targetEntity="\FTTHBundle\Entity\VLanID")
      * @ORM\JoinTable(name="onus_vlanids",
      *      joinColumns={@ORM\JoinColumn(name="onu_id", referencedColumnName="id", onDelete="CASCADE")},
      *      inverseJoinColumns={@ORM\JoinColumn(name="vlanid_id", referencedColumnName="id", onDelete="CASCADE")})