Merge branch 'develop_migration' into 'develop_master'

feat: There is no way the, xxxx

See merge request LiuChao/foton-slrs-system-rest!477
This commit is contained in:
super_liu
2022-05-02 16:14:48 +08:00
2 changed files with 21 additions and 9 deletions
@@ -80,7 +80,10 @@ public class SendStandMQService {
}
}
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
Map<String,Object> attrInfoMap = new TreeMap<>();
if(StringUtils.isNotBlank(sarStandAttrEOStr)){
attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
}
Map<String,Object> infoMap = infoEO.getAttrInfoMap();
Map<String,String> infoEOMapItems = infoEO.getMapItems();
@@ -178,15 +181,25 @@ public class SendStandMQService {
// 动态存储属性字段
for (String field : fieldInfoList) {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
String fieldValue = "";
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
if(!json.toString().equals("null")){
fieldValue = infoMap.get(field).toString();
String fieldValue = "";
try {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
if(json instanceof org.json.JSONArray){
fieldValue = String.join(",", com.alibaba.fastjson.JSONObject.parseArray(standMap.get(field).toString(),String.class));
}else {
if(!("null").equals(json)){
fieldValue = standMap.get(field).toString();
}
}
}
saveMap.put(field+"Name",fieldValue);
}catch (Exception e){
logger.info("国内外标准 消息队列: "+addOrUpdate+", 标准ID:"+infoEO.getId()+",问题字段:"+field);
saveMap.put(field+"Name",fieldValue);
}
saveMap.put(field+"Name",fieldValue);
}
if(infoEOMapItems != null && !infoEOMapItems.isEmpty()){
@@ -33,7 +33,6 @@ import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.JsonObject;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.client.transport.TransportClient;
import org.json.JSONTokener;