package com.changhong.epc.count.service.system.func.set.date; import com.changhong.epc.count.service.system.func.set.AbsFuncSupper; import com.changhong.epc.count.service.tool.SystemFunTool; import com.googlecode.aviator.runtime.type.AviatorObject; import com.iemsoft.framework.cloud.core.tools.DateTool; import java.util.Map; /** * 获取时间函数 * @author wangZX * */ public class GetDayFuntion extends AbsFuncSupper { @Override public AviatorObject call(Map env, AviatorObject arg1,AviatorObject arg2) { String maxDate = SystemFunTool.getStringVal(arg1, env); String minDate = SystemFunTool.getStringVal(arg2, env); try{ return getAviatorLong( new Double((DateTool.stringToDate(maxDate).getTime() - DateTool.stringToDate(minDate).getTime())/(24*60*60*1000.0)).longValue()); }catch(Exception e){ return getAviatorLong(0); } } @Override public String getName() { return FUNC_DATE_GET_DAY; } }