Compare commits

...

30 Commits

Author SHA1 Message Date
chengxl
d411d53a82 排版相关调整 2026-02-13 09:28:58 +08:00
chengxl
da54478a64 排版相关调整 2026-02-12 17:46:55 +08:00
chengxl
62e89e32ec 排版相关调整 2026-02-12 11:40:07 +08:00
chengxl
b215fc1ab8 新增获取文章底部信息方法 2026-02-12 09:48:21 +08:00
chengxl
71c94933f9 新增获取文章底部信息方法 2026-02-12 09:44:00 +08:00
chengxl
46ebbc3f0e 排版相关调整 2026-02-12 09:37:27 +08:00
chengxl
dad360489e 排版相关调整 2026-02-11 13:58:38 +08:00
chengxl
efc766cf1c 排版相关调整 2026-02-11 11:29:27 +08:00
chengxl
9c0f14d8d7 排版相关调整 2026-02-11 11:26:28 +08:00
chengxl
736d32bf91 测试问题修改 2026-02-11 09:39:16 +08:00
chengxl
e9bcaa5c24 判断是否是草稿箱 2026-02-06 17:50:23 +08:00
chengxl
c55e764a48 审稿人机构及草稿状态区分 2026-02-06 17:31:08 +08:00
chengxl
44b88a83ca 新增字段排版相关的 2026-02-06 17:27:43 +08:00
chengxl
6f417f6e9f 判断是否是草稿箱 2026-02-05 13:08:08 +08:00
chengxl
8319777d3e 判断是否是草稿箱 2026-02-04 17:55:28 +08:00
chengxl
71ec3c2ccd 查询终审审稿人的机构调整 2026-02-04 17:27:15 +08:00
chengxl
56dd707f9b 查询终审审稿人的机构调整 2026-02-04 13:37:40 +08:00
chengxl
d2fe34a7a3 排版问题处理 2026-02-04 10:47:40 +08:00
chengxl
2f921a4ea2 查询终审审稿人的机构调整 2026-02-03 17:28:59 +08:00
wangjinlei
e109a84eff Merge remote-tracking branch 'origin/master' 2026-02-03 14:00:03 +08:00
wangjinlei
31da31b252 latex update 2026-02-03 13:59:57 +08:00
chengxl
7c54b4f518 排版图片修改 2026-02-03 13:48:12 +08:00
chengxl
8fe397ff50 排版相关调整 2026-02-03 09:52:07 +08:00
wangjinlei
f9e29ad876 Merge remote-tracking branch 'origin/master' 2026-02-02 11:23:56 +08:00
wangjinlei
875d486ab5 latex update 2026-02-02 11:23:50 +08:00
chengxl
a80897644e 新增方法 2026-01-30 15:58:17 +08:00
chengxl
d518097f18 排版公共方法修改 2026-01-30 15:07:12 +08:00
wangjinlei
63a89b4af7 Merge remote-tracking branch 'origin/master' 2026-01-27 15:44:23 +08:00
wangjinlei
fd6d9de32f latex update 2026-01-27 15:44:19 +08:00
chengxl
0029b96308 处理表格和图片关联 2026-01-27 15:44:05 +08:00
9 changed files with 660 additions and 343 deletions

View File

