将数据生成接口移动到后台。

This commit is contained in:
Li Jianxuan 2013-09-12 08:06:05 +00:00
parent 256c4a3bc9
commit 9ed360237c
3 changed files with 23 additions and 15 deletions

View File

@ -114,8 +114,8 @@ class Admin_DownController extends Zend_Controller_Action
return true; return true;
} }
//退回 //拒绝
if($ac == "return") if($ac == "deny")
{ {
if(empty($offlineappid)) if(empty($offlineappid))
{ {
@ -125,10 +125,10 @@ class Admin_DownController extends Zend_Controller_Action
if(empty($submit)) 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->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->send(); $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=?"; $sql="select applicationform as pdflink from offlineapp where id=?";
$row=$this->db->fetchRow($sql,array($start)); $row=$this->db->fetchRow($sql,array($start));
$filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']); $filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']);

View File

@ -151,13 +151,6 @@ class AuthorController extends Zend_Controller_Action
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
if($sth->execute(array($uuid,$oid))) 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=?"; $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); $sth = $this->db->prepare($sql);

View File

@ -58,6 +58,7 @@ class DataService
'uid'=> view::User('id') 'uid'=> view::User('id')
); );
$data = $curl->request($info['service_url']."site/",$param,"POST"); $data = $curl->request($info['service_url']."site/",$param,"POST");
view::Dump($data['response']);
$data = json_decode($data['response'],TRUE); $data = json_decode($data['response'],TRUE);
}//site }//site
@ -103,10 +104,16 @@ class DataService
}//获取Wsn数据 }//获取Wsn数据
//访问wsn端生成数据的webservice //访问wsn端生成数据的webservice
public function makeWsnData() public function makeWsnData($param)
{ {
$url = "http://waterwsn.westgis.ac.cn/down.php"; $param_temp = array(
$curl = new Curl(); //'uuid'=> 'b7beb8bf-58d9-4e58-a945-7b6e1dc7705f', ///TEST TEST TEST
$data = $curl->request($url,array(),"POST"); );
$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);
} }
} }