From 7b150ee8acf435eb3ad332cbcfe9b816b6ebcac3 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 5 Sep 2013 04:00:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E5=90=8C=E6=84=8F=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7=E6=97=B6?= =?UTF-8?q?=E7=9A=84wsn=E6=95=B0=E6=8D=AE=E7=94=9F=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/AuthorController.php | 11 ++++++++++- application/models/data/DataService.php | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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