Browse Source

FD3-95 y FD3-97 Se actualizan las entidades en conjunto con un vendor
para poder enviar correctamente los datos al base, para actualizar
dispositivos.

Maximiliano Schvindt 8 years ago
parent
commit
227b60ca52

+ 1 - 0
app/config/bundles/ik/device-bundle/parameters.yml

@@ -3,3 +3,4 @@ parameters:
     device_check_url: 'http://127.0.0.1/base/app_dev.php/api/devices/check.json'
     device_post_url: 'http://127.0.0.1/base/app_dev.php/api/devices.json'
     device_delete_post_url: 'http://127.0.0.1/base/app_dev.php/api/device.json'
+    device_put_url: 'http://127.0.0.1/base/app_dev.php/api/devices/'

+ 1 - 0
app/config/bundles/ik/device-bundle/parameters.yml.dist

@@ -2,3 +2,4 @@ parameters:
     device_check_url: 'http://127.0.0.1/base/app_dev.php/api/devices/check.json'
     device_post_url: 'http://127.0.0.1/base/app_dev.php/api/devices.json'
     device_delete_post_url: 'http://127.0.0.1/base/app_dev.php/api/device.json'
+    device_put_url: 'http://127.0.0.1/base/app_dev.php/api/device.json'

+ 4 - 4
composer.lock

@@ -1281,7 +1281,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
-                "reference": "bf1029b73d5370885cc3790c5ed708b3263848ca"
+                "reference": "e8ca2d03e566e7a7daa02cb9355a5f4f051ce024"
             },
             "type": "library",
             "autoload": {
@@ -1296,7 +1296,7 @@
                 "bundle",
                 "validators"
             ],
-            "time": "2017-05-30 18:33:01"
+            "time": "2017-07-05 12:23:57"
         },
         {
             "name": "ik/extra-data-bundle",
@@ -1304,7 +1304,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/ExtraDataBundle.git",
-                "reference": "a5a6158cd382490cafd6510334cc63fc50865a58"
+                "reference": "c88fcf124002df00876323fc45039b142bad1403"
             },
             "type": "library",
             "autoload": {
@@ -1319,7 +1319,7 @@
                 "bundle",
                 "extra-data"
             ],
-            "time": "2017-05-29 15:02:46"
+            "time": "2017-07-05 12:20:18"
         },
         {
             "name": "ik/oauthclient-bundle",

+ 22 - 2
src/FTTHBundle/Entity/OLT.php

@@ -414,11 +414,31 @@ class OLT implements DeviceInterface
      */
     public function getDeviceData()
     {
-        return array(
+
+        $deviceData = array();
+        $deviceData['deviceType'] = get_class($this);
+        $deviceData['deviceId'] = $this->id;
+        $deviceData['ip'] = $this->ip;
+        $deviceData['tenancyId'] = $this->tenancyId;
+
+        $deviceExtraData = array('snmpCommunity' => $this->snmpCommunity, 'sshUser' => $this->sshUser, 'sshPass' => $this->sshPass,
+                                 'libraryVersion' => $this->libraryVersion, 'name' => $this->name);
+
+        ($this->model)? $model = $this->getModel()->getId() : $model = null;
+
+        $deviceExtraData['modelId'] = $model;
+        
+
+        $deviceData['extraData'] = json_encode($deviceExtraData);
+
+        return $deviceData;
+        
+        
+        /*return array(
             'deviceType' => get_class($this),
             'deviceId' => $this->id,
             'ip' => $this->ip,
-        );
+        );*/
     }
 
 }

+ 27 - 2
src/FTTHBundle/Entity/ONU.php

@@ -637,10 +637,35 @@ class ONU implements DeviceInterface
      */
     public function getDeviceData()
     {
-        return array(
+
+        $deviceData = array();
+        $deviceData['deviceType'] = get_class($this);
+        $deviceData['deviceId'] = $this->id;
+        $deviceData['ip'] = $this->ip;
+        $deviceData['tenancyId'] = $this->tenancyId;
+
+        $deviceExtraData = array('mac' => $this->mac, 'serialNumber' => $this->serialNumber, 'ponSerialNumber' => $this->ponSerialNumber,
+                                 'clientId' => $this->clientId);
+
+        ($this->olt)? $olt = $this->getOlt()->getId() : $olt = null;
+        ($this->model)? $model = $this->getModel()->getId() : $model = null;
+        ($this->nap)? $nap = $this->getNap()->getId() : $nap = null;
+        ($this->profile)? $profile = $this->getProfile()->getId() : $profile = null;
+
+        $deviceExtraData['oltId'] = $olt;
+        $deviceExtraData['modelId'] = $model;
+        $deviceExtraData['napId'] = $nap;
+        $deviceExtraData['profileId'] = $profile;
+        
+
+        $deviceData['extraData'] = json_encode($deviceExtraData);
+
+        return $deviceData;
+
+        /*return array(
             'deviceType' => get_class($this),
             'deviceId' => $this->id,
-        );
+        );*/
     }
 
 }