This commit is contained in:
wangjinlei
2022-11-01 09:13:15 +08:00
parent cf6b6004ba
commit 6814f788ed
3 changed files with 327 additions and 19 deletions

View File

@@ -391,6 +391,10 @@ class Production extends Controller
}
// $data['p_article_id'] = 7;
$p_info = $this->production_article_obj->where('p_article_id',$data['p_article_id'])->find();
if($p_info['proof_state']!=2){
return jsonError('Warning: It is a violation to publish your article online without completing PROOF.
The ONLINE step will only continue if you have completed the PROOF step.');
}
$article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
$authors = $this->production_article_author_obj->where('p_article_id',$data['p_article_id'])->where('state',0)->select();
@@ -563,6 +567,7 @@ class Production extends Controller
return jsonError($rule->getError());
}
$p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
proofState($p_info['article_id']);
$list = $this->production_article_author_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->select();
foreach ($list as $k => $v) {
$list[$k]['organs'] = $this->production_article_author_to_organ_obj
@@ -576,6 +581,27 @@ class Production extends Controller
return jsonSuccess($re);
}
/**
* 获取生产实例详情通过文章id
*/
public function getProductionDetailByArticleid()
{
$data = $this->request->post();
$rule = new Validate([
'article_id' => 'require|number'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$p_info = $this->production_article_obj->where('article_id', $data['article_id'])->where('state',0)->find();
$article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
$re['production'] = $p_info;
$re['article'] = $article_info;
$re['journal'] = $journal_info;
return jsonSuccess($re);
}
/**
* 添加作者机构
@@ -946,13 +972,14 @@ class Production extends Controller
//发送邮件
$tt = "Dear Author,<br/><br/>";
$tt .= "Please confirm proof of your manuscript on the submission website within 48 hours. (https://submission.tmrjournals.com)<br/><br/>";
$tt .= "<a href=''>Click here to confirm the proof.</a><br/>";
$tt .= "<a href=''>Click here to make changes based on this version.</a><br/><br/>";
$tt .= "<a href='https://submission.tmrjournals.com/api/Production/editProofFromEmail/articleId/".$p_info['article_id']."'>Click here to confirm the proof.</a><br/>";
$tt .= "<a href='https://submission.tmrjournals.com'>Click here to make changes based on this version.</a><br/><br/>";
$tt .= "If your response is not received, we will regard the author's consent to the version if the time exceeds.<br/><br/>";
$tt .= "If you have any questions, please feel free to contact us.<br/>";
$tt .= "Note: Double-check the authors' information carefully to ensure they are correct.";
// $maidata['email'] = '751475802@qq.com';
$maidata['email'] = $user_info['email'];
$maidata['title'] = "PROOF|".$journal_info['title'];
$maidata['content'] = $tt;
@@ -960,15 +987,14 @@ class Production extends Controller
$maidata['tpassword'] = $journal_info['epassword'];
$file = ROOT_PATH . 'public' . DS.'proofPDF'.DS.$p_info['article_id'].'.pdf';
sendEmail($maidata['email'],$maidata['title'],$journal_info['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword'],$file);
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
//更改数据库
$update['proof_state'] = 1;
$updata['proof_state'] = 1;
$updata['proof_stime'] = time();
$updata['proof_etime'] = strtotime("+2 day");
$this->production_article_obj->where('p_article_id',$data['p_article_id'])->update($updata);
return jsonSuccess([]);
return jsonSuccess(['msg'=>$this->production_article_obj->getLastSql()]);
}
/**
@@ -978,6 +1004,8 @@ class Production extends Controller
$this->production_article_obj->where('proof_state',1)->where('proof_etime','<',time())->update(['proof_state'=>2]);
}
/**
* 作者反馈proof
*/
@@ -991,14 +1019,14 @@ class Production extends Controller
return jsonError($rule->getError());
}
$updata = [];
$updata['proof_rtime'] = time();
if($data['code']==0){//同意
$update['proof_state'] = 2;
$updata['proof_state'] = 2;
}else{//拒绝
$update['proof_state'] = 2;
$update['proof_content'] = trim($data['content']);
$updata['proof_state'] = 2;
$updata['proof_content'] = trim($data['content']);
}
//发送邮件提醒编辑
$this->production_article_obj->where('article_id',$data['article_id'])->where('state',0)->update($updata);
return jsonSuccess([]);
}
@@ -1007,7 +1035,7 @@ class Production extends Controller
* 同意proof通过邮件链接
*/
public function editProofFromEmail($articleId){
$this->production_article_obj->where('article_id',$articleId)->where('state',0)->update(['proof'=>2]);
$this->production_article_obj->where('article_id',$articleId)->where('state',0)->update(['proof_state'=>2,'proof_rtime'=>time()]);
echo 'Commit Succeeded';
}
@@ -1019,7 +1047,6 @@ class Production extends Controller
vendor('fpdi/fpdi');
$pdf = new \FPDI();
$pageCount = $pdf->setSourceFile(ROOT_PATH . 'public' . DS.$p_info['file_pdf']);
// iterate through all pages
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
// import a page