|
@@ -3,6 +3,7 @@ package com.gyee.dataadapter.service;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
import com.gyee.dataadapter.dao.IHistoryDao;
|
|
import com.gyee.dataadapter.dao.IHistoryDao;
|
|
import com.gyee.dataadapter.dao.ILatestDao;
|
|
import com.gyee.dataadapter.dao.ILatestDao;
|
|
import com.gyee.dataadapter.entity.PointData;
|
|
import com.gyee.dataadapter.entity.PointData;
|
|
@@ -147,9 +148,10 @@ public class TsDataService {
|
|
}
|
|
}
|
|
|
|
|
|
public Map<String, PointData> getHistorySection(Date time, String tagNames) {
|
|
public Map<String, PointData> getHistorySection(Date time, String tagNames) {
|
|
|
|
+ Map<String, PointData> result = new HashMap<>();
|
|
|
|
+ if(StrUtil.isBlank(tagNames)) return result;
|
|
Map<Boolean, List<String>> nxFgs = Arrays.stream(tagNames.split(",")).collect(
|
|
Map<Boolean, List<String>> nxFgs = Arrays.stream(tagNames.split(",")).collect(
|
|
Collectors.groupingBy(tn -> tn.startsWith("NX_FGS_")));
|
|
Collectors.groupingBy(tn -> tn.startsWith("NX_FGS_")));
|
|
- Map<String, PointData> result = new HashMap<>();
|
|
|
|
try {
|
|
try {
|
|
Map<String, PointData> latest = historyDao.getHistorySection(time, nxFgs.get(true));
|
|
Map<String, PointData> latest = historyDao.getHistorySection(time, nxFgs.get(true));
|
|
result.putAll(latest);
|
|
result.putAll(latest);
|