计算量增加求和函数
This commit is contained in:
parent
21bae633fe
commit
44b7b590cb
@ -55,5 +55,23 @@ public class FunctionSumValue extends AbstractFunction {
|
|||||||
//未找到缓存,查询时序API获取数据
|
//未找到缓存,查询时序API获取数据
|
||||||
return AviatorRuntimeJavaType.valueOf(value);
|
return AviatorRuntimeJavaType.valueOf(value);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public AviatorObject call(Map<String, Object> env, AviatorObject deviceCode, AviatorObject attr, AviatorObject startTimeData, AviatorObject endTimeData) {
|
||||||
|
//设备Code
|
||||||
|
String code = (String)deviceCode.getValue(env);
|
||||||
|
String attrName = (String)attr.getValue(env);
|
||||||
|
Date startTime = (Date)startTimeData.getValue(env);
|
||||||
|
Date endTime = (Date)endTimeData.getValue(env);
|
||||||
|
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCacheByCode(code);
|
||||||
|
if (deviceInfoCache == null) {
|
||||||
|
return AviatorNil.NIL;
|
||||||
|
}
|
||||||
|
Double value = dataService.getTimeTopValue(deviceInfoCache.getDeviceId(), attrName, startTime.getTime(), endTime.getTime());
|
||||||
|
if (value == null){
|
||||||
|
return AviatorNil.NIL;
|
||||||
|
}
|
||||||
|
//未找到缓存,查询时序API获取数据
|
||||||
|
return AviatorRuntimeJavaType.valueOf(value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user