Compare commits
9 Commits
f9e29ad876
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8319777d3e | ||
|
|
71ec3c2ccd | ||
|
|
56dd707f9b | ||
|
|
d2fe34a7a3 | ||
|
|
2f921a4ea2 | ||
|
|
e109a84eff | ||
|
|
31da31b252 | ||
|
|
7c54b4f518 | ||
|
|
8fe397ff50 |
@@ -129,6 +129,12 @@ class Article extends Base
|
||||
}
|
||||
}
|
||||
$res[$key]['proof'] = $proof_state;
|
||||
//新增是否是草稿删除 20260204 start
|
||||
$res[$key]['is_draft'] = 2;
|
||||
if(!empty($val['accept_sn']) && substr($val['accept_sn'], 0, 5) === 'Draft'){
|
||||
$res[$key]['is_draft'] = 1;
|
||||
}
|
||||
//新增是否是草稿删除 20260204 end
|
||||
}
|
||||
|
||||
//返回数据
|
||||
@@ -585,6 +591,14 @@ class Article extends Base
|
||||
}
|
||||
}
|
||||
//查询终审意见 chengxiaoling 20250828 end
|
||||
//新增是否是草稿删除 20260204 start
|
||||
if(!empty($article_res)){
|
||||
$article_res['is_draft'] = 2;
|
||||
if(!empty($article_res['accept_sn']) && substr($article_res['accept_sn'], 0, 5) === 'Draft'){
|
||||
$article_res['is_draft'] = 1;
|
||||
}
|
||||
}
|
||||
//新增是否是草稿删除 20260204 end
|
||||
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, "major" => $major,'suggest_final' => $aFinal]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1167,9 +1167,17 @@ class Finalreview extends Base
|
||||
if(empty($aReviewerFinal)){
|
||||
return json_encode(['status' => 3,'msg' => 'Review record does not exist or review has been completed']);
|
||||
}
|
||||
//查询审稿人基本信息
|
||||
$aWhere = ['user_id' => $iReviewerId];
|
||||
$aUser = Db::name('user')->field('realname')->where($aWhere)->find();
|
||||
$aUser = Db::name('user')->field('realname,email')->where($aWhere)->find();
|
||||
$aReviewerFinal['realname'] = empty($aUser['realname']) ? '' : $aUser['realname'];
|
||||
$aReviewerFinal['email'] = empty($aUser['email']) ? '' : $aUser['email'];
|
||||
//查询审稿人机构
|
||||
if(!empty($aUser)){
|
||||
$aWhere = ['reviewer_id' => $iReviewerId,'state' => 0];
|
||||
$aReviewerInfo = Db::name('user_reviewer_info')->field('company')->where($aWhere)->find();
|
||||
$aReviewerFinal['company'] = empty($aReviewerInfo['company']) ? '' : $aReviewerInfo['company'];
|
||||
}
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => $aReviewerFinal]);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,12 @@ class Preaccept extends Base
|
||||
}else{
|
||||
$list[$k]['is_repeat'] = 0;
|
||||
}
|
||||
if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){
|
||||
$list[$k]['retract'] = 1;
|
||||
}else{
|
||||
$list[$k]['retract'] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
$re["refers"] = $list;
|
||||
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
|
||||
|
||||
@@ -632,6 +632,11 @@ class Production extends Base
|
||||
} else {
|
||||
$list[$k]['is_repeat'] = 0;
|
||||
}
|
||||
if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){
|
||||
$list[$k]['retract'] = 1;
|
||||
}else{
|
||||
$list[$k]['retract'] = 0;
|
||||
}
|
||||
}
|
||||
$re['refers'] = $list;
|
||||
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
|
||||
@@ -2243,9 +2248,15 @@ class Production extends Base
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$info = $this->article_main_obj->where("am_id",$data['id'])->find();
|
||||
if(isset($data["code"])){
|
||||
$content = $data['code'];
|
||||
}else{
|
||||
$content = $info['content'];
|
||||
}
|
||||
|
||||
$production_info = $this->production_article_obj->where("article_id",$info['article_id'])->find();
|
||||
$refers = $this->production_article_refer_obj->where("p_article_id",$production_info['p_article_id'])->where('state',0)->order("index")->select();
|
||||
$res = $this->convertToLatex($info['content'],$refers);
|
||||
$res = $this->convertToLatex($content,$refers);
|
||||
echo $res;
|
||||
// return jsonSuccess([$res]);
|
||||
}
|
||||
@@ -2259,9 +2270,9 @@ class Production extends Base
|
||||
return '';
|
||||
}
|
||||
//单行处理公式内容
|
||||
$pattern = '/^<wmath\s+data-latex="([^"]*)">.*<\/wmath>$/';
|
||||
$pattern = '/^<wmath[^>]*?\s+data-latex="([^"]*)"[^>]*?>.*?<\/wmath>$/';
|
||||
if(preg_match($pattern, $content) === 1){
|
||||
$pattern1 = '/<wmath\s+data-latex="([^"]*)">/';
|
||||
$pattern1 = '/<wmath[^>]*?\s+data-latex="([^"]*)">/';
|
||||
if (preg_match($pattern1, $content, $matches)) {
|
||||
$latexContent = $matches[1];
|
||||
// 将 $$ 转换为 $,因为equation环境不需要$$
|
||||
@@ -3656,7 +3667,14 @@ class Production extends Base
|
||||
// 方法1: 使用pdflatex命令(推荐)
|
||||
// $command = "{$sLatexDir}pdflatex -include-directory=" . dirname($texFilePath) .
|
||||
// " -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
||||
$command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
||||
// $command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
||||
$sLatexDir = '/usr/bin/';//latex执行目录
|
||||
$command = sprintf(
|
||||
'%slualatex -interaction=nonstopmode -output-directory=%s %s 2>&1',
|
||||
rtrim($sLatexDir, '/') . '/', // /usr/bin/lualatex
|
||||
escapeshellarg($pdfDir), // 转义输出目录(含空格/特殊字符)
|
||||
escapeshellarg($texFilePath) // 转义tex文件路径
|
||||
);
|
||||
|
||||
$output = [];
|
||||
$returnVar = 0;
|
||||
@@ -4327,10 +4345,8 @@ class Production extends Base
|
||||
$queue = Queue::push('app\api\job\ArticleCreatePdf@fire', ['p_article_id' => $iPArticleId], 'ArticleCreatePdf');
|
||||
//生成长表格PDF
|
||||
$aLongTableId = empty($aResult['long_table_id']) ? [] : $aResult['long_table_id'];
|
||||
var_dump($aLongTableId);
|
||||
if(!empty($aLongTableId)){ //调用生成长表格队列
|
||||
$longtablequeue = Queue::push('app\api\job\ArticleCreateLongTable@fire', ['p_article_id' => $iPArticleId,'long_table_id' => $aLongTableId], 'ArticleCreateLongTable');
|
||||
var_dump($longtablequeue);
|
||||
}
|
||||
return json_encode(array('status' => 1,'msg' => 'tex file generated successfully'));
|
||||
}
|
||||
|
||||
@@ -196,21 +196,23 @@ page={{stage_page}},%号
|
||||
//文章图片地址
|
||||
$sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon'];
|
||||
if(!empty($sIcon)){
|
||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
||||
// if(file_exists($sIconUrl)){
|
||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
//下载图片
|
||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
||||
$aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
if(!empty($aImageInfo['data'])){
|
||||
$aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
||||
$sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
||||
$sIconUrl = ROOT_PATH.trim($this->sArticleIcon,'/').'/'.$sIcon;
|
||||
if(file_exists($sIconUrl)){
|
||||
$sIconUrl = str_replace(ROOT_PATH.'public/', '', $sIconUrl);
|
||||
$sIconUrl = '../../'.$sIconUrl;
|
||||
$sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
}else{
|
||||
$sIcon = '';
|
||||
}
|
||||
// //下载图片
|
||||
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
||||
// $aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
// if(!empty($aImageInfo['data'])){
|
||||
// $aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
||||
// $sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
}
|
||||
$aSearch['{{article_icon}}'] = $sIcon;
|
||||
$aSearch['{{keywords}}'] = $sKeywords;
|
||||
@@ -256,6 +258,7 @@ page={{stage_page}},%号
|
||||
//查询正文信息
|
||||
$aWhere = ['article_id' => $aProductionArticle['article_id'],'state' => 0];
|
||||
$aArticleMain = Db::name('article_main')->field('am_id,article_id,type,content,ami_id,amt_id,is_h1,is_h2,is_h3,sort')->where($aWhere)->order('sort')->select();
|
||||
|
||||
if(!empty($aArticleMain)){
|
||||
|
||||
//查询图片
|
||||
@@ -306,7 +309,13 @@ page={{stage_page}},%号
|
||||
}
|
||||
if($value['is_h1'] == 0 && $value['is_h2'] == 0 && $value['is_h3'] == 0){
|
||||
if($value['type'] == 0 ){
|
||||
$sMain .= $this->dealContent($value['content'],$aReferences)."\\par\n";
|
||||
//处理内容
|
||||
$sMainContent = $this->dealContent($value['content'],$aReferences);
|
||||
//替换myh3标签
|
||||
$contentpattern = '/<myh3>(.*?)<\/myh3>/is';
|
||||
$contentreplacement = '\\subsubsection{$1}';
|
||||
$sMainContent = preg_replace($contentpattern, $contentreplacement, $sMainContent);
|
||||
$sMain .= $sMainContent."\\par\n";
|
||||
}
|
||||
if($value['type'] == 1 ){//图片
|
||||
$aImageInfo = empty($aArticleMainImage[$value['ami_id']]) ? [] : $aArticleMainImage[$value['ami_id']];
|
||||
@@ -314,21 +323,20 @@ page={{stage_page}},%号
|
||||
continue;
|
||||
}
|
||||
|
||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
||||
// if(file_exists($sIconUrl)){
|
||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
//下载图片
|
||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||
$aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
if(empty($aResult['data'])){
|
||||
$sMainImageUrl = ROOT_PATH.trim($this->sArticleMainImage,'/').'/'.$aImageInfo['url'];
|
||||
if(!file_exists($sMainImageUrl)){
|
||||
continue;
|
||||
}
|
||||
// //下载图片
|
||||
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||
// $aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
// if(empty($aResult['data'])){
|
||||
// continue;
|
||||
// }
|
||||
// $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']];
|
||||
// $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte);
|
||||
$aImageInfo['image_url'] = $aResult['data'];
|
||||
// $aImageInfo['image_url'] = $aResult['data'];
|
||||
$aImageInfo['image_url'] = $sMainImageUrl;
|
||||
$aDealImage = $this->dealImage($aImageInfo);
|
||||
if(empty($aDealImage['data'])){
|
||||
continue;
|
||||
@@ -354,7 +362,6 @@ page={{stage_page}},%号
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$aSearch['{{article_main}}'] = empty($sMain) ? '' : $sMain."\n";
|
||||
//模版内容替换
|
||||
$sTemplateInfo = str_replace(array_keys($aSearch), array_values($aSearch), $sTemplateInfo);
|
||||
@@ -642,7 +649,8 @@ page={{stage_page}},%号
|
||||
$isWideImage = $imageWidth > $wideImageThreshold;
|
||||
|
||||
// 生成LaTeX图片代码
|
||||
$sImageUrl = './image/'.basename($sImageUrl);
|
||||
$sImageUrl = str_replace(ROOT_PATH.'public/', '', $sImageUrl);
|
||||
$sImageUrl = '../../'.$sImageUrl;
|
||||
if ($isWideImage) {
|
||||
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
|
||||
$latexLines[] = " \\centering";
|
||||
|
||||
Reference in New Issue
Block a user