|
@@ -1423,7 +1423,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
while (m.find()){
|
|
|
String el=m.group();
|
|
|
String pstr=el.replaceAll("^"+FC_REG+"ifelse\\(","").replaceAll("\\)$","");
|
|
|
- String pa[]=pstr.split(",");
|
|
|
+ String[] pa =pstr.split(",");
|
|
|
if(pa.length==3){
|
|
|
Object data = Expression.parse(pa[0]+"?"+pa[1]+":"+pa[2]).calculate(createCurrentMap(el));
|
|
|
f=f.replace(el,putDataWithKey(data));
|
|
@@ -1435,12 +1435,38 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
max++;
|
|
|
}while (f.contains("ifelse")&&max<20);
|
|
|
}
|
|
|
+ if(f.contains("avg4segment")){
|
|
|
+ Matcher m = RegexUtils.matcher(FC_REG+"(avg4segment)\\(([^)]+)\\)",f);
|
|
|
+ while (m.find()){
|
|
|
+ String[] args=m.group(2).split(",");
|
|
|
+ List<FormData> target = getFormDataByCode(args[0]);
|
|
|
+ if(!target.isEmpty()){
|
|
|
+ FormData a=target.get(0);
|
|
|
+ int n=Math.max(1,a.coordsList.size()/fd.getCoordsList().size());
|
|
|
+ List<Object> data=CustomFunction.avg4segment(a.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),n);
|
|
|
+ f=f.replace(m.group(),putDataWithKey(data));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(f.contains("skip")){
|
|
|
+ Matcher m = RegexUtils.matcher(FC_REG+"(skip)\\(([^)]+)\\)",f);
|
|
|
+ while (m.find()){
|
|
|
+ String[] args=m.group(2).split(",");
|
|
|
+ List<FormData> target = getFormDataByCode(args[0]);
|
|
|
+ if(!target.isEmpty()){
|
|
|
+ FormData a=target.get(0);
|
|
|
+ a.setOffset(StringUtils.handleObj2Integer(args[1]));
|
|
|
+ f=f.replace(m.group(),args[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(f.contains("quantity")){
|
|
|
/*聚合*/
|
|
|
Matcher m = RegexUtils.matcher(FC_REG+"(quantity)\\(([^)]+)\\)",f);
|
|
|
while (m.find()) {
|
|
|
Object data=null;
|
|
|
List<String> codeList = getCodeList(m.group(2));
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
Map<String,List<Map<String,Object>>> textInfoMap= (Map<String, List<Map<String, Object>>>) tec.constantMap.getOrDefault(TEXT_INFO_MAP,new HashMap<>());
|
|
|
List<Map<String,Object>> tableColKeyVal= textInfoMap.get(codeList.get(0));
|
|
|
if(Func.isNotEmpty(tableColKeyVal)){
|