diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index dfdb3eb..3b3e61e 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -911,6 +911,19 @@ class Article extends Controller { return jsonError("Status cannot be changed"); } + //判断文章的h指数是否添加 + $authors = $this->article_author_obj->where('article_id',$data['articleId'])->where('is_report',1)->select(); + $h_check = false; + foreach($authors as $v){ + $cache_report = $this->user_obj->where('email',$v['email'])->find(); + if($article_info['state']!=0||$cache_report['google_time']!=0){ + $h_check = true; + break; + } + } + if($h_check==false){ + return jsonError('Please complete the H-index before proceeding'); + } // 发送邮件内容 $sendUser=[ @@ -1593,8 +1606,9 @@ class Article extends Controller { if($v['isReport']=="true"){ $re_user_check = $this->user_obj->where('account|email',trim($v['email']))->find(); if(!$re_user_check){ + $password = getRandPassword(); $inser_data['account'] = trim($v['email']); - $inser_data['password'] = md5('123456qwe'); + $inser_data['password'] = md5($password); $inser_data['email'] = trim($v['email']); $inser_data['realname'] = trim($v['firstname']).' '.trim($v['lastname']); $inser_data['ctime'] = time(); @@ -1602,6 +1616,21 @@ class Article extends Controller { if($res_add_user){ $res_add_user = $c_res_add_user; } + + //发送提示邮件给通讯作者 + $report_tt = "Dear ".$inser_data['realname'].',

'; + $report_tt .= "We are delighted to welcome you as a new author for our journal, ".$journal_info['title'].". We have received your submission and are excited to review it for potential publication.

"; + $report_tt .= "As a next step, we have created an account for you on our journal's website. Your account is [Username: ".trim($v['email'])." password:$password]"; + $report_tt .= "and you can access your account by visiting ".$journal_info['website']." and logging in.

"; + $report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.

"; + $report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.

