fix #410, 黑河数据汇交中添加元数据错误检查

This commit is contained in:
wlx 2012-12-03 03:42:25 +00:00
parent 7e87fc1768
commit cae70ddec1
1 changed files with 12 additions and 3 deletions

View File

@ -487,7 +487,17 @@ class HeiheController extends DataController
return true; return true;
}else{ }else{
$uuid = $row['uuid']; $uuid = $row['uuid'];
} }
//检查元数据错误
$iso=new ISO19115();
@$iso->loadXML($row['data']);
if ($iso->validate())
{
$data=array("error"=>"元数据导入过程中发现错误。<br />".implode("<br />",$iso->error));
$this->jsonexit($data);
return true;
}
$messages = array(); $messages = array();
@ -566,8 +576,7 @@ class HeiheController extends DataController
// 3. 保存数据评审状态 // 3. 保存数据评审状态
//导入元数据 //导入元数据
$iso=new ISO19115(); $iso->saveDB($this->db);
$iso->saveDB($this->db,$row['xml']);
//进入评审库 //进入评审库
$sql="insert into mdstatus (uuid,status,userid) values(?,?,?)"; $sql="insert into mdstatus (uuid,status,userid) values(?,?,?)";
$this->db->query($sql,array($uuid,0,$u_id)); $this->db->query($sql,array($uuid,0,$u_id));