调整 EquipmentCache接口方法名称
This commit is contained in:
parent
212f453e41
commit
dda74d9e65
@ -25,12 +25,12 @@ public interface EquipmentCache {
|
||||
* @param deviceCode
|
||||
* @return
|
||||
*/
|
||||
DeviceInfoCache getDeviceInfoCache(String deviceCode);
|
||||
DeviceInfoCache getDeviceInfoCacheByCode(String deviceCode);
|
||||
|
||||
/**
|
||||
* 通过设备ID获取设备缓存信息
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
DeviceInfoCache getDeviceInfoCache(Long deviceId);
|
||||
DeviceInfoCache getDeviceInfoCacheById(Long deviceId);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class EquipmentCacheImpl implements EquipmentCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInfoCache getDeviceInfoCache(String deviceCode) {
|
||||
public DeviceInfoCache getDeviceInfoCacheByCode(String deviceCode) {
|
||||
Integer index = deviceCodeIndex.get(deviceCode);
|
||||
if (index != null) {
|
||||
return deviceInfoCaches.get(index);
|
||||
@ -103,7 +103,7 @@ public class EquipmentCacheImpl implements EquipmentCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInfoCache getDeviceInfoCache(Long deviceId) {
|
||||
public DeviceInfoCache getDeviceInfoCacheById(Long deviceId) {
|
||||
Integer index = deviceIdIndex.get(deviceId);
|
||||
if (index != null) {
|
||||
return deviceInfoCaches.get(index);
|
||||
|
@ -37,7 +37,7 @@ public class FunctionRealData extends AbstractFunction {
|
||||
public AviatorObject call(Map<String, Object> env, AviatorObject deviceCode, AviatorObject attributes) {
|
||||
//设备Code
|
||||
String code = (String)deviceCode.getValue(env);
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCache(code);
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCacheByCode(code);
|
||||
//属性列表
|
||||
List<String> list = (List<String>)attributes.getValue(env);
|
||||
List<String> attrs = list.stream().map(String::toLowerCase).toList();
|
||||
|
@ -62,7 +62,7 @@ public class FunctionSaveCalcData extends AbstractVariadicFunction {
|
||||
if ( (args.length - 1) % 3 != 0) { return AviatorRuntimeJavaType.valueOf(1);}
|
||||
//deviceCode
|
||||
String code = (String)args[0].getValue(env);
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCache(code);
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCacheByCode(code);
|
||||
List<CalculateRTData> dataList = new ArrayList<>();
|
||||
for (int i = 1; i < args.length; i+=3) {
|
||||
Date date = (Date)FunctionUtils.getJavaObject(args[i], env);
|
||||
|
@ -299,7 +299,7 @@ public class NodeMessageServiceImpl implements NodeMessageService {
|
||||
});
|
||||
log.info("消息data转化deviceVo,{}",list);
|
||||
for (DeviceEventVo item : list){
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCache(Long.valueOf(item.getDeviceId()));
|
||||
DeviceInfoCache deviceInfoCache = cacheService.getEquipmentCache().getDeviceInfoCacheById(Long.valueOf(item.getDeviceId()));
|
||||
DeviceEventInfo deviceEventInfo = new DeviceEventInfo();
|
||||
deviceEventInfo.setUpdateTime(item.getEventTime());
|
||||
deviceEventInfo.setEventId(IdWorker.getId());
|
||||
|
Loading…
Reference in New Issue
Block a user