This commit is contained in:
wangjinlei
2022-02-18 17:39:32 +08:00
parent ddd4358f41
commit 4c6f6d97c1
6 changed files with 521 additions and 98 deletions

View File

@@ -6,6 +6,10 @@ use think\Controller;
use think\Db;
use think\Queue;
/**
* @title 公共管理相关
* @description 公共管理相关
*/
class Admin extends Controller {
protected $user_obj = '';
@@ -219,7 +223,24 @@ class Admin extends Controller {
}
/**
* 上传reviewer申请
* @title 上传reviewer申请
* @description 上传reviewer申请
* @author wangjinlei
* @url /api/Article/reviewer
* @method POST
*
* @param name:company type:String require:1 desc:单位
* @param name:country type:String require:1 desc:国家
* @param name:email type:String require:1 desc:邮箱
* @param name:field type:String require:1 desc:领域描述
* @param name:gender type:String require:1 desc:1男2女
* @param name:introduction type:String require:1 desc:简介
* @param name:journal type:int require:1 desc:journal_id
* @param name:major type:int require:1 desc:major_id
* @param name:qualifications type:String require:1 desc:cv地址
* @param name:technical type:String require:1 desc:职称
* @param name:username type:String require:1 desc:申请者用户名
*
*/
public function reviewer() {
//接受参数

View File

@@ -29,6 +29,7 @@ class Article extends Controller {
protected $login_auto_obj = '';
protected $major_obj = "";
protected $major_to_journal_obj = '';
protected $reviewer_from_author_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -50,6 +51,7 @@ class Article extends Controller {
$this->login_auto_obj = Db::name('login_auto');
$this->major_obj = Db::name("major");
$this->major_to_journal_obj = Db::name('major_to_journal');
$this->reviewer_from_author_obj = Db::name("reviewer_from_author");
}
/**
@@ -146,10 +148,24 @@ class Article extends Controller {
return json(['total' => $count, 'data' => $res]);
}
/**
* 获取文章详情(作者,编辑)
* @title 获取文章详情(作者,编辑)
* @description 获取文章详情(作者,编辑)
* @author wangjinlei
* @url /api/Article/getArticleDetail
* @method POST
*
* @param name:articleId type:int require:1 desc:文章id
* @param name:human type:string require:1 desc:editor/author
*
* @return article:文章信息#
* @return msg:文章跟踪信息#
* @return authors:作者信息#
* @return suggest:建议信息#
* @return transfer:转投信息#
* @return transinfo:建议转投信息#
* @return major:领域信息#
*
*/
public function getArticleDetail() {
//接受参数
@@ -178,17 +194,19 @@ class Article extends Controller {
}
//查询major信息
$major_data = [];
if($article_res['major_id']!=0){
$major_data['major'] = $this->reviewer_major_obj->where('major_id',$article_res['major_id'])->find();
}else{
$major_data['major'] = null;
}
if($article_res['cmajor_id']!=0){
$major_data['cmajor'] = $this->reviewer_major_obj->where('major_id',$article_res['cmajor_id'])->find();
}else{
$major_data['cmajor'] = null;
}
// $major_data = [];
// if($article_res['major_id']!=0){
// $major_data['major'] = $this->reviewer_major_obj->where('major_id',$article_res['major_id'])->find();
// }else{
// $major_data['major'] = null;
// }
// if($article_res['cmajor_id']!=0){
// $major_data['cmajor'] = $this->reviewer_major_obj->where('major_id',$article_res['cmajor_id'])->find();
// }else{
// $major_data['cmajor'] = null;
// }
//新领域查询
$major = $this->getMajorStr($article_res['major_id'])==""?"":substr($this->getMajorStr($article_res['major_id']), 3);
//查询文章作者信息
$author_res = $this->article_author_obj->where('article_id', $data['articleId'])->where('state', 0)->select();
@@ -212,9 +230,24 @@ class Article extends Controller {
}
$this->article_obj->where('article_id', $data['articleId'])->update($up_data);
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res,'suggest'=>$suggest,'transfer'=>$transfer_res,'transinfo'=>$transfer_info,'major'=>$major_data]);
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res,'suggest'=>$suggest,'transfer'=>$transfer_res,'transinfo'=>$transfer_info,'major'=>$major]);
}
private function getMajorStr($major_id){
$frag = '';
$major_info = $this->major_obj->where('major_id',$major_id)->find();
if($major_info==null){
return '';
}
if($major_info['major_level']==1){
return '';
}else{
$frag = $this->getMajorStr($major_info['pid']).' > '.$major_info['major_title'];
}
return $frag;
}
/**
* 作者同意转投
*/
@@ -492,6 +525,33 @@ class Article extends Controller {
$this->article_obj->where($where_article)->update(['editor_act'=>1]);
return json(['code' => 0]);
}
//接收文章必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章
if($data['state']==5&&$article_info['type']!="N"&&$article_info['type']!="T"){
//定义符合条件的数量
$rev_real_num = 0;
//获取通过的审稿意见数
$rev_list = $this->article_reviewer_obj
->field('t_article_reviewer_question.*')
->join("t_article_reviewer_question",'t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id','left')
->where('t_article_reviewer.article_id',$article_info['article_id'])
->where('t_article_reviewer.state','in',[1,3])
->select();
foreach ($rev_list as $v){
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $v['comments'])>0){//含有中文
if(mb_strlen($v['comments'], 'UTF8')>=60){
$rev_real_num++;
}
}else{//不含中文
$carray = explode(" ", $v['comments']);
if(count($carray)>=40){
$rev_real_num++;
}
}
}
if($rev_real_num<2){
return json(['code'=>1,'msg'=>"More than two available reviewer-comments are necessary before going next step."]);
}
}
$update_data['state'] = $data['state'];
$update_data['editor_act'] = 1;
//更新文章状态
@@ -507,7 +567,6 @@ class Article extends Controller {
//发送文章状态更改邮件
if($data['state']==3){//拒稿
if($data['trsjournal']==0){
$tt = '"'.$article_info['title'].'"<br>';
$tt .= $article_info['accept_sn'].'<br>';
$tt .= 'journal:'.$journal_info['title'].'<br>';
@@ -792,8 +851,8 @@ class Article extends Controller {
. ' in the journal '.$journal_info['title'].'. <br>';
$tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 10 days of receipt of the manuscript.<br><br>';
$tt .= 'Thank you for your consideration.<br> Look forward for your reply.<br>';
// $tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
$tt .= '<a href="https://submission.tmrjournals.com/">Click here to review the article</a><br>';
$tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
// $tt .= '<a href="https://submission.tmrjournals.com/">Click here to review the article</a><br>';
// $tt .= '<a href="">Click on the link to reject the review of this manuscript</a><br>';
$tt .= 'Your username:'.$reviewer_info['account'].'<br><br>';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
@@ -802,7 +861,7 @@ class Article extends Controller {
$tt .= $journal_info['title'].'<br>';
$tt .= 'Email:'.$journal_info['email'].'<br>';
$tt .= 'Website:'.$journal_info['website'];
sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
// sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//记录userlog
$log_data['user_id'] = $article_info['editor_id'];
@@ -895,11 +954,12 @@ class Article extends Controller {
}
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
//首先查重是否重复投稿
$checkArticle = $this->article_obj->where("title",trim($data['title']))->find();
if($checkArticle!=null){
return json(['code'=>1,'msg'=>'Warning: you re-submitting the article!']);
$checkArticle = $this->article_obj->where("title",trim($data['title']))->select();
foreach ($checkArticle as $v){
if($v['state']!=3){
return json(['code'=>1,'msg'=>'Warning: you are re-submitting the article!']);
}
}
Db::startTrans();
@@ -913,7 +973,7 @@ class Article extends Controller {
$inset_data['accept_sn'] = getArticleSN($journal_info['abbr'],$data['type']);
$inset_data['type'] = $data['type'];
$inset_data['major_id'] = $data['major'];
$inset_data['cmajor_id'] = $data['cmajor'];
// $inset_data['cmajor_id'] = $data['cmajor'];
$inset_data['approval'] = $data['approval']=='true'?1:0;
$inset_data['abstrart'] = $data['abstrart'];
$inset_data['author_act'] = 1;
@@ -1010,6 +1070,73 @@ class Article extends Controller {
}
}
/**
* 添加审稿人来自通讯作者
*/
private function addReviewerFromReportAuthor($art_aut_id,$journal_id){
$journal_info = $this->journal_obj->where('journal_id',$journal_id)->find();
//判断通讯作者信息是否合规
$author_info = $this->article_author_obj->where('art_aut_id',$art_aut_id)->find();
if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$author_info['email'])){
return ;
}
//判断目前的状态进行下一步流程
$user_info = $this->user_obj->where('email',$author_info['email'])->where('state',0)->find();
if($user_info==null){//不存在用户
//添加用户,发送邮件
$user_insert['account'] = $author_info['email'];
$user_insert['password'] = md5("123456qwe");
$user_insert['email'] = $author_info['email'];
$user_insert['realname'] = $author_info['firstname']." ".$author_info['lastname'];
$user_insert['ctime'] = time();
$this->user_obj->insert($user_insert);
//发送邮件
$tt = 'Dear Dr. '.$user_insert['realname'].'<br><br>';
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].' as the corresponding author.<br>';
$tt .= 'In order to provide a better online experience for authors, we have set up your account in our submission system.<br><br>';
$tt .= 'You could log in with your account in https://submission.tmrjournals.com/login <br>';
$tt .= 'Your username:'.$author_info['email'].'<br>';
$tt .= 'Your password:123456qwe (you could change your password in the system by yourself later.)<br><br>';
$tt .= 'Thank you so much for your kindly support.<br><br>';
$tt .= 'Sincerely,<br>Editorial Office<br>'.$journal_info['title'].'<br>';
$tt .= 'Email: '.$journal_info['email'].'<br>';
$tt .= 'Website:<a href="'.$journal_info['website'].'">'.$journal_info['website'].'</a>';
sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
//添加转换表数据
$art_insert['art_aut_id'] = $art_aut_id;
$art_insert['journal_id'] = $journal_id;
$art_insert['rfa_ctime'] = time();
$this->reviewer_from_author_obj->insert($art_insert);
return ;
}
$reviewer_check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find();
$reviewer_this_check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('journal_id',$journal_id)->where('state',0)->find();
if($reviewer_check == null){//存在用户但不是审稿人
//添加转换表数据
$art_insert['art_aut_id'] = $art_aut_id;
$art_insert['journal_id'] = $journal_id;
$art_insert['rfa_ctime'] = time();
$this->reviewer_from_author_obj->insert($art_insert);
return ;
}else{
if($reviewer_this_check==null){
//直接添加审稿人
$reviewer_insert['reviewer_id'] = $user_info['user_id'];
$reviewer_insert['journal_id'] = $journal_id;
$reviewer_insert['account'] = $author_info['email'];
$reviewer_insert['journal_title'] = $journal_info['title'];
$reviewer_insert['ctime'] = time();
$this->reviewer_to_journal_obj->insert($reviewer_insert);
return ;
}else{
return ;
}
}
}
/**
* 作者发送消息

View File

@@ -39,6 +39,19 @@ class Auto extends Controller {
$this->reviewer_info_obj = Db::name('user_reviewer_info');
}
public function testEmail(){
$journal_info = $this->journal_obj->where('journal_id',4)->find();
$maidata['email'] = "751475802@qq.com";
$maidata['title'] = "test email";
$maidata['content'] = "test content";
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
sendEmail($maidata['email'], $journal_info['title'], $journal_info['title'], $maidata['title'], $journal_info['email'], $journal_info['epassword']);
}
/**
* 推送邮件给审稿人提醒审稿人
*/

View File

@@ -0,0 +1,95 @@
<?php
namespace app\api\controller;
use think\Controller;
use think\Db;
use think\Queue;
/**
* @title 期刊相关
* @description 期刊相关
*/
class Journal extends Controller {
protected $user_obj = '';
protected $captcha_obj = '';
protected $journal_obj = '';
protected $user_act_obj = '';
protected $reviewer_major_obj = '';
protected $article_obj = '';
protected $article_msg_obj = '';
protected $article_author_obj = '';
protected $admin_obj = '';
protected $country_obj = '';
protected $reviewer_to_journal_obj = '';
protected $user_reviewer_info_obj = '';
protected $user_reviewer_obj = '';
protected $user_msg_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
$this->user_obj = Db::name('user');
$this->captcha_obj = Db::name('captcha');
$this->user_act_obj = Db::name('user_act');
$this->admin_obj = Db::name('admin');
$this->reviewer_major_obj = Db::name('reviewer_major');
$this->journal_obj = Db::name('journal');
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
$this->article_obj = Db::name('article');
$this->user_msg_obj = Db::name('user_msg');
$this->article_msg_obj = Db::name('article_msg');
$this->article_author_obj = Db::name('article_author');
$this->country_obj = Db::name('country');
}
/**
* @title 获取期刊列表除去审稿人已存在审稿关系
* @description 获取期刊列表除去审稿人已存在审稿关系
* @author wangjinlei
* @url /api/Journal/getJournalOutReviewer
* @method POST
*
* @param name:username type:string require:1 desc:用户名
*
* @return journals:期刊列表#
*/
public function getJournalOutReviewer(){
$data = $this->request->post();
$user_info = $this->user_obj->where("account",$data['username'])->find();
$journalIds = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->column('journal_id');
$list = $this->journal_obj->where('journal_id',"not in",$journalIds)->where('state',0)->select();
$re['journals'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取审稿人所属期刊列表
* @description 获取审稿人所属期刊列表
* @author wangjinlei
* @url /api/Journal/getJournalInReviewer
* @method POST
*
* @param name:username type:string require:1 desc:用户名
*
* @return journals:期刊列表#
*/
public function getJournalInReviewer(){
$data = $this->request->post();
$user_info = $this->user_obj->where('account',$data['username'])->where('state',0)->find();
$list = $this->reviewer_to_journal_obj
->field("t_journal.*")
->join('t_journal',"t_journal.journal_id = t_reviewer_to_journal.journal_id","left")
->where('t_reviewer_to_journal.reviewer_id',$user_info['user_id'])
->where('t_reviewer_to_journal.state',0)
->select();
$re['journals'] = $list;
return jsonSuccess($re);
}
}

View File

@@ -52,7 +52,18 @@ class Reviewer extends Controller {
}
/**
* 获取文章审稿实例列表(审稿人)
* @title 获取文章审稿实例列表(审稿人)
* @description 获取文章审稿实例列表(审稿人)
* @author wangjinlei
* @url /api/Reviewer/getReviewerList
* @method POST
*
* @param name:username type:string require:1 desc:审稿人account
* @param name:pageIndex type:int require:1 desc:当前页码
* @param name:pageSize type:int require:1 desc:每个页面的数据条数
*
* @return data:数据列表#
* @return total:数据条数
*/
public function getReviewerList() {
$data = $this->request->post();
@@ -62,7 +73,7 @@ class Reviewer extends Controller {
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where("t_article.state",2)
->where("t_article.state", 2)
->order('t_article_reviewer.state')
->limit($limit_start, $data['pageSize'])
->select();
@@ -89,7 +100,7 @@ class Reviewer extends Controller {
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where("t_article.state",2)
->where("t_article.state", 2)
->where('t_article_reviewer.state', 0)
->select();
foreach ($res as $k => $v) {
@@ -470,7 +481,7 @@ class Reviewer extends Controller {
$article_info = $this->article_obj->where('article_id', $data['articleId'])->find();
$reviewer_info = $this->user_obj
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user.user_id", "left")
->where('t_user.user_id', $data['uid'])
->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
@@ -484,22 +495,22 @@ class Reviewer extends Controller {
//发送email提醒审稿员
$tt = $article_info['accept_sn'] . '<br>';
$tt .= 'Dear Dr. ' . ($reviewer_info['realname'] == '' ? $reviewer_info["account"] : $reviewer_info['realname']) . '<br><br>';
$tt .= 'Dear Dr. ' . ($reviewer_info['realname'] == '' ? $reviewer_info["account"] : $reviewer_info['realname']) . '<br><br>';
$tt .= 'The manuscript entitled “'.$article_info['title'].'” has'
. ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would'
$tt .= 'The manuscript entitled “' . $article_info['title'] . '” has'
. ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would'
. ' be most grateful if you could offer an opinion regarding its suitability for publication'
. ' in the journal '.$journal_info['title'].'. <br>';
. ' in the journal ' . $journal_info['title'] . '. <br>';
$tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 10 days of receipt of the manuscript.<br><br>';
$tt .= 'Thank you for your consideration.<br> Look forward for your reply.<br>';
$tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
$tt .= 'Your username:'.$reviewer_info['account'].'<br><br>';
$tt .= '<a href="' . $this->creatLoginUrlForreviewer($reviewer_info, $res) . '">Click here to review the article</a><br>';
$tt .= 'Your username:' . $reviewer_info['account'] . '<br><br>';
$tt .= 'Your original password:123456qwe , if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
$tt .= $journal_info['title'].'<br>';
$tt .= 'Email:'.$journal_info['email'].'<br>';
$tt .= 'Website:'.$journal_info['website'];
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><br>';
$tt .= $journal_info['title'] . '<br>';
$tt .= 'Email:' . $journal_info['email'] . '<br>';
$tt .= 'Website:' . $journal_info['website'];
sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
return jsonSuccess([]);
@@ -616,19 +627,19 @@ class Reviewer extends Controller {
$insert_data['qu6'] = $data['qu6'];
$insert_data['qu7'] = $data['qu7'];
$insert_data['qu8'] = $data['qu8'];
$insert_data['qu9'] = $data['qu9'] ? 1 : 0;
$insert_data['qu9'] = $data['qu9']=="true" ? 1 : 0;
$insert_data['qu9_contents'] = $data['qu9contents'];
$insert_data['qu10'] = $data['qu10'] ? 1 : 0;
$insert_data['qu10'] = $data['qu10']=="true" ? 1 : 0;
$insert_data['qu10_contents'] = $data['qu10contents'];
$insert_data['qu11'] = $data['qu11'] ? 1 : 0;
$insert_data['qu11'] = $data['qu11']=="true" ? 1 : 0;
$insert_data['qu11_contents'] = $data['qu11contents'];
$insert_data['qu12'] = $data['qu12'] ? 1 : 0;
$insert_data['qu12'] = $data['qu12']=="true" ? 1 : 0;
$insert_data['qu12_contents'] = $data['qu12contents'];
$insert_data['qu13'] = $data['qu13'] ? 1 : 0;
$insert_data['qu13'] = $data['qu13']=="true" ? 1 : 0;
$insert_data['qu13_contents'] = $data['qu13contents'];
$insert_data['qu14'] = $data['qu14'] ? 1 : 0;
$insert_data['qu14'] = $data['qu14']=="true" ? 1 : 0;
$insert_data['qu14_contents'] = $data['qu14contents'];
$insert_data['qu15'] = $data['qu15'] ? 1 : 0;
$insert_data['qu15'] = $data['qu15']=="true" ? 1 : 0;
$insert_data['qu15_contents'] = $data['qu15contents'];
$insert_data['rated'] = $data['rated'];
$insert_data['recommend'] = $data['recommend'];
@@ -667,7 +678,6 @@ class Reviewer extends Controller {
$tt .= 'Please check the new comments from the reviewer.<br>';
$tt .= 'Journal:' . $journal_info['title'] . ' and article title:' . $article_info['title'];
// sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//发送email感谢reviewer并携带附件
$reviewer_info = $this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->find();
$tt1 = 'You have reviewed 1 submission in the journal ' . $journal_info['title'] . ' during ' . date('Y') . '.Thank you for your support to our journal. This contribution is greatly appreciated.<br><br>';
@@ -675,12 +685,11 @@ class Reviewer extends Controller {
$tt1 .= 'Contact us<br>TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand<br>Telephone: +64 02108293806<br>E-mail: publisher@tmrjournals.com';
// sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS);
//记录usermsg
add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be unloaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']);
add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be uploaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']);
return json(['code' => 0]);
}
// public function jpg_test(){
// $reviewer_ZS = self::createReviewerZS(3380);
// sendEmail("849192806@qq.com", "title", "ttttt", "content", 'tmr@tmrjournals.com', "Wu9999999999", $reviewer_ZS);
@@ -714,8 +723,6 @@ class Reviewer extends Controller {
}
}
/**
* @title 审稿人cv上传
* @description 审稿人cv上传
@@ -836,7 +843,7 @@ class Reviewer extends Controller {
$ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf';
$image = \think\Image::open($template);
$image->text($journal_info['title'], $ziti, 70, '#000000', [1450, 950])
->text($reviewer_info['realname']==''?$reviewer_info['account']:$reviewer_info['realname'], $ziti, 60, '#000000', [1900, 1700])
->text($reviewer_info['realname'] == '' ? $reviewer_info['account'] : $reviewer_info['realname'], $ziti, 60, '#000000', [1900, 1700])
->text('awarded ' . date('d, F, Y', $article_info['rtime'] == 0 ? $article_info['ctime'] : $article_info['rtime']) . ' to', $ziti, 60, '#000000', [1600, 1500])
->text('In recognitioin of the review made for the journal', $ziti, 80, '#000000', [900, 1900])
->text('The Editors of', $ziti, 65, '#000000', [230, 2345])
@@ -898,9 +905,10 @@ class Reviewer extends Controller {
$tt .= $journal_info['title'] . '<br>';
$tt .= 'Email:' . $journal_info['email'] . '<br>';
$tt .= 'Website:' . $journal_info['website'];
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
// sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
return jsonSuccess([]);
$re['art_rev_id'] = $res;
return jsonSuccess($re);
}
private function creatLoginUrlForreviewer($user, $article_id) {
@@ -944,7 +952,7 @@ class Reviewer extends Controller {
//记录审稿失败次数
$art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find();
$this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num");
$this->user_obj->where("user_id", $art_rev_info["reviewer_id"])->setInc("rd_num");
return jsonSuccess([]);
}
@@ -952,16 +960,16 @@ class Reviewer extends Controller {
/**
* 拒绝审稿get方法
*/
public function refusereview($aid){
public function refusereview($aid) {
$art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $aid)->find();
if($art_rev_info==null){
if ($art_rev_info == null) {
return "error";
}
$this->article_reviewer_obj->where('art_rev_id', $aid)->update(['state' => 4]);
//记录审稿失败次数
$this->user_obj->where("user_id",$art_rev_info["reviewer_id"])->setInc("rd_num");
$this->user_obj->where("user_id", $art_rev_info["reviewer_id"])->setInc("rd_num");
echo "You have declined the reviewing invitation.";
}
@@ -1045,6 +1053,50 @@ class Reviewer extends Controller {
return jsonSuccess($re);
}
/**
* @title 检测用户是否是为某本期刊的审稿人
* @description 检测用户是否是为某本期刊的审稿人
* @author wangjinlei
* @url /api/Reviewer/checkReviewerOfJournal
* @method POST
*
* @param name:username type:string require:1 desc:用户名
* @param name:journal type:int require:1 desc:期刊id
*
* @return has:是否存在(0不存在1存在)
*/
public function checkReviewerOfJournal(){
$data = $this->request->post();
$user_info = $this->user_obj->where('account',$data['username'])->where('state',0)->find();
if($user_info==null){
return jsonError("username error!!");
}
$check = $this->reviewer_to_journal_obj->where("reviewer_id",$user_info['user_id'])->where('journal_id',$data['journal'])->where('state',0)->find();
$re['has'] = $check==null?0:1;
return jsonSuccess($re);
}
/**
* @title 获取审稿人领域
* @description 获取审稿人领域
* @author wangjinlei
* @url /api/Reviewer/getMajorForReviewer
* @method POST
*
* @param name:username type:string require:1 desc:用户名
*
* @return major:领域id(0:不存在)
*/
public function getMajorForReviewer(){
$data = $this->request->post();
$user_info = $this->user_obj->where('account',$data['username'])->where('state',0)->find();
$reviewer_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->where('state',0)->find();
$re["major"] = $reviewer_info==null?0:$reviewer_info['major'];
return jsonSuccess($re);
}
/**
* @title 获取专业领域
* @description 获取专业领域
@@ -1241,7 +1293,7 @@ class Reviewer extends Controller {
* @param name:company type:string require:0 desc:单位
* @param name:cv type:string require:1 desc:审稿人简历
*/
public function editReviewerForEditor(){
public function editReviewerForEditor() {
$data = $this->request->post();
// $info_insert['reviewer_id'] = $data['user_id'];
$info_insert['technical'] = $data['title'];
@@ -1251,7 +1303,7 @@ class Reviewer extends Controller {
$info_insert['cmajor'] = $data['cmajor'];
$info_insert['field'] = trim($data['field']);
$info_insert['qualifications'] = trim($data['cv']);
$this->user_reviewer_info_obj->where("reviewer_id",$data['user_id'])->update($info_insert);
$this->user_reviewer_info_obj->where("reviewer_id", $data['user_id'])->update($info_insert);
return jsonSuccess([]);
}
@@ -1263,6 +1315,7 @@ class Reviewer extends Controller {
* @method POST
*
* @param name:username type:string require:1 desc:用户名
* @param name:keyword type:string require:0 desc:搜索账户名/email/真名
* @param name:journalId type:int require:1 desc:期刊id当全选时为0
* @param name:pageIndex type:int require:1 desc:开始页码
* @param name:pageSize type:int require:1 desc:每页是数据条数
@@ -1272,21 +1325,37 @@ class Reviewer extends Controller {
$editor_info = $this->user_obj->where('account', $data['username'])->where('state', 0)->find();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$jous = [];
$res = [];
$count = 0;
if ($data['journalId'] == 0) {
$jous = $this->journal_obj->where('editor_id', $editor_info['user_id'])->where('state', 0)->column('journal_id');
} else {
$jous[] = $data['journalId'];
}
$res = $this->reviewer_to_journal_obj
->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.title journal_title')
->join('t_journal', 't_journal.journal_id = t_reviewer_to_journal.journal_id', 'left')
->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')
->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')
->where('t_reviewer_to_journal.journal_id', 'in', $jous)
->where('t_reviewer_to_journal.state', 0)
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where('t_reviewer_to_journal.state', 0)->count();
if (isset($data['keyword'])) {
$res = $this->reviewer_to_journal_obj
->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.title journal_title')
->join('t_journal', 't_journal.journal_id = t_reviewer_to_journal.journal_id', 'left')
->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')
->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')
->where('t_reviewer_to_journal.journal_id', 'in', $jous)
->where('t_reviewer_to_journal.state', 0)
->where("t_user.account|t_user.realname|t_user.email","like",'%'.$data['keyword'].'%')
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where('t_reviewer_to_journal.state', 0)->where("t_user.account|t_user.realname|t_user.email","like",'%'.$data['keyword'].'%')->count();
}else{
$res = $this->reviewer_to_journal_obj
->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.title journal_title')
->join('t_journal', 't_journal.journal_id = t_reviewer_to_journal.journal_id', 'left')
->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')
->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')
->where('t_reviewer_to_journal.journal_id', 'in', $jous)
->where('t_reviewer_to_journal.state', 0)
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where('t_reviewer_to_journal.state', 0)->count();
}
return json(['code' => 0, 'data' => $res, 'total' => $count]);
}
@@ -1326,7 +1395,7 @@ class Reviewer extends Controller {
->where("t_reviewer_to_journal.state", 0)
->column("t_user_reviewer_info.major");
$list = $this->reviewer_major_obj->where("major_id", "in",$ids)->where("state", 0)->select();
$list = $this->reviewer_major_obj->where("major_id", "in", $ids)->where("state", 0)->select();
foreach ($list as $k => $v) {
$list[$k]["children"] = $this->reviewer_major_obj->where("pid", $v["major_id"])->where("state", 0)->select();
}
@@ -1362,7 +1431,7 @@ class Reviewer extends Controller {
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where('t_reviewer_to_journal.state', 0)
@@ -1379,7 +1448,7 @@ class Reviewer extends Controller {
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.major", $data['major_id'])
@@ -1401,7 +1470,7 @@ class Reviewer extends Controller {
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account", "like", "%" . $data["keywords"] . "%")
@@ -1422,7 +1491,7 @@ class Reviewer extends Controller {
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
->join("t_reviewer_major","t_reviewer_major.major_id = t_user_reviewer_info.cmajor","left")
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
->where("t_user_reviewer_info.major", $data['major_id'])
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
@@ -1461,11 +1530,11 @@ class Reviewer extends Controller {
public function getAllReviewerObj() {
$data = $this->request->post();
$list = $this->article_reviewer_obj
->where("article_id",$data['article_id'])
->where("state","in",[2,3])
->where("article_id", $data['article_id'])
->where("state", "in", [2, 3])
->select();
foreach ($list as $k => $v){
$list[$k]["question"] = $this->article_reviewer_question_obj->where("art_rev_id",$v['art_rev_id'])->find();
foreach ($list as $k => $v) {
$list[$k]["question"] = $this->article_reviewer_question_obj->where("art_rev_id", $v['art_rev_id'])->find();
}
$re["reviews"] = $list;
@@ -1494,12 +1563,11 @@ class Reviewer extends Controller {
$this->pdftest('I am wjl');
}
private function createReviewerZS($art_rev_id){
private function createReviewerZS($art_rev_id) {
if (!file_exists(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg')) {
$this->createZS($art_rev_id);
}
return ROOT_PATH.'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg';
return ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg';
}
/**
@@ -1544,5 +1612,4 @@ class Reviewer extends Controller {
// $pdf->Output($pdf_wj, 'F');
// return $pdf_wj;
// }
}

View File

@@ -121,6 +121,51 @@ class User extends Controller {
}
}
/**
* @title 申请期刊审稿人对于审稿人
* @description 申请期刊审稿人对于审稿人
* @author wangjinlei
* @url /api/User/applyReviewerForReviewer
* @method POST
*
* @param name:username type:string require:1 desc:用户名
* @param name:journal_id type:int require:1 desc:期刊id
*
*/
public function applyReviewerForReviewer(){
$data = $this->request->post();
$user_info = $this->user_obj->where('account', trim($data['username']))->find();
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
$editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
$reviewer_info_info = $this->user_reviewer_info_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find();
$check = $this->reviewer_to_journal_obj->where("reviewer_id",$user_info['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
$check1 = $this->user_reviewer_obj->where('name',trim($data['username']))->where('journal_id',$data['journal_id'])->find();
if($check||$check1){
return jsonError("You are already in the reviewer list of this journal");
}
$insert_data['journal_id'] = $data['journal_id'];
$insert_data['name'] = trim($data['username']);
$insert_data['introduction'] = $reviewer_info_info['introduction'];
$insert_data['email'] = $user_info['email'];
$insert_data['company'] = $reviewer_info_info['company'];
$insert_data['country'] = $reviewer_info_info['country'];
$insert_data['major'] = $reviewer_info_info['major'];
$insert_data['technical'] = $reviewer_info_info['technical'];
$insert_data['field'] = $reviewer_info_info['field'];
$insert_data['gender'] = $reviewer_info_info['gender'];
$insert_data['qualifications'] = $reviewer_info_info['qualifications'];
$insert_data['ctime'] = time();
$res = $this->user_reviewer_obj->insertGetId($insert_data);
//发送email-》编辑
$tt = 'Dear editor,<br>';
$tt .= 'Please check the new reviewer application.';
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//发送消息信息--编辑
add_usermsg($journal_info['editor_id'], '新增审稿人申请,申请人(' . $data['username'] . ')', '/reviewerApplyDetail?id=' . $res);
return jsonSuccess([]);
}
/**
* @title 审稿系统登录功能
* @description 审稿系统登录功能
@@ -525,11 +570,18 @@ class User extends Controller {
* 通过审核人
*/
public function reviewerAdopt() {
$reviewerId = $this->request->post('reviewerId');
$where['reviewer_id'] = $reviewerId;
$reviewerId = $this->request->post('reviewerApplyId');
$where['reviewer_apply_id'] = $reviewerId;
$apply_info = $this->user_reviewer_obj->where($where)->find();
$journal_info = $this->journal_obj->where('journal_id', $apply_info['journal_id'])->find();
$has_res = $this->user_obj->where('account', $apply_info['name'])->find();
//检测是否已经存在此审稿人
if($has_res){
$check = $this->reviewer_to_journal_obj->where('reviewer_id',$has_res['user_id'])->where('journal_id',$journal_info['journal_id'])->where('state',0)->find();
if($check){
return jsonError("has reviewer!");
}
}
Db::startTrans();
if ($has_res == null) {
$insert_data['account'] = $apply_info['name'];
@@ -636,12 +688,53 @@ class User extends Controller {
}
}
/**
* @title 审查用户是否是审稿人
* @description 审查用户是否是审稿人
* @author wangjinlei
* @url /api/User/checkUserIsReviewer
* @method POST
*
* @param name:username type:String require:1 desc:account
*
* @return is:0否1是
*
*/
public function checkUserIsReviewer(){
$data = $this->request->post();
$user_info = $this->user_obj->where('account',$data['username'])->find();
$check = $this->reviewer_to_journal_obj->where('reviewer_id',$user_info['user_id'])->where('state',0)->find();
$re['is'] = $check==null?0:1;
return jsonSuccess($re);
}
/**
* @title 审查用户是否存在通过用户名或邮箱
* @description 审查用户是否存在通过用户名或邮箱
* @author wangjinlei
* @url /api/User/checkUserByAccountOrEmail
* @method POST
*
* @param name:username type:String require:1 desc:account/email
*
* @return has:0无1有
*
*/
public function checkUserByAccountOrEmail(){
$data = $this->request->post();
$check_info = $this->user_obj->where("account|email",$data['username'])->where("state",0)->find();
$re['has'] = $check_info==null?0:1;
return jsonSuccess($re);
}
/**
* 拒绝审核人
*/
public function reviewerRejec() {
$reviewerId = $this->request->post('reviewerId');
$where['reviewer_id'] = $reviewerId;
$reviewerId = $this->request->post('reviewerApplyId');
$where['reviewer_apply_id'] = $reviewerId;
$this->user_reviewer_obj->where($where)->update(['state' => 2]);
//拒绝审稿人email-》审稿人
@@ -650,7 +743,14 @@ class User extends Controller {
}
/**
* 获取专业列表
* @title 获取专业列表(未来会废弃)
* @description 获取专业列表(未来会废弃)
* @author wangjinlei
* @url /api/User/getMajorList
* @method POST
*
*
* @return data:领域列表#
*/
public function getMajorList() {
$res = $this->reviewer_major_obj->select();