@@ -129,6 +129,12 @@ class Article extends Base
} }
} }
$res[$key]['proof'] = $proof_state; $res[$key]['proof'] = $proof_state;
//新增是否是草稿删除 20260204 start
$res[$key]['is_draft'] = 2;
if(!empty($val['accept_sn']) && substr($val['accept_sn'], 0, 5) === 'Draft'){
$res[$key]['is_draft'] = 1;
}
//新增是否是草稿删除 20260204 end
} }
//返回数据 //返回数据
@@ -585,6 +591,14 @@ class Article extends Base
} }
} }
//查询终审意见 chengxiaoling 20250828 end //查询终审意见 chengxiaoling 20250828 end
//新增是否是草稿删除 20260204 start
if(!empty($article_res)){
$article_res['is_draft'] = 2;
if(!empty($article_res['accept_sn']) && substr($article_res['accept_sn'], 0, 5) === 'Draft'){
$article_res['is_draft'] = 1;
}
}
//新增是否是草稿删除 20260204 end
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, "major" => $major,'suggest_final' => $aFinal]); return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, "major" => $major,'suggest_final' => $aFinal]);
} }
@@ -2794,196 +2808,196 @@ class Article extends Base
die("Please update your browser cache and resubmit your submission (shortcut key: Ctrl+F5)"); die("Please update your browser cache and resubmit your submission (shortcut key: Ctrl+F5)");
//接受参数,查询信息 //接受参数,查询信息
// $data = $this->request->post(); $data = $this->request->post();
//
// $user_res = $this->user_obj->where('account', $data['username'])->find(); $user_res = $this->user_obj->where('account', $data['username'])->find();
//
// //确定用户是否属于黑名单 //确定用户是否属于黑名单
// $black_check = $this->user_black_obj->where('user_id', $user_res['user_id'])->where('black_state', 0)->find(); $black_check = $this->user_black_obj->where('user_id', $user_res['user_id'])->where('black_state', 0)->find();
// if ($black_check) { if ($black_check) {
// return jsonError("Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com."); return jsonError("Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.");
// } }
//
// // if($user_res['account']=='fariba'||$user_res['account']=='zc'||$user_res['account']=='Mohammad Hossein'||$user_res['account']=='xiaoyueyue'||$user_res['account']=='sethlee000'||$user_res['account']=='yuanying9908'){ // if($user_res['account']=='fariba'||$user_res['account']=='zc'||$user_res['account']=='Mohammad Hossein'||$user_res['account']=='xiaoyueyue'||$user_res['account']=='sethlee000'||$user_res['account']=='yuanying9908'){
// // return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']); // return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']);
// // } // }
//
// $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find(); $journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
// //首先查重是否重复投稿 //首先查重是否重复投稿
// $checkArticle = $this->article_obj->where("title", trim($data['title']))->select(); $checkArticle = $this->article_obj->where("title", trim($data['title']))->select();
// foreach ($checkArticle as $v) { foreach ($checkArticle as $v) {
// if ($v['state'] != 3) { if ($v['state'] != 3) {
// return json(['code' => 1, 'msg' => 'Warning: you are re-submitting the article!']); return json(['code' => 1, 'msg' => 'Warning: you are re-submitting the article!']);
// } }
// } }
// Db::startTrans(); Db::startTrans();
//
// //添加文章基础信息 //添加文章基础信息
// $inset_data['user_id'] = $user_res['user_id']; $inset_data['user_id'] = $user_res['user_id'];
// $inset_data['journal_id'] = $data['journal']; $inset_data['journal_id'] = $data['journal'];
// $inset_data['editor_id'] = $journal_info['editor_id']; $inset_data['editor_id'] = $journal_info['editor_id'];
// $inset_data['title'] = trim($data['title']); $inset_data['title'] = trim($data['title']);
// $inset_data['keywords'] = $data['keyWords']; $inset_data['keywords'] = $data['keyWords'];
// $inset_data['fund'] = trim($data['fund']); $inset_data['fund'] = trim($data['fund']);
// $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']); $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
// $inset_data['type'] = $data['type']; $inset_data['type'] = $data['type'];
// $inset_data['major_id'] = $data['major']; $inset_data['major_id'] = $data['major'];
// // $inset_data['cmajor_id'] = $data['cmajor']; // $inset_data['cmajor_id'] = $data['cmajor'];
// $inset_data['approval'] = $data['approval'] == 'true' ? 1 : 0; $inset_data['approval'] = $data['approval'] == 'true' ? 1 : 0;
// $inset_data['abstrart'] = $data['abstrart']; $inset_data['abstrart'] = $data['abstrart'];
// $inset_data['author_act'] = 1; $inset_data['author_act'] = 1;
// $inset_data['ctime'] = time(); $inset_data['ctime'] = time();
// $res = $this->article_obj->insertGetId($inset_data); $res = $this->article_obj->insertGetId($inset_data);
//
// //上传文章作者信息 //上传文章作者信息
// $author_email = []; $author_email = [];
// $authors = []; $authors = [];
// $res_add_user = true; $res_add_user = true;
// foreach ($data['authorList'] as $v) { foreach ($data['authorList'] as $v) {
// if ($v['firstname'] == '') { if ($v['firstname'] == '') {
// continue; continue;
// } }
// $i['article_id'] = $res; $i['article_id'] = $res;
// $i['firstname'] = trim($v['firstname']); $i['firstname'] = trim($v['firstname']);
// $i['lastname'] = trim($v['lastname']); $i['lastname'] = trim($v['lastname']);
// $i['orcid'] = trim($v['orcid']); $i['orcid'] = trim($v['orcid']);
// $i['company'] = trim($v['company']); $i['company'] = trim($v['company']);
// $i['department'] = trim($v['department']); $i['department'] = trim($v['department']);
// $i['author_title'] = $v['title']; $i['author_title'] = $v['title'];
// $i['country'] = $v['country']; $i['country'] = $v['country'];
// $i['email'] = trim($v['email']); $i['email'] = trim($v['email']);
// $i['address'] = trim($v['address']); $i['address'] = trim($v['address']);
// $i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0; $i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
// $i['is_report'] = $v['isReport'] == 'true' ? 1 : 0; $i['is_report'] = $v['isReport'] == 'true' ? 1 : 0;
// $authors[] = $i; $authors[] = $i;
// $cache['email'] = trim($v['email']); $cache['email'] = trim($v['email']);
// $cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']); $cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
// $author_email[] = $cache; $author_email[] = $cache;
//
// //通讯作者用户添加 //通讯作者用户添加
// if ($v['isReport'] == "true") { if ($v['isReport'] == "true") {
// $re_user_check = $this->user_obj->where('account|email', trim($v['email']))->find(); $re_user_check = $this->user_obj->where('account|email', trim($v['email']))->find();
// if (!$re_user_check) { if (!$re_user_check) {
// $password = getRandPassword(); $password = getRandPassword();
// $inser_data['account'] = trim($v['email']); $inser_data['account'] = trim($v['email']);
// $inser_data['password'] = md5($password); $inser_data['password'] = md5($password);
// $inser_data['email'] = trim($v['email']); $inser_data['email'] = trim($v['email']);
// $inser_data['realname'] = trim($v['firstname']) . ' ' . trim($v['lastname']); $inser_data['realname'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
// $inser_data['ctime'] = time(); $inser_data['ctime'] = time();
// $c_res_add_user = $this->user_obj->insertGetId($inser_data); $c_res_add_user = $this->user_obj->insertGetId($inser_data);
// if ($res_add_user) { if ($res_add_user) {
// $res_add_user = $c_res_add_user; $res_add_user = $c_res_add_user;
// } }
//
// //发送提示邮件给通讯作者 //发送提示邮件给通讯作者
// $report_tt = "Dear " . $inser_data['realname'] . ',<br/><br/>'; $report_tt = "Dear " . $inser_data['realname'] . ',<br/><br/>';
// $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.<br/><br/>"; $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.<br/><br/>";
// $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 .= "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.<br/><br/>"; $report_tt .= "and you can access your account by visiting " . $journal_info['website'] . " and logging in.<br/><br/>";
// $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.<br/><br/>"; $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.<br/><br/>";
// $report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.<br/><br/>"; $report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.<br/><br/>";
// $report_tt .= "Best regards,<br>" . $journal_info['title']; $report_tt .= "Best regards,<br>" . $journal_info['title'];
// $maidata['email'] = trim($v['email']); $maidata['email'] = trim($v['email']);
// $maidata['title'] = $journal_info['title']; $maidata['title'] = $journal_info['title'];
// $maidata['content'] = $report_tt; $maidata['content'] = $report_tt;
// $maidata['tmail'] = $journal_info['email']; $maidata['tmail'] = $journal_info['email'];
// $maidata['tpassword'] = $journal_info['epassword']; $maidata['tpassword'] = $journal_info['epassword'];
// Queue::push('app\api\job\mail@fire', $maidata, "tmail"); Queue::push('app\api\job\mail@fire', $maidata, "tmail");
// } }
// } }
// } }
// $res_author = $this->article_author_obj->insertAll($authors); $res_author = $this->article_author_obj->insertAll($authors);
//
// //增加转投信息 //增加转投信息
// $transr = true; $transr = true;
// if ($data['istransfer'] == 'true') { if ($data['istransfer'] == 'true') {
// foreach ($data['checkedjours'] as $val) { foreach ($data['checkedjours'] as $val) {
// $trans_insert['article_id'] = $res; $trans_insert['article_id'] = $res;
// $trans_insert['journal_id'] = $val; $trans_insert['journal_id'] = $val;
// $trans_insert['ctime'] = time(); $trans_insert['ctime'] = time();
// $transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false; $transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false;
// } }
// } }
//
//
// //增加articlefile表的信息 //增加articlefile表的信息
// $res_file1 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['coverLetter'], 'coverLetter'); $res_file1 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['coverLetter'], 'coverLetter');
// $res_file2 = true; $res_file2 = true;
// if (isset($data['picturesAndTables'])) { if (isset($data['picturesAndTables'])) {
// foreach ($data['picturesAndTables'] as $v) { foreach ($data['picturesAndTables'] as $v) {
// $res_file2 = $res_file2 ? self::save_article_file($res, $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables') : false; $res_file2 = $res_file2 ? self::save_article_file($res, $user_res['user_id'], $user_res['account'], $v, 'picturesAndTables') : false;
// } }
// } }
// $res_file4 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage'); $res_file4 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['totalpage'], 'totalpage');
// $res_file3 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt'); $res_file3 = self::save_article_file($res, $user_res['user_id'], $user_res['account'], $data['manuscirpt'], 'manuscirpt');
//
// //发送邮件到编辑,提醒有待审文章 //发送邮件到编辑,提醒有待审文章
// $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find(); $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
// $tt = 'Dear editor,<br>'; $tt = 'Dear editor,<br>';
// $tt .= 'Please check the new manuscript in the submission system.'; $tt .= 'Please check the new manuscript in the submission system.';
// sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); 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(); $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_res['user_id'])->find();
// //发送邮件给作者,表示感谢 //发送邮件给作者,表示感谢
// $tt_t = 'Dear Dr. ' . ($user_res['realname'] == '' ? $user_res['account'] : $user_res['realname']) . ',<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>'; $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 期刊发送收到文章邮件 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 .= '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>'; $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>';
// $tt1 .= 'Thank you for choosing to submit your manuscript to Life Research.<br><br><br>'; $tt1 .= 'Thank you for choosing to submit your manuscript to Life Research.<br><br><br>';
// $tt1 .= 'Yours sincerely,<br>Haoran Zhang<br><br>'; $tt1 .= 'Yours sincerely,<br>Haoran Zhang<br><br>';
// $tt1 .= 'Manuscript Administration, Life Research<br>https://www.tmrjournals.com/lr/'; $tt1 .= 'Manuscript Administration, Life Research<br>https://www.tmrjournals.com/lr/';
// } else { //其他期刊发送邮件 } 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'] . '.<br><br>'; $tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact ' . $journal_info['email'] . '.<br><br>';
// $tt1 .= 'Thank you for choosing to submit your manuscript to ' . $journal_info['title'] . '.<br><br><br>'; $tt1 .= 'Thank you for choosing to submit your manuscript to ' . $journal_info['title'] . '.<br><br><br>';
// $tt1 .= 'Sincerely,<br>Editorial Office<br>'; $tt1 .= 'Sincerely,<br>Editorial Office<br>';
// $tt1 .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><br>'; $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 .= $journal_info['title'] . '<br>';
// $tt1 .= 'Email: ' . $journal_info['email'] . '<br>'; $tt1 .= 'Email: ' . $journal_info['email'] . '<br>';
// $tt1 .= 'Website: ' . $journal_info['website'] . '<br>'; $tt1 .= 'Website: ' . $journal_info['website'] . '<br>';
// $tt1 .= '<hr/>If you have any questions, please contact us: <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'; $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']); sendEmail($user_res['email'], $journal_info['title'], $journal_info['title'], $tt_t . $tt1, $journal_info['email'], $journal_info['epassword']);
//
// foreach ($author_email as $v) { foreach ($author_email as $v) {
// $cache_str = 'Dear Dr. ' . $v['name'] . ',<br><br>'; $cache_str = 'Dear Dr. ' . $v['name'] . ',<br><br>';
// $maidata['email'] = $v['email']; $maidata['email'] = $v['email'];
// $maidata['title'] = $journal_info['title']; $maidata['title'] = $journal_info['title'];
// $maidata['content'] = $cache_str . $tt1; $maidata['content'] = $cache_str . $tt1;
// $maidata['tmail'] = $journal_info['email']; $maidata['tmail'] = $journal_info['email'];
// $maidata['tpassword'] = $journal_info['epassword']; $maidata['tpassword'] = $journal_info['epassword'];
// Queue::push('app\api\job\mail@fire', $maidata, "tmail"); Queue::push('app\api\job\mail@fire', $maidata, "tmail");
// } }
//
// //增加用户操作log //增加用户操作log
// $log_data['user_id'] = $user_res['user_id']; $log_data['user_id'] = $user_res['user_id'];
// $log_data['type'] = 0; $log_data['type'] = 0;
// $log_data['content'] = $user_res['account'] . "(" . $user_res['realname'] . "),上传了一篇文章:" . $data['title'] . ",上传时间是:" . date('Y-m-d H:i:s', time()); $log_data['content'] = $user_res['account'] . "(" . $user_res['realname'] . "),上传了一篇文章:" . $data['title'] . ",上传时间是:" . date('Y-m-d H:i:s', time());
// $log_data['ctime'] = time(); $log_data['ctime'] = time();
// $res_log = $this->user_log_obj->insert($log_data); $res_log = $this->user_log_obj->insert($log_data);
//
// //增加usermsg //增加usermsg
// $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res); $res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res);
//
// //通讯作者转为审稿人 //通讯作者转为审稿人
// $this->addReviewerFromArticle($res, $journal_info['journal_id']); $this->addReviewerFromArticle($res, $journal_info['journal_id']);
//
// //推荐审稿人 //推荐审稿人
// $recommend_res = true; $recommend_res = true;
// $reviewers = isset($data['reviewers']) ? $data['reviewers'] : []; $reviewers = isset($data['reviewers']) ? $data['reviewers'] : [];
// foreach ($reviewers as $v) { foreach ($reviewers as $v) {
// $recommend_res = $this->addRecommentReviewer($v, $journal_info['journal_id'], $user_res['user_id'], $res); $recommend_res = $this->addRecommentReviewer($v, $journal_info['journal_id'], $user_res['user_id'], $res);
// } }
//
// if ($res && $res_author && $transr && $res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg && $recommend_res) { if ($res && $res_author && $transr && $res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg && $recommend_res) {
// Db::commit(); Db::commit();
// $this->ai_scor($res); $this->ai_scor($res);
// return json(['code' => 0]); return json(['code' => 0]);
// } else { } else {
// Db::rollback(); Db::rollback();
// return json(['code' => 1]); return json(['code' => 1]);
// } }
} }

View File

@@ -437,7 +437,7 @@ class Base extends Controller
$article_info = $this->article_obj->where('article_id', $article_id)->find(); $article_info = $this->article_obj->where('article_id', $article_id)->find();
$check = $this->article_main_obj->where("article_id",$article_id)->whereIn("state",[0,2])->find(); $check = $this->article_main_obj->where("article_id",$article_id)->whereIn("state",[0,2])->find();
if($check){ if($check){//防止重复添加
return ; return ;
} }
@@ -523,7 +523,10 @@ class Base extends Controller
$this->article_main_table_obj->insert($ins); $this->article_main_table_obj->insert($ins);
} }
//写入处理内容里table和figure队列-排版 20260121 start
\think\Queue::later(60,'app\api\job\DealMainFigureOrTable@fire', ['article_id' => $article_id], 'DealMainFigureOrTable');
//写入处理内容里table和figure队列-排版 20260121 end
$pics = $this->article_file_obj->where("article_id",$article_id)->where("type_name","picturesAndTables")->where("state",0)->order("file_id desc")->limit(1)->select(); $pics = $this->article_file_obj->where("article_id",$article_id)->where("type_name","picturesAndTables")->where("state",0)->order("file_id desc")->limit(1)->select();
if(!isset($pics[0])){ if(!isset($pics[0])){
return ; return ;

View File

@@ -1167,9 +1167,17 @@ class Finalreview extends Base
if(empty($aReviewerFinal)){ if(empty($aReviewerFinal)){
return json_encode(['status' => 3,'msg' => 'Review record does not exist or review has been completed']); return json_encode(['status' => 3,'msg' => 'Review record does not exist or review has been completed']);
} }
//查询审稿人基本信息
$aWhere = ['user_id' => $iReviewerId]; $aWhere = ['user_id' => $iReviewerId];
$aUser = Db::name('user')->field('realname')->where($aWhere)->find(); $aUser = Db::name('user')->field('realname,email')->where($aWhere)->find();
$aReviewerFinal['realname'] = empty($aUser['realname']) ? '' : $aUser['realname']; $aReviewerFinal['realname'] = empty($aUser['realname']) ? '' : $aUser['realname'];
$aReviewerFinal['email'] = empty($aUser['email']) ? '' : $aUser['email'];
//查询审稿人机构
if(!empty($aUser)){
$aWhere = ['reviewer_id' => $iReviewerId,'state' => 0];
$aReviewerInfo = Db::name('user_reviewer_info')->field('company')->where($aWhere)->find();
$aReviewerFinal['company'] = empty($aReviewerInfo['company']) ? '' : $aReviewerInfo['company'];
}
return json_encode(['status' => 1,'msg' => 'success','data' => $aReviewerFinal]); return json_encode(['status' => 1,'msg' => 'success','data' => $aReviewerFinal]);
} }

