搜索--文档库列表(正文)
This commit is contained in:
+14
-3
@@ -1203,6 +1203,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
|
|
||||||
List<Map<String, Object>> mapListTempCn = new ArrayList<>();
|
List<Map<String, Object>> mapListTempCn = new ArrayList<>();
|
||||||
List<Map<String, Object>> mapListTempEn = new ArrayList<>();
|
List<Map<String, Object>> mapListTempEn = new ArrayList<>();
|
||||||
|
StringBuilder fileTextAll = new StringBuilder();
|
||||||
try {
|
try {
|
||||||
String cutCn = CutEnum.CN.getValue();
|
String cutCn = CutEnum.CN.getValue();
|
||||||
String cutEn = CutEnum.EN.getValue();
|
String cutEn = CutEnum.EN.getValue();
|
||||||
@@ -1226,6 +1227,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(wordContent)) {
|
if (StringUtils.isNotBlank(wordContent)) {
|
||||||
fileText = wordContent;
|
fileText = wordContent;
|
||||||
|
fileTextAll.append(fileText+",");
|
||||||
}
|
}
|
||||||
} else if (ossFile.getFileName().endsWith(".pdf") || ossFile.getFileName().endsWith(".PDF")) {
|
} else if (ossFile.getFileName().endsWith(".pdf") || ossFile.getFileName().endsWith(".PDF")) {
|
||||||
String pdfContent = null;
|
String pdfContent = null;
|
||||||
@@ -1236,6 +1238,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(pdfContent)) {
|
if (StringUtils.isNotBlank(pdfContent)) {
|
||||||
fileText = pdfContent;
|
fileText = pdfContent;
|
||||||
|
fileTextAll.append(fileText+",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||||
@@ -1330,6 +1333,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
//添加es
|
//添加es
|
||||||
map.put("id", idTemp);
|
map.put("id", idTemp);
|
||||||
map.put("module_type", "文档库");
|
map.put("module_type", "文档库");
|
||||||
|
map.put("file_text",fileTextAll);
|
||||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(map));
|
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(map));
|
||||||
JSONArray arrayCn = JSONArray.parseArray(JSON.toJSONString(mapListTempCn));
|
JSONArray arrayCn = JSONArray.parseArray(JSON.toJSONString(mapListTempCn));
|
||||||
JSONArray arrayEn = JSONArray.parseArray(JSON.toJSONString(mapListTempEn));
|
JSONArray arrayEn = JSONArray.parseArray(JSON.toJSONString(mapListTempEn));
|
||||||
@@ -1740,12 +1744,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
|
|
||||||
List<Map<String, Object>> mapListTempCn = new ArrayList<>();
|
List<Map<String, Object>> mapListTempCn = new ArrayList<>();
|
||||||
List<Map<String, Object>> mapListTempEn = new ArrayList<>();
|
List<Map<String, Object>> mapListTempEn = new ArrayList<>();
|
||||||
|
String fileTextAll = "";
|
||||||
try {
|
try {
|
||||||
String cutCn = CutEnum.CN.getValue();
|
String cutCn = CutEnum.CN.getValue();
|
||||||
String cutEn = CutEnum.EN.getValue();
|
String cutEn = CutEnum.EN.getValue();
|
||||||
if (fileInfos.size() != 0) {
|
if (fileInfos.size() != 0) {
|
||||||
//编辑时,有修改文件的情况
|
//编辑时,有修改文件的情况
|
||||||
updateEsInfo(map, searchFieldList, sbCn, sbEn, fileInfos, mapListTempCn, mapListTempEn, cutCn, cutEn);
|
fileTextAll = updateEsInfo(map, searchFieldList, sbCn, sbEn, fileInfos, mapListTempCn, mapListTempEn, cutCn, cutEn);
|
||||||
} else {
|
} else {
|
||||||
//没有修改文件,获取之前上传过的文件
|
//没有修改文件,获取之前上传过的文件
|
||||||
List<OnlCgformField> fieldFileListTemp = fieldList.stream()
|
List<OnlCgformField> fieldFileListTemp = fieldList.stream()
|
||||||
@@ -1765,7 +1770,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
List<OSSFile> oSSFileListTemp = iOSSFileService.getFileInfosByConnectId(StringUtils.join(connectIdList, ","));
|
List<OSSFile> oSSFileListTemp = iOSSFileService.getFileInfosByConnectId(StringUtils.join(connectIdList, ","));
|
||||||
//处理文件排序(发布稿 增补件 报批稿 征求意见稿 测试程序)
|
//处理文件排序(发布稿 增补件 报批稿 征求意见稿 测试程序)
|
||||||
List<OSSFile> files = fileSort(fieldFileList, oSSFileListTemp, map);
|
List<OSSFile> files = fileSort(fieldFileList, oSSFileListTemp, map);
|
||||||
updateEsInfo(map, searchFieldList, sbCn, sbEn, files, mapListTempCn, mapListTempEn, cutCn, cutEn);
|
fileTextAll = updateEsInfo(map, searchFieldList, sbCn, sbEn, files, mapListTempCn, mapListTempEn, cutCn, cutEn);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
//之前没有上传过文件
|
//之前没有上传过文件
|
||||||
@@ -1829,6 +1834,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
|
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
|
||||||
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
|
||||||
map.put("module_type", "文档库");
|
map.put("module_type", "文档库");
|
||||||
|
map.put("file_text", fileTextAll);
|
||||||
Map<String,Object> objectMapTemp = new HashMap<>();
|
Map<String,Object> objectMapTemp = new HashMap<>();
|
||||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
Object value = entry.getValue();
|
Object value = entry.getValue();
|
||||||
@@ -1876,9 +1882,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateEsInfo(Map<String, Object> map, List<OnlCgformField> searchFieldList, StringBuilder sbCn, StringBuilder sbEn, List<OSSFile> fileInfos, List<Map<String, Object>> mapListTempCn, List<Map<String, Object>> mapListTempEn, String cutCn, String cutEn) {
|
private String updateEsInfo(Map<String, Object> map, List<OnlCgformField> searchFieldList, StringBuilder sbCn, StringBuilder sbEn, List<OSSFile> fileInfos, List<Map<String, Object>> mapListTempCn, List<Map<String, Object>> mapListTempEn, String cutCn, String cutEn) {
|
||||||
Map<String, Object> mapBaseDateCn = new HashMap<>();
|
Map<String, Object> mapBaseDateCn = new HashMap<>();
|
||||||
Map<String, Object> mapBaseDateEn = new HashMap<>();
|
Map<String, Object> mapBaseDateEn = new HashMap<>();
|
||||||
|
StringBuilder fileTextAll = new StringBuilder();
|
||||||
for (OSSFile ossFile : fileInfos) {
|
for (OSSFile ossFile : fileInfos) {
|
||||||
Map<String, Object> stringMapCn = new HashMap<>();
|
Map<String, Object> stringMapCn = new HashMap<>();
|
||||||
Map<String, Object> stringMapEn = new HashMap<>();
|
Map<String, Object> stringMapEn = new HashMap<>();
|
||||||
@@ -1895,6 +1902,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(wordContent)) {
|
if (StringUtils.isNotBlank(wordContent)) {
|
||||||
fileText = wordContent;
|
fileText = wordContent;
|
||||||
|
fileTextAll.append(fileText+",");
|
||||||
}
|
}
|
||||||
} else if (ossFile.getFileName().endsWith(".pdf") || ossFile.getFileName().endsWith(".PDF")) {
|
} else if (ossFile.getFileName().endsWith(".pdf") || ossFile.getFileName().endsWith(".PDF")) {
|
||||||
String pdfContent = null;
|
String pdfContent = null;
|
||||||
@@ -1905,6 +1913,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(pdfContent)) {
|
if (StringUtils.isNotBlank(pdfContent)) {
|
||||||
fileText = pdfContent;
|
fileText = pdfContent;
|
||||||
|
fileTextAll.append(fileText+",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||||
@@ -1963,6 +1972,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
mapBaseDateEn.put("file_sort",(String) map.get("id")+"_"+1);
|
mapBaseDateEn.put("file_sort",(String) map.get("id")+"_"+1);
|
||||||
mapListTempCn.add(mapBaseDateCn);
|
mapListTempCn.add(mapBaseDateCn);
|
||||||
mapListTempEn.add(mapBaseDateEn);
|
mapListTempEn.add(mapBaseDateEn);
|
||||||
|
return fileTextAll.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user