diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 88e88dd3..6ea64be5 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -6,6 +6,8 @@ @license http:// @link http:// */ +use data\DataService; + include_once("data/Author.php"); class AuthorController extends Zend_Controller_Action { @@ -149,6 +151,13 @@ class AuthorController extends Zend_Controller_Action $sth = $this->db->prepare($sql); if($sth->execute(array($uuid,$oid))) { + //如果是wsn数据则生成数据 + $dataservice = new DataService(); + $wsnData = $dataservice->get($uuid); + if(isset($wsnData['id']) && !empty($wsnData['id'])) + { + @$dataservice->makeWsnData(); + } //发送相关邮件给数据中心服务人员 $sql="select m.title,a.username from dataorder o left join metadata m on o.uuid=m.uuid left join offlineapp a on o.offlineappid=a.id where o.id=?"; $sth = $this->db->prepare($sql); @@ -2828,7 +2837,7 @@ class AuthorController extends Zend_Controller_Action $sth = $this->db->prepare($sql); $sth->execute(array(trim($ref))); $row = $sth->fetch(); - } + } $sql="insert into mdref (uuid,refid,reftype) values(?,?,?)"; $sth = $this->db->prepare($sql); $ex=$sth->execute(array($uuid,$row['id'],$reftype)); diff --git a/application/models/data/DataService.php b/application/models/data/DataService.php index 05a89fcd..a6a69b27 100644 --- a/application/models/data/DataService.php +++ b/application/models/data/DataService.php @@ -101,4 +101,12 @@ class DataService return NULL; } }//获取Wsn数据 + + //访问wsn端生成数据的webservice + public function makeWsnData() + { + $url = "http://waterwsn.westgis.ac.cn/down.php"; + $curl = new Curl(); + $data = $curl->request($url,array(),"POST"); + } } \ No newline at end of file