This commit is contained in:
chengxl
2025-11-05 16:55:26 +08:00
parent 8a911378ea
commit 71dac0d4d0

View File

@@ -3699,6 +3699,15 @@ class Article extends Base
if ($black) {
return jsonError("Your account is currently blacklisted by TMR Publishing Group. Please contact the official email of the journal you wish to submit to for further clarification.");
}
//验证前三步骤是否完成
$aArticleState = $this->getArticleStateThree($article_info);
$iStatus = empty($aArticleState['status']) ? 0 : $aArticleState['status'];
$sMsg = empty($aArticleState['msg']) ? '' : $aArticleState['msg'];
if($iStatus != 1){
return jsonError($sMsg);
}
//稿件号
$sbbr = empty($journal_info['abbr']) ? '' : $journal_info['abbr'];
$sArticleType = empty($article_info['type']) ? '' : $article_info['type'];
@@ -3863,6 +3872,7 @@ class Article extends Base
$sQueueId = \think\Queue::push('app\api\job\ArticleReview@fire', $aQueueParam, 'ArticleReview');
}
//AI初审队列 chengxiaoling 20250815 end
//判断是否有文章领域 进行更新操作 chengxiaoling 20250722 start
if(!empty($sMajorData) && !empty($iArticleId)){
$this->updateArticleField(['article_id' => $iArticleId,'article_field' => $sMajorData]);
@@ -6055,4 +6065,124 @@ class Article extends Base
$p = self::getMajorShuList($res['pid']);
return $p . ',' . $res['major_id'];
}
/**
* 按步骤获取文章的状态
*/
private function getArticleStateThree($aArticle = []){
if(empty($aArticle)){
return ['status' => 2,'msg' => 'The article does not exist'];
}
//第一步验证
$aFirst = ['title','type','abstrart','journal_id'];
$iFirstStatus = 1;
$sFirstMsg = $sSecondMsg = $sThreeMsg = $sFourMsg = '';
foreach ($aFirst as $key => $value) {
if(empty($aArticle[$value])){
$iFirstStatus = 2;
$sFirstMsg = 'Step 1: Required fields incomplete'.$value;
break;
}
}
if($iFirstStatus == 2){
return ['status' => 3,'msg' => $sFirstMsg];
}
//判断伦理
if(!empty($aArticle['approval']) && $aArticle['approval'] == 1 && empty($aArticle['approval_file'])){
$iFirstStatus = 2;
$sFirstMsg = 'Step 1: Ethics documents not uploaded';
return ['status' => 3,'msg' => $sFirstMsg];
}
if(isset($aArticle['approval']) && $aArticle['approval'] == 0 && empty($aArticle['approval_content'])){
$iFirstStatus = 2;
$sFirstMsg = 'Step 1: Please explain the lack of ethical recognition';
return ['status' => 3,'msg' => $sFirstMsg];
}
//查询manuscirpt文件是否上传
$iArticleId = empty($aArticle['article_id']) ? 0 : $aArticle['article_id'];
$aWhere = ['article_id' => $iArticleId,'state' => 0,'type_name' => 'manuscirpt'];
$aFile = Db::name('article_file')->where($aWhere)->order('ctime desc')->find();
if(empty($aFile)){
$iFirstStatus = 2;
$sFirstMsg = 'Step 1: The manuscirpt file has not been uploaded';
return ['status' => 3,'msg' => $sFirstMsg];
}
//第二步 查询作者
$iSecondStatus = 1;
$is_super = 2;
$is_report = 2;
$aWhere = ['article_id' => $iArticleId,'state' => 0];
$aAuthorData = DB::name('article_author')->where($aWhere)->select();
if(empty($aAuthorData)){
$iSecondStatus = 2;
}
if(!empty($aAuthorData)){
foreach ($aAuthorData as $key => $value) {
if(empty($value['email']) || empty($value['author_title']) || empty($value['company']) || empty($value['firstname']) || empty($value['lastname'])){
$iSecondStatus = 2;
break;
}
if($is_report != 1){
if($value['is_report'] == 1 && !empty($value['orcid'])){
$is_report = 1;
}
}
if($is_super != 1){
if($value['is_super'] == 1){
$is_super = 1;
}
}
}
}
if($iSecondStatus == 2){
$sSecondMsg = 'Step 2: The author\'s required information is incomplete';
return ['status' => 3,'msg' => $sSecondMsg];
}
if($iSecondStatus == 1){
if($is_super == 2){
$sSecondMsg = 'Step 2: Please select the first author';
$iSecondStatus = 2;
return ['status' => 3,'msg' => $sSecondMsg];
}
if($is_report == 2){
$sSecondMsg = 'Step 2: Please select the corresponding author';
$iSecondStatus = 2;
return ['status' => 3,'msg' => $sSecondMsg];
}
}
//第三步
$iThreeStatus = 1;
$sThreeMsg = '';
if($aArticle['is_use_ai'] == 3){//验证是否使用AI
$sThreeMsg = 'Step 3: Please check whether to use AI technology';
$iThreeStatus = 2;
return ['status' => 3,'msg' => $sThreeMsg];
}
if($aArticle['is_use_ai'] == 1 && empty($aArticle['use_ai_explain'])){//验证是否填写AI说明
$sThreeMsg = 'Step 3: Please enter supplementary instructions';
$iThreeStatus = 2;
return ['status' => 3,'msg' => $sThreeMsg];
}
if($aArticle['is_figure_copyright'] == 3){//验证是否上传版权声明
$sThreeMsg = 'Step 3: Please check whether to upload the figure copyright statement';
$iThreeStatus = 2;
return ['status' => 3,'msg' => $sThreeMsg];
}
if($aArticle['is_figure_copyright'] == 1){//验证是否上传版权声明
$aWhere = ['article_id' => $iArticleId,'state' => 0,'type_name' => 'figurecopyright'];
$aFile = Db::name('article_file')->where($aWhere)->order('ctime desc')->find();
if(empty($aFile)){
$sThreeMsg = 'Step 3: Please upload the figure copyright declaration file';
$iThreeStatus = 2;
return ['status' => 3,'msg' => $sThreeMsg];
}
}
return ['status' => 1,'msg' => 'success'];
}
}