1
This commit is contained in:
@@ -226,18 +226,19 @@ class Datebase extends Controller
|
||||
// }
|
||||
// }
|
||||
|
||||
public function getaaa(){
|
||||
$num = $this->request->post('num');
|
||||
$list = $this->article_obj->where('j_article.state',0)->join("j_journal_stage","j_journal_stage.journal_stage_id = j_article.journal_stage_id",'left')
|
||||
->page($num,1000)->field("j_article.article_id,j_journal_stage.stage_year")->select();
|
||||
$re['list'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
// public function getaaa(){
|
||||
// $num = $this->request->post('num');
|
||||
// $list = $this->article_obj->where('j_article.state',0)->join("j_journal_stage","j_journal_stage.journal_stage_id = j_article.journal_stage_id",'left')
|
||||
// ->page($num,1000)->field("j_article.article_id,j_journal_stage.stage_year")->select();
|
||||
// $re['list'] = $list;
|
||||
// return jsonSuccess($re);
|
||||
// }
|
||||
|
||||
|
||||
public function xmlCreateForArticle(){
|
||||
|
||||
$article_id = 3034;
|
||||
private function xmlCreateForArticle($article_id){
|
||||
|
||||
// $article_id = 3035;
|
||||
|
||||
$article_info = $this->article_obj->where("article_id",$article_id)->find();
|
||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||
@@ -335,10 +336,10 @@ class Datebase extends Controller
|
||||
$issue->addAttribute("content-type","No.");
|
||||
|
||||
//abstract
|
||||
// $abstract = $articleMeta->addChild("abstract ");
|
||||
// $abstract->addAttribute("xml:lang","en");
|
||||
// $abs_p = $abstract->addChild("p",$article_info['abstract']);
|
||||
// $abs_p->addAttribute("indent","0mm");
|
||||
$abstract = $articleMeta->addChild("abstract");
|
||||
$abstract->addAttribute("xml:lang","en");
|
||||
$abs_p = $abstract->addChild("p",htmlspecialchars($article_info['abstract'], ENT_QUOTES | ENT_XML1, 'UTF-8'));
|
||||
$abs_p->addAttribute("indent","0mm");
|
||||
|
||||
//keywords
|
||||
$kwd = $articleMeta->addChild("kwd-group");
|
||||
@@ -378,7 +379,10 @@ class Datebase extends Controller
|
||||
|
||||
// 将生成的 XML 输出或保存
|
||||
// echo $xml->asXML(); // 或者保存到文件,例如 $xml->asXML('output.xml');
|
||||
$xml->asXML('d:/output.xml');
|
||||
$x = $xml->asXML();
|
||||
|
||||
$file = ROOT_PATH."public/articleXML/".substr($article_info['doi'],strpos($article_info['doi'],"/")+1).".xml";
|
||||
file_put_contents($file, $x);
|
||||
|
||||
}
|
||||
|
||||
@@ -415,6 +419,30 @@ class Datebase extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function testAcopus(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"stage_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->scopusPushXML($data['stage_id']);
|
||||
}
|
||||
|
||||
|
||||
public function scopusPushXML($stage_id){
|
||||
$list = $this->article_obj->where("journal_stage_id",$stage_id)->where("state",0)->select();
|
||||
foreach ($list as $v){
|
||||
$this->xmlCreateForArticle($v['article_id']);
|
||||
$file = substr($v['doi'],strpos($v['doi'],"/")+1).".xml";
|
||||
pushSFTPForScopus($file);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送邮件至青年科学家
|
||||
*/
|
||||
@@ -695,6 +723,8 @@ class Datebase extends Controller
|
||||
// 发送ftp
|
||||
$this->createFtpFileInfo($data["journal_stage_id"]);
|
||||
|
||||
$this->scopusPushXML($data["journal_stage_id"]);
|
||||
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user