Commit 6f41dd9e by 李小龙

开启设备同步

parent 3be302f2
...@@ -50,7 +50,7 @@ public class IotSyncTask { ...@@ -50,7 +50,7 @@ public class IotSyncTask {
* 启用状态的租户才同步 * 启用状态的租户才同步
* 新增和更新平台端设备表 * 新增和更新平台端设备表
*/ */
// @Scheduled(cron = "0 0 */1 * * ?") //@Scheduled(cron = "0 0 */1 * * ?")
@TenantIdIgnore @TenantIdIgnore
public void syncEquipmentInfo() { public void syncEquipmentInfo() {
log.info("开始执行同步设备信息接口"); log.info("开始执行同步设备信息接口");
...@@ -109,8 +109,10 @@ public class IotSyncTask { ...@@ -109,8 +109,10 @@ public class IotSyncTask {
platDevice.setName(iotDevice.getName()); platDevice.setName(iotDevice.getName());
platDevice.setProductName(iotDevice.getProductName()); platDevice.setProductName(iotDevice.getProductName());
platDevice.setProductId(iotDevice.getProductId()); platDevice.setProductId(iotDevice.getProductId());
LocalDateTime registryTime = LocalDateTime.ofEpochSecond(iotDevice.getRegistryTime() / 1000, 0, ZoneOffset.ofHours(8)); if(iotDevice.getRegistryTime()!=null) {
platDevice.setRegistrationDate(registryTime); LocalDateTime registryTime = LocalDateTime.ofEpochSecond(iotDevice.getRegistryTime() / 1000, 0, ZoneOffset.ofHours(8));
platDevice.setRegistrationDate(registryTime);
}
platDevice.setDescription(iotDevice.getDescribe()); platDevice.setDescription(iotDevice.getDescribe());
String state = iotDevice.getState(); String state = iotDevice.getState();
DeviceState deviceState = JSON.parseObject(state, DeviceState.class); DeviceState deviceState = JSON.parseObject(state, DeviceState.class);
......
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