This commit is contained in:
wangjinlei
2021-08-24 14:58:13 +08:00
parent 3ae9be1e60
commit 5c5143166c
6 changed files with 1333 additions and 52 deletions

View File

@@ -6,6 +6,10 @@ use think\Controller;
use think\Db;
use TCPDF;
/**
* @title 审稿人接口
* @description 审稿人接口
*/
class Reviewer extends Controller {
protected $user_obj = '';
@@ -20,6 +24,8 @@ class Reviewer extends Controller {
protected $article_reviewer_obj = '';
protected $article_reviewer_file_obj = '';
protected $article_reviewer_question_obj = '';
protected $chief_to_journal_obj = '';
protected $board_to_journal_obj = '';
//put your code here
public function __construct(\think\Request $request = null) {
@@ -36,6 +42,8 @@ class Reviewer extends Controller {
$this->article_reviewer_obj = Db::name('article_reviewer');
$this->article_reviewer_file_obj = Db::name('article_reviewer_file');
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
$this->board_to_journal_obj = Db::name('board_to_journal');
}
/**
@@ -56,8 +64,66 @@ class Reviewer extends Controller {
return json(['code' => 0, 'data' => $res, 'total' => $count]);
}
/**
* @title 获取待审审稿实例列表
* @description 获取待审审稿实例列表
* @author wangjinlei
* @url /api/Reviewer/getReviewerListPending
* @method POST
*
* @param name:user_id type:int require:1 desc:审稿人id
*
* @return lists:数据列表#
*/
public function getReviewerListPending(){
$data = $this->request->post();
//获取审稿人基本信息
$reviewer_info = $this->user_obj->where('user_id',$data['user_id'])->find();
$res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.title article_title,t_journal.title journal_title,t_article.accept_sn accept_sn')
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where('t_article_reviewer.state',0)
->select();
$re['lists'] = $res;
return jsonSuccess($re);
}
/**
* @title 获取历史审稿实例列表
* @description 获取历史审稿实例列表
* @author wangjinlei
* @url /api/Reviewer/getReviewerListHistory
* @method POST
*
* @param name:user_id type:int require:1 desc:审稿人id
* @param name:pageIndex type:int require:1 desc:当前页码
* @param name:pageSize type:int require:1 desc:每个页面的数据条数
*
* @return lists:数据列表#
*/
public function getReviewerListHistory(){
$data = $this->request->post();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$reviewer_info = $this->user_obj->where('user_id',$data['user_id'])->find();
$res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article.title article_title,t_journal.title journal_title,t_article.accept_sn accept_sn')
->join('t_article', 't_article_reviewer.article_id = t_article.article_id', 'LEFT')
->join('t_journal', 't_article.journal_id = t_journal.journal_id', 'LEFT')
->where('t_article_reviewer.reviewer_id', $reviewer_info['user_id'])
->where('t_article_reviewer.state','>',0)
->order('t_article_reviewer.state')
->limit($limit_start, $data['pageSize'])
->select();
$re['lists'] = $res;
return jsonSuccess($re);
}
/**
* 获取审稿人详情
*
*/
public function getReviewerDetail(){
$uid = $this->request->post('rid');
@@ -72,6 +138,54 @@ class Reviewer extends Controller {
return json(['data'=>$base_info]);
}
/**
* @title 获取审稿人详情
* @description 获取审稿人详情
* @author wangjinlei
* @url /api/Reviewer/getReviewerDetail1
* @method POST
*
* @param name:user_id type:int require:1 desc:审稿人id
*/
public function getReviewerDetail1(){
$data = $this->request->post();
//获取基本信息
$base_info = $this->user_obj->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id')->where('t_user.user_id',$data['user_id'])->find();
//增加major
$major_res = $this->reviewer_major_obj->where('major_id',$base_info['major'])->column('title');
$base_info['major_title'] = $major_res?$major_res[0]:'';
$cmajor_res = $this->reviewer_major_obj->where('major_id',$base_info['cmajor'])->column('title');
$base_info['cmajor_title'] = $cmajor_res?$cmajor_res[0]:'';
//获取审稿人期刊与对应身份
$frag = [];
$revs = $this->reviewer_to_journal_obj->join('t_journal','t_reviewer_to_journal.journal_id = t_journal.journal_id','left')->where('t_reviewer_to_journal.reviewer_id',$data['user_id'])->where('t_reviewer_to_journal.state',0)->select();
$chiefs = $this->chief_to_journal_obj->join('t_journal','t_chief_to_journal.journal_id = t_journal.journal_id','left')->where('t_chief_to_journal.user_id',$data['user_id'])->where('t_chief_to_journal.state',0)->select();
$boards = $this->board_to_journal_obj->join('t_journal','t_board_to_journal.journal_id = t_journal.journal_id','left')->where('t_board_to_journal.user_id',$data['user_id'])->where('t_board_to_journal.state',0)->select();
foreach ($revs as $v){
$frag[] = array(
'journal'=>$v,
'type'=>'reviewer'
);
}
foreach ($chiefs as $v){
$frag[] = array(
'journal'=>$v,
'type'=>'chief'
);
}
foreach ($boards as $v){
$frag[] = array(
'journal'=>$v,
'type'=>'board'
);
}
$re['journals'] = $frag;
$re['reviewer'] = $base_info;
return jsonSuccess($re);
}
/**
* 更改审稿人信息
*/
@@ -145,8 +259,16 @@ class Reviewer extends Controller {
return json($frag);
}
/**
* 获取文章信息列表
* @title 获取文章文件列表
* @description 获取文章文件列表
* @author wangjinlei
* @url /api/Reviewer/getAFilelistByID
* @method POST
*
* @param name:revid type:int require:1 desc:art_rev_id文章审稿实例id
*
*/
public function getAFilelistByID(){
$rev_id = $this->request->post('revid');
@@ -162,8 +284,16 @@ class Reviewer extends Controller {
return json(['data'=>$file_list]);
}
/**
* 获取文章审稿实例详情(审稿人,编辑)
* @title 获取文章审稿实例详情(审稿人,编辑)
* @description 获取文章审稿实例详情(审稿人,编辑)
* @author wangjinlei
* @url /api/Reviewer/getartrevdate
* @method POST
*
* @param name:revid type:int require:1 desc:art_rev_id文章审稿实例id
* @param name:human type:string require:1 desc:(reviewer/editor)
*/
public function getartrevdate() {
//接受参数