This commit is contained in:
wangjinlei
2023-01-29 17:41:11 +08:00
parent dbfc3c6452
commit b1b4704964
7 changed files with 1497 additions and 882 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -159,9 +159,18 @@ class Auto extends Controller {
public function pppp(){
$extension_obj = Db::name('exten');
$file = "D://11.xlsx";
$journal_abbr_obj = Db::name('journal_abbr');
$file = "D://bbbb.xlsx";
$res = $this->readExcel($file);
$f = [];
foreach($res as $v){
$cache['full_name'] = $v['full'];
$cache['little_name'] = $v['aa'];
$f[] = $cache;
// $company_top_obj->insert($cache);
}
$journal_abbr_obj->insertAll($f);
// // dump($res);
// $extension_obj->insertAll($res);
}
@@ -180,15 +189,19 @@ class Auto extends Controller {
$highestRow = $sheet->getHighestRow();
$frag = [];
$frag1 = [];
for ($i = 2; $i <= $highestRow; $i++) {
$aa = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
for ($i = 0; $i <= $highestRow; $i++) {
$full = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
$aa = $objPHPExcel->getActiveSheet()->getCell("B" . $i)->getValue();
if($aa==''){
continue;
}
if(!in_array($aa,$frag1)){
$frag1[] = $aa;
$frag[] = ['email'=>$aa];
}
// if(!in_array($aa,$frag1)){
// $frag1[] = $aa;
// $frag[] = ['email'=>$aa];
// }
$ch['full'] = $full;
$ch['aa'] = $aa;
$frag[] = $ch;
}
return $frag;
}

View File

@@ -323,7 +323,7 @@ class Production extends Controller
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$update['refer_frag'] = trim($data['refer_frag']);
$updata['refer_frag'] = trim($data['refer_frag']);
$updata['cs'] = 1;
$this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->update($updata);
return jsonSuccess([]);
@@ -436,6 +436,7 @@ class Production extends Controller
$pra['doi'] = $p_info['doi'];
$pra['tradition_tag'] = $p_info['tradition_tag'];
$pra['tradition'] = $p_info['tradition'];
$pra['mhoo'] = $p_info['mhoo'];
$pra['abstract'] = $p_info['abstract'];
$pra['pub_date'] = $p_info['pub_date'];
$pra['abbr'] = $p_info['abbr'];
@@ -623,6 +624,86 @@ class Production extends Controller
}
// public function testTypeSetting(){
// $data['p_article_id'] = 7;
// $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
// $article_info = $this->article_obj->where('article_id', $p_info['article_id'])->find();
// $journal_info = $this->journal_obj->where('journal_id', $p_info['journal_id'])->find();
// $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
// $typesetInfo = [];
// $typesetInfo['info_title'] = $p_info['title'];
// $typesetInfo['info_type'] = $p_info['type'];
// $typesetInfo['doi'] = $p_info['doi'];
// $typesetInfo['topic'] = '';
// $typesetInfo['mainText'] = $p_info['main'];
// $au_res = $this->authorFormate($data['p_article_id']);
// $typesetInfo['author'] = $au_res['author'];
// $typesetInfo['authorAddress'] = $au_res['address'];
// $typesetInfo['authorContribution'] = $p_info['author_contribution'];
// //查询通讯作者
// $corr_authors = $this->production_article_author_obj->where('p_article_id', $data['p_article_id'])->where('is_report', 1)->where('state', 0)->select();
// $corrauthor = '';
// $corremail = '';
// foreach ($corr_authors as $v) {
// $corrauthor .= trim($v['first_name']) . ' ' . trim($v['last_name']) . '. ';
// $corremail .= $v['email'] . '. ';
// }
// $typesetInfo['authorCorresponding'] = substr(trim($corrauthor), 0, -1);
// $typesetInfo['authorCorrespondingEmail'] = substr(trim($corremail), 0, -1);
// $typesetInfo['traditon'] = $p_info['tradition'];
// $typesetInfo['journal'] = $journal_info['title'];
// $typesetInfo['jabbr'] = $journal_info['jabbr'];
// //查询分期
// $url = 'http://journalapi.tmrjournals.com/public/index.php/master/Journal/getStageDetail';
// $cs['journal_stage_id'] = $p_info['journal_stage_id'];
// $list = object_to_array(json_decode(myPost($url, $cs)));
// $stage_re = $list['data']['stage'];
// $typesetInfo['stage'] = $stage_re['stage_year'] . ';' . $stage_re['stage_vol'] . '(' . $stage_re['stage_no'] . '):' . $p_info['npp']; //2022;6(1):17
// $typesetInfo['little_author'] = $p_info['abbr'];
// $typesetInfo['website'] = $journal_info['website'];
// $typesetInfo['acknowledgment'] = $p_info['acknowledgment'];
// $typesetInfo['received_date'] = date("d F Y", $article_info['ctime']);;
// $typesetInfo['accepted_date'] = date("d F Y", $article_info['rtime']);
// $typesetInfo['online_date'] = $p_info['pub_date']; //这里可能会有问题
// $typesetInfo['abbreviation'] = $p_info['abbreviation'];
// $typesetInfo['abstractText'] = $p_info['abstract'];
// $typesetInfo['keywords'] = $p_info['keywords'];
// $typesetInfo['userAccount'] = $editor_info['nickname'];
// //获取文件
// // $files = $this->article_file_obj
// // ->where('article_id', $article_info['article_id'])
// // ->where('type_name', 'manuscirpt')
// // ->order('ctime desc')
// // ->limit(1)
// // ->select();
// // if (count($files) == 0) {
// // return jsonError('No Manuscript');
// // }
// // $typesetInfo['filename'] = "http://api.tmrjournals.com/public/" . $files[0]['file_url'];
// $rs = $this->production_article_refer_obj->where('p_article_id', $p_info['p_article_id'])->where('state', 0)->select();
// // $refers = [];
// // foreach ($rs as $v) {
// // $refers[] = $v['refer_frag'];
// // }
// $typesetInfo['refers'] = json_encode($rs);
// $url = "http://localhost:8081/typeset/webtest";
// $res = object_to_array(json_decode(myPost1($url, $typesetInfo)));
// dump($res);
// }
/**
* 排版主方法入口
*/
@@ -699,14 +780,16 @@ class Production extends Controller
$typesetInfo['filename'] = "http://api.tmrjournals.com/public/" . $files[0]['file_url'];
$rs = $this->production_article_refer_obj->where('p_article_id', $p_info['p_article_id'])->where('state', 0)->select();
$refers = [];
foreach ($rs as $v) {
$refers[] = $v['refer_frag'];
}
// $refers = [];
// foreach ($rs as $v) {
// $refers[] = $v['refer_frag'];
// }
$typesetInfo['refers'] = json_encode($refers);
// $typesetInfo['refers'] = json_encode($refers);
$typesetInfo['refers'] = json_encode($rs);
$url = "http://ts.tmrjournals.com/api/typeset/webGetDocx";
// $url = "http://localhost:8081/typeset/webGetDocx";
$res = object_to_array(json_decode(myPost1($url, $typesetInfo)));
if (!isset($res['data']['file']) || $res['data']['file'] == '') {
@@ -1060,6 +1143,10 @@ class Production extends Controller
return jsonSuccess([]);
}
public function testtest(){
$this->doiTofrag(7);
}
public function doiTofrag($p_article_id)
{
$p_info = $this->production_article_obj->where('p_article_id', $p_article_id)->find();
@@ -1126,7 +1213,7 @@ class Production extends Controller
$z = count($list);
$m = 0;
foreach ($list as $v) {
if ($v['refer_frag'] != '') {
if ($v['refer_frag'] != ''||$v['author']!='') {
$m++;
}
}

View File

@@ -617,6 +617,18 @@ class Reviewer extends Controller
return jsonSuccess($re);
}
public function getReviewerOnChina(){
$res = $this->user_obj
->field("t_user.email")
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
->where('t_user_reviewer_info.country','China')
->whereOr('t_user_reviewer_info.country','中国')
->select();
$re['emails']=$res;
return jsonSuccess($re);
}
/**
* @title 提交问卷(审稿人)
* @description 提交问卷(审稿人)
@@ -1559,10 +1571,10 @@ class Reviewer extends Controller
->where('t_reviewer_to_journal.journal_id', 'in', $jous)
->where($gradewhere)
->where('t_reviewer_to_journal.state', 0)
->where("t_user.account|t_user.realname|t_user.email", "like", '%' . $data['keyword'] . '%')
->where("t_user.account|t_user.realname|t_user.email|t_user_reviewer_info.field", "like", '%' . $data['keyword'] . '%')
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->reviewer_to_journal_obj->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where($gradewhere)->where('t_reviewer_to_journal.state', 0)->where("t_user.account|t_user.realname|t_user.email", "like", '%' . $data['keyword'] . '%')->count();
$count = $this->reviewer_to_journal_obj->join('t_user', 't_user.user_id = t_reviewer_to_journal.reviewer_id', 'left')->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')->where('t_reviewer_to_journal.journal_id', 'in', $jous)->where($gradewhere)->where('t_reviewer_to_journal.state', 0)->where("t_user.account|t_user.realname|t_user.email|t_user_reviewer_info.field", "like", '%' . $data['keyword'] . '%')->count();
} else {
$res = $this->reviewer_to_journal_obj
->field('t_reviewer_to_journal.is_yboard,t_user.*,t_reviewer_to_journal.grade,t_user_reviewer_info.*,t_journal.journal_id,t_journal.title journal_title')

View File

@@ -28,6 +28,8 @@ class Special extends Controller
protected $article_file_obj = '';
protected $article_msg_obj = '';
protected $user_log_obj = '';
protected $major_obj = "";
protected $major_to_journal_obj = '';
protected $user_black_obj = '';
protected $user_to_special_obj = '';
protected $chief_to_journal_obj = '';
@@ -54,6 +56,8 @@ class Special extends Controller
$this->article_file_obj = Db::name('article_file');
$this->article_msg_obj = Db::name('article_msg');
$this->user_log_obj = Db::name('user_log');
$this->major_obj = Db::name("major");
$this->major_to_journal_obj = Db::name('major_to_journal');
$this->user_black_obj = Db::name('user_black');
$this->user_to_special_obj = Db::name('user_to_special');
$this->chief_to_journal_obj = Db::name('chief_to_journal');
@@ -599,7 +603,7 @@ class Special extends Controller
if ($res && $res_author && $transr &&$res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) {
Db::commit();
$this->ai_scor($data['article_id']);
$this->ai_scor($res);
return json(['code' => 0]);
} else {
Db::rollback();
@@ -647,7 +651,8 @@ class Special extends Controller
$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'];
$wp = isset($res['data']['pic'])?$res['data']['pic']:2;
$tp = isset($res['data']['table'])?$res['data']['table']:2;
$pics = $this->article_file_obj->where('article_id',$article_id)->where('type_name','picturesAndTables')->select();
$np = 0;
@@ -662,9 +667,10 @@ class Special extends Controller
}
$p_num = $wp>$np?$wp:$np;
if($p_num>3){
$all_num = $p_num+$tp;
if($all_num>3){
$b_fen = 2;
}elseif($p_num>=1){
}elseif($all_num>=1){
$b_fen = 1;
}else{
$b_fen = 0;
@@ -683,16 +689,19 @@ class Special 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;
$report_author = $this->article_author_obj->where('article_id', $article_id)->where('email', $user_info['email'])->find();
if ($report_author) {
$ca_res = $this->company_top_obj->where('title', $report_author['company'])->find();
if ($ca_res) {
if($ca_res['company_id']<=100||($ca_res['company_id']>201&&$ca_res['company_id']<=301)){
$dw_fen = 1.5;
$fen += 1.5;
}else{
$dw_fen = 1;
$fen += 1;
}
}
}
//领域
$ly_fen = 0;
$m = $this->major_obj->where('major_id',$article_info['major_id'])->find();
@@ -703,7 +712,7 @@ class Special extends Controller
//基金
$jj_fen = 0;
if(strlen($article_info['fund'])>15){
if(strlen($article_info['fund'])>10){
$jj_fen = 0.5;
$fen += 0.5;
}