All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.outerman.be.util.AmountGetter Maven / Gradle / Ivy

There is a newer version: 1.1.22
Show newest version
package com.github.outerman.be.util;

import java.util.Map;

/**
 * Created by shenxy on 14/7/17.
 *
 * 金额来源表达式处理
 */
public class AmountGetter {

    public static  Double getAmount(T detail, String amountSource) {
        return getAmount(detail, amountSource, null);
    }

    public static  Double getAmount(T detail, String amountSource, Map params) {
        Object obj = JexlUtil.evaluate(amountSource, detail, params);
        if (obj == null) {
            return 0.0;
        }
        Double result = Double.parseDouble(obj.toString());
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy