feat: There is no way the Search Add Stand ES
This commit is contained in:
@@ -180,10 +180,12 @@ public class SendStandMQService {
|
|||||||
// 动态存储属性字段
|
// 动态存储属性字段
|
||||||
for (String field : fieldInfoList) {
|
for (String field : fieldInfoList) {
|
||||||
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
|
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
|
||||||
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
|
|
||||||
String fieldValue = "";
|
String fieldValue = "";
|
||||||
if(!json.toString().equals("null")){
|
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
|
||||||
fieldValue = infoMap.get(field).toString();
|
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
|
||||||
|
if(!json.toString().equals("null")){
|
||||||
|
fieldValue = infoMap.get(field).toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
saveMap.put(field+"Name",fieldValue);
|
saveMap.put(field+"Name",fieldValue);
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-12
@@ -68,6 +68,7 @@ import org.apache.poi.hwpf.extractor.WordExtractor;
|
|||||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
|
import org.json.JSONTokener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -387,13 +388,19 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attrInfoSearchDetails(SarStandardsInfo row) throws Exception {
|
public void attrInfoSearchDetails(SarStandardsInfo row,String type) throws Exception {
|
||||||
String fieldInfo = InitStandAttrUtil.queryField;
|
String fieldInfo = InitStandAttrUtil.queryField;
|
||||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||||
row.setCollectId(collectId);
|
row.setCollectId(collectId);
|
||||||
// 查询属性表数据
|
// 查询属性表数据
|
||||||
if (StringUtils.isNotBlank(fieldInfo)) {
|
if (StringUtils.isNotBlank(fieldInfo)) {
|
||||||
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
|
Map<String, Object> getAttrMap = new TreeMap<>();
|
||||||
|
if(type.equals("add")){
|
||||||
|
String sarStandAttrEOStr = row.getSarStandAttrEOStr();
|
||||||
|
getAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||||
|
}else {
|
||||||
|
getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
|
||||||
|
}
|
||||||
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
|
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
|
||||||
// 遍历修改所有clob类型的值
|
// 遍历修改所有clob类型的值
|
||||||
for (String clobField : InitStandAttrUtil.clobFieldList) {
|
for (String clobField : InitStandAttrUtil.clobFieldList) {
|
||||||
@@ -457,18 +464,28 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attrInfoShowSearchDetails(SarStandardsInfo row) throws Exception {
|
public void attrInfoShowSearchDetails(SarStandardsInfo row,String type) throws Exception {
|
||||||
if (row != null) {
|
if (row != null) {
|
||||||
attrInfoSearchDetails(row);
|
attrInfoSearchDetails(row,type);
|
||||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||||
if (getAttrMap != null && getAttrMap.size() > 0) {
|
if (getAttrMap != null && getAttrMap.size() > 0) {
|
||||||
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
|
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
|
||||||
String name = entry.getKey();
|
String name = entry.getKey();
|
||||||
String value = "";
|
String value = "";
|
||||||
|
List<String> valArr = new ArrayList<>();
|
||||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||||
value = entry.getValue().toString();
|
if(StringUtils.isNotBlank(entry.getValue().toString())){
|
||||||
List<String> valArr = Arrays.asList(value.split(","));
|
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
|
||||||
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
if(json instanceof org.json.JSONArray){
|
||||||
|
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
|
||||||
|
}else {
|
||||||
|
value = entry.getValue().toString();
|
||||||
|
valArr = Arrays.asList(value.split(","));
|
||||||
|
}
|
||||||
|
if(!valArr.isEmpty()){
|
||||||
|
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||||
|
}
|
||||||
|
}
|
||||||
entry.setValue(value);
|
entry.setValue(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,10 +593,20 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
}
|
}
|
||||||
String content = "新增" + number + " 《" + sarStandardsInfoEO.getStandName() + "》";
|
String content = "新增" + number + " 《" + sarStandardsInfoEO.getStandName() + "》";
|
||||||
sarUpdLogEOService.createBaseLog(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND", content);
|
sarUpdLogEOService.createBaseLog(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND", content);
|
||||||
// if(elasflag) {
|
if(elasflag) {
|
||||||
// // 消息队列
|
// 消息队列
|
||||||
// createStandMQService.sendStandMQ(sarStandardsInfoEO,"add");
|
attrInfoShowSearchDetails(sarStandardsInfoEO,"add");
|
||||||
// }
|
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||||
|
pageInfo.setStandId(sarStandardsInfoEO.getId());
|
||||||
|
pageInfo.setFileType("FBGBJBD");
|
||||||
|
List<SarItemVO> sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo);
|
||||||
|
if(!sarItemVOS.isEmpty()){
|
||||||
|
Map<String,String> collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null)
|
||||||
|
.collect(Collectors.toMap(SarItemVO::getItemsNum, SarItemVO::getItemsName));
|
||||||
|
sarStandardsInfoEO.setMapItems(collectMap);
|
||||||
|
}
|
||||||
|
createStandMQService.sendStandMQ(sarStandardsInfoEO,"add");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,7 +1175,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
// 记录修改日志
|
// 记录修改日志
|
||||||
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
|
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
|
||||||
if(elasflag) { //what?
|
if(elasflag) { //what?
|
||||||
attrInfoShowSearchDetails(sarStandardsInfoEO);
|
attrInfoShowSearchDetails(sarStandardsInfoEO,"upd");
|
||||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||||
pageInfo.setStandId(sarStandardsInfoEO.getId());
|
pageInfo.setStandId(sarStandardsInfoEO.getId());
|
||||||
pageInfo.setFileType("FBGBJBD");
|
pageInfo.setFileType("FBGBJBD");
|
||||||
|
|||||||
Reference in New Issue
Block a user