拆分GSO问题处理,选择框名称修改
This commit is contained in:
+3
@@ -2796,6 +2796,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else if ("doc".equals(type)) {
|
||||
//查询条件
|
||||
conditionSb.append(" and osf.file_name like '%.doc%'");
|
||||
}else if ("pdfdoc".equals(type)) {
|
||||
//查询条件
|
||||
conditionSb.append(" and osf.file_name like '%.doc%'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-5
@@ -10,15 +10,16 @@ public enum SplitFileTypeTypeEnum {
|
||||
GSO("GSO","GSO"),
|
||||
KMVSS_TABLE("KMVSS_Table","KMVSS_Table"),
|
||||
KMVSS_ARTICLE("KMVSS_Article","KMVSS_Article"),
|
||||
US("US","美国"),
|
||||
EU("EU","欧洲"),
|
||||
US("CFR","美国"),
|
||||
EU("UNECE","欧洲"),
|
||||
/**
|
||||
* Japan Attachment
|
||||
*/
|
||||
JAPAN_ONE("Japan_one","Japan Attachment"),
|
||||
JPN_ATTACHMENT("JPN_Attachment","Japan Attachment"),
|
||||
|
||||
JAPAN_TWO("Japan_two","Japan Article"),
|
||||
CN("CN","中国");
|
||||
JPN_ARTICLE("JPN_Article","Japan Article"),
|
||||
GB("GB","中国"),
|
||||
GBT("GBT","中国");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
+47
-22
@@ -2,6 +2,7 @@ package com.jero.modules.split.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.document.utils.ReadPdfUtil;
|
||||
import com.jero.modules.ocr.util.UUIDUtils;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
@@ -404,24 +405,44 @@ public class FileSpiltService {
|
||||
throw new JeroBootException("当前文件未找到,请重新选择!");
|
||||
}
|
||||
|
||||
InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。
|
||||
XWPFDocument doc = new XWPFDocument(is);
|
||||
//修改为读取PDF
|
||||
// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。
|
||||
// XWPFDocument doc = new XWPFDocument(is);
|
||||
|
||||
String readPdf = ReadPdfUtil.readPdf(readFilePath);
|
||||
if(StringUtils.isEmpty(readPdf)){
|
||||
throw new JeroBootException("未读取到文件内容,请检查后重试!");
|
||||
}
|
||||
String[] pdfArrays = readPdf.split("\r\n");
|
||||
|
||||
// Pattern ptest ;
|
||||
// Matcher matcher;
|
||||
|
||||
// 记录拆分后的每一段文字
|
||||
List<IBodyElement> elements = doc.getBodyElements();
|
||||
//修改为读取PDF
|
||||
// List<IBodyElement> elements = doc.getBodyElements();
|
||||
// 记录word自动生成的编号数据
|
||||
Map numberMap = new HashMap<String,Integer>();
|
||||
boolean menuCanAdd = false; // 判断当前目录下是否可以正常填写数据
|
||||
for (IBodyElement element : elements) {
|
||||
//修改为读取PDF
|
||||
// for (IBodyElement element : elements) {
|
||||
//定义初始化数据
|
||||
boolean firstFlag = true;
|
||||
for (String paragraphString : pdfArrays) {
|
||||
if(paragraphString.contains("SCOPE")){
|
||||
firstFlag = false;
|
||||
}
|
||||
if(firstFlag){
|
||||
continue;
|
||||
}
|
||||
|
||||
// 段落
|
||||
if (element instanceof XWPFParagraph) {
|
||||
XWPFParagraph p = (XWPFParagraph)element;
|
||||
//修改为读取PDF
|
||||
// if (element instanceof XWPFParagraph) {
|
||||
// XWPFParagraph p = (XWPFParagraph)element;
|
||||
|
||||
// 处理段落生成编号不识别问题
|
||||
String paragraphString = p.getText();
|
||||
// String paragraphString = p.getText();
|
||||
if (StringUtils.isNotBlank(paragraphString)) {
|
||||
paragraphString = paragraphString.replace((char) 12288, ' ');
|
||||
paragraphString = paragraphString.trim();
|
||||
@@ -475,13 +496,13 @@ public class FileSpiltService {
|
||||
}
|
||||
|
||||
if(!hasGoIf && menuCanAdd) {
|
||||
if (!p.getText().equals("") ){
|
||||
addItermsConditionsText(messageList.get(messageList.size()-1),itemValList,p.getText());
|
||||
}
|
||||
List<String> imageBundleList = readImageInParagraph((XWPFParagraph)p);
|
||||
if(CollectionUtils.isNotEmpty(imageBundleList)) {
|
||||
addItermsConditionsImage(messageList.get(messageList.size()-1),itemValList, p,imageBundleList);
|
||||
if (!paragraphString.equals("") ){
|
||||
addItermsConditionsText(messageList.get(messageList.size()-1),itemValList,paragraphString);
|
||||
}
|
||||
// List<String> imageBundleList = readImageInParagraph((XWPFParagraph)p);
|
||||
// if(CollectionUtils.isNotEmpty(imageBundleList)) {
|
||||
// addItermsConditionsImage(messageList.get(messageList.size()-1),itemValList, p,imageBundleList);
|
||||
// }
|
||||
// }
|
||||
hasGoIf = true;
|
||||
}
|
||||
@@ -490,14 +511,17 @@ public class FileSpiltService {
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (element instanceof XWPFTable){
|
||||
if(messageList != null && !messageList.isEmpty()){
|
||||
addItermsConditionsOfTable(messageList.get(messageList.size()-1),itemValList,(XWPFTable)element);
|
||||
}
|
||||
}
|
||||
//修改为读取PDF
|
||||
// } else if (element instanceof XWPFTable){
|
||||
// if(messageList != null && !messageList.isEmpty()){
|
||||
// addItermsConditionsOfTable(messageList.get(messageList.size()-1),itemValList,(XWPFTable)element);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
}catch (JeroBootException e){
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
@@ -1845,7 +1869,8 @@ public class FileSpiltService {
|
||||
a:
|
||||
for (SarFileSplitMenuEO forDocumentTree : treeList) {
|
||||
switch (enumByValue) {
|
||||
case CN:
|
||||
case GB:
|
||||
case GBT:
|
||||
case US:
|
||||
case GSO:
|
||||
if (name.indexOf(".") >= 0) {
|
||||
@@ -1869,7 +1894,7 @@ public class FileSpiltService {
|
||||
documentTreeEO.setPId(generalCatalogueId);
|
||||
}
|
||||
break;
|
||||
case JAPAN_ONE:
|
||||
case JPN_ATTACHMENT:
|
||||
if (name.contains(".")) {
|
||||
if (name.indexOf(".") >= 0) {
|
||||
if (name.substring(0, name.lastIndexOf(".")).equals(forDocumentTree.getName())) {
|
||||
@@ -1891,7 +1916,7 @@ public class FileSpiltService {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case JAPAN_TWO:
|
||||
case JPN_ARTICLE:
|
||||
if (name.indexOf("=") >= 0) {
|
||||
String[] nameSplit = name.split("=");
|
||||
|
||||
|
||||
+4
-3
@@ -78,7 +78,8 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
|
||||
int result = 0;
|
||||
switch (enumByValue){
|
||||
case CN:
|
||||
case GB:
|
||||
case GBT:
|
||||
result = fileSpiltService.fileCHN(sarFileSplitInfoEO,enumByValue);
|
||||
break;
|
||||
case EU:
|
||||
@@ -90,10 +91,10 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
|
||||
case GSO:
|
||||
result = fileSpiltService.fileGSO(sarFileSplitInfoEO,enumByValue);
|
||||
break;
|
||||
case JAPAN_ONE:
|
||||
case JPN_ATTACHMENT:
|
||||
result = fileSpiltService.fileJapanOne(sarFileSplitInfoEO,enumByValue);
|
||||
break;
|
||||
case JAPAN_TWO:
|
||||
case JPN_ARTICLE:
|
||||
result = fileSpiltService.fileJapanTwo(sarFileSplitInfoEO,enumByValue);
|
||||
break;
|
||||
case KMVSS_ARTICLE:
|
||||
|
||||
@@ -631,11 +631,13 @@ module.exports = {
|
||||
view: 'view',
|
||||
KMVSS_Table: 'KMVSS Table',
|
||||
KMVSS_Article: 'KMVSS Article',
|
||||
America: 'America',
|
||||
Europe: 'Europe',
|
||||
Japan_one: 'Japan Attachment',
|
||||
Japan_two: 'Japan Article',
|
||||
China: 'China',
|
||||
CFR: 'CFR',
|
||||
UNECE: 'UNECE',
|
||||
JPN_Attachment: 'JPN Attachment',
|
||||
JPN_Article: 'JPN Article',
|
||||
GB: 'GB',
|
||||
GBT: 'GB/T',
|
||||
GSO: 'GSO',
|
||||
onlyOnefileUploaded: 'only one file can be uploaded',
|
||||
typeCannotUploaded: 'this type of file cannot be uploaded',
|
||||
confirmWithdraw: 'confirm Withdraw ?',
|
||||
|
||||
@@ -638,11 +638,13 @@ module.exports = {
|
||||
view: '查看',
|
||||
KMVSS_Table: 'KMVSS Table',
|
||||
KMVSS_Article: 'KMVSS Article',
|
||||
America: '美国',
|
||||
Europe: '欧洲',
|
||||
Japan_one: 'Japan Attachment',
|
||||
Japan_two: 'Japan Article',
|
||||
China: '中国',
|
||||
CFR: 'CFR',
|
||||
UNECE: 'UNECE',
|
||||
JPN_Attachment: 'JPN Attachment',
|
||||
JPN_Article: 'JPN Article',
|
||||
GB: 'GB',
|
||||
GBT: 'GB/T',
|
||||
GSO: 'GSO',
|
||||
onlyOnefileUploaded: '只能上传一个文件',
|
||||
typeCannotUploaded: '不支持上传该类型的文件',
|
||||
confirmWithdraw: '确认撤回?',
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<div class="operator-select-type">
|
||||
<span class="operator-file-type"><i class="operator-i">*</i>{{$t('fileType')}}</span>
|
||||
<a-select v-model="fileGroup" :placeholder="$t('selectFileType')" class="file-type-select">
|
||||
<a-select-option value="GSO" key="GSO" title="GSO">
|
||||
GSO
|
||||
<a-select-option value="GSO" key="GSO" :title="$t('GSO')">
|
||||
{{$t('GSO')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="KMVSS_Table" key="KMVSS_Table" :title="$t('KMVSS_Table')">
|
||||
{{$t('KMVSS_Table')}}
|
||||
@@ -31,20 +31,23 @@
|
||||
<a-select-option value="KMVSS_Article" key="KMVSS_Article" :title="$t('KMVSS_Article')">
|
||||
{{$t('KMVSS_Article')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="US" key="US" :title="$t('America')">
|
||||
{{$t('America')}}
|
||||
<a-select-option value="CFR" key="CFR" :title="$t('CFR')">
|
||||
{{$t('CFR')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="EU" key="EU" :title="$t('Europe')">
|
||||
{{$t('Europe')}}
|
||||
<a-select-option value="UNECE" key="UNECE" :title="$t('UNECE')">
|
||||
{{$t('UNECE')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="Japan_one" key="Japan_one" :title="$t('Japan_one')">
|
||||
{{$t('Japan_one')}}
|
||||
<a-select-option value="JPN_Attachment" key="JPN_Attachment" :title="$t('JPN_Attachment')">
|
||||
{{$t('JPN_Attachment')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="Japan_two" key="Japan_two" :title="$t('Japan_two')">
|
||||
{{$t('Japan_two')}}
|
||||
<a-select-option value="JPN_Article" key="JPN_Article" :title="$t('JPN_Article')">
|
||||
{{$t('JPN_Article')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="CN" key="CN" :title="$t('China')">
|
||||
{{$t('China')}}
|
||||
<a-select-option value="GB" key="GB" :title="$t('GB')">
|
||||
{{$t('GB')}}
|
||||
</a-select-option>
|
||||
<a-select-option value="GBT" key="GBT" :title="$t('GBT')">
|
||||
{{$t('GBT')}}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
@@ -133,7 +136,7 @@
|
||||
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //搜索字段
|
||||
tableList: 'split/sarFileSplitInfo/splitFilePageInfo', //表格数据
|
||||
},
|
||||
type:'doc',
|
||||
type:'pdfdoc',
|
||||
OperationList:[],
|
||||
token:Vue.ls.get(ACCESS_TOKEN),
|
||||
cut:'',
|
||||
@@ -217,7 +220,7 @@
|
||||
if (file.file_name) {
|
||||
let name = file.file_name.split('.')
|
||||
let nameSuffix = name[name.length - 1]
|
||||
if (nameSuffix.toLowerCase() === 'doc'||nameSuffix.toLowerCase() === 'docx') {
|
||||
if (nameSuffix.toLowerCase() === 'doc'||nameSuffix.toLowerCase() === 'docx'||nameSuffix.toLowerCase() === 'pdf') {
|
||||
let params = {
|
||||
attId: file.id,
|
||||
title: file.title,
|
||||
|
||||
Reference in New Issue
Block a user