View File

@@ -45,6 +45,12 @@ class Preaccept extends Base
}else{ }else{
$list[$k]['is_repeat'] = 0; $list[$k]['is_repeat'] = 0;
} }
if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){
$list[$k]['retract'] = 1;
}else{
$list[$k]['retract'] = 0;
}
} }
$re["refers"] = $list; $re["refers"] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat;

View File

@@ -18,7 +18,7 @@ use think\log;
class Production extends Base class Production extends Base
{ {
private $supportedTags = ['sup', 'sub', 'blue', 'b', 'i', 't', 'r', 'wmath']; private $supportedTags = ['sup', 'sub', 'blue', 'b', 'i', 't', 'r', 'wmath','myh3'];
// 颜色映射自定义标签颜色对应LaTeX的HTML十六进制颜色 // 颜色映射自定义标签颜色对应LaTeX的HTML十六进制颜色
private $colorMap = [ private $colorMap = [
'blue' => '0082AA', 'blue' => '0082AA',
@@ -260,22 +260,24 @@ class Production extends Base
*/ */
public function getProductionMains() public function getProductionMains()
{ {
die("stop service!"); // die("stop service!");
// $data = $this->request->post(); $data = $this->request->post();
// $rule = new Validate([ $rule = new Validate([
// "p_article_id" => "require" "p_article_id" => "require"
// ]); ]);
// if (!$rule->check($data)) { if (!$rule->check($data)) {
// return jsonError($rule->getError()); return jsonError($rule->getError());
// } }
// $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find(); $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
$frag = getArticleMains($p_info['article_id']);
// $frag = $this->getProductionMainImgs($data['p_article_id']); // $frag = $this->getProductionMainImgs($data['p_article_id']);
// if (count($frag) == 0) { // if (count($frag) == 0) {
// return jsonError("create error"); // return jsonError("create error");
// } // }
// $re['mains'] = $frag; $re['mains'] = $frag;
// $re['production'] = $p_info; $re['production'] = $p_info;
// return jsonSuccess($re); return jsonSuccess($re);
} }
/** /**
@@ -516,6 +518,12 @@ class Production extends Base
$p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find(); $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $p_info['journal_id'])->find(); $journal_info = $this->journal_obj->where('journal_id', $p_info['journal_id'])->find();
//是否显示图文摘要图片1是2否3默认 20260206 start
$is_graphical_abstract = empty($data['is_graphical_abstract']) ? 3 : $data['is_graphical_abstract'];
if(!in_array($is_graphical_abstract, [1,2])){
return jsonError('Please select whether the uploaded picture should be shown as graphic abstract on the PDF title page');
}
//是否显示图文摘要图片1是2否3默认 20260206 end
$update['title'] = trim($data['title']); $update['title'] = trim($data['title']);
$update['journal_stage_id'] = $data['journal_stage_id']; $update['journal_stage_id'] = $data['journal_stage_id'];
@@ -535,6 +543,9 @@ class Production extends Base
// $update['pub_date'] = trim($data['pub_date']); // $update['pub_date'] = trim($data['pub_date']);
$update['npp'] = isset($data['npp']) ? $data['npp'] : ''; $update['npp'] = isset($data['npp']) ? $data['npp'] : '';
//是否显示图文摘要图片1是2否3默认 20260206 start
$update['is_graphical_abstract'] = $is_graphical_abstract;
//是否显示图文摘要图片1是2否3默认 20260206 end
//生成doi号 //生成doi号
// $doi = ''; // $doi = '';
// if ($p_info['doi'] == '') { // if ($p_info['doi'] == '') {
@@ -630,6 +641,11 @@ class Production extends Base
} else { } else {
$list[$k]['is_repeat'] = 0; $list[$k]['is_repeat'] = 0;
} }
if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){
$list[$k]['retract'] = 1;
}else{
$list[$k]['retract'] = 0;
}
} }
$re['refers'] = $list; $re['refers'] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
@@ -815,6 +831,7 @@ class Production extends Base
$pra['authors'] = json_encode($authors); $pra['authors'] = json_encode($authors);
$pra['organs'] = json_encode($organs); $pra['organs'] = json_encode($organs);
$res = object_to_array(json_decode(myPost($url, $pra))); $res = object_to_array(json_decode(myPost($url, $pra)));
if ($res['code'] == 0) { if ($res['code'] == 0) {
$r_update['state'] = 2; $r_update['state'] = 2;
$r_update['w_article_id'] = isset($res['data']['article_id']) ? $res['data']['article_id'] : 0; $r_update['w_article_id'] = isset($res['data']['article_id']) ? $res['data']['article_id'] : 0;
@@ -1701,6 +1718,12 @@ class Production extends Base
} }
//判断邮箱是否重复 chengxiaoling 20250926 end //判断邮箱是否重复 chengxiaoling 20250926 end
//判断是否是通讯作者 通讯地址必填 20260206 start
if(isset($data['is_report']) && $data['is_report'] == 1 && empty($data['mailing_address'])){
return jsonError("Please enter your mailing address");
}
//判断是否是通讯作者 通讯地址必填 20260206 end
$article_info = $this->article_obj->where('article_id', $old_article_author_info['article_id'])->find(); $article_info = $this->article_obj->where('article_id', $old_article_author_info['article_id'])->find();
$updata['author_name'] = $article_info['journal_id'] == 21 ? trim($data['last_name']) . trim($data['first_name']) : trim($data['first_name']) . ' ' . trim($data['last_name']); $updata['author_name'] = $article_info['journal_id'] == 21 ? trim($data['last_name']) . trim($data['first_name']) : trim($data['first_name']) . ' ' . trim($data['last_name']);
$updata['first_name'] = trim($data['first_name']); $updata['first_name'] = trim($data['first_name']);
@@ -1710,6 +1733,11 @@ class Production extends Base
$updata['is_first'] = $data['is_first']; $updata['is_first'] = $data['is_first'];
$updata['is_report'] = $data['is_report']; $updata['is_report'] = $data['is_report'];
$updata['email'] = isset($data['email']) ? trim($data['email']) : ''; $updata['email'] = isset($data['email']) ? trim($data['email']) : '';
//通信地址 20260206 start
$updata['mailing_address'] = isset($data['mailing_address']) ? trim($data['mailing_address']) : '';
//通信地址 20260206 end
$this->production_article_author_obj->where('p_article_author_id', $data['p_article_author_id'])->update($updata); $this->production_article_author_obj->where('p_article_author_id', $data['p_article_author_id'])->update($updata);
if (is_array($data['organs'])) { if (is_array($data['organs'])) {
$has_ids = []; $has_ids = [];
@@ -1803,6 +1831,12 @@ class Production extends Base
} }
//判断邮箱是否重复 chengxiaoling 20250926 end //判断邮箱是否重复 chengxiaoling 20250926 end
//判断是否是通讯作者 通讯地址必填 20260206 start
if(isset($data['is_report']) && $data['is_report'] == 1 && empty($data['mailing_address'])){
return jsonError("Please enter your mailing address");
}
//判断是否是通讯作者 通讯地址必填 20260206 end
$insert['p_article_id'] = $data['p_article_id']; $insert['p_article_id'] = $data['p_article_id'];
$insert['article_id'] = $p_info['article_id']; $insert['article_id'] = $p_info['article_id'];
$insert['author_name'] = $article_info['journal_id'] == 21 ? trim($data['last_name']) . trim($data['first_name']) : trim($data['first_name']) . ' ' . trim($data['last_name']); $insert['author_name'] = $article_info['journal_id'] == 21 ? trim($data['last_name']) . trim($data['first_name']) : trim($data['first_name']) . ' ' . trim($data['last_name']);
@@ -1814,6 +1848,10 @@ class Production extends Base
$insert['is_report'] = $data['is_report']; $insert['is_report'] = $data['is_report'];
$insert['email'] = isset($data['email']) ? trim($data['email']) : ''; $insert['email'] = isset($data['email']) ? trim($data['email']) : '';
//通信地址 20260206 start
$insert['mailing_address'] = isset($data['mailing_address']) ? trim($data['mailing_address']) : '';
//通信地址 20260206 end
Db::startTrans(); Db::startTrans();
$pa_id = $this->production_article_author_obj->insertGetId($insert); $pa_id = $this->production_article_author_obj->insertGetId($insert);
$or_res = true; $or_res = true;
@@ -2240,9 +2278,15 @@ class Production extends Base
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$info = $this->article_main_obj->where("am_id",$data['id'])->find(); $info = $this->article_main_obj->where("am_id",$data['id'])->find();
if(isset($data["code"])){
$content = $data['code'];
}else{
$content = $info['content'];
}
$production_info = $this->production_article_obj->where("article_id",$info['article_id'])->find(); $production_info = $this->production_article_obj->where("article_id",$info['article_id'])->find();
$refers = $this->production_article_refer_obj->where("p_article_id",$production_info['p_article_id'])->where('state',0)->order("index")->select(); $refers = $this->production_article_refer_obj->where("p_article_id",$production_info['p_article_id'])->where('state',0)->order("index")->select();
$res = $this->convertToLatex($info['content'],$refers); $res = $this->convertToLatex($content,$refers);
echo $res; echo $res;
// return jsonSuccess([$res]); // return jsonSuccess([$res]);
} }
@@ -2256,9 +2300,9 @@ class Production extends Base
return ''; return '';
} }
//单行处理公式内容 //单行处理公式内容
$pattern = '/^<wmath\s+data-latex="([^"]*)">.*<\/wmath>$/'; $pattern = '/^<wmath[^>]*?\s+data-latex="([^"]*)"[^>]*?>.*?<\/wmath>$/';
if(preg_match($pattern, $content) === 1){ if(preg_match($pattern, $content) === 1){
$pattern1 = '/<wmath\s+data-latex="([^"]*)">/'; $pattern1 = '/<wmath[^>]*?\s+data-latex="([^"]*)">/';
if (preg_match($pattern1, $content, $matches)) { if (preg_match($pattern1, $content, $matches)) {
$latexContent = $matches[1]; $latexContent = $matches[1];
// 将 $$ 转换为 $因为equation环境不需要$$ // 将 $$ 转换为 $因为equation环境不需要$$
@@ -2623,6 +2667,9 @@ class Production extends Base
$style['color'] = $this->colorMap['r']; $style['color'] = $this->colorMap['r'];
break; break;
// tr标签已被移除无需处理 // tr标签已被移除无需处理
case 'myh3':
$style['h3'] = true;
break;
} }
} }
@@ -2664,6 +2711,10 @@ class Production extends Base
$content = '$_{{'.$content.'}}$'; $content = '$_{{'.$content.'}}$';
} }
// 处理h3标签
if (isset($style['h3']) && $style['h3']) {
$content = "\\textbf{{$content}}";
}
return $content; return $content;
} }
@@ -3256,6 +3307,16 @@ class Production extends Base
$article_info = $this->article_obj->where('article_id', $p_info['article_id'])->find(); $article_info = $this->article_obj->where('article_id', $p_info['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_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(); $user_info = $this->user_obj->where('user_id', $article_info['user_id'])->find();
//查询文章是否有Accept记录 20260210 start
$article_info_id = empty($article_info['article_id']) ? 0 : $article_info['article_id'];
$aMsgWhere = ['article_id' => $article_info_id,'state_to' => 5];
$aArticleMsg = Db::name('article_msg')->field('msg_id')->where($aMsgWhere)->find();
if(empty($aArticleMsg)){
return jsonError("Please set the paper as Accept before asking the author to confirm");
}
//查询文章是否有Accept记录 20260210 end
$this->pdfAddProof($p_info['article_id']); $this->pdfAddProof($p_info['article_id']);
if ($p_info['file_pdf'] == '') { if ($p_info['file_pdf'] == '') {
return jsonError('To the editor: PROOF is the final form before the article goes online. The PROOF link step not be opened if you have not completed the previous steps.'); return jsonError('To the editor: PROOF is the final form before the article goes online. The PROOF link step not be opened if you have not completed the previous steps.');
@@ -3415,11 +3476,11 @@ class Production extends Base
$tex_content .= "\\usepackage{textcomp} \n"; $tex_content .= "\\usepackage{textcomp} \n";
$tex_content .= "\\usepackage[english]{babel} \n"; $tex_content .= "\\usepackage[english]{babel} \n";
$tex_content .= "\\geometry{ $tex_content .= "\\geometry{
a4paper, % A4纸张 a4paper, % A4纸张
left=1.5cm, % 左页边距 left=1.5cm, % 左页边距
right=1.5cm, % 右页边距 right=1.5cm, % 右页边距
top=2cm, % 上页边距 top=2cm, % 上页边距
bottom=2cm, % 下页边距 bottom=2cm, % 下页边距
}"; }";
$tex_content .= "\\linespread{1.05}"; $tex_content .= "\\linespread{1.05}";
$tex_content .= "\\definecolor{tablegray}{RGB}{250,231,232}\n\n"; $tex_content .= "\\definecolor{tablegray}{RGB}{250,231,232}\n\n";
@@ -3653,7 +3714,14 @@ class Production extends Base
// 方法1: 使用pdflatex命令推荐 // 方法1: 使用pdflatex命令推荐
// $command = "{$sLatexDir}pdflatex -include-directory=" . dirname($texFilePath) . // $command = "{$sLatexDir}pdflatex -include-directory=" . dirname($texFilePath) .
// " -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath); // " -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
$command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath); // $command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
$sLatexDir = '/usr/bin/';//latex执行目录
$command = sprintf(
'%slualatex -interaction=nonstopmode -output-directory=%s %s 2>&1',
rtrim($sLatexDir, '/') . '/', // /usr/bin/lualatex
escapeshellarg($pdfDir), // 转义输出目录(含空格/特殊字符)
escapeshellarg($texFilePath) // 转义tex文件路径
);
$output = []; $output = [];
$returnVar = 0; $returnVar = 0;
@@ -4324,10 +4392,8 @@ class Production extends Base
$queue = Queue::push('app\api\job\ArticleCreatePdf@fire', ['p_article_id' => $iPArticleId], 'ArticleCreatePdf'); $queue = Queue::push('app\api\job\ArticleCreatePdf@fire', ['p_article_id' => $iPArticleId], 'ArticleCreatePdf');
//生成长表格PDF //生成长表格PDF
$aLongTableId = empty($aResult['long_table_id']) ? [] : $aResult['long_table_id']; $aLongTableId = empty($aResult['long_table_id']) ? [] : $aResult['long_table_id'];
var_dump($aLongTableId);
if(!empty($aLongTableId)){ //调用生成长表格队列 if(!empty($aLongTableId)){ //调用生成长表格队列
$longtablequeue = Queue::push('app\api\job\ArticleCreateLongTable@fire', ['p_article_id' => $iPArticleId,'long_table_id' => $aLongTableId], 'ArticleCreateLongTable'); $longtablequeue = Queue::push('app\api\job\ArticleCreateLongTable@fire', ['p_article_id' => $iPArticleId,'long_table_id' => $aLongTableId], 'ArticleCreateLongTable');
var_dump($longtablequeue);
} }
return json_encode(array('status' => 1,'msg' => 'tex file generated successfully')); return json_encode(array('status' => 1,'msg' => 'tex file generated successfully'));
} }
@@ -4438,4 +4504,54 @@ class Production extends Base
Db::commit(); Db::commit();
return json_encode(array('status' => 1,'msg' => 'PDF generated successfully')); return json_encode(array('status' => 1,'msg' => 'PDF generated successfully'));
} }
/**
* 获取排版生成PDF历史版本
* @param p_article_id 文章ID
*/
public function getProductionArticlePdf($aParam = []){
//获取参数
$aParam = empty($aParam) ? $this->request->post() : $aParam;
//必填值验证
$iPArticleId = empty($aParam['p_article_id']) ? '' : $aParam['p_article_id'];
if(empty($iPArticleId)){
return json_encode(array('status' => 2,'msg' => 'Please select an article' ));
}
//查询文章
$aWhere = ['p_article_id' => $iPArticleId,'state' => ['in',[0,2]]];
$aProductionArticle = Db::name('production_article')->field('article_id,pdf_id')->where($aWhere)->find();
if(empty($aProductionArticle)){
return json_encode(array('status' => 3,'msg' => 'No articles found' ));
}
$iArticleId = empty($aProductionArticle['article_id']) ? 0 : $aProductionArticle['article_id'];
if(empty($iArticleId)){
return json_encode(array('status' => 4,'msg' => 'Unbound article' ));
}
//日志查询
$aWhere = ['article_id' => $iArticleId,'p_article_id' => $iPArticleId,'state' => 2];
$aPdf = Db::name('production_article_pdf')->field('pdf_id,url,create_time')->where($aWhere)->select();
return json_encode(array('status' => 1,'msg' => 'success','data' => $aPdf));
}
/**
* 获取生产文章信息
* @param p_article_id 文章ID
*/
public function getProductionArticle($aParam = []){
//获取参数
$aParam = empty($aParam) ? $this->request->post() : $aParam;
//必填值验证
$iPArticleId = empty($aParam['p_article_id']) ? '' : $aParam['p_article_id'];
if(empty($iPArticleId)){
return json_encode(array('status' => 2,'msg' => 'Please select an article' ));
}
//查询文章
$aWhere = ['p_article_id' => $iPArticleId,'state' => ['in',[0,2]]];
$aProductionArticle = Db::name('production_article')->field('pdf_id,file_sub_table')->where($aWhere)->find();
return json_encode(array('status' => 1,'msg' => 'success','data' => $aPdf));
}
} }

View File

@@ -23,7 +23,7 @@ class Supplementary extends Base
public function getJournalBoard(){ public function getJournalBoard(){
//获取参数 //获取参数
$aParam = $this->request->post(); $aParam = $this->request->post();
//参数验证 //参数验证
@@ -38,17 +38,17 @@ class Supplementary extends Base
$aWhere = ['state' => 0,'issn' => ['in',$sIssn]]; $aWhere = ['state' => 0,'issn' => ['in',$sIssn]];
$aJournal = Db::name('journal')->where($aWhere)->column('journal_id,issn'); $aJournal = Db::name('journal')->where($aWhere)->column('journal_id,issn');
if(empty($aJournal)){ if(empty($aJournal)){
return json_encode(['status' => 3,'msg' => 'No journal information found']); return json_encode(['status' => 3,'msg' => 'No journal information found']);
} }
//查询期刊编辑信息 //查询期刊编辑信息
$aWhere = ['state' => 0,'journal_id' => ['in',array_keys($aJournal)]]; $aWhere = ['state' => 0,'journal_id' => ['in',array_keys($aJournal)]];
if(isset($aParam['type'])){//编辑类型 if(isset($aParam['type'])){//编辑类型
$aWhere['type'] = $aParam['type']; $aWhere['type'] = $aParam['type'];
} }
$aJournalBoard = Db::name('board_to_journal')->field('journal_id,user_id')->where($aWhere)->select(); $aJournalBoard = Db::name('board_to_journal')->field('journal_id,user_id')->where($aWhere)->select();
if(empty($aJournalBoard)){ if(empty($aJournalBoard)){
return json_encode(['status' => 4,'msg' => 'No editorial information was found for the journal']); return json_encode(['status' => 4,'msg' => 'No editorial information was found for the journal']);
} }
//查询编辑详情 //查询编辑详情
@@ -62,10 +62,73 @@ class Supplementary extends Base
continue; continue;
} }
$sRealName = empty($aUser[$value['user_id']]) ? '' : $aUser[$value['user_id']]; $sRealName = empty($aUser[$value['user_id']]) ? '' : $aUser[$value['user_id']];
if(!empty($sRealName) && strlen($sRealName) >= 3 && substr($sRealName, 0, 3) === "\xEF\xBB\xBF") {
$sRealName = substr($sRealName, 3);
}
$aUserData[$sIssn][] = $sRealName; $aUserData[$sIssn][] = $sRealName;
} }
return json_encode(['status' => 1,'msg' => 'success','data' => $aUserData]); return json_encode(['status' => 1,'msg' => 'success','data' => $aUserData]);
} }
/**
* @title 获取文章底部信息
* @description 获取期刊编辑接口
*/
public function getProductiArticleFooter(){
$aParam = $this->request->post();
//官网文章ID
$iWarticleId = empty($aParam['w_article_id']) ? 0 : $aParam['w_article_id'];
if(empty($iWarticleId)){
return json_encode(['status' => 2,'msg' => 'Please select an article']);
}
//获取子刊信息
$aJournalStage = empty($aParam['journal_stage']) ? [] : $aParam['journal_stage'];
//查询文章生产信息
$aWhere = ['w_article_id' => $iWarticleId,'state' => ['in',[0,2]]];
$aProductionArticle = Db::name('production_article')->field('p_article_id,article_id,journal_stage_id,journal_id,title,type,acknowledgment,abbreviation,author_contribution,abbr,npp,doi,executive_editor')->where($aWhere)->find();
if(empty($aProductionArticle)){
return json_encode(['status' => 3,'msg' => 'No production article information found']);
}
//查询期刊信息
$iJournalId = empty($aProductionArticle['journal_id']) ? 0 : $aProductionArticle['journal_id'];
$aJournal = [];
if(!empty($iJournalId)){
$aWhere = ['journal_id' => $iJournalId,'state' => 0];
$aJournal = Db::name('journal')->field('jabbr,title')->where($aWhere)->find();
}
//获取文章时间/编委信息
$iArticleId = empty($aProductionArticle['article_id']) ? 0 : $aProductionArticle['article_id'];
if(empty($iArticleId)){
return json_encode(['status' => 3,'msg' => 'No article information found']);
}
$oLatexContent = new \app\common\LatexContent;
$aTime = $oLatexContent->getArticleTime(['article_id' => $iArticleId]);
$aProductionArticle = empty($aTime['data']) ? $aProductionArticle : array_merge($aTime['data'],$aProductionArticle);
//获取期刊引用信息
$sCite = $this->_cite($aProductionArticle,$aJournal,$aJournalStage);
$aProductionArticle['article_cite'] = empty($sCite) ? '' : $sCite;
$aProductionArticle['journal_title'] = empty($aJournal['title']) ? '' : $aJournal['title'];
return json_encode(['status' => 1,'data' => $aProductionArticle]);
}
//处理期刊引用信息
private function _cite($aArticle = [],$aJournal = [],$aJournalStage = []){
$no = empty($aJournalStage['stage_no']) ? ':' : '(' . $aJournalStage['stage_no'] . '):';
$jabbr = empty($aJournal['jabbr']) ? '' : $aJournal['jabbr'];
$stage_year = empty($aJournalStage['stage_year']) ? '' : $aJournalStage['stage_year'];
$stage_vol = empty($aJournalStage['stage_vol']) ? '' : $aJournalStage['stage_vol'];
$sCite = '';
if ($aArticle['journal_id'] == 22) {
$sCite = $aArticle['abbr'] . '. ' . $aArticle['title'] . '[J]. ' . choiseJabbr($aArticle['article_id'],$jabbr) . ',' . $stage_year . ',' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi'];
} else {
$sCite = $aArticle['abbr'] . '. ' . $aArticle['title'] . '. <i>' . choiseJabbr($aArticle['article_id'], $jabbr) . '</i>. ' . $stage_year . ';' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi'];
}
return $sCite;
}
} }
?> ?>

