Browse Source

查询通讯告警的最后一小时的运行数据

zhongwei
段飞宇 1 year ago
parent
commit
84e662f089
  1. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/CentralMonitorServiceImpl.java

@ -16,6 +16,7 @@ import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.StringUtil;
@ -91,13 +92,13 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
OriginalDataQuery originalDataQuery = new OriginalDataQuery();
originalDataQuery.setRealId(roleId);
originalDataQuery.setLimit(size);
LocalDateTime startTime = LocalDateTime.now();
LocalDateTime endTime = startTime.minusHours(1);
LocalDateTime endTime = LocalDateTime.now();
LocalDateTime startTime = endTime.minusHours(1);
originalDataQuery.setBeginTime(this.getOriginalDate(startTime));
originalDataQuery.setEndTime(this.getOriginalDate(endTime));
Result<HzPage<PointData>> originalDataByRealIds = historyDataSearchClient.getOriginalDataByRealIds(originalDataQuery);
if (!originalDataByRealIds.isSuccess()) {
throw new IllegalArgumentException("数据不存在");
throw new ServiceException("数据不存在");
}
HzPage<PointData> data = originalDataByRealIds.getData();
List<PointDataVo> collect = data.getRecords().stream().map(item -> {

Loading…
Cancel
Save