Merge remote-tracking branch 'origin/mdc' into mdc

This commit is contained in:
nieziyan 2024-01-04 15:56:12 +08:00
commit 9c07c72421

View File

@ -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,18 +171,16 @@ 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)) { DataInfoVo dataInfo = new DataInfoVo();
for (GardsSohData sohData : dataListSoh) { dataInfo.setType("SOH");
DataInfoVo dataInfo = new DataInfoVo(); dataInfo.setStatus("SOH");
dataInfo.setType("SOH"); Date startTime = sohData.getStartTime();
dataInfo.setStatus("SOH"); dataInfo.setBeginTime(Double.valueOf(startTime.getTime() / 1000));
Date startTime = sohData.getStartTime(); dataInfo.setSpanTime(Double.valueOf(sohData.getTime()));
dataInfo.setBeginTime(Double.valueOf(startTime.getTime() / 1000)); dataInfo.setEndTime(Double.valueOf((startTime.getTime() / 1000) + sohData.getTime()));
dataInfo.setSpanTime(Double.valueOf(sohData.getTime())); dataInfoList.add(dataInfo);
dataInfoList.add(dataInfo);
}
} }
} }
if (CollectionUtils.isNotEmpty(metDataList)) { if (CollectionUtils.isNotEmpty(metDataList)) {