feat: 国内外标准 编辑入es库 问题修改
This commit is contained in:
+19
-9
@@ -110,6 +110,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag; //ES是否启用
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
|
||||
@@ -550,7 +553,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
Map<String, String> selectionMap = new HashMap<>();
|
||||
Map<String, String> fileMap = new HashMap<>();
|
||||
Map<String, String> multiTimeMap = new HashMap<>();
|
||||
String fileIds = "";
|
||||
List<String> fileIds = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : sarStandAttrMap.entrySet()) {
|
||||
String attrKey = entry.getKey();
|
||||
String attrValue = String.valueOf(entry.getValue());
|
||||
@@ -571,7 +574,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
selectionMap.put(attrKey, attrValue);
|
||||
} else if (InitStandAttrUtil.fileFieldList.contains(attrKey)) {
|
||||
fileMap.put(attrKey, attrValue);
|
||||
fileIds += attrValue + ",";
|
||||
List<String> list= Arrays.asList(attrValue .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
|
||||
fileIds.addAll(list);
|
||||
// String attrValueStr = String.join(",", list);
|
||||
// fileIds += attrValueStr + ",";
|
||||
if (attrKey.equals("XXZLXX")) {
|
||||
// this.saveMsgDynamicInfo(attrValue,sarStandardsInfoEO.getStandName(),sarStandardsInfoEO.getId(),sarStandardsInfoEO.getStandSort()+" "+sarStandardsInfoEO.getStandNumber()+"-"+sarStandardsInfoEO.getStandYear());
|
||||
}
|
||||
@@ -589,10 +595,14 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
attrValue = "'" + attrValue + "'";
|
||||
}
|
||||
valuesBuilder.append("," + attrValue);
|
||||
sarStandardsInfoEO.setFileIds(fileIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!fileIds.isEmpty()){
|
||||
sarStandardsInfoEO.setFileIds(String.join(",", fileIds));
|
||||
}else {
|
||||
sarStandardsInfoEO.setFileIds("");
|
||||
}
|
||||
String insertField = mustFields + fieldsBuilder.toString();
|
||||
String insertValue = mustValues + valuesBuilder.toString();
|
||||
int insertRes = sarStandAttrInfoEODao.insertStandAttr(insertField, insertValue);
|
||||
@@ -2062,8 +2072,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) ){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
// String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
if (null != attFileEO.getFileSuffix() && (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc") || attFileEO.getFileSuffix().equals("ppt") || attFileEO.getFileSuffix().equals("pptx"))) {
|
||||
@@ -2122,10 +2132,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) && !"null".equals(attidlist[i])){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
/*if (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")) {
|
||||
if (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")){
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
@@ -2148,8 +2158,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
// String[] lines = pdfFileInText.split("\\r?\\n");
|
||||
content.append(pdfFileInText);
|
||||
}
|
||||
}*/
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
}
|
||||
// String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
|
||||
Reference in New Issue
Block a user