|
|
@@ -66,6 +66,10 @@ public class IotDeviceService {
|
|
|
iotProductVos.forEach(a -> {
|
|
|
Optional.ofNullable(userApi.queryUser(a.getCreateBy())).ifPresent(userCache -> a.setCreateByLabel(userCache.getName()));
|
|
|
Optional.ofNullable(userApi.queryUser(a.getUpdateBy())).ifPresent(userCache -> a.setUpdateByLabel(userCache.getName()));
|
|
|
+ Optional.ofNullable(cacheService.getKey(String.format(CacheConstant.ONLINE_CACHE, a.getGuid()))).ifPresent(t -> {
|
|
|
+ a.setOnlineTime((LocalDateTime) t);
|
|
|
+ a.setStatus(1);
|
|
|
+ });
|
|
|
});
|
|
|
return new PageRes<>(pageInfo, iotProductVos);
|
|
|
}
|
|
|
@@ -154,6 +158,10 @@ public class IotDeviceService {
|
|
|
Optional.ofNullable(dictApi.query(DictType.REPORT_PROTOCOL_TYPE, String.valueOf(detail.getReportProtocol()))).ifPresent(cache -> detail.setReportProtocolLabel(cache.getLabel()));
|
|
|
Optional.ofNullable(dictApi.query(DictType.VENDORS_TYPE, String.valueOf(detail.getVendors()))).ifPresent(cache -> detail.setVendorsLabel(cache.getLabel()));
|
|
|
Optional.ofNullable(dictApi.query(DictType.DATA_FORMAT_TYPE, String.valueOf(detail.getDataFormat()))).ifPresent(cache -> detail.setDataFormatLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(cacheService.getKey(String.format(CacheConstant.ONLINE_CACHE, detail.getGuid()))).ifPresent(t -> {
|
|
|
+ detail.setOnlineTime((LocalDateTime) t);
|
|
|
+ detail.setStatus(1);
|
|
|
+ });
|
|
|
return detail;
|
|
|
}
|
|
|
|