MappingapiController.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace app\controllers;
  3. use Yii;
  4. use yii\web\Controller;
  5. use app\models\MainModel;
  6. use app\models\ProcedureModel;
  7. use app\models\entity\Tasks;
  8. use app\models\ProjectsModel;
  9. use app\models\entity\Accounts;
  10. use app\models\entity\Sections;
  11. use app\models\LocomotiveModel;
  12. use app\models\entity\Tasktypes;
  13. use app\models\logger\LoggerFile;
  14. use app\models\entity\Repairtypes;
  15. use app\models\entity\Projecttypes;
  16. use app\models\entity\AsusgProject;
  17. use app\models\entity\AsusgJobPlan;
  18. use app\models\MappingHandlerModel;
  19. use app\models\entity\AsusgJob2Launch;
  20. use app\models\entity\AsusgProjectType;
  21. use app\models\entity\LocomotiveSeries;
  22. use app\models\entity\ProjectsLocotech;
  23. use app\models\entity\AsusgJob2Command;
  24. use app\models\MappingapiModel;
  25. use app\models\procedure\StartProjectForLocoModel;
  26. class MappingapiController extends MainController
  27. {
  28. //public function beforeAction($action)
  29. // {
  30. // parent::beforeAction($action);
  31. // $key = Yii::$app->request->headers->get('uuid-key');
  32. //$this->checkAuth($key);
  33. // return true;
  34. //}
  35. public function actionGetpause() { //$user_uuid = null,$id_work =
  36. $get = Yii::$app->request->get();
  37. $GWparams = ['url' => 'http://devplatform.digitaldepot.ru:8085/Thingworx/Things/SMoPPIntegrationLibrary/Services/work_pause',
  38. 'param' => $get,
  39. 'login' => 'ПройдаковИА',
  40. 'pass' => 'Ip15351112'
  41. ];
  42. $mainModel = new MainModel();
  43. $listWorks = json_decode($mainModel->curlRequestUni($GWparams));
  44. return true;
  45. }
  46. public function actionTest() { //$user_uuid = null,$id_work =
  47. $get = Yii::$app->request->get();
  48. $mappingapiModel = new MappingapiModel();
  49. $mappingapiModel->workDetail($get);
  50. return true;
  51. }
  52. public function actionTest2() {
  53. //$get = Yii::$app->request->get();
  54. $user_uuid = Yii::$app->request->get('user_id');
  55. $work_uuid = Yii::$app->request->get('id_work');
  56. $maintask = 95705;
  57. $params = [];
  58. // завершаю задачу
  59. $taskEntity2 = \app\models\entity\Tasks::findOne($maintask);
  60. $taskEntity2->status = 5;
  61. //var_dump($maintask);
  62. //$taskEntity2->save();
  63. // завершаю все команды
  64. \app\models\entity\Tasks::updateAll(['parent_id' => $maintask]);
  65. // запрос к еипп
  66. //$work_uuid = $taskEntity2->asusgjob2launch->asusg_job_uuid;
  67. //$user_uuid = $taskEntity2->assignees_arr->uuid;
  68. //var_dump($taskEntity2->assignees_arr->uuid);
  69. $params['user_id'] = "0f9ed850-e473-11e2-aaad-ac162db0b20c";
  70. $params['id_work'] = "a0a572e0-4d70-45d7-ac4a-9483933c70b9";
  71. $params['id_reason'] = "прочее";
  72. $params['comment'] = "прочее";
  73. //var_dump($params);
  74. if ( null != $work_uuid) {
  75. $mappingapiModel = new \app\models\MappingapiModel();
  76. $mappingapiModel->getPause($params);
  77. }
  78. exit;
  79. }
  80. }