|
@@ -2,6 +2,7 @@ package com.bizmatics.service.impl;
|
|
|
|
|
|
import com.bizmatics.common.core.exception.BusinessException;
|
|
|
import com.bizmatics.common.core.util.DateUtils;
|
|
|
+import com.bizmatics.model.AlarmPower;
|
|
|
import com.bizmatics.model.HtAnalogData;
|
|
|
import com.bizmatics.persistence.mapper.HtAnalogDataMapper;
|
|
|
import com.bizmatics.service.HtAnalogDataService;
|
|
@@ -196,5 +197,24 @@ public class HtAnalogDataServiceImpl extends AbstractCrudService<HtAnalogDataMap
|
|
|
return Arith.sub(descHadEpp,ascHadEpp);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 汇总
|
|
|
+ * @param list
|
|
|
+ * @param handlingStatus
|
|
|
+ * @param startTime
|
|
|
+ * @param endTime
|
|
|
+ * @param digitalStatus
|
|
|
+ */
|
|
|
+ public Long getCount(List<AlarmPower> list, Integer handlingStatus, Date startTime, Date endTime, Integer digitalStatus, String measName){
|
|
|
+ return list.stream()
|
|
|
+ .filter(alarmPower -> alarmPower.getSendingTime().after(startTime) && alarmPower.getSendingTime().before(endTime))
|
|
|
+ .filter(alarmPower -> Optional.ofNullable(handlingStatus).map(hand -> hand.equals(alarmPower.getHandlingStatus())).orElse(true))
|
|
|
+ .filter(alarmPower -> Optional.ofNullable(digitalStatus).map(dig -> dig.equals(alarmPower.getDigitalValue())).orElse(true))
|
|
|
+ .filter(alarmPower -> Optional.ofNullable(measName).map(means -> means.equals(alarmPower.getMeasName())).orElse(true))
|
|
|
+ .count();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|