添加SOURCE缺失检查

This commit is contained in:
wlx 2010-07-06 02:33:58 +00:00
parent 5e6f5f8c40
commit 6e22c780ce
3 changed files with 49 additions and 0 deletions

View File

@ -68,5 +68,12 @@ class Admin_TestController extends Zend_Controller_Action
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and doi='' order by title"; $sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and doi='' order by title";
$this->view->rows=$this->db->fetchAll($sql); $this->view->rows=$this->db->fetchAll($sql);
} }
//检查source不符合要求
function sourceAction()
{
$sql="select uuid,title,source from metadata where title ilike '黑河综合遥感联合试验%' and source=''";
$this->view->rows=$this->db->fetchAll($sql);
}
} }

View File

@ -2,4 +2,5 @@
<li><a href="/admin/test/reftest">文献链接测试</a></li> <li><a href="/admin/test/reftest">文献链接测试</a></li>
<li><a href="/admin/test/doi">DOI重复检查</a></li> <li><a href="/admin/test/doi">DOI重复检查</a></li>
<li><a href="/admin/test/nodoiwater">WATER中没有DOI的数据</a></li> <li><a href="/admin/test/nodoiwater">WATER中没有DOI的数据</a></li>
<li><a href="/admin/test/source">WATER中没有SOURCE缺失的数据</a></li>
</ul> </ul>

View File

@ -0,0 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/test">数据测试工具</a>');
$this->breadcrumb('source缺失检查');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('test/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<?php if ($this->rows) : ?>
<div id="mdlist">
缺失SOURCE的数据项
<?php foreach ($this->rows as $doi): ?>
<ul>
<li><a href="/water/<?= $doi['uuid']; ?>"><?php echo $doi['title']; ?></a></li>
</ul>
<?php endforeach; ?>
以上数据若确认是黑河试验的数据请通过以下SQL语句执行修复
"update metadata set source='0595169a-279e-4b95-819f-129d0ba4280d' where id in (select id from metadata where source='' and title ilike '黑河综合遥感联合试验%')"
也可以对geonetwork数据库统一赋值。
</div>
<?php else : ?>
恭喜!没有对应的数据。
<?php endif; ?>
</div>