Commit f7df7f06 by 罗志长

fix: saas端设备详情固件版本和最后上线时间没有返回

parent 19dddbd5
......@@ -613,6 +613,17 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
deviceOtherLambdaQueryWrapper.eq(PlatDeviceOther::getDeviceId, platDevice.getId());
PlatDeviceOther platDeviceOther = platDeviceOtherService.getOne(deviceOtherLambdaQueryWrapper, false);
DeviceDetail detail = iotProductDeviceService.getDetail(platDevice.getOriDeviceId());
if (detail != null) {
if (detail.getFirmwareInfo() != null) {
platDevice.setFirmwareVersion(detail.getFirmwareInfo().getVersion());
}
if (detail.getOnlineTime() != 0) {
platDevice.setLastOnlineData(LocalDateTime.ofEpochSecond(detail.getOnlineTime() / 1000, 0, ZoneOffset.ofHours(8)));
}
platDevice.setDescription(detail.getDescription());
}
PlatDeviceDetailDTO detailDTO = new PlatDeviceDetailDTO();
detailDTO.setPlatDevice(platDevice);
detailDTO.setPlatDeviceOther(platDeviceOther);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment