Commit 6f41dd9e by 李小龙

开启设备同步

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