This commit is contained in:
wangjinlei
2024-08-07 15:02:14 +08:00
parent c57077e35f
commit 1f7220f36e
6 changed files with 179 additions and 23 deletions

View File

@@ -20,6 +20,37 @@ class Article extends Base
parent::__construct($request);
}
public function refusePassword()
{
$data = $this->request->post();
$rule = new Validate([
"password" => "require"
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$password = $data['password'];
if (function_exists('openssl_random_pseudo_bytes')) {
$salt = substr(str_replace('+', '.', base64_encode(openssl_random_pseudo_bytes(6))), 0, 8);
} else {
// 使用 mt_rand 作为后备方法
$salt = '';
for ($i = 0; $i < 8; $i++) {
$salt .= chr(mt_rand(33, 126)); // 生成随机字符
}
}
$hashed_password = crypt($password, '$1$' . $salt . '$');
return jsonSuccess(["result"=>$hashed_password]);
// return $hashed_password;
}
/**
* 获取文章列表(作者)
*/
@@ -1097,6 +1128,24 @@ class Article extends Base
}
public function checkArticleStart(){
$data = $this->request->post();
$rule = new Validate([
"article_id" => "require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
if($article_info['scoring'] < $journal_info['kfen']){
return jsonError("The initial review score for ".$journal_info['title']." is ".$journal_info['kfen'].". The current article's initial review score is ".$article_info['scoring'].", and the manuscript will be automatically rejected while it is in the with editor status.");
}else{
return jsonSuccess([]);
}
}
/**
* @title 修改文章状态(编辑)
* @description 修改文章状态(编辑)
@@ -1768,6 +1817,10 @@ class Article extends Base
return jsonError("Invitation record already exists!");
}
if($article_info['state']==0){
return jsonError("The article can only be added in state with editor at least");
}
//增加信息到文章审稿表
$insert_data['reviewer_id'] = $data['uid'];
$insert_data['article_id'] = $data['articleId'];

View File

@@ -0,0 +1,46 @@
<?php
namespace app\api\controller;
use app\api\controller\Base;
use think\Db;
use think\Queue;
use think\Env;
use think\Validate;
class EmailService extends Base
{
public function __construct(\think\Request $request = null)
{
parent::__construct($request);
}
public function refusePassword()
{
$data = $this->request->post();
$rule = new Validate([
"password" => "require"
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$password = $data['password'];
if (function_exists('openssl_random_pseudo_bytes')) {
$salt = substr(str_replace('+', '.', base64_encode(openssl_random_pseudo_bytes(6))), 0, 8);
} else {
// 使用 mt_rand 作为后备方法
$salt = '';
for ($i = 0; $i < 8; $i++) {
$salt .= chr(mt_rand(33, 126)); // 生成随机字符
}
}
$hashed_password = crypt($password, '$1$' . $salt . '$');
return jsonSuccess(["result"=>$hashed_password]);
// return $hashed_password;
}
}

View File

@@ -155,6 +155,7 @@ class Monitor extends Base
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count();
$frag[$year."-".$month."sql"] = $this->article_obj->getLastSql();
$frag[$year."-".$month] = $n;
if($month==12){
$year++;

View File

@@ -1,9 +1,10 @@
<?php
namespace app\api\controller;
use think\Controller;
use think\Validate;
use think\Db;
class Super extends Controller{
class Super extends Controller {
protected $article_obj = '';
protected $user_obj = '';
@@ -16,6 +17,7 @@ class Super extends Controller{
protected $article_file_obj = '';
protected $article_reviewer_obj = '';
protected $article_author_obj = '';
protected $board_to_journal = '';
protected $article_transfer_obj = '';
protected $staff_obj = '';
protected $staff_level_obj = '';
@@ -35,6 +37,7 @@ class Super extends Controller{
$this->article_file_obj = Db::name('article_file');
$this->article_reviewer_obj = Db::name('article_reviewer');
$this->article_author_obj = Db::name('article_author');
$this->board_to_journal = Db::name("board_to_journal");
$this->article_transfer_obj = Db::name('article_transfer');
$this->staff_obj = Db::name('staff');
$this->staff_level_obj = Db::name('staff_level');
@@ -57,6 +60,52 @@ class Super extends Controller{
}
return json($list);
}
/**编辑的期刊情况表
* @return void
*/
public function editorJournal(){
$data = $this->request->post();
$rule = new Validate([
"editor_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$start_time = strtotime(date("Y")."-01-01");
$end_time = strtotime(date("Y")."-12-31 23:59:59");
$q_start_time = strtotime((date("Y")-1)."-01-01");
$q_end_time = strtotime((date("Y")-1)."-12-31 23:59:59");
$journal_list = $this->journal_obj->field("journal_id,title,issn,abbr")->where("editor_id",$data['editor_id'])->select();
$gjh_url = "http://journalapi.tmrjournals.com/public/index.php/super/Publish/getGJHByIssn";
foreach ($journal_list as $k => $v){
$journal_list[$k]["board"] = $this->getBoardData($v['journal_id']);
$sj_r = $this->getSJ($v['journal_id'],$start_time,$end_time);
$lyl_r = $this->getLYL($v['journal_id'],$start_time,$end_time);
$year["mq"] = $sj_r['mq'];
$year["zc"] = $sj_r['zc'];
$year["zr"] = $sj_r['zr'];
$year['lyl'] = $lyl_r;
$gjh = object_to_array(json_decode(myPost($gjh_url,["year"=>date("Y"),"issn"=>$v['issn']])));
$year['gjh'] = $gjh['data']['result'];
$journal_list[$k]["year"] = $year;
$sj_rq = $this->getSJ($v['journal_id'],$q_start_time,$q_end_time);
$lyl_rq = $this->getLYL($v['journal_id'],$q_start_time,$q_end_time);
$yearq["mq"] = $sj_rq['mq'];
$yearq["zc"] = $sj_rq['zc'];
$yearq["zr"] = $sj_rq['zr'];
$yearq['lyl'] = $lyl_rq;
$gjhq = object_to_array(json_decode(myPost($gjh_url,["year"=>date("Y")-1,"issn"=>$v['issn']])));
$yearq['gjh'] = $gjhq['data']['result'];
$journal_list[$k]['p_year'] = $yearq;
}
$re['list'] = $journal_list;
return jsonSuccess($re);
}
public function getAllArticle(){
$data = $this->request->post();
@@ -93,6 +142,28 @@ class Super extends Controller{
$re['articles'] = $list;
return jsonSuccess($re);
}
private function getBoardData($journal_id){
$list = $this->board_to_journal->field("t_board_to_journal.*,t_user_reviewer_info.country")
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_board_to_journal.user_id","left")
->where("t_board_to_journal.journal_id",$journal_id)
->where("t_board_to_journal.state",0)
->select();
$flag = [];
$flag['all'] = count($list);
$f = [];
foreach ($list as $v){
if(isset($f[$v['country']])){
$f[$v['country']]++;
}else{
$f[$v['country']] = 1;
}
}
$flag['country'] = $f;
return $flag;
}
/**
* 获取审稿人数量
@@ -251,26 +322,6 @@ class Super extends Controller{
return $frag;
}
public function mutest(){
$start_time = strtotime('2021-01-01');
$end_time = strtotime('2021-04-15 23:59:59');
$res = $this->getSJ(1, $start_time, $end_time);
echo '<pre>';
var_dump($res);
echo '</pre>';
die;
}
public function mmmyyy(){
$start = strtotime('2021-01-01');
$end = strtotime('2021-04-22 11:30:12');
$res = $this->getSJ(8, $start, $end);
echo '<pre>';
var_dump($res);
echo '</pre>';
die;
}
/**
* 获取时间异常
*/
@@ -304,6 +355,9 @@ class Super extends Controller{
$journal_info = $this->journal_obj->where('journal_id',$journalId)->find();
$zc_num = $this->article_obj->where('accept_sn','like',$journal_info['abbr'].'%')->where('journal_id','<>',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count();
// echo $this->article_obj->getLastSql();die;
$zr_num = $this->article_obj->where('accept_sn','not like',$journal_info['abbr'].'%')->where('journal_id',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count();
//获取全部总数
$mq_num = $this->article_obj
@@ -311,6 +365,7 @@ class Super extends Controller{
->where('ctime','>',$start_time)
->where('ctime','<',$end_time)
->count();
echo $this->article_obj->getLastSql();die;
$res['mq'] = $mq_num;//文章总数
$res['zc'] = $zc_num;//转出文章数
$res['zr'] = $zr_num;//转入文章数

View File

@@ -201,8 +201,9 @@ class Web extends Base
||($article_info['journal_id']==6&&$p_info['journal_stage_id']>=515)
||($article_info['journal_id']==15&&($article_info['article_id']>=4465||$article_info['article_id']==4349))
||($article_info['journal_id']==10&&$p_info['journal_stage_id']>=534)
||($article_info['journal_id']==3&&($article_info['article_id']>=4523||$article_info['article_id']==4094))
||($article_info['journal_id']==3&&($article_info['article_id']>=4523||$article_info['article_id']==4094||$article_info['article_id']==4369))
||($article_info['journal_id']==2&&$article_info['article_id']>=4361)
||($article_info['journal_id']==9&&$p_info['journal_stage_id']>=545)
||$article_info['journal_id']==23){
//添加初审问卷
$reviewers[$k]['question'] = $this->article_reviewer_question_obj->where('art_rev_id',$v['art_rev_id'])->find();

View File

@@ -25,7 +25,7 @@ class Redis extends Driver
protected $options = [
'host' => '127.0.0.1',
'port' => 6379,
'password' => '',
'password' => 'Jgll2015',
'select' => 0,
'timeout' => 0,
'expire' => 0,