搜索中心修改
This commit is contained in:
+6
@@ -494,4 +494,10 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
|||||||
String title = bussDocumentLibraryEOService.getTitle(id, cut);
|
String title = bussDocumentLibraryEOService.getTitle(id, cut);
|
||||||
return Result.OK(title);
|
return Result.OK(title);
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value="编辑ES数据(添加module_type_flag)", notes="编辑ES数据(添加module_type_flag)")
|
||||||
|
@GetMapping(value = "/updateES")
|
||||||
|
public Result<?> getTitle() {
|
||||||
|
int count = bussDocumentLibraryEOService.updateES();
|
||||||
|
return Result.OK(count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -223,4 +223,6 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
|||||||
String getTitle(String id,String cut);
|
String getTitle(String id,String cut);
|
||||||
|
|
||||||
String sqlJoint(List<QueryConditionVO> queryConditionVOList);
|
String sqlJoint(List<QueryConditionVO> queryConditionVOList);
|
||||||
|
|
||||||
|
int updateES();
|
||||||
}
|
}
|
||||||
|
|||||||
+74
-2
@@ -51,6 +51,7 @@ import com.jero.modules.message.websocket.WebSocket;
|
|||||||
import com.jero.modules.ocr.service.IOcrRecordEOService;
|
import com.jero.modules.ocr.service.IOcrRecordEOService;
|
||||||
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;
|
||||||
|
import com.jero.modules.searchcenter.enums.ModuleTypeFlagEnum;
|
||||||
import com.jero.modules.split.common.FileUnZip;
|
import com.jero.modules.split.common.FileUnZip;
|
||||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||||
@@ -1759,6 +1760,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
for (OSSFile ossFile : ossFileList) {
|
for (OSSFile ossFile : ossFileList) {
|
||||||
Map<String, Object> stringMapCn = new HashMap<>();
|
Map<String, Object> stringMapCn = new HashMap<>();
|
||||||
Map<String, Object> stringMapEn = new HashMap<>();
|
Map<String, Object> stringMapEn = new HashMap<>();
|
||||||
|
stringMapCn.put("create_time",new Date());
|
||||||
|
stringMapEn.put("create_time",new Date());
|
||||||
String fileText = "";
|
String fileText = "";
|
||||||
if (ossFile.getFileName().endsWith(".doc")
|
if (ossFile.getFileName().endsWith(".doc")
|
||||||
|| ossFile.getFileName().endsWith(".docx")
|
|| ossFile.getFileName().endsWith(".docx")
|
||||||
@@ -1839,11 +1842,19 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
} else {
|
} else {
|
||||||
Map<String, Object> stringMapCn = new HashMap<>();
|
Map<String, Object> stringMapCn = new HashMap<>();
|
||||||
Map<String, Object> stringMapEn = new HashMap<>();
|
Map<String, Object> stringMapEn = new HashMap<>();
|
||||||
|
Map<String, Object> mapBaseDateCn = new HashMap<>();
|
||||||
|
Map<String, Object> mapBaseDateEn = new HashMap<>();
|
||||||
|
stringMapCn.put("create_time",new Date());
|
||||||
|
stringMapEn.put("create_time",new Date());
|
||||||
|
mapBaseDateCn.put("create_time",new Date());
|
||||||
|
mapBaseDateEn.put("create_time",new Date());
|
||||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||||
String s = StringUtils.valueOf(map.get(onlCgformField.getDbFieldName()));
|
String s = StringUtils.valueOf(map.get(onlCgformField.getDbFieldName()));
|
||||||
if(StringUtils.isNotBlank(s)){
|
if(StringUtils.isNotBlank(s)){
|
||||||
stringMapCn.put(onlCgformField.getDbFieldName(), s);
|
stringMapCn.put(onlCgformField.getDbFieldName(), s);
|
||||||
stringMapEn.put(onlCgformField.getDbFieldName(), s);
|
stringMapEn.put(onlCgformField.getDbFieldName(), s);
|
||||||
|
mapBaseDateCn.put(onlCgformField.getDbFieldName(), s);
|
||||||
|
mapBaseDateEn.put(onlCgformField.getDbFieldName(), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//封装中文的全文内容(es)
|
//封装中文的全文内容(es)
|
||||||
@@ -1856,8 +1867,23 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
StringUtils.valueOf(map.get("title")), "", "",
|
StringUtils.valueOf(map.get("title")), "", "",
|
||||||
cutEn, stringMapEn,SEARCH_FLAG);
|
cutEn, stringMapEn,SEARCH_FLAG);
|
||||||
stringMapEn.put("file_sort",idTemp+"_"+1);
|
stringMapEn.put("file_sort",idTemp+"_"+1);
|
||||||
|
|
||||||
|
//用于全文带条件查询-----------------------------
|
||||||
|
//封装中文的全文内容(es)
|
||||||
|
putMapCn(idTemp+"1", StringUtils.valueOf(map.get("serial_number")), "文档库", sbCn.toString(),
|
||||||
|
StringUtils.valueOf(map.get("title")), "", "",
|
||||||
|
cutCn, mapBaseDateCn, null);
|
||||||
|
mapBaseDateCn.put("file_sort",idTemp+"_"+1);
|
||||||
|
//封装英文的全文内容(es)
|
||||||
|
putMapCn(idTemp+"2", StringUtils.valueOf(map.get("serial_number")), "document library", sbEn.toString(),
|
||||||
|
StringUtils.valueOf(map.get("title")), "", "",
|
||||||
|
cutEn, mapBaseDateEn,null);
|
||||||
|
stringMapEn.put("file_sort",idTemp+"_"+1);
|
||||||
|
//用于全文带条件查询-----------------------------
|
||||||
mapListTempCn.add(stringMapCn);
|
mapListTempCn.add(stringMapCn);
|
||||||
mapListTempEn.add(stringMapEn);
|
mapListTempEn.add(stringMapEn);
|
||||||
|
mapListTempCn.add(mapBaseDateCn);
|
||||||
|
mapListTempEn.add(mapBaseDateEn);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -1879,6 +1905,8 @@ 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("module_type_flag", ModuleTypeFlagEnum.DOCUMENT_LIBRARY.getValue());
|
||||||
|
map.put("create_time", new Date());
|
||||||
map.put("file_text",fileTextAll);
|
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));
|
||||||
@@ -2224,6 +2252,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if(StringUtils.isNotBlank(issueTime)){
|
if(StringUtils.isNotBlank(issueTime)){
|
||||||
issueTimeDate = df.parse(issueTime);
|
issueTimeDate = df.parse(issueTime);
|
||||||
}
|
}
|
||||||
|
if(ObjectUtils.isNotEmpty(map.get("es_update_flag"))){
|
||||||
|
if(ObjectUtils.isNotEmpty(map.get("implement_time"))){
|
||||||
|
map.put("implement_time",df.format(map.get("implement_time")));
|
||||||
|
}
|
||||||
|
if(ObjectUtils.isNotEmpty(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){
|
||||||
|
map.put("xin1_che1_xing2_shi2_shi1_ri4_qi1",df.format(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1")));
|
||||||
|
}
|
||||||
|
}
|
||||||
String implementTime = (String) map.get("implement_time");//在产车实施日期
|
String implementTime = (String) map.get("implement_time");//在产车实施日期
|
||||||
String newCarimplementTime = (String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
String newCarimplementTime = (String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1");//新车型实施日期
|
||||||
if (StringUtils.isNotBlank(implementTime) && ObjectUtils.isNotEmpty(issueTimeDate)) {
|
if (StringUtils.isNotBlank(implementTime) && ObjectUtils.isNotEmpty(issueTimeDate)) {
|
||||||
@@ -2398,7 +2434,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
String value = StringUtils.valueOf(entry.getValue());
|
String value = StringUtils.valueOf(entry.getValue());
|
||||||
if(fileFieldList.contains(key)){
|
if(fileFieldList.contains(key)){
|
||||||
if(!"null".equals(value)){
|
if(!"null".equals(value) && StringUtils.isNotBlank(value)){
|
||||||
connectIdList.add(value);
|
connectIdList.add(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2413,6 +2449,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
//之前没有上传过文件
|
//之前没有上传过文件
|
||||||
Map<String, Object> stringMapCn = new HashMap<>();
|
Map<String, Object> stringMapCn = new HashMap<>();
|
||||||
Map<String, Object> stringMapEn = new HashMap<>();
|
Map<String, Object> stringMapEn = new HashMap<>();
|
||||||
|
Map<String, Object> mapBaseDateCn = new HashMap<>();
|
||||||
|
Map<String, Object> mapBaseDateEn = new HashMap<>();
|
||||||
|
stringMapCn.put("create_time",new Date());
|
||||||
|
stringMapEn.put("create_time",new Date());
|
||||||
|
mapBaseDateCn.put("create_time",new Date());
|
||||||
|
mapBaseDateEn.put("create_time",new Date());
|
||||||
for (OnlCgformField onlCgformField : searchFieldList) {
|
for (OnlCgformField onlCgformField : searchFieldList) {
|
||||||
String s = (String) map.get(onlCgformField.getDbFieldName());
|
String s = (String) map.get(onlCgformField.getDbFieldName());
|
||||||
if(FieldTypeEnum.DATE_SINGLE.getValue().equals(onlCgformField.getFieldShowType()) && StringUtils.isNotBlank(s)){
|
if(FieldTypeEnum.DATE_SINGLE.getValue().equals(onlCgformField.getFieldShowType()) && StringUtils.isNotBlank(s)){
|
||||||
@@ -2435,8 +2477,23 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
cutEn, stringMapEn,SEARCH_FLAG);
|
cutEn, stringMapEn,SEARCH_FLAG);
|
||||||
stringMapEn.put("file_sort", StringUtils.valueOf(map.get("id")+"_"+1));
|
stringMapEn.put("file_sort", StringUtils.valueOf(map.get("id")+"_"+1));
|
||||||
|
|
||||||
|
//用于全文带条件查询-----------------------------
|
||||||
|
//封装中文的全文内容(es)
|
||||||
|
putMapCn(StringUtils.valueOf(map.get("id"))+"1", StringUtils.valueOf(map.get("serial_number")), "文档库", sbCn.toString(),
|
||||||
|
StringUtils.valueOf(map.get("title")), "", "",
|
||||||
|
cutCn, mapBaseDateCn, null);
|
||||||
|
mapBaseDateCn.put("file_sort",StringUtils.valueOf(map.get("id")+"_"+1));
|
||||||
|
//封装英文的全文内容(es)
|
||||||
|
putMapCn(StringUtils.valueOf(map.get("id"))+"2", StringUtils.valueOf(map.get("serial_number")), "document library", sbEn.toString(),
|
||||||
|
StringUtils.valueOf(map.get("title")), "", "",
|
||||||
|
cutEn, mapBaseDateEn,null);
|
||||||
|
stringMapEn.put("file_sort",StringUtils.valueOf(map.get("id")+"_"+1));
|
||||||
|
//用于全文带条件查询-----------------------------
|
||||||
|
|
||||||
mapListTempCn.add(stringMapCn);
|
mapListTempCn.add(stringMapCn);
|
||||||
mapListTempEn.add(stringMapEn);
|
mapListTempEn.add(stringMapEn);
|
||||||
|
mapListTempCn.add(mapBaseDateCn);
|
||||||
|
mapListTempEn.add(mapBaseDateEn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2473,6 +2530,8 @@ 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("module_type_flag", ModuleTypeFlagEnum.DOCUMENT_LIBRARY.getValue());
|
||||||
|
map.put("create_time", new Date());
|
||||||
map.put("file_text", fileTextAll);
|
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()) {
|
||||||
@@ -2481,7 +2540,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
if(dateSingleList.contains(entry.getKey())){
|
if(dateSingleList.contains(entry.getKey())){
|
||||||
value = value.toString().split(" ")[0];
|
value = value.toString().split(" ")[0];
|
||||||
}else if("create_time".equals(entry.getKey()) || "update_time".equals(entry.getKey())){
|
}else if("create_time".equals(entry.getKey()) || "update_time".equals(entry.getKey())){
|
||||||
value = value.toString().split(" ")[0];
|
// value = value.toString().split(" ")[0];
|
||||||
}
|
}
|
||||||
objectMapTemp.put(entry.getKey(),value);
|
objectMapTemp.put(entry.getKey(),value);
|
||||||
}
|
}
|
||||||
@@ -5650,6 +5709,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
stringMap.put("id", id);
|
stringMap.put("id", id);
|
||||||
stringMap.put("serial_number", serialNumber);
|
stringMap.put("serial_number", serialNumber);
|
||||||
stringMap.put("module_type", moduleType);
|
stringMap.put("module_type", moduleType);
|
||||||
|
stringMap.put("module_type_flag", ModuleTypeFlagEnum.DOCUMENT_LIBRARY.getValue());
|
||||||
stringMap.put("content", content);
|
stringMap.put("content", content);
|
||||||
stringMap.put("title", title);
|
stringMap.put("title", title);
|
||||||
stringMap.put("file_text", fileText);
|
stringMap.put("file_text", fileText);
|
||||||
@@ -5921,4 +5981,16 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateES() {
|
||||||
|
List<Map<String, Object>> mapList = this.listMaps();
|
||||||
|
int count = 0;
|
||||||
|
for (Map<String, Object> map : mapList) {
|
||||||
|
map.put("es_update_flag","es_update_flag");
|
||||||
|
updateInfo(map);
|
||||||
|
count ++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user