This commit is contained in:
wangjinlei
2022-09-29 18:12:49 +08:00
5 changed files with 123 additions and 9 deletions

View File

@@ -1484,6 +1484,7 @@ class Article extends Controller {
$res = $this->article_obj->insertGetId($inset_data);
//上传文章作者信息
$author_email = [];
$authors = [];
foreach ($data['authorList'] as $v) {
if ($v['firstname'] == '') {
@@ -1502,6 +1503,9 @@ class Article extends Controller {
$i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
$i['is_report'] = $v['isReport'] == 'true'?1:0;
$authors[] = $i;
$cache['email'] = trim($v['email']);
$cache['name'] = trim($v['firstname']).' '.trim($v['lastname']);
$author_email[] = $cache;
}
$res_author = $this->article_author_obj->insertAll($authors);
@@ -1535,8 +1539,8 @@ class Article extends Controller {
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
$user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_res['user_id'])->find();
//发送邮件给作者,表示感谢
$tt1 = 'Dear Dr. '.($user_res['realname']==''?$user_res['account']:$user_res['realname']).',<br><br>';
$tt1 .= 'Thank you for submitting your manuscript entitled "'.$data['title'].'". Your submission has been assigned the following tracking number:'.$inset_data['accept_sn'].'. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.$journal_info['title'].', you will be informed as soon as possible.<br><br><br>';
$tt_t = 'Dear Dr. '.($user_res['realname']==''?$user_res['account']:$user_res['realname']).',<br><br>';
$tt1 = 'Thank you for submitting your manuscript entitled "'.$data['title'].'". Your submission has been assigned the following tracking number:'.$inset_data['accept_sn'].'. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.$journal_info['title'].', you will be informed as soon as possible.<br><br><br>';
if($journal_info['journal_id']==9){//life research 期刊发送收到文章邮件
$tt1 .= 'Life Research applies the CC BY-NC 4.0 license. Full details of the policy can be found at https://www.tmrjournals.com/notice.html?J_num=14&footer_id=123. Authors should read Guide to Authors carefully before submitting.<br><br>';
$tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact liferes@tmrjournals.com.<br><br>';
@@ -1550,10 +1554,23 @@ class Article extends Controller {
$tt1 .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
$tt1 .= $journal_info['title'].'<br>';
$tt1 .= 'Email: '.$journal_info['email'].'<br>';
$tt1 .= 'Website: '.$journal_info['website'];
$tt1 .= 'Website: '.$journal_info['website'].'<br>';
$tt1 .= '<hr/>If you have any questions, please contact us: <br>';
$tt1 .= 'Head of publication ethics<br>Dr. Dan Chen<br>TMR Publishing Group Limited Company, Auckland, New Zealand<br>Email: publication.ethics@tmrjournals.com';
}
sendEmail($user_res['email'],$journal_info['title'], $journal_info['title'], $tt_t.$tt1,$journal_info['email'],$journal_info['epassword']);
foreach($author_email as $v){
$cache_str = 'Dear Dr. '.$v['name'].',<br><br>';
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $cache_str.$tt1;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
sendEmail($user_res['email'],$journal_info['title'], $journal_info['title'], $tt1,$journal_info['email'],$journal_info['epassword']);
//增加用户操作log
$log_data['user_id'] = $user_res['user_id'];
$log_data['type'] = 0;
@@ -2071,7 +2088,7 @@ class Article extends Controller {
$pushData['content'] = $all;
$pushData['user_id'] = $value['reviewer_id'];
$pushData['email'] =$value['email'];
Queue::push('app\api\job\domail@fire',$pushData,'domail');
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
$num = $value['recommend'];
if($value['comments']!=''){
$difference.= "<br>Reviewer ". ($k+1).' : '.$recommend[$num] ." ( ".preg_replace("/\t/","",$value['comments'])." )<br>";
@@ -2086,10 +2103,10 @@ class Article extends Controller {
$pushData['user_id'] = $value['reviewer_id'];
$pushData['email'] =$value['email'];
if($state == 3 && ($value['recommend'] == 1 || $value['recommend'] == 2)){
Queue::push('app\api\job\domail@fire',$pushData,'domail');
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
}
if($state == 5 && ($value['recommend'] == 3 || $value['recommend'] == 4)){
Queue::push('app\api\job\domail@fire',$pushData,'domail');
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
}
}

View File

@@ -5,6 +5,7 @@ namespace app\api\controller;
use think\Controller;
use think\Db;
use think\Queue;
use think\Validate;
/**
* @title 编委相关接口
@@ -33,6 +34,8 @@ class Board extends Controller {
protected $chief_msg_obj = '';
protected $article_to_board_obj = '';
protected $login_auto_obj = '';
protected $user_index_obj = '';
protected $user_email_index_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -58,6 +61,8 @@ class Board extends Controller {
$this->article_to_board_obj = Db::name('article_to_board');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
$this->login_auto_obj = Db::name('login_auto');
$this->user_index_obj = Db::name('user_index');
$this->user_email_index_obj = Db::name('user_email_index');
}
/**
@@ -258,6 +263,33 @@ class Board extends Controller {
$re['reviewers'] = $revs;
return jsonSuccess($re);
}
/**
* 编辑/添加H指数
*/
public function editIndex(){
$data = $this->request->post();
$rule = new Validate([
'user_id'=>'require',
'year'=>'require',
'index'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->user_index_obj->where('user_id',$data['user_id'])->where('year',$data['year'])->where('state',0)->find();
if($check){
$this->user_index_obj->where('in_id',$check['in_id'])->update(['h_index'=>$data['index']]);
}else{
$insert['user_id'] = $data['user_id'];
$insert['year'] = $data['year'];
$insert['h_index'] = $data['index'];
$this->user_index_obj->insert($insert);
}
return jsonSuccess([]);
}
/**
* @title 编委导入--通过账号搜索用户

View File

@@ -34,6 +34,8 @@ class Chief extends Controller {
protected $chief_msg_obj = '';
protected $article_to_board_obj = '';
protected $login_auto_obj = '';
protected $user_index_obj = '';
protected $user_email_index_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -59,6 +61,8 @@ class Chief extends Controller {
$this->article_to_board_obj = Db::name('article_to_board');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
$this->login_auto_obj = Db::name('login_auto');
$this->user_index_obj = Db::name('user_index');
$this->user_email_index_obj = Db::name('user_email_index');
}
/**
@@ -852,7 +856,18 @@ class Chief extends Controller {
*/
public function getJournalBoard(){
$data = $this->request->post();
$boards = $this->board_to_journal_obj->join('t_user','t_user.user_id = t_board_to_journal.user_id','LEFT')->where('t_board_to_journal.journal_id',$data['journal_id'])->where('t_board_to_journal.state',0)->select();
$boards = $this->board_to_journal_obj
->join('t_user','t_user.user_id = t_board_to_journal.user_id','LEFT')
->where('t_board_to_journal.journal_id',$data['journal_id'])
->where('t_board_to_journal.state',0)
->select();
foreach($boards as $k => $v){
$boards[$k]['indexs'] = $this->user_index_obj
->where('user_id',$v['user_id'])
->where('state',0)
->order('year')->select();
}
$re['boards']=$boards;
return jsonSuccess($re);

View File

@@ -111,7 +111,7 @@ class Reviewer extends Controller
->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.user_id','!=',$reviewer_info['user_id'])
->where('t_article.user_id','<>',$reviewer_info['user_id'])
->where('t_article_reviewer.state', 0)
->select();
foreach ($res as $k => $v) {

View File

@@ -33,6 +33,8 @@ class User extends Controller
protected $article_author_obj = '';
protected $user_black_obj = '';
protected $user_to_special_obj = '';
protected $user_index_obj = '';
protected $user_email_index_obj = '';
public function __construct(\think\Request $request = null)
{
@@ -53,6 +55,8 @@ class User extends Controller
$this->article_author_obj = Db::name('article_author');
$this->user_black_obj = Db::name('user_black');
$this->user_to_special_obj = Db::name('user_to_special');
$this->user_index_obj = Db::name('user_index');
$this->user_email_index_obj = Db::name('user_email_index');
}
public function pstest(){
@@ -580,6 +584,52 @@ class User extends Controller
return jsonSuccess([]);
}
/**
* 编辑/添加指数by邮箱
*/
public function editIndexByEmail(){
$data = $this->request->post();
$rule = new Validate([
'email'=>'require',
'year'=>'require',
'index'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->user_email_index_obj->where('email',$data['email'])->where('year',$data['year'])->where('state',0)->find();
if($check){
$this->user_email_index_obj->where('ein_id',$check['ein_id'])->update(['h_index'=>$data['index']]);
}else{
$insert['email'] = $data['email'];
$insert['year'] = $data['year'];
$insert['h_index'] = $data['index'];
$this->user_email_index_obj->insert($insert);
}
return jsonSuccess([]);
}
/**
* 获取指数通过邮箱
*/
public function getIndexByEmail(){
$data = $this->request->post();
$rule = new Validate([
'email'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$list = $this->user_email_index_obj
->where('email',$data['email'])
->where('state',0)
->order('year')
->select();
$re['indexs'] = $list;
return jsonSuccess($re);
}
/**
* @title 降级青年编委至审稿人
* @description 降级青年编委至审稿人