1
This commit is contained in:
@@ -27,10 +27,6 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取文章列表(作者)
|
||||
* @description 获取文章列表(作者)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:用户名
|
||||
* @param name:journal type:int require:1 desc:期刊id
|
||||
* @param name:state type:int require:1 desc:状态id0全部
|
||||
@@ -46,6 +42,10 @@ class Article extends Base
|
||||
* @return transinfo:建议转投信息#
|
||||
* @return major:领域信息#
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticle
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function getArticle()
|
||||
{
|
||||
@@ -75,7 +75,6 @@ class Article extends Base
|
||||
$count = $this->article_obj->where($where)->count();
|
||||
|
||||
|
||||
|
||||
foreach ($res as $key => $val) {
|
||||
//查询建议转投详情
|
||||
$transfer_info = $this->article_transfer_obj
|
||||
@@ -113,7 +112,8 @@ class Article extends Base
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function getPreacceptArticleDetail(){
|
||||
public function getPreacceptArticleDetail()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id" => "require"
|
||||
@@ -124,7 +124,8 @@ class Article extends Base
|
||||
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
|
||||
$production_info = $this->production_article_obj->where("article_id", $article_info['article_id'])->where("state", 0)->find();
|
||||
if (!$production_info) {
|
||||
return jsonSuccess("production error");
|
||||
$this->addProductionEx($data['article_id']);
|
||||
$production_info = $this->production_article_obj->where("article_id", $article_info['article_id'])->where("state", 0)->find();
|
||||
}
|
||||
$refers = $this->production_article_refer_obj->where('p_article_id', $production_info['p_article_id'])->where('state', 0)->select();
|
||||
$re['production'] = $production_info;
|
||||
@@ -132,13 +133,104 @@ class Article extends Base
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**获取预接收内容状态
|
||||
* @return void
|
||||
*/
|
||||
public function getPreacceptStatus(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id" => "require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||
$production_info = $this->production_article_obj->where('article_id',$article_info['article_id'])->where('state',0)->find();
|
||||
//refer状态获取
|
||||
$refers = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->select();
|
||||
$refer_state = true;
|
||||
foreach ($refers as $v){
|
||||
if($v['refer_doi']==""||$v['author']==""){
|
||||
$refer_state = false;
|
||||
}
|
||||
}
|
||||
$re['refer_state'] = $refer_state;
|
||||
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
/**接收文章
|
||||
* @return void
|
||||
*/
|
||||
public function articleAccept(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
|
||||
$user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
|
||||
$editor_info = $this->user_obj->where('user_id',$article_info['editor_id'])->find();
|
||||
//接收后为用户增加积分
|
||||
if ($data['state'] == 5) {
|
||||
if ($journal_info['level'] == 'A') {
|
||||
$score = 1;
|
||||
} elseif ($journal_info['level'] == 'B') {
|
||||
$score = 0.5;
|
||||
} else {
|
||||
$score = 0.3;
|
||||
}
|
||||
addUserScoreLog($user_info['user_id'], $score, "add score " . $score . " for submit article :" . $article_info['accept_sn'], time());
|
||||
$this->user_obj->where('user_id', $user_info['user_id'])->setInc('score', $score);
|
||||
}
|
||||
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
|
||||
$insert_data['article_id'] = $data['article_id'];
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = 5;
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
|
||||
|
||||
$update_data['state'] = 5;
|
||||
$update_data['editor_act'] = 1;
|
||||
$this->article_obj->where("article_id",$data['article_id'])->update($update_data);
|
||||
|
||||
//拒稿或者录用 - 发送审稿意见
|
||||
$this->sendEmailToReviewer($data['article_id'], 5);
|
||||
|
||||
$this->article_obj->where('article_id', $article_info['article_id'])->update(['rtime' => time()]);
|
||||
|
||||
$tt = 'Manuscript ID: ' . $article_info['accept_sn'] . '<br>';
|
||||
$tt .= 'Manuscript Title: ' . $article_info['title'] . '<br>';
|
||||
$tt .= 'Authors’ Name: ' . self::getArticleAuthors($article_info['article_id']) . '<br><br>';
|
||||
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in ' . $journal_info['title'] . ' (ISSN ' . $journal_info['issn'] . ').<br> The editor will contact you further by email soon.<br><br><br>';
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
$tt .= $journal_info['title'] . '<br>';
|
||||
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><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']);
|
||||
|
||||
//增加用户操作log
|
||||
$log_data['user_id'] = $editor_info['user_id'];
|
||||
$log_data['type'] = 1;
|
||||
$log_data['content'] = $editor_info['account'] . "(" . $editor_info['realname'] . "),更改了一篇文章:(" . $article_info['title'] . ")的状态,更改时间是:" . date('Y-m-d H:i:s', time());
|
||||
$log_data['ctime'] = time();
|
||||
$this->user_log_obj->insert($log_data);
|
||||
|
||||
//增加usermsg
|
||||
add_usermsg($article_info['user_id'], 'Your manuscript has new process: ' . $article_info['title'], '/articleDetail?id=' . $article_info['article_id']);
|
||||
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章列表(编辑)
|
||||
* @description 获取文章列表(编辑)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleForEditor
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:编辑用户名
|
||||
* @param name:journal type:int require:1 desc:期刊id
|
||||
* @param name:state type:int require:1 desc:状态
|
||||
@@ -150,6 +242,10 @@ class Article extends Base
|
||||
*
|
||||
* @return articles:文章列表#
|
||||
* @return count:总数#
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleForEditor
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function getArticleForEditor()
|
||||
{
|
||||
@@ -168,7 +264,6 @@ class Article extends Base
|
||||
}
|
||||
|
||||
|
||||
|
||||
//构造查询条件
|
||||
if ($data['journal'] == 0) { //全部期刊
|
||||
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
|
||||
@@ -234,7 +329,7 @@ class Article extends Base
|
||||
|
||||
//添加国家信息
|
||||
foreach ($res as $k => $v) {
|
||||
$cache_author_list = $this->article_author_obj->where('article_id', $v['article_id'])->select();
|
||||
$cache_author_list = $this->article_author_obj->where('article_id', $v['article_id'])->where("state",0)->select();
|
||||
$cache_country = [];
|
||||
foreach ($cache_author_list as $key => $val) {
|
||||
if ($val['country'] != '' && !in_array($val['country'], $cache_country)) {
|
||||
@@ -254,7 +349,7 @@ class Article extends Base
|
||||
foreach ($state_num as $item) {
|
||||
$num_arr[$item['state']] = $item['num'];
|
||||
}
|
||||
for ($i=0;$i<6;$i++){
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$num_frag[$i] = isset($num_arr[$i]) ? $num_arr[$i] : 0;
|
||||
}
|
||||
|
||||
@@ -314,10 +409,6 @@ class Article extends Base
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
@@ -329,6 +420,10 @@ class Article extends Base
|
||||
* @return transinfo:建议转投信息#
|
||||
* @return major:领域信息#
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleDetail
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function getArticleDetail()
|
||||
{
|
||||
@@ -399,7 +494,6 @@ class Article extends Base
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 作者同意转投
|
||||
*/
|
||||
@@ -429,18 +523,6 @@ class Article extends Base
|
||||
$tt1 = 'Dear editor';
|
||||
$tt1 .= 'Please check the new transfer manuscript in the submission system.';
|
||||
|
||||
$sendUser = [
|
||||
'title' => $journal_info['title'], // 邮件标题
|
||||
'content' => $tt1, //邮件内容
|
||||
'user_id' => $journal_info['editor_id'], //收件人ID
|
||||
'email' => $editor_info['email'], // 收件人邮箱
|
||||
'journal_id' => $journal_info['journal_id'], // 期刊ID
|
||||
'sendEmail' => $journal_info['email'], // 期刊邮箱
|
||||
'sendPassword' => $journal_info['epassword'], // 期刊密码
|
||||
'from_name' => $journal_info['title']
|
||||
];
|
||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
//发送消息给编辑
|
||||
@@ -452,12 +534,12 @@ class Article extends Base
|
||||
/**
|
||||
* @title 作者拒绝转投
|
||||
* @description 作者拒绝转投
|
||||
* @param name:transfer_id type:int require:1 desc:转投id
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/trans_manu_no
|
||||
* @method POST
|
||||
*
|
||||
* @param name:transfer_id type:int require:1 desc:转投id
|
||||
*
|
||||
*/
|
||||
public function trans_manu_no()
|
||||
{
|
||||
@@ -621,21 +703,27 @@ class Article extends Base
|
||||
/**
|
||||
* @title 修回文章
|
||||
* @description 修回文章
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/RepairBack
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:作者账号名
|
||||
* @param name:articleId type:int require:1 desc:文章id
|
||||
* @param name:picturesAndTables type:string require:1 desc:Figures
|
||||
* @param name:manuscirpt type:string require:1 desc:文章文件
|
||||
* @param name:responseFile type:string require:0 desc:作者反馈审稿人文件
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/RepairBack
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function RepairBack()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
|
||||
$rule = new Validate([
|
||||
"username"=>"require",
|
||||
"articleId"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$username = $data['username'];
|
||||
$user_res = $this->user_obj->where(['account' => $username])->find();
|
||||
$article_old_info = $this->article_obj->where('article_id', $data['articleId'])->find();
|
||||
@@ -661,24 +749,13 @@ class Article extends Base
|
||||
//发送邮件
|
||||
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
|
||||
$tt = 'Dear editor,<br>';
|
||||
$tt .= 'The author changed the manuscript’s status, please check.<br><br>';
|
||||
$tt .= 'The author has repair, please check.<br><br>';
|
||||
$tt .= 'TMR Publishing Group';
|
||||
|
||||
// $sendUser=[
|
||||
// 'title'=> $journal_info['title'], // 邮件标题
|
||||
// 'content'=>$tt,//邮件内容
|
||||
// 'user_id'=>$user_res['user_id'], //收件人ID
|
||||
// 'email'=>$editor_info['email'],// 收件人邮箱
|
||||
// 'journal_id'=>$journal_info['journal_id'], // 期刊ID
|
||||
// 'sendEmail'=>$journal_info['email'], // 期刊邮箱
|
||||
// 'sendPassword'=>$journal_info['epassword'], // 期刊密码
|
||||
// 'from_name'=>$journal_info['title']
|
||||
// ];
|
||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
$res2 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['picturesAndTables'], 'picturesAndTables');
|
||||
$res3 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
|
||||
$res4 = self::save_article_file($data['articleId'], $user_res['user_id'], $user_res['account'], $data['supplementary'], 'supplementary');
|
||||
|
||||
//作者反馈审稿人信息文件
|
||||
$res_response = true;
|
||||
@@ -700,7 +777,7 @@ class Article extends Base
|
||||
//增加usermsg
|
||||
$umsg_res = add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
|
||||
|
||||
if ($msg_res && $res2 && $res3 && $log_res && $umsg_res && $res_response) {
|
||||
if ($msg_res && $res2 && $res3 && $res4 && $log_res && $umsg_res && $res_response) {
|
||||
Db::commit();
|
||||
return json(['code' => 0]);
|
||||
} else {
|
||||
@@ -712,14 +789,14 @@ class Article extends Base
|
||||
/**
|
||||
* @title 发送留言板消息
|
||||
* @description 发送留言板消息
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/pushArticleDialog
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:username type:String require:1 desc:发送者用户名
|
||||
* @param name:ad_content type:String require:1 desc:内容
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/pushArticleDialog
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function pushArticleDialog()
|
||||
{
|
||||
@@ -738,15 +815,15 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取留言板消息列表
|
||||
* @description 获取留言板消息列表
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleDialogs
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*
|
||||
* @return dialogs:消息列表@
|
||||
* @dialogs ad_id:主键 article_id:文章id user_id:用户id username:用户名 ad_content:消息 ad_time:时间 ad_state:状态
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleDialogs
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function getArticleDialogs()
|
||||
{
|
||||
@@ -765,13 +842,13 @@ class Article extends Base
|
||||
/**
|
||||
* @title 添加修回页修回意见(编辑)
|
||||
* @description 添加修回页修回意见(编辑)
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:proposal_file type:String require:1 desc:文件地址
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/addArticleProposal
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:proposal_file type:String require:1 desc:文件地址
|
||||
*
|
||||
*/
|
||||
public function addArticleProposal()
|
||||
{
|
||||
@@ -786,14 +863,14 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取修回页修回意见列表
|
||||
* @description 获取修回页修回意见列表
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleProposals
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*
|
||||
* @return proposals:意见列表@
|
||||
* @proposals proposal_id:主键 proposal_file:文件地址 ap_ctime:添加时间
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleProposals
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function getArticleProposals()
|
||||
{
|
||||
@@ -873,10 +950,6 @@ class Article extends Base
|
||||
/**
|
||||
* @title 修改文章状态(编辑)
|
||||
* @description 修改文章状态(编辑)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/editArticleEditor
|
||||
* @method POST
|
||||
*
|
||||
* @param name:editname type:String require:1 desc:编辑名字
|
||||
* @param name:articleId type:int require:1 desc:文章id
|
||||
* @param name:state type:int require:1 desc:状态代码
|
||||
@@ -885,6 +958,10 @@ class Article extends Base
|
||||
* @param name:proposal_content type:string require:0 desc:退修编辑意见文件
|
||||
*
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/editArticleEditor
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function editArticleEditor()
|
||||
{
|
||||
@@ -899,10 +976,12 @@ class Article extends Base
|
||||
$user_info = $this->user_obj->where(['user_id' => $article_info['user_id']])->find();
|
||||
$user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_info['user_id'])->find();
|
||||
|
||||
//防止编辑误操作其他期刊的文章
|
||||
if ($editor_info['user_id'] != $journal_info['editor_id']) {
|
||||
return jsonError("insufficient privilege");
|
||||
}
|
||||
|
||||
//接收或拒绝文章后不可再更改文章状态
|
||||
if ($article_info['state'] == 5 || $article_info['state'] == 3) {
|
||||
return jsonError("Status cannot be changed");
|
||||
}
|
||||
@@ -924,8 +1003,8 @@ class Article extends Base
|
||||
//初审分数不够,自动拒稿
|
||||
if ($article_info['state'] == 0 && $article_info['type'] != 'N' && $article_info['type'] != 'T') {
|
||||
// if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 21 && $article_info['scoring'] < 0) || (($journal_info['journal_id'] == 16||$journal_info['journal_id'] == 6||$journal_info['journal_id'] == 12) && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 6 && $journal_info['journal_id'] != 16 && $journal_info['journal_id'] != 12 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 21 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1)) {
|
||||
if($article_info['scoring']<$journal_info['kfen']){
|
||||
if (count($transfer_list) > 0) {
|
||||
if ($article_info['scoring'] < $journal_info['kfen']) {//触发拒稿
|
||||
if (count($transfer_list) > 0) {//如果没有共同投稿
|
||||
//查询转投期刊信息
|
||||
$transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
|
||||
//转投
|
||||
@@ -958,11 +1037,6 @@ class Article extends Base
|
||||
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
|
||||
$tt .= 'Website: ' . $tran_journal['website'];
|
||||
|
||||
$sendUser['user_id'] = $user_info['user_id'];
|
||||
$sendUser['email'] = $user_info['email'];
|
||||
$sendUser['content'] = $tt;
|
||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||
|
||||
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
//发送邮件提醒编辑有新的转投稿件
|
||||
@@ -975,7 +1049,7 @@ class Article extends Base
|
||||
|
||||
return json(['code' => 0]);
|
||||
|
||||
} else {
|
||||
} else {//有共同投稿的情况下
|
||||
$this->article_obj->where('article_id', $article_info['article_id'])->update(['state' => 3]);
|
||||
$tt = '"' . $article_info['title'] . '"<br>';
|
||||
$tt .= $article_info['accept_sn'] . '<br>';
|
||||
@@ -1002,17 +1076,8 @@ class Article extends Base
|
||||
}
|
||||
}
|
||||
|
||||
// 发送邮件内容
|
||||
$sendUser = [
|
||||
'title' => $journal_info['title'], // 邮件标题
|
||||
'user_id' => $user_info['user_id'],
|
||||
'email' => $user_info['email'],
|
||||
'journal_id' => $journal_info['journal_id'], // 期刊ID
|
||||
'sendEmail' => $journal_info['email'], // 期刊邮箱
|
||||
'sendPassword' => $journal_info['epassword'], // 期刊密码
|
||||
'from_name' => $journal_info['title']
|
||||
];
|
||||
if ($data['state'] == 3 && count($transfer_list) > 0) {
|
||||
//执行文章各方面相关的操作
|
||||
if ($data['state'] == 3 && count($transfer_list) > 0) {//如果是拒稿。并且有共同投稿
|
||||
//查询转投期刊信息
|
||||
$transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
|
||||
//转投
|
||||
@@ -1046,11 +1111,6 @@ class Article extends Base
|
||||
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
|
||||
$tt .= 'Website: ' . $tran_journal['website'];
|
||||
|
||||
$sendUser['user_id'] = $user_info['user_id'];
|
||||
$sendUser['email'] = $user_info['email'];
|
||||
$sendUser['content'] = $tt;
|
||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||
|
||||
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
//发送邮件提醒编辑有新的转投稿件
|
||||
@@ -1062,9 +1122,9 @@ class Article extends Base
|
||||
add_usermsg($tran_journal['editor_id'], 'New transfer manuscript ', '/articleDetailEditor?id=' . $article_info['article_id']);
|
||||
|
||||
return json(['code' => 0]);
|
||||
} else {
|
||||
} else {//其他状态下的流程操作
|
||||
//接收文章,必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章
|
||||
if ($data['state'] == 5 && $article_info['type'] != "N" && $article_info['type'] != "T" && $article_info['type'] != "LTE" && $article_info['journal_id'] != 21) {
|
||||
if ($data['state'] == 6 && $article_info['type'] != "N" && $article_info['type'] != "T" && $article_info['type'] != "LTE" && $article_info['journal_id'] != 21) {
|
||||
//定义符合条件的数量
|
||||
$rev_real_num = 0;
|
||||
//获取通过的审稿意见数,必须大于两个
|
||||
@@ -1092,23 +1152,22 @@ class Article extends Base
|
||||
}
|
||||
}
|
||||
//接收必须查重小于20%
|
||||
if ($data['state'] == 5 && $article_info['repetition'] > 25) {
|
||||
if ($data['state'] == 6 && $article_info['repetition'] > 25) {
|
||||
return jsonError("Submissions with a repetition rate greater than thirty percent will not be accepted");
|
||||
}
|
||||
|
||||
//接收后为用户增加积分
|
||||
if($data['state']==5){
|
||||
$score = 0;
|
||||
if($journal_info['level']=='A'){
|
||||
$score=1;
|
||||
}elseif($journal_info['level']=='B'){
|
||||
$score=0.5;
|
||||
}else{
|
||||
$score=0.3;
|
||||
}
|
||||
addUserScoreLog($user_info['user_id'],$score,"add score ".$score." for submit article :".$article_info['accept_sn'],time());
|
||||
$this->user_obj->where('user_id',$user_info['user_id'])->setInc('score',$score);
|
||||
}
|
||||
// if ($data['state'] == 5) {
|
||||
// if ($journal_info['level'] == 'A') {
|
||||
// $score = 1;
|
||||
// } elseif ($journal_info['level'] == 'B') {
|
||||
// $score = 0.5;
|
||||
// } else {
|
||||
// $score = 0.3;
|
||||
// }
|
||||
// addUserScoreLog($user_info['user_id'], $score, "add score " . $score . " for submit article :" . $article_info['accept_sn'], time());
|
||||
// $this->user_obj->where('user_id', $user_info['user_id'])->setInc('score', $score);
|
||||
// }
|
||||
|
||||
|
||||
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
|
||||
@@ -1144,9 +1203,14 @@ class Article extends Base
|
||||
if ($article_info['journal_id'] == 1 && ($data['state'] == 3 || $data['state'] == 5)) {
|
||||
$this->sendEmailToReviewer($data['articleId'], $data['state']);
|
||||
}
|
||||
|
||||
//为预接收的文章生成production实例
|
||||
if($data['state'] == 6){
|
||||
$this->addProductionEx($data['articleId']);
|
||||
}
|
||||
}
|
||||
|
||||
//发送文章状态更改邮件
|
||||
//发送文章状态更改邮件给作者
|
||||
if ($data['state'] == 3) { //拒稿
|
||||
if ($data['trsjournal'] == 0) {
|
||||
$tt = '"' . $article_info['title'] . '"<br>';
|
||||
@@ -1180,13 +1244,6 @@ class Article extends Base
|
||||
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in ' . $journal_info['title'] . ' (ISSN ' . $journal_info['issn'] . ').<br> The editor will contact you further by email soon.<br><br><br>';
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
} else if ($data['state'] == 4) { //退修
|
||||
// $tt = $article_info['accept_sn'] . '<br>';
|
||||
// $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',<br>';
|
||||
// $tt .= 'Thank you for submitting the manuscript to ' . $journal_info['title'] . '. <br>';
|
||||
// $tt .= 'Please find the new comments in the "<a href="http://submission.tmrjournals.com/submission?journal=' . $journal_info['alias'] . '">Author Center</a>", Please submit your revised manuscript within two weeks.<br><br>';
|
||||
// $tt .= 'If you need more time to revise, you can send E-mial to tell us.<br>';
|
||||
// $tt .= "Please also find the Manuscript Check List attached. Check and complete each item one by one. If you could put the completed form on the revised manuscript's last page, it would speed up the processing process of the manuscript. Please note that this is voluntary.<br><br>";
|
||||
// $tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
$tt = $article_info['accept_sn'] . "——" . $article_info['title'] . "<br/>";
|
||||
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',<br>';
|
||||
$tt .= "Thank you for submitting the manuscript to " . $journal_info['title'] . ".<br/>";
|
||||
@@ -1219,18 +1276,12 @@ class Article extends Base
|
||||
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><br>';
|
||||
$tt .= 'Email: ' . $journal_info['email'] . '<br>';
|
||||
$tt .= 'Website: ' . $journal_info['website'];
|
||||
// if ($data['state'] != 5) {//不接收的邮件发送
|
||||
$sendUser['content'] = $tt;
|
||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||
if ($data['state'] == 4) {
|
||||
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword'], ROOT_PATH . 'public' . DS . 'system' . DS . 'Checklist_new.docx');
|
||||
} else {
|
||||
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
}
|
||||
// }else{//接收文章时应该发送到所有人上,包括所有作者和上传用户
|
||||
|
||||
|
||||
// }
|
||||
// if ($data['state'] == 6) { //进入终审,通知主编邮件
|
||||
// $chiefs = $this->chief_to_journal_obj->join('t_user', 't_user.user_id = t_chief_to_journal.user_id', 'left')->where('t_chief_to_journal.journal_id', $journal_info['journal_id'])->where('t_chief_to_journal.state', 0)->select();
|
||||
// foreach ($chiefs as $v) {
|
||||
@@ -1277,7 +1328,8 @@ class Article extends Base
|
||||
/**获取拒绝文章列表
|
||||
* @return void
|
||||
*/
|
||||
public function getRejectArticles(){
|
||||
public function getRejectArticles()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"pageIndex" => "require",
|
||||
@@ -1373,13 +1425,13 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取期刊by领域
|
||||
* @description 获取期刊by领域
|
||||
* @param name:major_id type:int require:1 desc:领域id
|
||||
*
|
||||
* @return journals:期刊列表#
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getJournalsByMajor
|
||||
* @method POST
|
||||
*
|
||||
* @param name:major_id type:int require:1 desc:领域id
|
||||
*
|
||||
* @return journals:期刊列表#
|
||||
*/
|
||||
public function getJournalsByMajor()
|
||||
{
|
||||
@@ -1411,14 +1463,14 @@ class Article extends Base
|
||||
/**
|
||||
* @title 更改重复率(编辑)
|
||||
* @description 更改重复率(编辑)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/changeRepetition
|
||||
* @method POST
|
||||
*
|
||||
* @param name:articleId type:int require:1 desc:文章id
|
||||
* @param name:repefen type:string require:1 desc:重复数字
|
||||
* @param name:zipurl type:string require:1 desc:查重文件地址
|
||||
*
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/changeRepetition
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function changeRepetition()
|
||||
{
|
||||
@@ -1526,7 +1578,6 @@ class Article extends Base
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加文章审稿实例(编辑)
|
||||
*/
|
||||
@@ -1654,10 +1705,6 @@ class Article extends Base
|
||||
/**
|
||||
* @title 添加文章(投稿)
|
||||
* @description 添加文章(投稿)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/addArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:用户名
|
||||
* @param name:journal type:int require:1 desc:期刊id
|
||||
* @param name:title type:int require:1 desc:标题
|
||||
@@ -1671,6 +1718,10 @@ class Article extends Base
|
||||
*
|
||||
* @return articles:文章列表#
|
||||
* @return count:总数#
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/addArticle
|
||||
* @method POST
|
||||
*
|
||||
*/
|
||||
public function addArticle()
|
||||
{
|
||||
@@ -1995,7 +2046,8 @@ class Article extends Base
|
||||
/**获取期刊话题
|
||||
* @return void
|
||||
*/
|
||||
public function getJournalTopics(){
|
||||
public function getJournalTopics()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'journal_id' => "require"
|
||||
@@ -2087,7 +2139,6 @@ class Article extends Base
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加文章文件
|
||||
*/
|
||||
@@ -2280,9 +2331,6 @@ class Article extends Base
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取文章通讯作者信息
|
||||
*/
|
||||
@@ -2444,7 +2492,8 @@ class Article extends Base
|
||||
if ($article_info['type'] == "A") {
|
||||
if ($all_num < 1) {
|
||||
$jan_fen1 = 1;
|
||||
}if($all_num<2){
|
||||
}
|
||||
if ($all_num < 2) {
|
||||
$jan_fen1 = 0.5;
|
||||
}
|
||||
} elseif ($article_info['type'] == "B") {
|
||||
@@ -2458,9 +2507,6 @@ class Article extends Base
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//国家
|
||||
$c_fen = 0;
|
||||
$author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find();
|
||||
@@ -2586,12 +2632,12 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取待审文章
|
||||
* @description 获取待审文章
|
||||
* @return articles:待审稿件#
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getReviewerArticles
|
||||
* @method POST
|
||||
*
|
||||
*
|
||||
* @return articles:待审稿件#
|
||||
*/
|
||||
public function getReviewerArticles()
|
||||
{
|
||||
@@ -2606,13 +2652,13 @@ class Article extends Base
|
||||
/**
|
||||
* @title 获取待审文章
|
||||
* @description 获取待审文章
|
||||
* @param name:issn type:string require:1 desc:issn
|
||||
*
|
||||
* @return articles:待审稿件#
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getReviewerArticlesForJournal
|
||||
* @method POST
|
||||
*
|
||||
* @param name:issn type:string require:1 desc:issn
|
||||
*
|
||||
* @return articles:待审稿件#
|
||||
*/
|
||||
public function getReviewerArticlesForJournal()
|
||||
{
|
||||
@@ -2756,6 +2802,7 @@ class Article extends Base
|
||||
$list = $this->journal_obj->where($where)->select();
|
||||
return json($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取期刊列表
|
||||
*/
|
||||
@@ -2800,13 +2847,13 @@ class Article extends Base
|
||||
/**
|
||||
* @title 上传编辑修回意见文件
|
||||
* @description 上传编辑修回意见文件
|
||||
* @param name:name type:string require:1 default:articleProposal desc:文件域名称
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/up_proposal_file
|
||||
* @method POST
|
||||
*
|
||||
* @param name:name type:string require:1 default:articleProposal desc:文件域名称
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
*/
|
||||
public function up_proposal_file()
|
||||
{
|
||||
@@ -2973,8 +3020,6 @@ class Article extends Base
|
||||
// 给审稿人发送邮件- 稿件的基本情况
|
||||
public function sendEmailToReviewer($articleId, $state)
|
||||
{
|
||||
//articleId = 1037;
|
||||
//$state = 3;
|
||||
$resState = $state == 3 ? "Reject" : "Accept";
|
||||
$allArticleReviewer = $this->article_reviewer_obj->field('t_user.email,t_user.realname,t_article_reviewer.reviewer_id,t_article_reviewer_question.recommend,t_article_reviewer_question.comments')
|
||||
->join('t_article_reviewer_question', 't_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id', 'LEFT')
|
||||
@@ -3036,6 +3081,7 @@ class Article extends Base
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 留言板留言文章显示红点并发送邮件
|
||||
* @param $article_id
|
||||
@@ -3073,7 +3119,8 @@ class Article extends Base
|
||||
/**编辑消息一键全读
|
||||
* @return void
|
||||
*/
|
||||
public function allEditorMsgReaded(){
|
||||
public function allEditorMsgReaded()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'editor_id' => 'require'
|
||||
|
||||
@@ -231,7 +231,8 @@ class Base extends Controller
|
||||
return $frag;
|
||||
}
|
||||
|
||||
public function getMajorOne($major_id){
|
||||
public function getMajorOne($major_id)
|
||||
{
|
||||
$major_info = $this->major_obj->where('major_id', $major_id)->find();
|
||||
return $major_info['major_title'];
|
||||
}
|
||||
@@ -272,6 +273,81 @@ class Base extends Controller
|
||||
return substr($frag, 0, -1);
|
||||
}
|
||||
|
||||
public function addProductionEx($article_id)
|
||||
{
|
||||
$check = $this->production_article_obj->where('article_id', $article_id)->where('state', 0)->find();
|
||||
if ($check) {
|
||||
return 'Instance already exists';
|
||||
}
|
||||
|
||||
$article_info = $this->article_obj->where('article_id', $article_id)->find();
|
||||
$files = $this->article_file_obj
|
||||
->where('article_id', $article_info['article_id'])
|
||||
->where('type_name', 'manuscirpt')
|
||||
->order('ctime desc')
|
||||
->limit(1)
|
||||
->select();
|
||||
if (count($files) == 0) {
|
||||
return jsonError('No Manuscript');
|
||||
}
|
||||
|
||||
$url = "http://ts.tmrjournals.com/api/typeset/webReaddoc";
|
||||
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
|
||||
$res = object_to_array(json_decode(myPost($url, $program)));
|
||||
$file_runs = $res['data'];
|
||||
|
||||
//整理信息
|
||||
$frag = [];
|
||||
$aa = [];
|
||||
$frag['title'] = $article_info['title'];
|
||||
$start_refer = false;
|
||||
foreach ($file_runs as $k => $v) {
|
||||
if ($start_refer && $v != '') {
|
||||
if (strlen($v) > 500) {
|
||||
$start_refer = false;
|
||||
$frag['main'][] = $v;
|
||||
continue;
|
||||
}
|
||||
$frag['references'][] = $v;
|
||||
continue;
|
||||
}
|
||||
$g_val = trim(preg_replace('/\<.*?\>/', '', $v));
|
||||
$aa[] = $g_val;
|
||||
|
||||
if ((strpos(strtolower(trim($g_val)), "keyword") == 0 || strpos(strtolower(trim($g_val)), "keyword") == 1) && !isset($frag['keywords'])) {
|
||||
$frag['keywords'] = $v;
|
||||
continue;
|
||||
}
|
||||
if (strtolower($g_val) == 'reference:' || strtolower($g_val) == 'references:' || strtolower($g_val) == 'references' || strtolower($g_val) == 'reference') {
|
||||
$start_refer = true;
|
||||
continue;
|
||||
}
|
||||
$frag['main'][] = $v;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($frag['main'])) {
|
||||
return jsonError("manuscript file error!");
|
||||
}
|
||||
|
||||
$insert['main'] = isset($frag['main']) ? json_encode($frag['main']) : '';
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['journal_id'] = $article_info['journal_id'];
|
||||
$insert['ctime'] = time();
|
||||
$p_article_id = $this->production_article_obj->insertGetId($insert);
|
||||
|
||||
|
||||
//将主体内容写入数据库
|
||||
foreach ($frag['main'] as $v) {
|
||||
$ca['p_article_id'] = $p_article_id;
|
||||
$ca['content'] = $v;
|
||||
$ca['content_g'] = '';
|
||||
$ca['ctime'] = time();
|
||||
$this->production_article_main_obj->insert($ca);
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function getCvs($user_id)
|
||||
{
|
||||
@@ -388,7 +464,8 @@ class Base extends Controller
|
||||
return $frag;
|
||||
}
|
||||
|
||||
public function creatUserCode($str){
|
||||
public function creatUserCode($str)
|
||||
{
|
||||
$hashids = hashids::instance(8, "tmrjournals");
|
||||
return $hashids->encode($str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user