Merge remote-tracking branch 'origin/mdc' into mdc
This commit is contained in:
commit
9c07c72421
|
@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.CacheName;
|
import org.jeecg.common.CacheName;
|
||||||
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
||||||
|
import org.jeecg.common.util.DateUtils;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import org.jeecg.modules.base.entity.original.GardsMetData;
|
import org.jeecg.modules.base.entity.original.GardsMetData;
|
||||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||||
|
@ -111,10 +112,14 @@ public class DataReceivingStatusManager {
|
||||||
StationData stationData = new StationData();
|
StationData stationData = new StationData();
|
||||||
//stream流获取探测器id
|
//stream流获取探测器id
|
||||||
List<Integer> detectorIds = detectors.stream().map(GardsDetectorsSystem::getDetectorId).collect(Collectors.toList());
|
List<Integer> detectorIds = detectors.stream().map(GardsDetectorsSystem::getDetectorId).collect(Collectors.toList());
|
||||||
|
//探测器加上NA 无效探测器id
|
||||||
|
detectorIds.add(1);
|
||||||
//根据探测器id 开始时间查询样品基础数据
|
//根据探测器id 开始时间查询样品基础数据
|
||||||
List<GardsSampleData> sampleDataList = stationSampleDataMapper.findSampleDataList(detectorIds, startDateTime);
|
List<GardsSampleData> sampleDataList = stationSampleDataMapper.findSampleDataList(detectorIds, startDateTime);
|
||||||
//根据台站id,探测器id,开始时间
|
//根据台站id,探测器id,开始时间
|
||||||
List<GardsSohData> sohDataList = stationSohDataMapper.findSohDataList(stationId, detectorIds, startDateTime);
|
List<GardsSohData> sohDataList = stationSohDataMapper.findSohDataList(stationId, detectorIds, startDateTime);
|
||||||
|
//移除掉最后一个探测器
|
||||||
|
detectorIds.remove(detectorIds.size()-1);
|
||||||
//用于接收当前台站下所有探测器及探测器所有的样品数据,气体数据,状态数据集合
|
//用于接收当前台站下所有探测器及探测器所有的样品数据,气体数据,状态数据集合
|
||||||
List<Map<String, DetectorData>> detectorDataList = new LinkedList<>();
|
List<Map<String, DetectorData>> detectorDataList = new LinkedList<>();
|
||||||
for (Integer detectorId : detectorIds) {
|
for (Integer detectorId : detectorIds) {
|
||||||
|
@ -166,20 +171,18 @@ public class DataReceivingStatusManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(sohDataList)) {
|
if (CollectionUtils.isNotEmpty(sohDataList)) {
|
||||||
List<GardsSohData> dataListSoh = sohDataList.stream().filter(item -> item.getDetectorId().equals(detectorId)).collect(Collectors.toList());
|
//根据台站id 开始时间查询状态数据
|
||||||
//根据探测器id 台站id 开始时间查询状态数据
|
for (GardsSohData sohData : sohDataList) {
|
||||||
if (CollectionUtils.isNotEmpty(dataListSoh)) {
|
|
||||||
for (GardsSohData sohData : dataListSoh) {
|
|
||||||
DataInfoVo dataInfo = new DataInfoVo();
|
DataInfoVo dataInfo = new DataInfoVo();
|
||||||
dataInfo.setType("SOH");
|
dataInfo.setType("SOH");
|
||||||
dataInfo.setStatus("SOH");
|
dataInfo.setStatus("SOH");
|
||||||
Date startTime = sohData.getStartTime();
|
Date startTime = sohData.getStartTime();
|
||||||
dataInfo.setBeginTime(Double.valueOf(startTime.getTime() / 1000));
|
dataInfo.setBeginTime(Double.valueOf(startTime.getTime() / 1000));
|
||||||
dataInfo.setSpanTime(Double.valueOf(sohData.getTime()));
|
dataInfo.setSpanTime(Double.valueOf(sohData.getTime()));
|
||||||
|
dataInfo.setEndTime(Double.valueOf((startTime.getTime() / 1000) + sohData.getTime()));
|
||||||
dataInfoList.add(dataInfo);
|
dataInfoList.add(dataInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (CollectionUtils.isNotEmpty(metDataList)) {
|
if (CollectionUtils.isNotEmpty(metDataList)) {
|
||||||
List<GardsMetData> dataListMet = metDataList.stream().filter(item -> item.getStationId().equals(stationId)).collect(Collectors.toList());
|
List<GardsMetData> dataListMet = metDataList.stream().filter(item -> item.getStationId().equals(stationId)).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(dataListMet)) {
|
if (CollectionUtils.isNotEmpty(dataListMet)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user