params['api']['domain'] . Yii::$app->params['api']['pathListCurrentComments']; $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->getSectionRemarks($params,false); return json_decode($result); } public static function getsectionlist($params = []) { if ( [] == $params ) { $params['place'] = 'a84d0a15-08ec-11e5-829d-00155d6cab05'; //$params['place'] = '5fb47130-580c-11e7-aefa-00155d6cab05'; $params['date'] = '1562077752';//$this->milliseconds(); } $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->getSectionList($params); return $result; } public static function addcompletedwork($params = []) { if ( [] == $params ) { $params['number'] = '345'; // номер секции $params['subnumber'] = '123'; $params['diagnosticCard'] = '123e4567-e89b-12d3-a456-426655440000'; $params['inspectionId'] = '910'; // ид проекта $params['isSCWorksNeeded'] = 'true'; $params['startTime'] = $this->milliseconds(); //начало выполнения первого таска $params['endTime'] = $this->milliseconds()+2000; // завершение последнего $params['worker'] = '2'; $params['engineer'] = '27'; $params['otcEmployee'] = '3'; } $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->addCompletedWork($params); return $result; //$result = $this->curlRequest($url,$params); } public static function addremark($params = []) { $locomotiveModel = new LocomotiveModel(); if ( [] == $params ) { $locomotiveModel->project_id = '1332'; $params['number'] = '234234'; $params['subnumber'] = '35468795'; $params['diagnosticCard'] = '004d9e52-9848-11e9-80d5-005056011052';//'123e4567-e89b-12d3-a456-426655440000'; $params['date'] = $locomotiveModel->milliseconds(); $params['worker'] = '023169da-e473-11e2-aaad-ac162db0b20c'; //Котов $params['source'] = ''; $params['description'] = ''; $params['isSCWorksNeeded'] = ''; } $url = Yii::$app->params['api']['domain'] . Yii::$app->params['api']['pathCommentSection']; $result = $locomotiveModel->addRemark($params); return $result; } public static function getsourcesofcoments() { $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->getSourcesOfComents(); return json_decode($result); } public static function getrepairsites() { $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->getRepairSites(); return json_decode($result); } public static function getsldlist() { $locomotiveModel = new LocomotiveModel(); $result = $locomotiveModel->getSldList(); return json_decode($result); } public static function getworkers($params = []) { if ( [] == $params ) { $params['sld'] = '95d764c1-e7ee-11e4-829d-00155d6cab05'; $params['placeOfRepair'] = 'a84d0a15-08ec-11e5-829d-00155d6cab05'; // из списка get_sld_list } $employeesModel = new EmployeesModel(); $result = $employeesModel->getWorkers($params); return $result; } public static function getemployeestatus($params = []) { if ( [] == $params ) { $params['worker'] = '25b3793b-ce67-11e6-aab3-00155d6cab04'; $params['date'] = '1562072228';//$this->milliseconds(); } $employeesModel = new EmployeesModel(); $result = $employeesModel->getEmployeeStatus($params); return $result; } public static function getworkertimetable($params = []) { if ( [] == $params ) { $params['name'] = 'Ивлева Светлана Николаевна'; $params['date'] = $this->milliseconds(); } $employeesModel = new EmployeesModel(); $result = $employeesModel->getWorkerTimetable($params); return $result; } public static function getpositionlist() { $employeesModel = new EmployeesModel(); $result = $employeesModel->getPositionList($params); return $result; } } ?>