From 0b706eca4cf27bd522c647fc40da8bbcdeb8db42 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 24 Jul 2023 09:35:35 +0800 Subject: [PATCH] 1 --- application/api/controller/Base.php | 12 +++++++++ application/api/controller/Preaccept.php | 19 +++++++++++--- application/api/controller/Production.php | 31 +++++++++++++++++++++++ application/api/controller/Reviewer.php | 25 ++++++++++++++++++ 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Base.php b/application/api/controller/Base.php index 21a899a..d6c6502 100644 --- a/application/api/controller/Base.php +++ b/application/api/controller/Base.php @@ -69,6 +69,7 @@ class Base extends Controller protected $apply_reviewer_obj = ''; protected $promotion_obj = ''; protected $promotion_email_obj = ''; + protected $article_reviewer_repeat_obj = ''; public function __construct(\think\Request $request = null) @@ -135,6 +136,7 @@ class Base extends Controller $this->apply_reviewer_obj = Db::name("apply_reviewer"); $this->promotion_obj = Db::name("promotion"); $this->promotion_email_obj = Db::name("promotion_email"); + $this->article_reviewer_repeat_obj = Db::name("article_reviewer_repeat"); } @@ -201,6 +203,16 @@ class Base extends Controller return $frag; } + public function delOneRefer($p_refer_id){ + + $refer_info = $this->production_article_refer_obj->where('p_refer_id', $p_refer_id)->find(); + if(!$refer_info){ + return ""; + } + $this->production_article_refer_obj->where('p_article_id', $refer_info['p_article_id'])->where('index', ">", $refer_info['index'])->where('state', 0)->setDec('index'); + $this->production_article_refer_obj->where('p_refer_id', $p_refer_id)->update(['state' => 1]); + } + public function getMajorShu($major) { diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php index 0bbce01..a5c1b6a 100644 --- a/application/api/controller/Preaccept.php +++ b/application/api/controller/Preaccept.php @@ -263,12 +263,25 @@ class Preaccept extends Base if (!$rule->check($data)) { return jsonError($rule->getError()); } - $refer_info = $this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->find(); - $this->production_article_refer_obj->where('p_article_id', $refer_info['p_article_id'])->where('index', ">", $refer_info['index'])->where('state', 0)->setDec('index'); - $this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->update(['state' => 1]); + $this->delOneRefer($data['p_refer_id']); return jsonSuccess([]); } + public function delRefers(){ + $data = $this->request->post(); + $rule = new Validate([ + "ids" => "require|array" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + foreach ($data['ids'] as $v){ + $this->delOneRefer($v); + } + return jsonSuccess([]); + + } + /**编辑refer * @return \think\response\Json * @throws \think\Exception diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index a9a5923..e1253f6 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -177,6 +177,23 @@ class Production extends Base return jsonSuccess([]); } + /**清空web的主体内容 + * @return void + */ + public function clearWebMains(){ + $data = $this->request->post(); + $rule = new Validate([ + "article_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $url = "http://journalapi.tmrjournals.com/public/index.php/master/Article/clearArticleMainForSubmission"; + $res = object_to_array(json_decode(myPost($url,$data))); + return jsonSuccess([]); + + } + public function delWebMain(){ @@ -192,6 +209,20 @@ class Production extends Base return jsonSuccess([]); } + public function delWebMains(){ + $data = $this->request->post(); + $rule = new Validate([ + "ids"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $program['ids'] = json_encode($data['ids']); + $url = "http://journalapi.tmrjournals.com/public/index.php/master/Article/delArticleMainsForSubmission"; + $res = object_to_array(json_decode(myPost($url,$program))); + return jsonSuccess([]); + } + public function editWebMain(){ $data = $this->request->post(); $rule = new Validate([ diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index 91e13ad..fc61316 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -92,6 +92,31 @@ class Reviewer extends Base return jsonSuccess($re); } + /**创建复审实例 + * @return void + */ + public function startRepeatReviewer(){ + $data = $this->request->post(); + $rule = new Validate([ + "art_rev_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $article_reviewer_info = $this->article_reviewer_obj->where('art_rev_id',$data['art_rev_id'])->find(); + $reviewer_info = $this->user_obj->where('user_id',$article_reviewer_info['reviewer_id'])->find(); + $article_info = $this->article_obj->where('article_id',$article_reviewer_info['article_id'])->find(); + + //添加实例数据 + $insert['art_rev_id'] = $data['art_rev_id']; + $insert['ctime'] = time(); + $this->article_reviewer_repeat_obj->insert($insert); + + //发送邮件至审稿人,提醒到系统内复审稿件 + + return jsonSuccess([]); + } + /** * @title 获取历史审稿实例列表 * @description 获取历史审稿实例列表