1
This commit is contained in:
@@ -41,6 +41,7 @@ class Article extends Controller {
|
||||
protected $email_log_obj = '';
|
||||
protected $email_template_obj = '';
|
||||
protected $production_article_obj = '';
|
||||
protected $company_top_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
@@ -72,6 +73,7 @@ class Article extends Controller {
|
||||
$this->email_log_obj = Db::name('email_log');
|
||||
$this->email_template_obj = Db::name('email_template');
|
||||
$this->production_article_obj = Db::name('production_article');
|
||||
$this->company_top_obj = Db::name('company_top');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,6 +139,8 @@ class Article extends Controller {
|
||||
->find();
|
||||
$res[$key]['transinfo'] = $transfer_info;
|
||||
|
||||
//查询作者信息
|
||||
// $res[$key]['author'] = $this->article_author_obj->where('article_id',$val['article_id'])->where('state',0)->select();
|
||||
|
||||
//对于接受的文章查询后续状态
|
||||
$proof_state = 0;
|
||||
@@ -236,6 +240,15 @@ class Article extends Controller {
|
||||
->where("t_article_reviewer.state",'in',[1,2,3])
|
||||
->select();
|
||||
$res[$key]['review'] = $cache_review;
|
||||
|
||||
//查询作者信息
|
||||
$res[$key]['author'] = $this->article_author_obj->where('article_id',$val['article_id'])->where('state',0)->select();
|
||||
|
||||
//查询H指数添加人信息
|
||||
$res[$key]['H'] = $this->getHPerson($val['article_id']);
|
||||
|
||||
//查询文章通讯作者的账号信息
|
||||
$res[$key]['reports'] = $this->getReportAuthors($val['article_id']);
|
||||
}
|
||||
|
||||
//添加国家信息
|
||||
@@ -261,6 +274,33 @@ class Article extends Controller {
|
||||
return json(['total' => $count, 'data' => $res]);
|
||||
}
|
||||
|
||||
private function getReportAuthors($article_id){
|
||||
$article_info = $this->article_obj->where('article_id',$article_id)->find();
|
||||
$authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
|
||||
foreach($authors as $k => $v){
|
||||
$c_user = $this->user_obj->where('email',$v['email'])->find();
|
||||
$authors[$k]['author_account'] = $c_user;
|
||||
}
|
||||
return $authors;
|
||||
}
|
||||
|
||||
|
||||
private function getHPerson($article_id){
|
||||
$article_info = $this->article_obj->where('article_id',$article_id)->find();
|
||||
$authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
|
||||
$user_id = $article_info['user_id'];
|
||||
$g_index = 0;
|
||||
foreach($authors as $v){
|
||||
$c_user = $this->user_obj->where('email',$v['email'])->find();
|
||||
if($c_user['google_index']>=$g_index){
|
||||
$user_id = $c_user['user_id'];
|
||||
$g_index = $c_user['google_index'];
|
||||
}
|
||||
}
|
||||
$user_info = $this->user_obj->where('user_id',$user_id)->find();
|
||||
return $user_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章的用户详情
|
||||
*/
|
||||
@@ -587,6 +627,11 @@ class Article extends Controller {
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
public function getAllCompany(){
|
||||
$companys = $this->company_top_obj->select();
|
||||
$re['companys'] = $companys;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 修回文章
|
||||
@@ -1034,7 +1079,7 @@ class Article extends Controller {
|
||||
$tt .= "Please also find the Manuscript Check List attached. Check and complete each item one by one. If you could put the completed form on the revised manuscript's last page, it would speed up the processing process of the manuscript. Please note that this is voluntary.<br><br>";
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
}else if($data['state']==6){//终审
|
||||
$tt = 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',<br>';
|
||||
$tt = 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',<br>';
|
||||
$tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.';
|
||||
}else{
|
||||
$tt = '"'.$article_info['title'].'"<br>';
|
||||
@@ -1522,6 +1567,7 @@ class Article extends Controller {
|
||||
//上传文章作者信息
|
||||
$author_email = [];
|
||||
$authors = [];
|
||||
$res_add_user = true;
|
||||
foreach ($data['authorList'] as $v) {
|
||||
if ($v['firstname'] == '') {
|
||||
continue;
|
||||
@@ -1542,6 +1588,22 @@ class Article extends Controller {
|
||||
$cache['email'] = trim($v['email']);
|
||||
$cache['name'] = trim($v['firstname']).' '.trim($v['lastname']);
|
||||
$author_email[] = $cache;
|
||||
|
||||
//通讯作者用户添加
|
||||
if($v['isReport']=="true"){
|
||||
$re_user_check = $this->user_obj->where('account|email',trim($v['email']))->find();
|
||||
if(!$re_user_check){
|
||||
$inser_data['account'] = trim($v['email']);
|
||||
$inser_data['password'] = md5('123456qwe');
|
||||
$inser_data['email'] = trim($v['email']);
|
||||
$inser_data['realname'] = trim($v['firstname']).' '.trim($v['lastname']);
|
||||
$inser_data['ctime'] = time();
|
||||
$c_res_add_user=$this->user_obj->insertGetId($inser_data);
|
||||
if($res_add_user){
|
||||
$res_add_user = $c_res_add_user;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$res_author = $this->article_author_obj->insertAll($authors);
|
||||
|
||||
@@ -1627,7 +1689,7 @@ class Article extends Controller {
|
||||
$recommend_res = $this->addRecommentReviewer($v,$journal_info['journal_id'],$user_res['user_id'],$res);
|
||||
}
|
||||
|
||||
if ($res && $res_author && $transr && $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();
|
||||
$this->ai_scor($res);
|
||||
return json(['code' => 0]);
|
||||
@@ -1637,11 +1699,38 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function ffff(){
|
||||
// public function ffff(){
|
||||
// $data = $this->request->post();
|
||||
// $this->ai_scor($data['article_id']);
|
||||
// }
|
||||
|
||||
|
||||
public function editHindexAndScor(){
|
||||
$data = $this->request->post();
|
||||
$this->ai_scor($data['article_id']);
|
||||
$rule = new Validate([
|
||||
'article_id'=>'require',
|
||||
'email'=>'require',
|
||||
'Hindex'=>'require',
|
||||
'editor_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$editor_info = $this->user_obj->where('user_id',$data['editor_id'])->find();
|
||||
|
||||
$updata['google_index']=$data['Hindex'];
|
||||
$updata['google_time'] = time();
|
||||
$updata['google_editor'] = $editor_info['realname'];
|
||||
|
||||
$this->user_obj->where('email',$data['email'])->update($updata);
|
||||
$this->ai_scor($data['article_id']);
|
||||
return jsonSuccess([]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 人工智能打分
|
||||
*/
|
||||
@@ -1651,7 +1740,18 @@ class Article extends Controller {
|
||||
->order('ctime desc')
|
||||
->limit(1)
|
||||
->select();
|
||||
$user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
|
||||
|
||||
$authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
|
||||
$user_id = $article_info['user_id'];
|
||||
$g_index = 0;
|
||||
foreach($authors as $v){
|
||||
$c_user = $this->user_obj->where('email',$v['email'])->find();
|
||||
if($c_user['google_index']>=$g_index){
|
||||
$user_id = $c_user['user_id'];
|
||||
$g_index = $c_user['google_index'];
|
||||
}
|
||||
}
|
||||
$user_info = $this->user_obj->where('user_id',$user_id)->find();
|
||||
$fen = 0;
|
||||
//h指数分数
|
||||
$h_fen = 0;
|
||||
@@ -1707,7 +1807,14 @@ class Article extends Controller {
|
||||
}
|
||||
//单位
|
||||
$dw_fen = 0;
|
||||
|
||||
$report_author = $this->article_author_obj->where('email',$user_info['email'])->find();
|
||||
if($report_author){
|
||||
$ca_res = $this->company_top_obj->where('title',$report_author['company'])->find();
|
||||
if($ca_res){
|
||||
$dw_fen = 1.5;
|
||||
$fen+=1.5;
|
||||
}
|
||||
}
|
||||
|
||||
//领域
|
||||
$ly_fen = 0;
|
||||
|
||||
@@ -33,6 +33,7 @@ class Special extends Controller
|
||||
protected $chief_to_journal_obj = '';
|
||||
protected $article_reviewer_obj = '';
|
||||
protected $user_reviewer_recommend_obj = '';
|
||||
protected $company_top_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null)
|
||||
{
|
||||
@@ -58,6 +59,7 @@ class Special extends Controller
|
||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
||||
$this->company_top_obj = Db::name('company_top');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -565,6 +567,7 @@ class Special extends Controller
|
||||
|
||||
if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) {
|
||||
Db::commit();
|
||||
$this->ai_scor($data['article_id']);
|
||||
return json(['code' => 0]);
|
||||
} else {
|
||||
Db::rollback();
|
||||
@@ -572,6 +575,127 @@ class Special extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工智能打分
|
||||
*/
|
||||
public function ai_scor($article_id){
|
||||
$article_info = $this->article_obj->where('article_id',$article_id)->find();
|
||||
$files = $this->article_file_obj->where('article_id',$article_id)->where('type_name','manuscirpt')
|
||||
->order('ctime desc')
|
||||
->limit(1)
|
||||
->select();
|
||||
|
||||
$authors = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
|
||||
$user_id = $article_info['user_id'];
|
||||
$g_index = 0;
|
||||
foreach($authors as $v){
|
||||
$c_user = $this->user_obj->where('email',$v['email'])->find();
|
||||
if($c_user['google_index']>=$g_index){
|
||||
$user_id = $c_user['user_id'];
|
||||
$g_index = $c_user['google_index'];
|
||||
}
|
||||
}
|
||||
$user_info = $this->user_obj->where('user_id',$user_id)->find();
|
||||
$fen = 0;
|
||||
//h指数分数
|
||||
$h_fen = 0;
|
||||
if($user_info['google_index']>=20){
|
||||
$h_fen = 4;
|
||||
}elseif($user_info['google_index']>=6){
|
||||
$h_fen = 3;
|
||||
}elseif($user_info['google_index']>=2){
|
||||
$h_fen = 1;
|
||||
}else{
|
||||
$h_fen = 0;
|
||||
}
|
||||
$fen += $h_fen;
|
||||
//图表
|
||||
$b_fen = 0;
|
||||
$p_num = 0;
|
||||
$url = "http://ts.tmrjournals.com/api/typeset/readPic";
|
||||
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
|
||||
$res = object_to_array(json_decode(myPost($url, $program)));
|
||||
$wp = $res['data'];
|
||||
|
||||
$pics = $this->article_file_obj->where('article_id',$article_id)->where('type_name','picturesAndTables')->select();
|
||||
$np = 0;
|
||||
foreach($pics as $v){
|
||||
$ext = substr(strrchr($v['file_url'],'.'),1);
|
||||
if($ext=='zip'){
|
||||
$cn = $this->readZip(ROOT_PATH . "public".DS.$v['file_url']);
|
||||
$np += $cn;
|
||||
}else{
|
||||
$np++;
|
||||
}
|
||||
}
|
||||
$p_num = $wp>$np?$wp:$np;
|
||||
|
||||
if($p_num>3){
|
||||
$b_fen = 2;
|
||||
}elseif($p_num>=1){
|
||||
$b_fen = 1;
|
||||
}else{
|
||||
$b_fen = 0;
|
||||
}
|
||||
|
||||
$fen += $b_fen;
|
||||
//国家
|
||||
$c_fen = 0;
|
||||
$author = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->find();
|
||||
if($author['country']!=""){
|
||||
$coun = $this->country_obj->where('en_name',$author['country'])->find();
|
||||
if($coun&&$coun['is_hot']==1){
|
||||
$c_fen = 1;
|
||||
$fen+=1;
|
||||
}
|
||||
}
|
||||
//单位
|
||||
$dw_fen = 0;
|
||||
$report_author = $this->article_author_obj->where('email',$user_info['email'])->find();
|
||||
if($report_author){
|
||||
$ca_res = $this->company_top_obj->where('title',$report_author['company'])->find();
|
||||
if($ca_res){
|
||||
$dw_fen = 1.5;
|
||||
$fen+=1.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//领域
|
||||
$ly_fen = 0;
|
||||
$m = $this->major_obj->where('major_id',$article_info['major_id'])->find();
|
||||
if($m['is_hot']==1){
|
||||
$ly_fen = 1;
|
||||
$fen += 1;
|
||||
}
|
||||
|
||||
//基金
|
||||
$jj_fen = 0;
|
||||
if(strlen($article_info['fund'])>15){
|
||||
$jj_fen = 0.5;
|
||||
$fen += 0.5;
|
||||
}
|
||||
// return $fen;
|
||||
$updata['scoring'] = $fen;
|
||||
$updata['h_fen'] = $h_fen;
|
||||
$updata['b_fen'] = $b_fen;
|
||||
$updata['c_fen'] = $c_fen;
|
||||
$updata['dw_fen'] = $dw_fen;
|
||||
$updata['ly_fen'] = $ly_fen;
|
||||
$updata['jj_fen'] = $jj_fen;
|
||||
|
||||
$this->article_obj->where('article_id',$article_id)->update($updata);
|
||||
}
|
||||
|
||||
private function readZip($file){
|
||||
$zip = new \ZipArchive();
|
||||
if($zip->open($file)===true){
|
||||
return $zip->numFiles;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 客座编辑添加审稿人
|
||||
*/
|
||||
|
||||
@@ -212,6 +212,45 @@ class Super extends Controller{
|
||||
return $re;
|
||||
}
|
||||
|
||||
// public function company(){
|
||||
// $file = "d://company.xlsx";
|
||||
// $res = $this->readExcel($file);
|
||||
// $frag = [];
|
||||
// foreach($res as $v){
|
||||
// $ca['title'] = trim($v);
|
||||
// $ca['ctime'] = time();
|
||||
// $ca['state'] = 0;
|
||||
// $frag[] = $ca;
|
||||
// }
|
||||
// Db::name('company_top')->insertAll($frag);
|
||||
// }
|
||||
|
||||
private function readExcel($path)
|
||||
{
|
||||
$extension = substr($path, strrpos($path, '.') + 1);
|
||||
vendor("PHPExcel.PHPExcel");
|
||||
if ($extension == 'xlsx') {
|
||||
$objReader = new \PHPExcel_Reader_Excel2007();
|
||||
$objPHPExcel = $objReader->load($path);
|
||||
} else if ($extension == 'xls') {
|
||||
$objReader = new \PHPExcel_Reader_Excel5();
|
||||
$objPHPExcel = $objReader->load($path);
|
||||
}
|
||||
$sheet = $objPHPExcel->getSheet(0);
|
||||
$highestRow = $sheet->getHighestRow();
|
||||
$frag = [];
|
||||
for ($i = 3; $i <= $highestRow; $i++) {
|
||||
// $aa['username'] = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
|
||||
// $aa['has'] = '未出证';
|
||||
// if($aa['username']==''){
|
||||
// continue;
|
||||
// }
|
||||
$aa = $objPHPExcel->getActiveSheet()->getCell("B" . $i)->getValue();
|
||||
$frag[] = $aa;
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
|
||||
public function mutest(){
|
||||
$start_time = strtotime('2021-01-01');
|
||||
$end_time = strtotime('2021-04-15 23:59:59');
|
||||
|
||||
Reference in New Issue
Block a user