123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- namespace app\controllers;
- use Yii;
- use yii\web\Controller;
- use app\models\MainModel;
- use app\models\ProcedureModel;
- use app\models\entity\Tasks;
- use app\models\ProjectsModel;
- use app\models\entity\Accounts;
- use app\models\entity\Sections;
- use app\models\LocomotiveModel;
- use app\models\entity\Tasktypes;
- use app\models\logger\LoggerFile;
- use app\models\entity\Repairtypes;
- use app\models\entity\Projecttypes;
- use app\models\entity\AsusgProject;
- use app\models\entity\AsusgJobPlan;
- use app\models\MappingHandlerModel;
- use app\models\entity\AsusgJob2Launch;
- use app\models\entity\AsusgProjectType;
- use app\models\entity\LocomotiveSeries;
- use app\models\entity\ProjectsLocotech;
- use app\models\entity\AsusgJob2Command;
- use app\models\MappingapiModel;
- use app\models\procedure\StartProjectForLocoModel;
- class MappingapiController extends MainController
- {
- //public function beforeAction($action)
- // {
- // parent::beforeAction($action);
- // $key = Yii::$app->request->headers->get('uuid-key');
- //$this->checkAuth($key);
- // return true;
- //}
-
- public function actionGetpause() { //$user_uuid = null,$id_work =
-
- $get = Yii::$app->request->get();
- $GWparams = ['url' => 'http://devplatform.digitaldepot.ru:8085/Thingworx/Things/SMoPPIntegrationLibrary/Services/work_pause',
- 'param' => $get,
- 'login' => 'ПройдаковИА',
- 'pass' => 'Ip15351112'
- ];
- $mainModel = new MainModel();
-
- $listWorks = json_decode($mainModel->curlRequestUni($GWparams));
-
-
- return true;
- }
-
- public function actionTest() { //$user_uuid = null,$id_work =
-
- $get = Yii::$app->request->get();
- $mappingapiModel = new MappingapiModel();
- $mappingapiModel->workDetail($get);
-
-
-
- return true;
- }
-
- public function actionTest2() {
-
- //$get = Yii::$app->request->get();
- $user_uuid = Yii::$app->request->get('user_id');
- $work_uuid = Yii::$app->request->get('id_work');
- $maintask = 95705;
- $params = [];
- // завершаю задачу
- $taskEntity2 = \app\models\entity\Tasks::findOne($maintask);
- $taskEntity2->status = 5;
- //var_dump($maintask);
- //$taskEntity2->save();
- // завершаю все команды
- \app\models\entity\Tasks::updateAll(['parent_id' => $maintask]);
-
- // запрос к еипп
- //$work_uuid = $taskEntity2->asusgjob2launch->asusg_job_uuid;
- //$user_uuid = $taskEntity2->assignees_arr->uuid;
- //var_dump($taskEntity2->assignees_arr->uuid);
- $params['user_id'] = "0f9ed850-e473-11e2-aaad-ac162db0b20c";
- $params['id_work'] = "a0a572e0-4d70-45d7-ac4a-9483933c70b9";
- $params['id_reason'] = "прочее";
- $params['comment'] = "прочее";
- //var_dump($params);
- if ( null != $work_uuid) {
- $mappingapiModel = new \app\models\MappingapiModel();
- $mappingapiModel->getPause($params);
- }
- exit;
- }
-
- }
|