|
@@ -18,10 +18,7 @@ import com.jfireel.expression.token.TokenType;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
-import org.springblade.core.tool.utils.CharPool;
|
|
|
-import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
-import org.springblade.core.tool.utils.Func;
|
|
|
-import org.springblade.core.tool.utils.StringPool;
|
|
|
+import org.springblade.core.tool.utils.*;
|
|
|
import org.springblade.manager.dto.ElementData;
|
|
|
|
|
|
import java.io.File;
|
|
@@ -1912,17 +1909,15 @@ public class CustomFunction {
|
|
|
List<Object> list = obj2ListNe(o);
|
|
|
int index =0;
|
|
|
if(NumberUtil.isNumber(indexObj.toString())){
|
|
|
- index=StringUtils.handObj2Integer(indexObj);
|
|
|
+ index=StringUtils.handObj2Integer(indexObj)-1;
|
|
|
}else if(StringUtils.isEquals("last",indexObj)){
|
|
|
index=list.size()-1;
|
|
|
}
|
|
|
if(ListUtils.isNotEmpty(list) ){
|
|
|
- if(index>0){
|
|
|
- if(list.size()>index){
|
|
|
- return list.get(index);
|
|
|
- }
|
|
|
+ if(list.size()>index&&index>=1){
|
|
|
+ return list.get(index);
|
|
|
}else{
|
|
|
- return list.get(list.size()+index);
|
|
|
+ return list.get(list.size()-1);
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
@@ -1932,6 +1927,7 @@ public class CustomFunction {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @Description 关键字转换
|
|
|
* @Param [cn]
|
|
@@ -1968,6 +1964,11 @@ public class CustomFunction {
|
|
|
List<Object> list = obj2List(obj);
|
|
|
return list.parallelStream().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
|
|
}
|
|
|
+ /*obj2ListNe别名*/
|
|
|
+ public static List<Object> objToListNe(Object obj){
|
|
|
+ return obj2ListNe(obj);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @Description 过滤掉List中的空对象
|