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