|
|
@ -1,10 +1,14 @@ |
|
|
|
package com.hnac.hzims.operational.config.service.impl; |
|
|
|
package com.hnac.hzims.operational.config.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.hnac.hzims.operational.config.service.CentralMonitorService; |
|
|
|
import com.hnac.hzims.operational.config.service.CentralMonitorService; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.config.vo.PointDataVo; |
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
import com.hnac.hzims.operational.station.service.IStationService; |
|
|
|
import com.hnac.hzims.operational.station.service.IStationService; |
|
|
|
import com.hnac.hzims.operational.main.vo.RealStationVo; |
|
|
|
import com.hnac.hzims.operational.main.vo.RealStationVo; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.ticket.fegin.StationFeginService; |
|
|
|
import com.hnac.hzinfo.datasearch.PointData; |
|
|
|
import com.hnac.hzinfo.datasearch.PointData; |
|
|
|
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; |
|
|
|
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient; |
|
|
|
import com.hnac.hzinfo.datasearch.history.OriginalDataQuery; |
|
|
|
import com.hnac.hzinfo.datasearch.history.OriginalDataQuery; |
|
|
@ -17,7 +21,9 @@ import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
@ -81,7 +87,7 @@ public class CentralMonitorServiceImpl implements CentralMonitorService { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HzPage<PointData> selectOriginalDataByRealIds(Integer page, Integer size, String roleId) { |
|
|
|
public IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId) { |
|
|
|
OriginalDataQuery originalDataQuery = new OriginalDataQuery(); |
|
|
|
OriginalDataQuery originalDataQuery = new OriginalDataQuery(); |
|
|
|
originalDataQuery.setRealId(roleId); |
|
|
|
originalDataQuery.setRealId(roleId); |
|
|
|
originalDataQuery.setLimit(size); |
|
|
|
originalDataQuery.setLimit(size); |
|
|
@ -93,12 +99,26 @@ public class CentralMonitorServiceImpl implements CentralMonitorService { |
|
|
|
if (!originalDataByRealIds.isSuccess()) { |
|
|
|
if (!originalDataByRealIds.isSuccess()) { |
|
|
|
throw new IllegalArgumentException("数据不存在"); |
|
|
|
throw new IllegalArgumentException("数据不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
return originalDataByRealIds.getData(); |
|
|
|
HzPage<PointData> data = originalDataByRealIds.getData(); |
|
|
|
|
|
|
|
List<PointDataVo> collect = data.getRecords().stream().map(item -> { |
|
|
|
|
|
|
|
PointDataVo pointDataVo = new PointDataVo(); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(item, pointDataVo); |
|
|
|
|
|
|
|
//通过站点id获取站点名称
|
|
|
|
|
|
|
|
String station = pointDataVo.getStation(); |
|
|
|
|
|
|
|
String stationName = stationService.selectStationById(station); |
|
|
|
|
|
|
|
pointDataVo.setStationName(stationName); |
|
|
|
|
|
|
|
return pointDataVo; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<PointDataVo> iPage = new Page(data.getCurrent(), data.getSize()); |
|
|
|
|
|
|
|
iPage.setRecords(collect); |
|
|
|
|
|
|
|
return iPage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* LocalDateTime 转 date |
|
|
|
* LocalDateTime 转 date |
|
|
|
|
|
|
|
* |
|
|
|
* @param localDateTime |
|
|
|
* @param localDateTime |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|