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