This commit is contained in:
wangjinlei
2024-11-01 15:40:39 +08:00
parent a6804ba463
commit 28a3c99ee3
3 changed files with 61 additions and 8 deletions

View File

@@ -251,7 +251,7 @@ function getAuthor($article) {
}
function pushSFTPForScopus($file)
function pushSFTPForScopus($file,$pdf_file)
{
$host = 'sftp-opsbank2.elsevier.com';
$port = 22; // SFTP 默认端口号
@@ -275,7 +275,13 @@ function pushSFTPForScopus($file)
$res = $sftp->put($remoteFile, $localFile, SFTP::SOURCE_LOCAL_FILE);
if ($res) {
//上传pdf
$localPdf = ROOT_PATH."public/articlePDF/".$pdf_file;
$remoteFilePdf = "/data/incoming/tmr/".str_replace(".xml",".pdf",$file);
$res1 = $sftp->put($remoteFilePdf,$localPdf,SFTP::SOURCE_LOCAL_FILE);
if ($res&$res1) {
echo "文件上传成功!";
} else {
var_dump($sftp);

View File

@@ -319,8 +319,8 @@ class Datebase extends Controller
$affAl_cache->addAttribute("id","aff".$os[$v['article_organ_id']]);
$aff_cache = $affAl_cache->addChild("aff");
$aff_cache->addAttribute("xml:lang","en");
$aff_cache->addChild("label",$os[$v['article_organ_id']]." ".$v['organ_name']);
$ins_cache = $aff_cache->addChild("institution ",$v['organ_name']);
$aff_cache->addChild("label",htmlspecialchars($os[$v['article_organ_id']]." ".$v['organ_name']));
$ins_cache = $aff_cache->addChild("institution ",htmlspecialchars($v['organ_name']));
$ins_cache->addAttribute("content-type",'orgname');
}
@@ -439,7 +439,8 @@ class Datebase extends Controller
foreach ($list as $v){
$this->xmlCreateForArticle($v['article_id']);
$file = substr($v['doi'],strpos($v['doi'],"/")+1).".xml";
pushSFTPForScopus($file);
pushSFTPForScopus($file,$v['file_pdf']);
}
}
@@ -723,9 +724,9 @@ class Datebase extends Controller
// 发送ftp
$this->createFtpFileInfo($data["journal_stage_id"]);
// $this->scopusPushXML($data["journal_stage_id"]);
if($journal_info['journal_id']==1){
$this->scopusPushXML($data["journal_stage_id"]);
}
return jsonSuccess([]);
}

View File

@@ -259,6 +259,33 @@ class Journal extends Controller
return jsonSuccess($re);
}
public function getCiteListPForSubmission(){
$data = $this->request->post();
$rule = new Validate([
"issn"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$journal_info = $this->journal_obj->where("issn",$data['issn'])->find();
if(date("m")==1){
$p_m_time = strtotime((date("Y")-1)."-12-1");
}else{
$p_m_time = strtotime(date("Y")."-".(date("m")-1)."-1");
}
$s_time = strtotime(date("Y-m")."-1");
$list1 = $this->article_cite_obj
->field("j_article.title,j_article.doi,j_article.article_id,j_article_cite.article_cite_id,j_article_cite.factor,j_article_cite.article_name,j_article_cite.doi article_doi,j_article_cite.journal_name,j_article_cite.vol,j_article_cite.is_wos,j_article_cite.is_china")
->join("j_article","j_article.article_id = j_article_cite.article_id","left")
->where("j_article_cite.journal_id",$journal_info['journal_id'])
->where("j_article_cite.state",1)
->where("j_article_cite.ctime",">",$p_m_time)
->where("j_article_cite.ctime","<",$s_time)
->select();
$re['list'] = $list1;
return jsonSuccess($re);
}
public function getCiteDataForSubmission(){
$data = $this->request->post();
$rule = new Validate([
@@ -290,6 +317,25 @@ class Journal extends Controller
}
}
$flag['month_num'] = $month_num."/".count($list1);
//上个月引用
if(date("m")==1){
$p_m_time = strtotime((date("Y")-1)."-12-1");
}else{
$p_m_time = strtotime(date("Y")."-".(date("m")-1)."-1");
}
$list_m_p = $this->article_cite_obj
->where("journal_id",$journal['journal_id'])
->where("state",1)
->where("ctime",">",$p_m_time)
->where("ctime","<",$s_time)
->select();
$m_p_month_num = 0;
foreach ($list1 as $item) {
if($item['is_wos']==1){
$m_p_month_num++;
}
}
$flag['p_month_num'] = $m_p_month_num."/".count($list_m_p);
//今年引用
// $y_time = strtotime(date("Y")."-1-1");
// $list3 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->where("ctime",">",$y_time)->select();