From 9ed360237c302bf57435c97b5a7ad6503582e94b Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 12 Sep 2013 08:06:05 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=95=B0=E6=8D=AE=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DownController.php | 16 ++++++++++++---- .../default/controllers/AuthorController.php | 7 ------- application/models/data/DataService.php | 15 +++++++++++---- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 97952dfc..89b74fd5 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -114,8 +114,8 @@ class Admin_DownController extends Zend_Controller_Action return true; } - //退回 - if($ac == "return") + //拒绝 + if($ac == "deny") { if(empty($offlineappid)) { @@ -125,10 +125,10 @@ class Admin_DownController extends Zend_Controller_Action if(empty($submit)) { - + $offlineapp = new Offlineapp(); } - return true; + return; } //重置申请表 @@ -200,6 +200,14 @@ class Admin_DownController extends Zend_Controller_Action $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->send(); + //如果是wsn数据则生成数据 + $dataservice = new DataService(); + $wsnData = $dataservice->get($uuid); + if(isset($wsnData['id']) && !empty($wsnData['id'])) + { + @$dataservice->makeWsnData(array('uid'=>$row['userid'])); + } + $sql="select applicationform as pdflink from offlineapp where id=?"; $row=$this->db->fetchRow($sql,array($start)); $filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']); diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 6ea64be5..bc846292 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -151,13 +151,6 @@ 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); diff --git a/application/models/data/DataService.php b/application/models/data/DataService.php index a6a69b27..d59bc64d 100644 --- a/application/models/data/DataService.php +++ b/application/models/data/DataService.php @@ -58,6 +58,7 @@ class DataService 'uid'=> view::User('id') ); $data = $curl->request($info['service_url']."site/",$param,"POST"); + view::Dump($data['response']); $data = json_decode($data['response'],TRUE); }//site @@ -103,10 +104,16 @@ class DataService }//获取Wsn数据 //访问wsn端生成数据的webservice - public function makeWsnData() + public function makeWsnData($param) { - $url = "http://waterwsn.westgis.ac.cn/down.php"; - $curl = new Curl(); - $data = $curl->request($url,array(),"POST"); + $param_temp = array( + //'uuid'=> 'b7beb8bf-58d9-4e58-a945-7b6e1dc7705f', ///TEST TEST TEST + ); + $param = array_merge($param,$param_temp); + + $url = "http://waterwsn.westgis.ac.cn/downdatas.php"; + + $data = $curl->request($url,$param,"POST"); + $data = json_decode($data['response'],TRUE); } } \ No newline at end of file