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

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++;
}
}