|
@@ -257,6 +257,7 @@ public class MonitorIndicatorServiceImpl extends ServiceImpl<MonitorIndicatorMap
|
|
// 获取监测指标的历史采集值 monitorId -> (time -> value)
|
|
// 获取监测指标的历史采集值 monitorId -> (time -> value)
|
|
List<String> infoCodeList = infoCodeArray.toJavaList(String.class);
|
|
List<String> infoCodeList = infoCodeArray.toJavaList(String.class);
|
|
Map<String, Map<Date, String>> monitorValuesMap = getIndicatorHistoryValues(
|
|
Map<String, Map<Date, String>> monitorValuesMap = getIndicatorHistoryValues(
|
|
|
|
+ alarmRecord.getObjId(),
|
|
infoCodeList, queryMonitorIndicatorRecordInfoDTO.getStartTime(),
|
|
infoCodeList, queryMonitorIndicatorRecordInfoDTO.getStartTime(),
|
|
queryMonitorIndicatorRecordInfoDTO.getEndTime());
|
|
queryMonitorIndicatorRecordInfoDTO.getEndTime());
|
|
|
|
|
|
@@ -440,6 +441,7 @@ public class MonitorIndicatorServiceImpl extends ServiceImpl<MonitorIndicatorMap
|
|
/**
|
|
/**
|
|
* 获取监测指标的历史采集值
|
|
* 获取监测指标的历史采集值
|
|
*
|
|
*
|
|
|
|
+ * @param objId 设备id
|
|
* @param infoCodeList [equipId-monitorId]
|
|
* @param infoCodeList [equipId-monitorId]
|
|
* @param startTime 开始时间
|
|
* @param startTime 开始时间
|
|
* @param endTime 结束时间
|
|
* @param endTime 结束时间
|
|
@@ -448,22 +450,11 @@ public class MonitorIndicatorServiceImpl extends ServiceImpl<MonitorIndicatorMap
|
|
* @version V1.0 2021/9/27 2:35 下午
|
|
* @version V1.0 2021/9/27 2:35 下午
|
|
*/
|
|
*/
|
|
private Map<String, Map<Date, String>> getIndicatorHistoryValues(
|
|
private Map<String, Map<Date, String>> getIndicatorHistoryValues(
|
|
- List<String> infoCodeList, Date startTime, Date endTime) {
|
|
|
|
|
|
+ String objId, List<String> infoCodeList, Date startTime, Date endTime) {
|
|
// monitorId -> (time -> value)
|
|
// monitorId -> (time -> value)
|
|
Map<String, Map<Date, String>> monitorValuesMap = new HashMap<>();
|
|
Map<String, Map<Date, String>> monitorValuesMap = new HashMap<>();
|
|
- // infoCodeList:[equipId-monitorId]
|
|
|
|
- for (String infoCode : infoCodeList) {
|
|
|
|
- String objId;
|
|
|
|
- String indicatorId;
|
|
|
|
- try {
|
|
|
|
- objId = infoCode.substring(0, infoCode.indexOf("_"));
|
|
|
|
- indicatorId = infoCode.substring(infoCode.indexOf("_") + 1);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- throw new IllegalArgumentException("报警记录数据有误,无法正确获取到报警条件中的信息点");
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isBlank(objId) || StringUtils.isBlank(indicatorId)) {
|
|
|
|
- throw new IllegalArgumentException("报警记录数据有误,无法正确获取到报警条件中的信息点");
|
|
|
|
- }
|
|
|
|
|
|
+ // infoCodeList:[indicatorId]
|
|
|
|
+ for (String indicatorId : infoCodeList) {
|
|
// 查询设备监测指标取值
|
|
// 查询设备监测指标取值
|
|
QueryMonitorIndicatorRecordDTO queryMonitorIndicatorRecordDTO = new QueryMonitorIndicatorRecordDTO();
|
|
QueryMonitorIndicatorRecordDTO queryMonitorIndicatorRecordDTO = new QueryMonitorIndicatorRecordDTO();
|
|
queryMonitorIndicatorRecordDTO.setObjId(objId);
|
|
queryMonitorIndicatorRecordDTO.setObjId(objId);
|