diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php
index 7d3d349..70282d5 100644
--- a/application/api/controller/Article.php
+++ b/application/api/controller/Article.php
@@ -27,17 +27,13 @@ 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全部
* @param name:name type:string require:1 desc:查询条件
* @param name:pageIndex type:int require:1 desc:页码
* @param name:pageSize type:int require:1 desc:单页条数
- *
+ *
* @return article:文章信息#
* @return msg:文章跟踪信息#
* @return authors:作者信息#
@@ -45,7 +41,11 @@ class Article extends Base
* @return transfer:转投信息#
* @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,58 @@ 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"
+ ]);
+ 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();
+ if (!$production_info) {
+ $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;
+ $re['refers'] = $refers;
+ 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"
@@ -121,24 +171,66 @@ class Article extends Base
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();
- if(!$production_info){
- return jsonSuccess("production error");
+ $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);
}
- $refers = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->select();
- $re['production'] = $production_info;
- $re['refers'] = $refers;
- return jsonSuccess($re);
+ //添加文章状态信息(如果状态未更新可做通话用,并结束操作)
+ $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'] . '
';
+ $tt .= 'Manuscript Title: ' . $article_info['title'] . '
';
+ $tt .= 'Authors’ Name: ' . self::getArticleAuthors($article_info['article_id']) . '
';
+ $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in ' . $journal_info['title'] . ' (ISSN ' . $journal_info['issn'] . ').
The editor will contact you further by email soon.
';
+ $tt .= 'Sincerely,
Editorial Office
';
+ $tt .= $journal_info['title'] . '
';
+ $tt .= 'Subscribe to this journal
';
+ $tt .= 'Email: ' . $journal_info['email'] . '
';
+ $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:状态
@@ -147,9 +239,13 @@ class Article extends Base
* @param name:special_num type:int require:1 desc:客座num
* @param name:pageIndex type:int require:1 desc:当前页码
* @param name:pageSize type:int require:1 desc:每个页面的数据条数
- *
+ *
* @return articles:文章列表#
* @return count:总数#
+ * @author wangjinlei
+ * @url /api/Article/getArticleForEditor
+ * @method POST
+ *
*/
public function getArticleForEditor()
{
@@ -159,8 +255,8 @@ class Article extends Base
if (isset($data['sn']) && trim($data['sn']) != "") {
$where["t_article.accept_sn"] = trim($data['sn']);
- $sn_info = $this->article_obj->where('accept_sn',trim($data['sn']))->find();
- if(!$sn_info){
+ $sn_info = $this->article_obj->where('accept_sn', trim($data['sn']))->find();
+ if (!$sn_info) {
return jsonError("Article not found");
}
$data['journal'] = $sn_info['journal_id'];
@@ -168,7 +264,6 @@ class Article extends Base
}
-
//构造查询条件
if ($data['journal'] == 0) { //全部期刊
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
@@ -208,7 +303,7 @@ class Article extends Base
foreach ($res as $key => $val) {
$cache_review = $this->article_reviewer_obj
->field("t_article_reviewer.*,t_article_reviewer_question.rated")
- ->join("t_article_reviewer_question","t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id",'left')
+ ->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", $val['article_id'])
->where("t_article_reviewer.state", 'in', [0, 1, 2, 3])
->select();
@@ -224,7 +319,7 @@ class Article extends Base
$res[$key]['reports'] = $this->getReportAuthors($val['article_id']);
//添加file
- $res_file = $this->article_file_obj->where("article_id",$val['article_id'])->select();
+ $res_file = $this->article_file_obj->where("article_id", $val['article_id'])->select();
$file_frag = [];
foreach ($res_file as $v) {
$file_frag[$v['type_name']][] = $v;
@@ -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,14 +349,14 @@ class Article extends Base
foreach ($state_num as $item) {
$num_arr[$item['state']] = $item['num'];
}
- for ($i=0;$i<6;$i++){
- $num_frag[$i] = isset($num_arr[$i])?$num_arr[$i]:0;
+ for ($i = 0; $i < 7; $i++) {
+ $num_frag[$i] = isset($num_arr[$i]) ? $num_arr[$i] : 0;
}
$count = $this->article_obj->where($where)->count();
- return json(['total' => $count, 'data' => $res,"state_num"=>$num_frag]);
+ return json(['total' => $count, 'data' => $res, "state_num" => $num_frag]);
}
private function getReportAuthors($article_id)
@@ -314,13 +409,9 @@ 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
- *
+ *
* @return article:文章信息#
* @return msg:文章跟踪信息#
* @return authors:作者信息#
@@ -328,7 +419,11 @@ class Article extends Base
* @return transfer:转投信息#
* @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,
';
- $tt .= 'The author changed the manuscript’s status, please check.
';
+ $tt .= 'The author has repair, please check.
';
$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 获取留言板消息列表
+ * @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
- *
- * @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:状态
- *
+ *
*/
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 获取修回页修回意见列表
+ * @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
- *
- * @param name:article_id type:int require:1 desc:文章id
- *
- * @return proposals:意见列表@
- * @proposals proposal_id:主键 proposal_file:文件地址 ap_ctime:添加时间
+ *
*/
public function getArticleProposals()
{
@@ -873,18 +950,18 @@ 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:状态代码
* @param name:editormsg type:String require:1 desc:携带的消息(以后会废除)
* @param name:trsjournal type:int require:0 desc:转投期刊id(拒稿时候是必传,不推荐转投的为0)
* @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 ($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");
}
@@ -912,20 +991,20 @@ class Article extends Base
$h_check = false;
foreach ($authors as $v) {
$cache_report = $this->user_obj->where('email', $v['email'])->find();
- if ($cache_report==null||$article_info['state'] != 0 || $cache_report['google_time'] != 0|| $cache_report['google_index'] != 0 || $data['state'] == 3) {
+ if ($cache_report == null || $article_info['state'] != 0 || $cache_report['google_time'] != 0 || $cache_report['google_index'] != 0 || $data['state'] == 3) {
$h_check = true;
break;
}
}
- if ($article_info['state'] == 0&&$authors && $h_check == false) {
+ if ($article_info['state'] == 0 && $authors && $h_check == false) {
return jsonError('Please complete the H-index before proceeding');
}
//初审分数不够,自动拒稿
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();
//转投
@@ -948,7 +1027,7 @@ class Article extends Base
$tt = '"' . $article_info['title'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
$tt .= 'journal:' . $journal_info['title'] . '
';
-
+
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
$tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '. Your manuscript has undergone review.
';
$tt .= 'Unfortunately the editors feel that ' . $journal_info['title'] . ' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - ' . $tran_journal['title'] . ' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.
Yours sincerely,
';
@@ -957,25 +1036,20 @@ class Article extends Base
$tt .= 'Subscribe to this journal
';
$tt .= 'Email: ' . $journal_info['email'] . '
';
$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']);
-
+
//发送邮件提醒编辑有新的转投稿件
$tt1 = 'Dear editor';
$tt1 .= 'Please check the new transfer manuscript in the submission system.';
sendEmail($trans_editor_info['email'], $journal_info['title'], $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword']);
-
+
//增加usermsg
add_usermsg($tran_journal['editor_id'], 'New transfer manuscript ', '/articleDetailEditor?id=' . $article_info['article_id']);
-
+
return json(['code' => 0]);
- } else {
+ } else {//有共同投稿的情况下
$this->article_obj->where('article_id', $article_info['article_id'])->update(['state' => 3]);
$tt = '"' . $article_info['title'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
@@ -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'] . '
';
$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'] . '"
';
@@ -1180,16 +1244,9 @@ class Article extends Base
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in ' . $journal_info['title'] . ' (ISSN ' . $journal_info['issn'] . ').
The editor will contact you further by email soon.
';
$tt .= 'Sincerely,
Editorial Office
';
} else if ($data['state'] == 4) { //退修
-// $tt = $article_info['accept_sn'] . '
';
-// $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
-// $tt .= 'Thank you for submitting the manuscript to ' . $journal_info['title'] . '.
';
-// $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.
';
-// $tt .= 'If you need more time to revise, you can send E-mial to tell us.
';
-// $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.
";
-// $tt .= 'Sincerely,
Editorial Office
';
- $tt = $article_info['accept_sn'] ."——".$article_info['title']."
";
+ $tt = $article_info['accept_sn'] . "——" . $article_info['title'] . "
";
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
- $tt .="Thank you for submitting the manuscript to ".$journal_info['title'].".
";
+ $tt .= "Thank you for submitting the manuscript to " . $journal_info['title'] . ".
";
$tt .= "The reviewers have given professional comments and suggestions on your manuscript which you can find in the Author Center. Please submit your revised manuscript within two weeks in the manuscript central. And please mark all modification in blue and reply the reviewer's comments one by one.
";
$tt .= "If you need more time or you have any other plans for this manuscript, please feel free to e-mail us in time.
";
$tt .= "Before submitting the revised manuscript, please check and complete the following items. If you want see more matters, please find the attached Manuscript Checklist.
";
@@ -1210,7 +1267,7 @@ class Article extends Base
$tt = 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
$tt .= 'Manuscript status: Your manuscript "' . $article_info['title'] . '" is under reviewing by editorial member team of ' . $journal_info['title'] . '.';
} else {
- $tt = '"' . $article_info['title'] . '"
';
+ $tt = '"' . $article_info['title'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
$tt .= 'journal:' . $journal_info['title'] . '
';
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
Please check the new status of your manuscript online.
';
@@ -1219,18 +1276,12 @@ class Article extends Base
$tt .= 'Subscribe to this journal
';
$tt .= 'Email: ' . $journal_info['email'] . '
';
$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'] == 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']);
+ }
-
- // }
// 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,21 +1328,22 @@ class Article extends Base
/**获取拒绝文章列表
* @return void
*/
- public function getRejectArticles(){
+ public function getRejectArticles()
+ {
$data = $this->request->post();
$rule = new Validate([
- "pageIndex"=>"require",
- "pageSize"=>"require"
+ "pageIndex" => "require",
+ "pageSize" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $list = $this->article_obj->where('state',3)->page($data['pageIndex'],$data['pageSize'])->order('article_id desc')->select();
- foreach ($list as $key => $val){
+ $list = $this->article_obj->where('state', 3)->page($data['pageIndex'], $data['pageSize'])->order('article_id desc')->select();
+ foreach ($list as $key => $val) {
$list[$key]['author'] = $this->article_author_obj->where('article_id', $val['article_id'])->where('state', 0)->select();
- $list[$key]['user'] = $this->user_obj->where('user_id',$val['user_id'])->find();
+ $list[$key]['user'] = $this->user_obj->where('user_id', $val['user_id'])->find();
}
- $count = $this->article_obj->where('state',3)->count();
+ $count = $this->article_obj->where('state', 3)->count();
$re['articles'] = $list;
$re['count'] = $count;
return jsonSuccess($re);
@@ -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()
{
@@ -1426,14 +1478,14 @@ class Article extends Base
$data = $this->request->post();
$this->article_obj->where('article_id', $data['articleId'])->update(['repetition' => $data['repefen'], 'repeurl' => $data['zipurl']]);
//当文章重复率大于50%时,拒稿,拉作者进黑名单
- if($data['repefen']>=50){
- $article_info = $this->article_obj->where('article_id',$data['articleId'])->find();
- $user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
+ if ($data['repefen'] >= 50) {
+ $article_info = $this->article_obj->where('article_id', $data['articleId'])->find();
+ $user_info = $this->user_obj->where('user_id', $article_info['user_id'])->find();
$insert['user_id'] = $data['user_id'];
$insert['reason'] = "The author was blacklisted due to the check rate exceeded 50%";
$insert['black_ctime'] = time();
$this->user_black_obj->insert($insert);
- $this->article_obj->where('article_id',$data['articleId'])->update(['state'=>3]);
+ $this->article_obj->where('article_id', $data['articleId'])->update(['state' => 3]);
}
return json(['code' => 0]);
}
@@ -1526,7 +1578,6 @@ class Article extends Base
}
-
/**
* 添加文章审稿实例(编辑)
*/
@@ -1542,8 +1593,8 @@ class Article extends Base
$reviewer_move = $this->user_reviewer_info_obj->where("reviewer_info_id", $reviewer_info['user_id'])->find();
// $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
- $check = $this->article_reviewer_obj->where('reviewer_id',$data['uid'])->where('article_id',$data['articleId'])->find();
- if($check){
+ $check = $this->article_reviewer_obj->where('reviewer_id', $data['uid'])->where('article_id', $data['articleId'])->find();
+ if ($check) {
return jsonError("Invitation record already exists!");
}
@@ -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:标题
@@ -1668,9 +1715,13 @@ class Article extends Base
* @param name:approval type:string require:1 desc:true/false
* @param name:abstrart type:string require:1 desc:简介
* @param name:authorList type:array require:1 desc:作者
- *
+ *
* @return articles:文章列表#
* @return count:总数#
+ * @author wangjinlei
+ * @url /api/Article/addArticle
+ * @method POST
+ *
*/
public function addArticle()
{
@@ -1963,14 +2014,14 @@ class Article extends Base
$inset_data['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : '';
$inset_data['fund'] = isset($data['fund']) ? trim($data['fund']) : '';
$inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
- $inset_data['topics'] = isset($data["topics"])?json_encode($data['topics']):"";
+ $inset_data['topics'] = isset($data["topics"]) ? json_encode($data['topics']) : "";
$inset_data['type'] = $data['type'];
$inset_data['major_id'] = $data['major'];
$inset_data['ctime'] = time();
$inset_data['state'] = -1;
$article_id = $this->article_obj->insertGetId($inset_data);
} else {
- $checkArticle = $this->article_obj->where("article_id","<>",$article_id)->where("title", trim($data['title']))->select();
+ $checkArticle = $this->article_obj->where("article_id", "<>", $article_id)->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!']);
@@ -1982,7 +2033,7 @@ class Article extends Base
$up['title'] = trim($data['title']);
$up['abstrart'] = trim($data['abstrart']);
$up['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : '';
- $up['topics'] = isset($data["topics"])?json_encode($data['topics']):"";
+ $up['topics'] = isset($data["topics"]) ? json_encode($data['topics']) : "";
$up['fund'] = isset($data['fund']) ? trim($data['fund']) : '';
$up['type'] = $data['type'];
$up['major_id'] = $data['major'];
@@ -1995,18 +2046,19 @@ class Article extends Base
/**获取期刊话题
* @return void
*/
- public function getJournalTopics(){
+ public function getJournalTopics()
+ {
$data = $this->request->post();
$rule = new Validate([
'journal_id' => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
$url = "http://journalapi.tmrjournals.com/public/index.php/master/Submision/getTopicsByIssn";
$pro['issn'] = $journal_info['issn'];
- $res = object_to_array(json_decode(myPost($url,$pro)));
+ $res = object_to_array(json_decode(myPost($url, $pro)));
$topics = $res['data']['topics'];
$re['topics'] = $topics;
return jsonSuccess($re);
@@ -2087,7 +2139,6 @@ class Article extends Base
}
-
/**
* 添加文章文件
*/
@@ -2158,7 +2209,7 @@ class Article extends Base
$author_email = [];
- $authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state',0)->select();
+ $authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
foreach ($authors as $k => $v) {
$cache['email'] = trim($v['email']);
$cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
@@ -2223,15 +2274,15 @@ class Article extends Base
// $tt1 .= 'Yours sincerely,
Haoran Zhang
';
// $tt1 .= 'Manuscript Administration, Life Research
https://www.tmrjournals.com/lr/';
// } else { //其他期刊发送邮件
- $tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact ' . $journal_info['email'] . '.
';
- $tt1 .= 'Thank you for choosing to submit your manuscript to ' . $journal_info['title'] . '.
';
- $tt1 .= 'Sincerely,
Editorial Office
';
- $tt1 .= 'Subscribe to this journal
';
- $tt1 .= $journal_info['title'] . '
';
- $tt1 .= 'Email: ' . $journal_info['email'] . '
';
- $tt1 .= 'Website: ' . $journal_info['website'] . '
';
- $tt1 .= '