浏览代码

Ref base#14 - Modified method to execute transitions on ONUs by ONU ID
or Client ID.

Maximiliano Schvindt 5 年之前
父节点
当前提交
70ce243491
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/FTTHBundle/Controller/REST/ONURESTController.php

+ 6 - 5
src/FTTHBundle/Controller/REST/ONURESTController.php

@@ -127,6 +127,8 @@ class ONURESTController extends RESTController
      * @Get("/client/{id}/apply/{transition}")
      * @Get("/client/{id}/apply/{transition}")
      * @View(statusCode=201, serializerEnableMaxDepthChecks=true)
      * @View(statusCode=201, serializerEnableMaxDepthChecks=true)
      *
      *
+     * https://ftth.client.flowdat.net/api/client/2/apply/active_disable
+     * 
      * @param Request $request
      * @param Request $request
      * @param $id
      * @param $id
      * @param $transition
      * @param $transition
@@ -135,6 +137,7 @@ class ONURESTController extends RESTController
      */
      */
     public function clientAction(Request $request, Int $id, String $transition)
     public function clientAction(Request $request, Int $id, String $transition)
     {
     {
+
         try {
         try {
             $tenancyService = $this->getTenancyService();
             $tenancyService = $this->getTenancyService();
             $tenancyService->disableFilter();
             $tenancyService->disableFilter();
@@ -143,11 +146,9 @@ class ONURESTController extends RESTController
 
 
             $query = $em->createQuery("
             $query = $em->createQuery("
                 SELECT o FROM FTTHBundle:ONU o
                 SELECT o FROM FTTHBundle:ONU o
-                WHERE o.administrativeState != :transition
-                AND o.clientId = :client
+                WHERE o.clientId = :client
             ")->setParameters([
             ")->setParameters([
-                'transition' => $transition,
-                'client' => $id,
+                'client' => $id
             ]);
             ]);
             $onus = $query->getResult();
             $onus = $query->getResult();
 
 
@@ -155,7 +156,7 @@ class ONURESTController extends RESTController
             
             
             $cmd_args = [
             $cmd_args = [
                 'entity' => '--entity:FTTHBundle\\Entity\\ONU',
                 'entity' => '--entity:FTTHBundle\\Entity\\ONU',
-                'workflow' => '--workflow:administrative_state',
+                'workflow' => '--workflow:onu_workflow',
                 'transition' => "--transition:{$transition}",
                 'transition' => "--transition:{$transition}",
             ];
             ];