View File

@@ -199,48 +199,48 @@ class Typeset extends Base
/** /**
* 推送文章到官网系统 * 推送文章到官网系统
*/ */
public function pushArticleToSystem(){ // public function pushArticleToSystem(){
die('Service suspension!'); // die('Service suspension!');
$data = $this->request->post(); // $data = $this->request->post();
$rule = new Validate([ // $rule = new Validate([
'on_id'=>'require' // 'on_id'=>'require'
]); // ]);
if(!$rule->check($data)){ // if(!$rule->check($data)){
return jsonError($rule->getError()); // return jsonError($rule->getError());
} // }
$on_info = $this->online_obj->where('on_id',$data['on_id'])->find(); // $on_info = $this->online_obj->where('on_id',$data['on_id'])->find();
$ts_info = $this->ts_obj->where('article_id',$on_info['article_id'])->where('ts_state',0)->find(); // $ts_info = $this->ts_obj->where('article_id',$on_info['article_id'])->where('ts_state',0)->find();
$article_info = $this->article_obj->where('article_id',$on_info['article_id'])->find(); // $article_info = $this->article_obj->where('article_id',$on_info['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find(); // $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
$authors = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('state',0)->select(); // $authors = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
//check信息是否完整 // //check信息是否完整
if($on_info['journal_stage_id']==''||$on_info['on_doi']==''||$on_info['abstract']==''||$on_info['npp']==''){ // if($on_info['journal_stage_id']==''||$on_info['on_doi']==''||$on_info['abstract']==''||$on_info['npp']==''){
return jsonError('信息不全!'); // return jsonError('信息不全!');
} // }
//发送推送请求 // //发送推送请求
// $url = "http://www.journal.com/master/Article/addArticleForSubmission"; // // $url = "http://www.journal.com/master/Article/addArticleForSubmission";
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/addArticleForSubmission'; // $url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/addArticleForSubmission';
$pra = []; // $pra = [];
$pra['title'] = $ts_info['ts_title']; // $pra['title'] = $ts_info['ts_title'];
$pra['journal_stage_id'] = $on_info['journal_stage_id']; // $pra['journal_stage_id'] = $on_info['journal_stage_id'];
$pra['issn'] = $journal_info['issn']; // $pra['issn'] = $journal_info['issn'];
$pra['type'] = translateType($article_info['type']); // $pra['type'] = translateType($article_info['type']);
$pra['doi'] = $on_info['on_doi']; // $pra['doi'] = $on_info['on_doi'];
$pra['abstract'] = $on_info['abstract']; // $pra['abstract'] = $on_info['abstract'];
$pra['pub_date'] = $ts_info['online_date']; // $pra['pub_date'] = $ts_info['online_date'];
$pra['file_pdf'] = $article_info['pdf_url']; // $pra['file_pdf'] = $article_info['pdf_url'];
$pra['keywords'] = $ts_info['keywords']; // $pra['keywords'] = $ts_info['keywords'];
$pra['npp'] = $on_info['npp']; // $pra['npp'] = $on_info['npp'];
$pra['authors'] = json_encode($authors); // $pra['authors'] = json_encode($authors);
//
$res = object_to_array(json_decode(myPost($url, $pra))); // $res = object_to_array(json_decode(myPost($url, $pra)));
if($res['code']==0){ // if($res['code']==0){
$this->online_obj->where('on_id',$data['on_id'])->update(['has_push'=>1]); // $this->online_obj->where('on_id',$data['on_id'])->update(['has_push'=>1]);
return jsonSuccess([]); // return jsonSuccess([]);
}else{ // }else{
return jsonError('system error:'.$res['msg']); // return jsonError('system error:'.$res['msg']);
} // }
} // }
/** /**
* 编辑online信息 * 编辑online信息

View File

@@ -36,7 +36,7 @@ class Workbench extends Base
//获取状态 //获取状态
$iState = isset($aParam['state']) ? $aParam['state'] : -2; $iState = isset($aParam['state']) ? $aParam['state'] : -2;
//空的查询条件 //空的查询条件
$aWhere = []; $aWhere = ['accept_sn' => ['not like','Draft%']];
//SN //SN
$sAcceptSn = empty($aParam['accept_sn']) ? '': $aParam['accept_sn']; $sAcceptSn = empty($aParam['accept_sn']) ? '': $aParam['accept_sn'];
if(!empty($sAcceptSn)){ if(!empty($sAcceptSn)){
@@ -181,6 +181,10 @@ class Workbench extends Base
$aArticle[$key]['report'] = $aAuthorInfo; $aArticle[$key]['report'] = $aAuthorInfo;
$aArticle[$key]['country'] = empty($aAuthorInfo) ? [] : array_unique(array_column($aAuthorInfo, 'country')); $aArticle[$key]['country'] = empty($aAuthorInfo) ? [] : array_unique(array_column($aAuthorInfo, 'country'));
$aArticle[$key]['type_name'] = translateType($value['type']); $aArticle[$key]['type_name'] = translateType($value['type']);
$aArticle[$key]['is_draft'] = 2;
if(!empty($value['accept_sn']) && substr($value['accept_sn'], 0, 5) === 'Draft'){
$aArticle[$key]['is_draft'] = 1;
}
// //付款信息 // //付款信息
// $iPsId = empty($aOrder[$value['article_id']]) ? 0 : $aOrder[$value['article_id']]; // $iPsId = empty($aOrder[$value['article_id']]) ? 0 : $aOrder[$value['article_id']];
@@ -452,6 +456,12 @@ class Workbench extends Base
$aArticleReviewer['realname'] = empty($aUser['realname']) ? '' : $aUser['realname']; $aArticleReviewer['realname'] = empty($aUser['realname']) ? '' : $aUser['realname'];
$aArticleReviewer['email'] = empty($aUser['email']) ? '' : $aUser['email']; $aArticleReviewer['email'] = empty($aUser['email']) ? '' : $aUser['email'];
} }
//查询审稿人机构
if(!empty($aUser)){
$aWhere = ['reviewer_id' => $iUserId,'state' => 0];
$aReviewerInfo = Db::name('user_reviewer_info')->field('company')->where($aWhere)->find();
$aArticleReviewer['company'] = empty($aReviewerInfo['company']) ? '' : $aReviewerInfo['company'];
}
//组装信息 //组装信息
$aData = ['article' => $aArticle,'article_reviewer' => $aArticleReviewer]; $aData = ['article' => $aArticle,'article_reviewer' => $aArticleReviewer];
@@ -641,13 +651,31 @@ class Workbench extends Base
//查询审稿记录 //查询审稿记录
$aWhere = ['art_rev_id' => $iArtRevId]; $aWhere = ['art_rev_id' => $iArtRevId];
$aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,article_id,state')->where($aWhere)->find(); $aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,article_id,state,agree_review_time,ctime')->where($aWhere)->find();
if(empty($aArticleReviewer)){ if(empty($aArticleReviewer)){
return json_encode(['status' => 4,'msg' => 'Review record does not exist']); return json_encode(['status' => 4,'msg' => 'Review record does not exist']);
} }
if($aArticleReviewer['state'] != 4){ if($aArticleReviewer['state'] != 4 && $aArticleReviewer['state'] != 0){
return json_encode(['status' => 5,'msg' => 'The review link has not expired and no application is required']); return json_encode(['status' => 5,'msg' => 'The review link has not expired and no application is required']);
} }
if($aArticleReviewer['state'] == 0){
$iCtime = empty($aArticleReviewer['ctime']) ? 0 : $aArticleReviewer['ctime'];
$iTime = empty($aArticleReviewer['agree_review_time']) ? 0 : $aArticleReviewer['agree_review_time'];
$iTime = empty($iTime) ? intval($iCtime) : intval($iTime);
if (!is_numeric($iTime) || (int)$iTime <= 0) {
return json_encode(['status' => 12,'msg' => 'Invalid record time, the review period has expired']);
}
//判断是否超过14天
// 14天 = 14*24*3600 秒 = 1209600 秒
$iNowTime = strtotime(date('Y-m-d', time()));
$iFourteenDays = 14 * 24 * 3600;
$iTime = date('Y-m-d', $iTime);
$iTime = strtotime($iTime);//同意审稿时间戳
$timeDiff = $iTime+$iFourteenDays;
if($timeDiff >= $iNowTime){
return json_encode(['status' => 13,'msg' => 'The review link has not expired and no application is required']);
}
}
//获取文章信息 //获取文章信息
$aWhere = ['article_id' => $aArticleReviewer['article_id']]; $aWhere = ['article_id' => $aArticleReviewer['article_id']];
@@ -685,7 +713,7 @@ class Workbench extends Base
$aUser = array_column($aUser, null,'user_id'); $aUser = array_column($aUser, null,'user_id');
//更新审稿人重新申请状态为 //更新审稿人重新申请状态为
$aWhere = ['art_rev_id' => $iArtRevId,'state' => 4]; $aWhere = ['art_rev_id' => $iArtRevId];
$result = Db::name('article_reviewer')->where($aWhere)->limit(1)->update(['is_reapply' => 1,'reapply_time' => time(),'reviewer_act' => 1]); $result = Db::name('article_reviewer')->where($aWhere)->limit(1)->update(['is_reapply' => 1,'reapply_time' => time(),'reviewer_act' => 1]);
if($result === false){ if($result === false){
return json_encode(array('status' => 11,'msg' => 'Application to reopen link failed' )); return json_encode(array('status' => 11,'msg' => 'Application to reopen link failed' ));
@@ -773,14 +801,34 @@ class Workbench extends Base
//查询审稿记录 //查询审稿记录
$aWhere = ['art_rev_id' => $iArtRevId]; $aWhere = ['art_rev_id' => $iArtRevId];
$aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,article_id,state')->where($aWhere)->find(); $aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,article_id,state,ctime,agree_review_time')->where($aWhere)->find();
if(empty($aArticleReviewer)){ if(empty($aArticleReviewer)){
return json_encode(['status' => 4,'msg' => 'Review record does not exist']); return json_encode(['status' => 4,'msg' => 'Review record does not exist']);
} }
if($aArticleReviewer['state'] != 4){ // if($aArticleReviewer['state'] != 4){
// return json_encode(['status' => 5,'msg' => 'The review link has not expired and no application is required']);
// }
if($aArticleReviewer['state'] != 4 && $aArticleReviewer['state'] != 0){
return json_encode(['status' => 5,'msg' => 'The review link has not expired and no application is required']); return json_encode(['status' => 5,'msg' => 'The review link has not expired and no application is required']);
} }
if($aArticleReviewer['state'] == 0){
$iCtime = empty($aArticleReviewer['ctime']) ? 0 : $aArticleReviewer['ctime'];
$iTime = empty($aArticleReviewer['agree_review_time']) ? 0 : $aArticleReviewer['agree_review_time'];
$iTime = empty($iTime) ? intval($iCtime) : intval($iTime);
if (!is_numeric($iTime) || (int)$iTime <= 0) {
return json_encode(['status' => 12,'msg' => 'Invalid record time, the review period has expired']);
}
//判断是否超过14天
$iNowTime = strtotime(date('Y-m-d', time()));
// 14天 = 14*24*3600 秒 = 1209600 秒
$iFourteenDays = 14 * 24 * 3600;
$iTime = date('Y-m-d', $iTime);
$iTime = strtotime($iTime);//同意审稿时间戳
$timeDiff = $iTime+$iFourteenDays;
if($timeDiff >= $iNowTime){
return json_encode(['status' => 13,'msg' => 'The review link has not expired and no application is required']);
}
}
//获取文章信息 //获取文章信息
$aWhere = ['article_id' => $aArticleReviewer['article_id']]; $aWhere = ['article_id' => $aArticleReviewer['article_id']];
$aArticle = Db::name('article')->field('article_id,abstrart,title,type,accept_sn,journal_id,state')->where($aWhere)->find(); $aArticle = Db::name('article')->field('article_id,abstrart,title,type,accept_sn,journal_id,state')->where($aWhere)->find();
@@ -808,12 +856,24 @@ class Workbench extends Base
// } // }
//更新文章状态为邀请 //更新文章状态为邀请
$aWhere = ['art_rev_id' => $iArtRevId,'state' => 4]; $aWhere = ['art_rev_id' => $iArtRevId];
$result = Db::name('article_reviewer')->where($aWhere)->limit(1)->update(['state' => 5,'ctime' => time(),'editor_act' => 1,'is_reapply' => 2,'update_time' => time(),'reviewer_act' => 0]); $aUpdate = [];
if($aArticleReviewer['state'] == 4){
$aUpdate['state'] = 5;
$aUpdate['ctime'] = time();
}
if($aArticleReviewer['state'] == 0){
$aUpdate['agree_review_time'] = time();
}
if(empty($aUpdate)){
return json_encode(array('status' => 15,'msg' => 'Update data to empty' ));
}
$aUpdate += ['editor_act' => 1,'is_reapply' => 2,'update_time' => time(),'reviewer_act' => 0];
$result = Db::name('article_reviewer')->where($aWhere)->limit(1)->update($aUpdate);
if($result === false){ if($result === false){
return json_encode(array('status' => 11,'msg' => 'Status update failed' )); return json_encode(array('status' => 11,'msg' => 'Status update failed' ));
} }
//查询审稿人的邮箱 //查询审稿人的邮箱
$aWhere = ['user_id' => $aArticleReviewer['reviewer_id'],'state' => 0,'email' => ['<>','']]; $aWhere = ['user_id' => $aArticleReviewer['reviewer_id'],'state' => 0,'email' => ['<>','']];
$aUser = Db::name('user')->field('user_id,email,realname,account')->where($aWhere)->find(); $aUser = Db::name('user')->field('user_id,email,realname,account')->where($aWhere)->find();

View File

@@ -30,6 +30,7 @@ class LatexContent{
\end{figure}' ; \end{figure}' ;
//首页内容 //首页内容
private $sFirst = '\documentclass[ private $sFirst = '\documentclass[
articletype={{article_type}},
journal={{journal_abbr}}, journal={{journal_abbr}},
journalname={{{{journal_title}}}}, journalname={{{{journal_title}}}},
layout=largetwo, layout=largetwo,
@@ -43,6 +44,7 @@ page={{stage_page}},%号
\journalweb{{{website}}} \journalweb{{{website}}}
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{balance}
\usepackage[nopatch]{microtype} \usepackage[nopatch]{microtype}
\usepackage{booktabs} \usepackage{booktabs}
\usepackage[backend=biber]{biblatex} \usepackage[backend=biber]{biblatex}
@@ -50,27 +52,28 @@ page={{stage_page}},%号
\usepackage{tabularray} \usepackage{tabularray}
\addbibresource{references_{{article_id}}.bib} \addbibresource{references_{{article_id}}.bib}
\definecolor{evenRowColor}{RGB}{250,231,232} \definecolor{evenRowColor}{RGB}{250,231,232}
\setlength{\parindent}{1em}
\title{{{article_title}}} \title{{{article_title}}}
{{author_info}} {{author_info}}
{{correspondence_info}} \Correspondence{{{correspondence_info}}}
\keywords{keyword entry 1, keyword entry 2, keyword entry 3} %% First letter not capped \keywords{keyword entry 1, keyword entry 2, keyword entry 3} %% First letter not capped
{{author_contribution}} \authorcontributions{{{author_contribution}}}
\competinginterests{The authors declare no conflicts of interest.} \competinginterests{The authors declare no conflicts of interest.}
{{article_acknowledgment}} \Acknowledgments{{{article_acknowledgment}}}
\Peerreviewinformation{{{journal_title}} thanks all anonymous reviewers for their contribution to the peer review of this paper} \Peerreviewinformation{\textit{{{journal_title}}} thanks all anonymous reviewers for their contribution to the peer review of this paper}
{{article_abbreviation}} \Abbreviations{{{article_abbreviation}}}
{{article_cite}} \Citation{{{article_cite}}}
\received{{{received_date}}} \received{{{received_date}}}
\revised{{{revision_date}}} \revised{{{revision_date}}}
\accepted{{{accepted_date}}} \accepted{{{accepted_date}}}
\Availableonline{{{pub_date}}} \Availableonline{{{pub_date}}}
{{executive_editor}} \EditorialAdvisoryBoard{{{editorial_advisory_board}}}
\Executiveeditor{{{executive_editor}}}
{{abstract}} {{abstract}}
{{keywords}} {{keywords}}
@@ -83,6 +86,7 @@ page={{stage_page}},%号
{{article_main}} {{article_main}}
\nocite{*} \nocite{*}
\printbibliography[title={References}] \printbibliography[title={References}]
\balance
\end{document}'; \end{document}';
/** /**
* 生成初稿-基本内容 * 生成初稿-基本内容
@@ -105,6 +109,7 @@ page={{stage_page}},%号
} }
} }
//子刊信息 //子刊信息
$aJournalStage = [];
$iJournalStageId = empty($aProductionArticle['journal_stage_id']) ? 0 : $aProductionArticle['journal_stage_id']; $iJournalStageId = empty($aProductionArticle['journal_stage_id']) ? 0 : $aProductionArticle['journal_stage_id'];
if(!empty($iJournalStageId)){ if(!empty($iJournalStageId)){
$aJournalStage = $this->getJournalStage(['journal_stage_id' => $iJournalStageId]); $aJournalStage = $this->getJournalStage(['journal_stage_id' => $iJournalStageId]);
@@ -118,9 +123,9 @@ page={{stage_page}},%号
//年 //年
$iYear = empty($aJournalStage['stage_year']) ? date('Y') : $aJournalStage['stage_year']; $iYear = empty($aJournalStage['stage_year']) ? date('Y') : $aJournalStage['stage_year'];
//卷 //卷
$iVolume = empty($aJournalStage['stage_vol']) ? 0 : $aJournalStage['stage_vol']; $iVolume = empty($aJournalStage['stage_vol']) ? '' : $aJournalStage['stage_vol'];
//期 //期
$iPeriod = empty($aJournalStage['stage_no']) ? 0 : $aJournalStage['stage_no']; $iPeriod = empty($aJournalStage['stage_no']) ? '' : $aJournalStage['stage_no'];
//页 //页
$sPage = empty($aProductionArticle['npp']) ? '' : $aProductionArticle['npp']; $sPage = empty($aProductionArticle['npp']) ? '' : $aProductionArticle['npp'];
@@ -138,7 +143,7 @@ page={{stage_page}},%号
$aAuthoInfo = $this->dealAuthor(['p_article_id' => $aProductionArticle['p_article_id']]); $aAuthoInfo = $this->dealAuthor(['p_article_id' => $aProductionArticle['p_article_id']]);
$aSearch['{{author_info}}'] = empty($aAuthoInfo['author']) ? '' : $aAuthoInfo['author']; $aSearch['{{author_info}}'] = empty($aAuthoInfo['author']) ? '' : $aAuthoInfo['author'];
//通讯作者信息 //通讯作者信息
$aSearch['{{correspondence_info}}'] = empty($aAuthoInfo['correspondence']) ? '' : '\Correspondence{'.$aAuthoInfo['correspondence'].'}'; $aSearch['{{correspondence_info}}'] = empty($aAuthoInfo['correspondence']) ? '' : $aAuthoInfo['correspondence'];
//文章基本信息处理 //文章基本信息处理
//标题 //标题
@@ -156,34 +161,44 @@ page={{stage_page}},%号
} }
$aSearch['{{article_title}}'] = $sTitle; $aSearch['{{article_title}}'] = $sTitle;
//author_contribution //author_contribution
$aSearch['{{author_contribution}}'] = empty($aProductionArticle['author_contribution']) ? '' : '\authorcontributions{'.$this->dealContent($aProductionArticle['author_contribution']).'}'; $aSearch['{{author_contribution}}'] = empty($aProductionArticle['author_contribution']) ? '' : $this->dealContent($aProductionArticle['author_contribution']);
//acknowledgment //acknowledgment
$aSearch['{{article_acknowledgment}}'] = empty($aProductionArticle['acknowledgment']) ? '' : '\Acknowledgments{'.$this->dealContent($aProductionArticle['acknowledgment']).'}'; $aSearch['{{article_acknowledgment}}'] = empty($aProductionArticle['acknowledgment']) ? '' : $this->dealContent($aProductionArticle['acknowledgment']);
//abbreviation //abbreviation
$aSearch['{{article_abbreviation}}'] = empty($aProductionArticle['abbreviation']) ? '' : '\Abbreviations{'.$this->dealContent($aProductionArticle['abbreviation']).'}'; $aSearch['{{article_abbreviation}}'] = empty($aProductionArticle['abbreviation']) ? '' : $this->dealContent($aProductionArticle['abbreviation']);
//文章引用信息 //文章引用信息
$sCite = $this->getArticleCite($aProductionArticle,$aJournal,$aJournalStage); $sCite = $this->getArticleCite($aProductionArticle,$aJournal,$aJournalStage);
$aSearch['{{article_cite}}'] = empty($sCite) ? '' : '\Citation{'.$sCite.'}'; $aSearch['{{article_cite}}'] = empty($sCite) ? '' : $sCite;
//文章类型
$aSearch['{{article_type}}'] = empty($aProductionArticle['type']) ? 'ARTICLE' : strtoupper($aProductionArticle['type']);
if($aSearch['{{article_type}}'] == 'MINIREVIEW'){
$aSearch['{{article_type}}'] = 'MINI REVIEW';
}
//获取文章时间 //获取文章时间
$aTime = $this->getArticleTime(['article_id' => $aProductionArticle['article_id']]); $aTime = $this->getArticleTime(['article_id' => $aProductionArticle['article_id']]);
$aTime = empty($aTime['data']) ? [] : $aTime['data']; $aTime = empty($aTime['data']) ? [] : $aTime['data'];
$aSearch['{{received_date}}'] = empty($aTime['received_date']) ? '' : $aTime['received_date']; $aSearch['{{received_date}}'] = empty($aTime['received_date']) ? '' : $aTime['received_date'];
$aSearch['{{revision_date}}'] = empty($aTime['revision_date']) ? '' : $aTime['revision_date']; $aSearch['{{revision_date}}'] = '';
if(in_array( $aSearch['{{article_type}}'], ['ARTICLE','REVIEW','MINI REVIEW'])){
$aSearch['{{revision_date}}'] = empty($aTime['revision_date']) ? '' : $aTime['revision_date'];
}
$aSearch['{{accepted_date}}'] = empty($aTime['accepted_date']) ? '' : $aTime['accepted_date']; $aSearch['{{accepted_date}}'] = empty($aTime['accepted_date']) ? '' : $aTime['accepted_date'];
$aSearch['{{pub_date}}'] = empty($aProductionArticle['pub_date']) ? '' : $aProductionArticle['pub_date']; $aSearch['{{pub_date}}'] = empty($aProductionArticle['pub_date']) ? '' : $aProductionArticle['pub_date'];
//终审编委名字
$aSearch['{{editorial_advisory_board}}'] = empty($aTime['editorial_advisory_board']) ? '' : $aTime['editorial_advisory_board'];
//获取编辑信息 //获取编辑信息
$executive_editor = empty($aProductionArticle['executive_editor']) ? '' : '\Executiveeditor{'.$this->dealContent($aProductionArticle['executive_editor']).'}'; $executive_editor = empty($aProductionArticle['executive_editor']) ? '' : $this->dealContent($aProductionArticle['executive_editor']);
$executive_editor_realname = empty($aUser['realname']) ? '' : '\Executiveeditor{'.$this->dealContent($aUser['realname']).'}'; $executive_editor_realname = empty($aUser['realname']) ? '' : $this->dealContent($aUser['realname']);
$executive_editor = empty($executive_editor) ? $executive_editor_realname : $executive_editor; $executive_editor = empty($executive_editor) ? $executive_editor_realname : $executive_editor;
$aSearch['{{executive_editor}}'] = $executive_editor; $aSearch['{{executive_editor}}'] = $executive_editor;
//摘要替换 //摘要替换
$sAbstract = empty($aProductionArticle['abstract']) ? '' : $this->dealContent($aProductionArticle['abstract']); $sAbstract = empty($aProductionArticle['abstract']) ? '' : $this->dealContent($aProductionArticle['abstract']);
if(!empty($sAbstract)){ if(!empty($sAbstract)){
$aRelace = ['Background:' => '\textcolor[HTML]{0070C0}{\textbf{Background:}}','Methods:' => '\textcolor[HTML]{0070C0}{\textbf{Methods:}}','Results:' => '\textcolor[HTML]{0070C0}{\textbf{Results:}}','Conclusion:' => '\textcolor[HTML]{0070C0}{\textbf{Conclusion:}}']; $aRelace = ['Background:' => '\textcolor[HTML]{0070C0}{\textbf{Background:}}','Methods:' => '\\ \textcolor[HTML]{0070C0}{\textbf{Methods:}}','Results:' => '\\ \textcolor[HTML]{0070C0}{\textbf{Results:}}','Conclusion:' => '\\ \textcolor[HTML]{0070C0}{\textbf{Conclusion:}}'];
$sAbstract = str_replace(array_keys($aRelace), array_values($aRelace), $sAbstract); $sAbstract = str_replace(array_keys($aRelace), array_values($aRelace), $sAbstract);
$sAbstract = '\tmrabstract{'.$sAbstract.'}'; $sAbstract = '\tmrabstract{'.$sAbstract.'}';
} }
@@ -194,24 +209,27 @@ page={{stage_page}},%号
//文章图片地址 //文章图片地址
$sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon']; $sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon'];
$is_graphical_abstract = empty($aProductionArticle['is_graphical_abstract']) ? 3 : $aProductionArticle['is_graphical_abstract'];//是否显示图文摘要1是2否3未选择
if(!empty($sIcon)){ if(!empty($sIcon)){
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon; $sIconUrl = ROOT_PATH.trim($this->sArticleIcon,'/').'/'.$sIcon;
// if(file_exists($sIconUrl)){ if(file_exists($sIconUrl) && $is_graphical_abstract == 1){
// $sIcon = '\KeywordImage{'.$sIconUrl.'}'; $sIconUrl = str_replace(ROOT_PATH.'public/', '', $sIconUrl);
// }else{ $sIconUrl = '../../'.$sIconUrl;
// $sIcon = ''; $sIcon = $sIconUrl;
// }
//下载图片
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
$aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
if(!empty($aImageInfo['data'])){
$aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
$sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
}else{ }else{
$sIcon = ''; $sIcon = '';
} }
// //下载图片
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
// $aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
// if(!empty($aImageInfo['data'])){
// $aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
// $sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
// }else{
// $sIcon = '';
// }
} }
$aSearch['{{article_icon}}'] = $sIcon; $aSearch['{{article_icon}}'] = '\KeywordImage{'.$sIcon.'}';
$aSearch['{{keywords}}'] = $sKeywords; $aSearch['{{keywords}}'] = $sKeywords;
// $aSearch['{{CLSFILEURL}}'] = ROOT_PATH.'public/latex/cls'; // $aSearch['{{CLSFILEURL}}'] = ROOT_PATH.'public/latex/cls';
$aSearch['{{article_id}}'] = $aProductionArticle['article_id']; $aSearch['{{article_id}}'] = $aProductionArticle['article_id'];
@@ -255,6 +273,7 @@ page={{stage_page}},%号
//查询正文信息 //查询正文信息
$aWhere = ['article_id' => $aProductionArticle['article_id'],'state' => 0]; $aWhere = ['article_id' => $aProductionArticle['article_id'],'state' => 0];
$aArticleMain = Db::name('article_main')->field('am_id,article_id,type,content,ami_id,amt_id,is_h1,is_h2,is_h3,sort')->where($aWhere)->order('sort')->select(); $aArticleMain = Db::name('article_main')->field('am_id,article_id,type,content,ami_id,amt_id,is_h1,is_h2,is_h3,sort')->where($aWhere)->order('sort')->select();
if(!empty($aArticleMain)){ if(!empty($aArticleMain)){
//查询图片 //查询图片
@@ -305,7 +324,13 @@ page={{stage_page}},%号
} }
if($value['is_h1'] == 0 && $value['is_h2'] == 0 && $value['is_h3'] == 0){ if($value['is_h1'] == 0 && $value['is_h2'] == 0 && $value['is_h3'] == 0){
if($value['type'] == 0 ){ if($value['type'] == 0 ){
$sMain .= $this->dealContent($value['content'],$aReferences)."\\par\n"; //处理内容
$sMainContent = $this->dealContent($value['content'],$aReferences);
// //替换myh3标签
// $contentpattern = '/<myh3>(.*?)<\/myh3>/is';
// $contentreplacement = '\\subsubsection{$1}';
// $sMainContent = preg_replace($contentpattern, $contentreplacement, $sMainContent);
$sMain .= $sMainContent."\\par\n";
} }
if($value['type'] == 1 ){//图片 if($value['type'] == 1 ){//图片
$aImageInfo = empty($aArticleMainImage[$value['ami_id']]) ? [] : $aArticleMainImage[$value['ami_id']]; $aImageInfo = empty($aArticleMainImage[$value['ami_id']]) ? [] : $aArticleMainImage[$value['ami_id']];
@@ -313,21 +338,20 @@ page={{stage_page}},%号
continue; continue;
} }
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon; $sMainImageUrl = ROOT_PATH.trim($this->sArticleMainImage,'/').'/'.$aImageInfo['url'];
// if(file_exists($sIconUrl)){ if(!file_exists($sMainImageUrl)){
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
// }else{
// $sIcon = '';
// }
//下载图片
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
$aResult = $this->getImage($sImagePath,$aProductionArticle['p_article_id']);
if(empty($aResult['data'])){
continue; continue;
} }
// //下载图片
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
// $aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
// if(empty($aResult['data'])){
// continue;
// }
// $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']]; // $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']];
// $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte); // $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte);
$aImageInfo['image_url'] = $aResult['data']; // $aImageInfo['image_url'] = $aResult['data'];
$aImageInfo['image_url'] = $sMainImageUrl;
$aDealImage = $this->dealImage($aImageInfo); $aDealImage = $this->dealImage($aImageInfo);
if(empty($aDealImage['data'])){ if(empty($aDealImage['data'])){
continue; continue;
@@ -353,7 +377,6 @@ page={{stage_page}},%号
} }
} }
} }
$aSearch['{{article_main}}'] = empty($sMain) ? '' : $sMain."\n"; $aSearch['{{article_main}}'] = empty($sMain) ? '' : $sMain."\n";
//模版内容替换 //模版内容替换
$sTemplateInfo = str_replace(array_keys($aSearch), array_values($aSearch), $sTemplateInfo); $sTemplateInfo = str_replace(array_keys($aSearch), array_values($aSearch), $sTemplateInfo);
@@ -382,7 +405,7 @@ page={{stage_page}},%号
} }
//查询作者机构 //查询作者机构
$aWhere['p_article_author_id'] = ['in',array_column($aAuthor, 'p_article_author_id')]; $aWhere['p_article_author_id'] = ['in',array_column($aAuthor, 'p_article_author_id')];
$aAuthorOrgan = Db::name('production_article_author_to_organ')->field('p_article_author_id,p_article_organ_id')->where($aWhere)->select(); $aAuthorOrgan = Db::name('production_article_author_to_organ')->field('p_article_author_id,p_article_organ_id')->where($aWhere)->order('p_article_author_id asc,p_article_organ_id asc')->select();
//查询机构信息 //查询机构信息
$aAuthorOrganList = []; $aAuthorOrganList = [];
if(!empty($aAuthorOrgan)){ if(!empty($aAuthorOrgan)){
@@ -401,9 +424,10 @@ page={{stage_page}},%号
} }
//处理作者 //处理作者
$sAuthor = $sCorrespondence = ''; $sAuthor = $sCorrespondence = '';
$iFirstNum = 0;
foreach ($aAuthor as $key => $value) { foreach ($aAuthor as $key => $value) {
//作者姓名 //作者姓名
$sName = empty($value['fifirst_name']) ? '' : $value['fifirst_name']; $sName = empty($value['first_name']) ? '' : $value['first_name'];
$sName = empty($sName) ? '' : $sName . ' ' .$value['last_name']; $sName = empty($sName) ? '' : $sName . ' ' .$value['last_name'];
if(empty($sName)){ if(empty($sName)){
$sName = empty($value['author_name']) ? '' : $value['author_name']; $sName = empty($value['author_name']) ? '' : $value['author_name'];
@@ -434,21 +458,32 @@ page={{stage_page}},%号
} }
if($value['is_first'] == 1){ if($value['is_first'] == 1){
$sAuthor .= '\firstauthor'."\n"; $sAuthor .= '\firstauthor'."\n";
$iFirstNum++;
} }
if(!empty($value['orcid'])){ if(!empty($value['orcid'])){
$sAuthor .= '\orcid{'.$this->dealContent($value['orcid']).'}'."\n"; $sAuthor .= '\orcid{'.$this->dealContent($value['orcid']).'}'."\n";
} }
if($value['is_report'] == 1){ if($value['is_report'] == 1){
$sCorrespondence .= $sName; $sCorrespondenceInfo = $sName;
if(!empty($aOrganList[0])){ // if(!empty($aOrganList[0])){
$sCorrespondence .= ','.trim($this->dealContent($aOrganList[0]),'.'); // $sCorrespondence .= ','.trim($this->dealContent($aOrganList[0]),'.');
// }
if(!empty($value['mailing_address'])){//通讯地址
$value['mailing_address'] = trim($value['mailing_address']);
$sCorrespondenceInfo .= ','.trim($this->dealContent($value['mailing_address']),'.');
} }
if(!empty($value['email'])){ if(!empty($value['email'])){
$sCorrespondence .= '.E-mail: '.trim($this->dealContent($value['email']),'.').'.'; $sCorrespondenceInfo .= '. E-mail:'.trim($this->dealContent($value['email']),'.').'.';
}else{
$sCorrespondenceInfo .= trim($sCorrespondenceInfo,'.').'.';
} }
$sCorrespondence .= $sCorrespondenceInfo .' ';
} }
} }
return ['author' => $sAuthor,'correspondence' => $sCorrespondence]; if($iFirstNum == 1 && !empty($sAuthor)){
$sAuthor = str_replace('\firstauthor'."\n", '', $sAuthor);
}
return ['author' => $sAuthor,'correspondence' => trim($sCorrespondence)];
} }
/** /**
@@ -476,28 +511,29 @@ page={{stage_page}},%号
$jabbr = empty($aJournal['jabbr']) ? '' : $aJournal['jabbr']; $jabbr = empty($aJournal['jabbr']) ? '' : $aJournal['jabbr'];
$stage_year = empty($aJournalStage['stage_year']) ? '' : $aJournalStage['stage_year']; $stage_year = empty($aJournalStage['stage_year']) ? '' : $aJournalStage['stage_year'];
$stage_vol = empty($aJournalStage['stage_vol']) ? '' : $aJournalStage['stage_vol']; $stage_vol = empty($aJournalStage['stage_vol']) ? '' : $aJournalStage['stage_vol'];
$sAbbr = empty($aArticle['abbr']) ? '' : trim(trim($aArticle['abbr'],'.'));
$aAbbr = empty($aArticle['abbr']) ? '' : explode(',', trim($aArticle['abbr'])); // $aAbbr = empty( $sAbbr ) ? [] : explode(',', trim( $sAbbr ));
if(!empty($aAbbr)){ // if(!empty($aAbbr)){
$sEnd = end($aAbbr); // $sEnd = end($aAbbr);
if($sEnd != 'et al'){ // if($sEnd != 'et al'){
$aArticle['abbr'] = implode(',', array_slice($aAbbr, 0,3)); // $aThree = array_slice($aAbbr, 0,3);
if(!empty($aArticle['abbr'])){ // $sAbbr = implode(',', $aThree);
$aArticle['abbr'] .= ', et al'; // if(!empty( $sAbbr ) && count($aThree) > 3){
} // $sAbbr .= ', et al';
} // }
} // }
// }
$sCite = ''; $sCite = '';
if ($aArticle['journal_id'] == 22) { if ($aArticle['journal_id'] == 22) {
$sCite = $aArticle['abbr'] . '. ' . $aArticle['title'] . '[J]. ' . choiseJabbr($aArticle['article_id'],$jabbr) . ',' . $stage_year . ',' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi']; $sCite = $sAbbr . '. ' . $aArticle['title'] . '[J]. ' . choiseJabbr($aArticle['article_id'],$jabbr) . ',' . $stage_year . ',' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi'];
$sCite = $this->dealContent($sCite); $sCite = $this->dealContent($sCite);
} else { } else {
$sCite = $this->dealContent($aArticle['abbr']) . '. ' . $this->dealContent($aArticle['title']) . '. \textit{' . $this->dealContent(choiseJabbr($aArticle['article_id'], $jabbr)) . '}. ' . $stage_year . ';' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi']; $sCite = $this->dealContent($sAbbr) . '. ' . $this->dealContent($aArticle['title']) . '. \textit{' . $this->dealContent(choiseJabbr($aArticle['article_id'], $jabbr)) . '}. ' . $stage_year . ';' . $stage_vol . $no . $aArticle['npp'] . '. doi:' . $aArticle['doi'];
} }
return $sCite; return $sCite;
} }
private function getArticleTime($aParam = []){ public function getArticleTime($aParam = []){
//必填值验证 //必填值验证
$iArticleId = empty($aParam['article_id']) ? '' : $aParam['article_id']; $iArticleId = empty($aParam['article_id']) ? '' : $aParam['article_id'];
if(empty($iArticleId)){ if(empty($iArticleId)){
@@ -509,6 +545,15 @@ page={{stage_page}},%号
if(empty($aArticle)){ if(empty($aArticle)){
return array('status' => 2,'msg' => 'The article does not exist' ); return array('status' => 2,'msg' => 'The article does not exist' );
} }
//查询终审-审稿记录
$aWhere = ['article_id' => $iArticleId,'state' => ['in',[1,2,3]]];
$aFinalReviewerId = Db::name('article_reviewer_final')->order('review_time desc')->where($aWhere)->column('reviewer_id');
//查询审稿人姓名
$aUserName = [];
if(!empty($aFinalReviewerId)){
$aWhere = ['user_id' => ['in',array_unique($aFinalReviewerId)],'state' => 0,'realname' => ['<>','']];
$aUserName = Db::name('user')->where($aWhere)->column('realname');
}
//获取文章记录 //获取文章记录
$aWhere = ['article_id' => $iArticleId,'state' => 0,'state_to' => ['in',[0,1,5]]]; $aWhere = ['article_id' => $iArticleId,'state' => 0,'state_to' => ['in',[0,1,5]]];
$aArticleMsg = Db::name('article_msg')->field('state_from,state_to,ctime')->where($aWhere)->order('ctime deac')->select(); $aArticleMsg = Db::name('article_msg')->field('state_from,state_to,ctime')->where($aWhere)->order('ctime deac')->select();
@@ -532,6 +577,7 @@ page={{stage_page}},%号
$aTime['received_date'] = empty($iReceivedTime) ? '' : $this->timestampToEnglishDate($iReceivedTime); $aTime['received_date'] = empty($iReceivedTime) ? '' : $this->timestampToEnglishDate($iReceivedTime);
$aTime['revision_date'] = empty($iRevisionTime) ? '' : $this->timestampToEnglishDate($iRevisionTime); $aTime['revision_date'] = empty($iRevisionTime) ? '' : $this->timestampToEnglishDate($iRevisionTime);
$aTime['accepted_date'] = empty($iAcceptedTime) ? '' : $this->timestampToEnglishDate($iAcceptedTime); $aTime['accepted_date'] = empty($iAcceptedTime) ? '' : $this->timestampToEnglishDate($iAcceptedTime);
$aTime['editorial_advisory_board'] = empty($aUserName) ? '' : implode(',', $aUserName);
return ['status' => 1,'msg' => 'success','data' => $aTime]; return ['status' => 1,'msg' => 'success','data' => $aTime];
} }
/** /**
@@ -641,7 +687,8 @@ page={{stage_page}},%号
$isWideImage = $imageWidth > $wideImageThreshold; $isWideImage = $imageWidth > $wideImageThreshold;
// 生成LaTeX图片代码 // 生成LaTeX图片代码
$sImageUrl = './image/'.basename($sImageUrl); $sImageUrl = str_replace(ROOT_PATH.'public/', '', $sImageUrl);
$sImageUrl = '../../'.$sImageUrl;
if ($isWideImage) { if ($isWideImage) {
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏 $latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
$latexLines[] = " \\centering"; $latexLines[] = " \\centering";