|
@@ -122,6 +122,17 @@ public class IotDeviceController {
|
|
|
iotDeviceRespVO.setAssetClassName(Objects.nonNull(iotProductClassify)?iotProductClassify.getName():"");
|
|
|
// IotModelDO iotModel = iotModelService.getIotModel(iotDevice.getModel());
|
|
|
// iotDeviceRespVO.setModelName(Objects.nonNull(iotModel)?iotModel.getName():"");
|
|
|
+ List<YfDeviceDO> allDevice = yfDeviceService.getAllDevice();
|
|
|
+ allDevice.stream().filter(e -> e.getSerialNumber().equals(iotDevice.getDeviceCode())).findFirst().ifPresent(e -> {
|
|
|
+ iotDeviceRespVO.setIfInline(e.getStatus());
|
|
|
+ List<DeviceVO> deviceVOS = deviceMapper.selectNew(e.getSerialNumber());
|
|
|
+ if (CollUtil.isNotEmpty(deviceVOS)) {
|
|
|
+ Timestamp ts = deviceVOS.get(0).getTs();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String format = sdf.format(ts);
|
|
|
+ iotDeviceRespVO.setLastInlineTime(format);
|
|
|
+ }
|
|
|
+ });
|
|
|
return success(iotDeviceRespVO);
|
|
|
}
|
|
|
|