|
@@ -311,14 +311,17 @@ public class MonitorIndicatorServiceImpl extends ServiceImpl<MonitorIndicatorMap
|
|
|
String formula = monitorIndicatorFormulaItem.getFormula();
|
|
|
List<GraphItemVO> referenceValueList = new ArrayList<>();
|
|
|
Map<Date, String> indicatorRecordMap = monitorValuesMap.get(monitorIndicator.getId());
|
|
|
- for (Date date : indicatorRecordMap.keySet()) {
|
|
|
- HashMap<String, Object> paramMap = getParamMap(monitorValuesMap, date);
|
|
|
- Double formulaResult = calculateFormula(formula, paramMap);
|
|
|
- GraphItemVO graphItemVO = new GraphItemVO(
|
|
|
- String.valueOf(date.getTime()), formulaResult,
|
|
|
- AttrValueTypeEnum.number_2, monitorIndicator.getUnit());
|
|
|
- referenceValueList.add(graphItemVO);
|
|
|
+ if (!CollectionUtils.isEmpty(indicatorRecordMap)) {
|
|
|
+ for (Date date : indicatorRecordMap.keySet()) {
|
|
|
+ HashMap<String, Object> paramMap = getParamMap(monitorValuesMap, date);
|
|
|
+ Double formulaResult = calculateFormula(formula, paramMap);
|
|
|
+ GraphItemVO graphItemVO = new GraphItemVO(
|
|
|
+ String.valueOf(date.getTime()), formulaResult,
|
|
|
+ AttrValueTypeEnum.number_2, monitorIndicator.getUnit());
|
|
|
+ referenceValueList.add(graphItemVO);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
monitorIndicatorReferenceItem.setValue(referenceValueList);
|
|
|
reference.add(monitorIndicatorReferenceItem);
|
|
|
}
|