# 14.表达式函数

# 内置EL函数

# @nk


@nk.account() // 返回当前登陆用户ID
@nk.realname() // 返回当前登陆用户姓名
@nk.user() // 返回当前登陆用户信息UserDetails
@nk.me() // 返回当前登陆用户的档案单据DocHV
1
2
3
4
5

# @array


// 合并数组集合为字符串
@array.join(List<String>)
@array.join(String[])
@array.join(delimiter,List<String>)
@array.join(delimiter,String[])

// 截取集合
@array.sub(Object[],limit)
@array.sub(List<String>,limit)
@array.sub(Object[],skip,limit)
@array.sub(List<String>,skip,limit)

// 排序
@array.sort(Object[]);
@array.sort(List<String>);
@array.sort(Object[],field);
@array.sort(List<String>,field);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# @date

@date.now() // 返回当前时间秒
@date.diff(date1,date2) // 计算两个日期相差的天数
@date.monthAdd(date,month) // 日期加month月
@date.yearAdd(date,year) // 日期加year年

//解析字符串日期 
//22年4月12日
//49年10-01
//2022年4月12日
//2022年4月12日 13点
//2022年4月12号 13:00:12
//2022年4月12号 13时0分12秒
//2022年4月12号13时0分
//2022-4-12
//2022-4-12 13:00:12
@date.parse(str) 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# @dict

@dict.json(key) // 返回字典JSON值
@dict.text(key) // 返回字典字符串值
1
2

# @math

// 解析字符串为数值类型,只解析数字0-9,负号-,小数点.,百分号%这几类字符,其他的忽略
@math.parseInt(str)
@math.parseLong(str)
@math.parseDouble(str)
1
2
3
4

# @string

@string.isNotBlank(str) // 判断字符串是否非空
1

# 尚未启用的保留关键字

@auth
@doc
@menu
@partner
@tp
1
2
3
4
5

# 第三方接口

# @qcc

@qcc.get(url) // 调用企查查接口
1