commit | author | age
|
a18bfa
|
1 |
package cn.autoform.web.formula.info.impl.cpn; |
Z |
2 |
|
|
3 |
import java.util.Objects; |
|
4 |
|
|
5 |
import org.apache.commons.lang3.StringUtils; |
|
6 |
|
|
7 |
import cn.autoform.bean.form.CpnType; |
|
8 |
import cn.autoform.web.formula.prop.Attribute; |
|
9 |
|
|
10 |
/** |
|
11 |
* 数组控件 |
|
12 |
* @author WangYX |
|
13 |
* |
|
14 |
*/ |
|
15 |
public class NumberCpn extends AbstractBaseFormCpn{ |
|
16 |
|
|
17 |
@Override |
|
18 |
public CpnType getCpnType() { |
|
19 |
return CpnType.number; |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
23 |
public Object get(Object key) { |
|
24 |
Object val = super.get(key); |
|
25 |
if((MAPPING_KEY.get(key) == Attribute.value || key == Attribute.value) && StringUtils.isNotBlank(val.toString())) |
|
26 |
return Double.parseDouble(Objects.toString(val, "0")); |
|
27 |
return val; |
|
28 |
} |
|
29 |
|
|
30 |
} |