"; + $report_tt .= "Best regards,
".$inser_data['realname'].'
'.$journal_info['title']; + $maidata['email'] = trim($v['email']); + $maidata['title'] = $journal_info['title']; + $maidata['content'] = $report_tt; + $maidata['tmail'] = $journal_info['email']; + $maidata['tpassword'] = $journal_info['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); } } } @@ -1705,6 +1734,26 @@ class Article extends Controller { // } + /** + * 获取文章通讯作者信息 + */ + public function getArticleReport(){ + $data = $this->request->post(); + $rule = new Validate([ + 'article_id'=>'require' + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $reports = $this->article_author_obj->where('article_id',$data['article_id'])->where('is_report',1)->select(); + foreach($reports as $k => $v){ + $ca=$this->user_obj->where('email',$v['email'])->find(); + $reports[$k]['account'] = $ca; + } + $re['reports'] = $reports; + return jsonSuccess($re); + } + public function editHindexAndScor(){ $data = $this->request->post(); $rule = new Validate([ @@ -2080,6 +2129,14 @@ class Article extends Controller { $list = $this->journal_obj->where($where)->select(); return json($list); } + /** + * 获取期刊列表 + */ + public function getJournalOutLx() { + $editorid = $this->request->post('editor_id'); + $list = $this->journal_obj->where('editor_id',$editorid)->where('journal_id','not in','2,3,15')->select(); + return json($list); + } /** * 获取文章历史上传file列表 @@ -2148,6 +2205,27 @@ class Article extends Controller { } } + /** + * 编辑获取连续出刊列表 + */ + public function getContinuityJournals(){ + $data = $this->request->post(); + $rule = new Validate([ + 'editor_id'=>'require' + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $res = $this->user_obj->where('user_id',$data['editor_id'])->find(); + if(!$res){ + return jsonError('no this user!'); + } + $journals = $this->journal_obj->where('editor_id',$res['user_id'])->where('journal_id','in','2,3,15')->select(); + $re['journals'] = $journals; + return jsonSuccess($re); + } + + /** * 获取文章审稿实例列表 */ diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index b7e114b..f79b278 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -145,6 +145,54 @@ class Auto extends Controller { Queue::push('app\api\job\mail@fire', $maidata, "tmail"); } + + public function qqqq(){ + $extension_obj = Db::name('exten'); + $data = $this->request->post(); + $num = $data['num']; + + $limit_start = ($num - 1) * 1000; + $list = $extension_obj->limit($limit_start,1000)->select(); + $re['list'] = $list; + return jsonSuccess($re); + } + + + public function pppp(){ + $extension_obj = Db::name('exten'); + $file = "D://11.xlsx"; + $res = $this->readExcel($file); + // $extension_obj->insertAll($res); + } + + private function readExcel($path) { + $extension = substr($path, strrpos($path, '.') + 1); + vendor("PHPExcel.PHPExcel"); + if ($extension == 'xlsx') { + $objReader = new \PHPExcel_Reader_Excel2007(); + $objPHPExcel = $objReader->load($path); + } else if ($extension == 'xls') { + $objReader = new \PHPExcel_Reader_Excel5(); + $objPHPExcel = $objReader->load($path); + } + + $sheet = $objPHPExcel->getSheet(0); + $highestRow = $sheet->getHighestRow(); + $frag = []; + $frag1 = []; + for ($i = 2; $i <= $highestRow; $i++) { + $aa = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue(); + if($aa==''){ + continue; + } + if(!in_array($aa,$frag1)){ + $frag1[] = $aa; + $frag[] = ['email'=>$aa]; + } + } + return $frag; + } + private function creatLoginUrlForreviewer($user, $article_id) { $code = md5(time() . rand(1000, 9999) . 'thinkphp'); $insert['user_id'] = $user['user_id']; @@ -166,9 +214,6 @@ class Auto extends Controller { } - public function pushEmailForAuthor1(){ - - } /** * 推送邮件提醒作者修回稿件 diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index cec6801..4ac6e5a 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -347,6 +347,8 @@ class Production extends Controller $journalids = []; if ($data['journal_id'] == 0) { $journalids = $this->journal_obj->where('editor_id', $data['editor_id'])->column('journal_id'); + }else{ + $journalids[] = $data['journal_id']; } $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; $list = $this->production_article_obj @@ -429,6 +431,7 @@ class Production extends Controller $pra['title'] = $p_info['title']; $pra['journal_stage_id'] = $p_info['journal_stage_id']; $pra['issn'] = $journal_info['issn']; + $pra['ltai'] = $p_info['ltai']; $pra['type'] = $p_info['type']; $pra['doi'] = $p_info['doi']; $pra['tradition_tag'] = $p_info['tradition_tag']; diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index 9aea534..2a30f93 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -492,6 +492,7 @@ class Special extends Controller //上传文章作者信息 $authors = []; + $res_add_user = true; foreach ($data['authorList'] as $v) { if ($v['firstname'] == '') { continue; @@ -508,6 +509,37 @@ class Special extends Controller $i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0; $i['is_report'] = $v['isReport'] == 'true' ? 1 : 0; $authors[] = $i; + //通讯作者用户添加 + if($v['isReport']=="true"){ + $re_user_check = $this->user_obj->where('account|email',trim($v['email']))->find(); + if(!$re_user_check){ + $password = getRandPassword(); + $inser_data['account'] = trim($v['email']); + $inser_data['password'] = md5($password); + $inser_data['email'] = trim($v['email']); + $inser_data['realname'] = trim($v['firstname']).' '.trim($v['lastname']); + $inser_data['ctime'] = time(); + $c_res_add_user=$this->user_obj->insertGetId($inser_data); + if($res_add_user){ + $res_add_user = $c_res_add_user; + } + + //发送提示邮件给通讯作者 + $report_tt = "Dear ".$inser_data['realname'].',

'; + $report_tt .= "We are delighted to welcome you as a new author for our journal, ".$journal_info['title'].". We have received your submission and are excited to review it for potential publication.

"; + $report_tt .= "As a next step, we have created an account for you on our journal's website. Your account is [Username: ".trim($v['email'])." password:$password]"; + $report_tt .= "and you can access your account by visiting ".$journal_info['website']." and logging in.

"; + $report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.

"; + $report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.

"; + $report_tt .= "Best regards,
".$inser_data['realname'].'
'.$journal_info['title']; + $maidata['email'] = trim($v['email']); + $maidata['title'] = $journal_info['title']; + $maidata['content'] = $report_tt; + $maidata['tmail'] = $journal_info['email']; + $maidata['tpassword'] = $journal_info['epassword']; + Queue::push('app\api\job\mail@fire', $maidata, "tmail"); + } + } } $res_author = $this->article_author_obj->insertAll($authors); @@ -565,7 +597,7 @@ class Special extends Controller //增加usermsg $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res); - if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) { + if ($res && $res_author && $transr &&$res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) { Db::commit(); $this->ai_scor($data['article_id']); return json(['code' => 0]); diff --git a/application/common.php b/application/common.php index b1c49b8..ff6d1ec 100644 --- a/application/common.php +++ b/application/common.php @@ -129,6 +129,20 @@ function get_str(){ } +function getRandPassword(){ + + $length = 8; + $str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + $len = strlen($str)-1; + $randstr = ''; + for ($i=0;$i<$length;$i++) { + $num=mt_rand(0,$len); + $randstr .= $str[$num]; + } + return $randstr; + +} + function proofState($article_id){ $p_article_obj = Db::name('production_article');