Commit c28fe535 by 朱淼
parents e9ed0d15 6f41dd9e
......@@ -7,7 +7,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 告警记录
......@@ -28,7 +27,7 @@ public class PlatAlarmRecord extends BaseBusEntity {
/**
* 告警时间
*/
private Date alarmDate;
private LocalDateTime alarmDate;
/**
* 状态 0 待处理 1 已处理
......
......@@ -52,7 +52,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;
......@@ -327,7 +326,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
PlatAlarmRecord platAlarmRecord = new PlatAlarmRecord();
platAlarmRecord.setAlarmId(config.getId());
platAlarmRecord.setAlarmType(config.getAlarmType());
platAlarmRecord.setAlarmDate(new Date());
platAlarmRecord.setAlarmDate(LocalDateTime.now());
platAlarmRecord.setStatus(CommonEnum.NO.getValue());
platAlarmRecord.setNoticeStatus(CommonEnum.NO.getValue());
//模板信息 替换参数
......
......@@ -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());
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