Przeglądaj źródła

es mapping 数据逻辑处理保存

jkzlzhoujie 6 lat temu
rodzic
commit
b4aa630167

+ 13 - 20
src/main/java/com/yihu/quota/service/cube/ElasticSearchDataProcessService.java

@ -177,12 +177,7 @@ public class ElasticSearchDataProcessService {
            }
            }
            //其他算法 --
            //其他算法 --
        }else {
        }else {
            if(StringUtils.isNotEmpty(dataType)){
                Object value = dataConver(dataType,cloumnValue);
                source.put(cloumnCode,value);
            }else{
                source.put(cloumnCode,cloumnValue);
            }
            source.put(cloumnCode,dataConver(dataType,cloumnValue));
        }
        }
        return  source;
        return  source;
    }
    }
@ -233,28 +228,26 @@ public class ElasticSearchDataProcessService {
                //组装 子集历史数据,更改当前字段值 在添加
                //组装 子集历史数据,更改当前字段值 在添加
                List<Map<String, Object>> childList = (List<Map<String, Object>>)oldMataMap.get(parentCode);
                List<Map<String, Object>> childList = (List<Map<String, Object>>)oldMataMap.get(parentCode);
                if(childList != null && childList.size() > 0){
                if(childList != null && childList.size() > 0){
                    boolean isexist = false;
                    for(Map<String, Object> map : childList){
                    for(Map<String, Object> map : childList){
                        if(oldMataMap.get(subRowKey_k) != null){
                            if(oldMataMap.get(subRowKey_k).toString().equals(subRowKey)){
                                for(String colKey :map.keySet()) {
                                    if (colKey.equals(cloumnCode)) {
                                        map.put(cloumnCode, cloumnValue);
                                    }
                                }
                            }
                        if(subRowKey.equals(map.get(subRowKey_k).toString())){
                            map.put(subRowKey_k,subRowKey);
                            map.put(cloumnCode,dataConver(dataType,cloumnValue));
                            isexist = true;
                        }
                        }
                        nestedList.add(map);
                        nestedList.add(map);
                    }
                    }
                    if( !isexist){
                        Map<String,Object> map = new HashMap<>();
                        map.put(subRowKey_k,subRowKey);
                        map.put(cloumnCode,dataConver(dataType,cloumnValue));
                        nestedList.add(map);
                    }
                    source.put(parentCode, nestedList);
                    source.put(parentCode, nestedList);
                }else{
                }else{
                    Map<String,Object> map = new HashMap<>();
                    Map<String,Object> map = new HashMap<>();
                    map.put(subRowKey_k,subRowKey);
                    map.put(subRowKey_k,subRowKey);
                    if(StringUtils.isNotEmpty(dataType)){
                        Object value = dataConver(dataType,cloumnValue);
                        map.put(cloumnCode,value);
                    }else{
                        map.put(cloumnCode,cloumnValue);
                    }
                    map.put(cloumnCode,dataConver(dataType,cloumnValue));
                    nestedList.add(map);
                    nestedList.add(map);
                    source.put(parentCode, nestedList);
                    source.put(parentCode, nestedList);
                }
                }