|
@ -8,6 +8,7 @@ import com.yihu.ehr.util.datetime.DateUtil;
|
|
import com.yihu.quota.etl.formula.AgeGroupFunc;
|
|
import com.yihu.quota.etl.formula.AgeGroupFunc;
|
|
import com.yihu.quota.etl.formula.DictFunc;
|
|
import com.yihu.quota.etl.formula.DictFunc;
|
|
import com.yihu.quota.etl.formula.DivisionFunc;
|
|
import com.yihu.quota.etl.formula.DivisionFunc;
|
|
|
|
import com.yihu.quota.etl.formula.FuncHelper;
|
|
import com.yihu.quota.model.cube.Cube;
|
|
import com.yihu.quota.model.cube.Cube;
|
|
import com.yihu.quota.model.cube.CubeMemberMapping;
|
|
import com.yihu.quota.model.cube.CubeMemberMapping;
|
|
import com.yihu.quota.util.ElasticSearchHandler;
|
|
import com.yihu.quota.util.ElasticSearchHandler;
|
|
@ -170,20 +171,29 @@ public class ElasticSearchDataProcessService {
|
|
* @param dataType
|
|
* @param dataType
|
|
* @param dict
|
|
* @param dict
|
|
* @param algorithm
|
|
* @param algorithm
|
|
* @param algorithmParm
|
|
|
|
|
|
* @param algorithmParm 格式如 维度值,如果需要后端获取后代替用value,每个参数直接用逗号分隔,像第一个和第二个参数用逗号,分开,如: value,2,3
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Map<String,Object> dimensionDataExtendToMap(String cloumnValue,String cloumnCode,String dataType ,String dict,String algorithm,String algorithmParm ){
|
|
|
|
|
|
public Map<String,Object> dimensionDataExtendToMap(String cloumnValue,String cloumnCode,String dataType ,
|
|
|
|
String dict,String algorithm,String algorithmParm ) throws Exception {
|
|
Map<String, Object> source = new HashMap<>();
|
|
Map<String, Object> source = new HashMap<>();
|
|
//字典扩展
|
|
//字典扩展
|
|
if(StringUtils.isNotEmpty(dict) && StringUtils.isEmpty(algorithm)){
|
|
if(StringUtils.isNotEmpty(dict) && StringUtils.isEmpty(algorithm)){
|
|
source = extendDictData(source,cloumnCode,dict,cloumnValue);
|
|
source = extendDictData(source,cloumnCode,dict,cloumnValue);
|
|
}else if(StringUtils.isNotEmpty(algorithm)){
|
|
}else if(StringUtils.isNotEmpty(algorithm)){
|
|
|
|
// //通过 反射方式进行 后续开放 暂时字典redis不通
|
|
|
|
// FuncHelper funcHelper = new FuncHelper();
|
|
|
|
// algorithmParm = algorithmParm.replace("value",cloumnCode);
|
|
|
|
// Object data = funcHelper.function(algorithm, algorithmParm.split(","));
|
|
|
|
// if(StringUtils.isNotEmpty(dict)){
|
|
|
|
// source = extendDictData(source,cloumnCode,dict,data.toString());
|
|
|
|
// }else{
|
|
|
|
// source.put(cloumnCode,data);
|
|
|
|
// }
|
|
//年龄段
|
|
//年龄段
|
|
if(algorithm.equals("AgeGroupFunc")){
|
|
|
|
|
|
if(algorithm.contains("AgeGroupFunc")){
|
|
source = extendAgeGroupData(source,cloumnCode,dict,cloumnValue);
|
|
source = extendAgeGroupData(source,cloumnCode,dict,cloumnValue);
|
|
}
|
|
}
|
|
//其他算法 --
|
|
|
|
}else {
|
|
}else {
|
|
source.put(cloumnCode,dataConver(dataType,cloumnValue));
|
|
source.put(cloumnCode,dataConver(dataType,cloumnValue));
|
|
}
|
|
}
|
|
@ -214,8 +224,18 @@ public class ElasticSearchDataProcessService {
|
|
objChildMap = extendDictData(objChildMap,cloumnCode,dict,cloumnValue);
|
|
objChildMap = extendDictData(objChildMap,cloumnCode,dict,cloumnValue);
|
|
source.put(parentCode,objChildMap);
|
|
source.put(parentCode,objChildMap);
|
|
}else if(StringUtils.isNotEmpty(algorithm)){
|
|
}else if(StringUtils.isNotEmpty(algorithm)){
|
|
|
|
|
|
|
|
// //通过 反射方式进行 后续开放 暂时字典redis不通
|
|
|
|
// FuncHelper funcHelper = new FuncHelper();
|
|
|
|
// algorithmParm = algorithmParm.replace("value",cloumnCode);
|
|
|
|
// Object data = funcHelper.function(algorithm, algorithmParm.split(","));
|
|
|
|
// if(StringUtils.isNotEmpty(dict)){
|
|
|
|
// objChildMap = extendDictData(objChildMap,cloumnCode,dict,data.toString());
|
|
|
|
// }else{
|
|
|
|
// objChildMap.put(cloumnCode,data);
|
|
|
|
// }
|
|
//区域算法
|
|
//区域算法
|
|
if(algorithm.equals("DivisionFunc") && StringUtils.isNotEmpty(algorithmParm)){
|
|
|
|
|
|
if(algorithm.contains("DivisionFunc") && StringUtils.isNotEmpty(algorithmParm)){
|
|
objChildMap = extendDivisionData(objChildMap, cloumnCode, algorithmParm, cloumnValue);
|
|
objChildMap = extendDivisionData(objChildMap, cloumnCode, algorithmParm, cloumnValue);
|
|
}
|
|
}
|
|
source.put(parentCode,objChildMap);
|
|
source.put(parentCode,objChildMap);
|