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