package com.jsowell.pile.util; import java.math.BigDecimal; /** * 平台根据实时监测曲线估算的尖峰平谷电量(仅观测,不参与结算)。 */ public class TouElectricityEstimateResult { private BigDecimal sharp = BigDecimal.ZERO; private BigDecimal peak = BigDecimal.ZERO; private BigDecimal flat = BigDecimal.ZERO; private BigDecimal valley = BigDecimal.ZERO; /** 最后一条实时累计电量 */ private BigDecimal totalFromLastSample = BigDecimal.ZERO; /** 各时段差分电量之和 */ private BigDecimal totalFromDeltas = BigDecimal.ZERO; private int sampleCount; private int positiveDeltaCount; private int negativeOrZeroDeltaCount; private int unmatchedPeriodCount; private String note; public BigDecimal getSharp() { return sharp; } public void setSharp(BigDecimal sharp) { this.sharp = sharp; } public BigDecimal getPeak() { return peak; } public void setPeak(BigDecimal peak) { this.peak = peak; } public BigDecimal getFlat() { return flat; } public void setFlat(BigDecimal flat) { this.flat = flat; } public BigDecimal getValley() { return valley; } public void setValley(BigDecimal valley) { this.valley = valley; } public BigDecimal getTotalFromLastSample() { return totalFromLastSample; } public void setTotalFromLastSample(BigDecimal totalFromLastSample) { this.totalFromLastSample = totalFromLastSample; } public BigDecimal getTotalFromDeltas() { return totalFromDeltas; } public void setTotalFromDeltas(BigDecimal totalFromDeltas) { this.totalFromDeltas = totalFromDeltas; } public int getSampleCount() { return sampleCount; } public void setSampleCount(int sampleCount) { this.sampleCount = sampleCount; } public int getPositiveDeltaCount() { return positiveDeltaCount; } public void setPositiveDeltaCount(int positiveDeltaCount) { this.positiveDeltaCount = positiveDeltaCount; } public int getNegativeOrZeroDeltaCount() { return negativeOrZeroDeltaCount; } public void setNegativeOrZeroDeltaCount(int negativeOrZeroDeltaCount) { this.negativeOrZeroDeltaCount = negativeOrZeroDeltaCount; } public int getUnmatchedPeriodCount() { return unmatchedPeriodCount; } public void setUnmatchedPeriodCount(int unmatchedPeriodCount) { this.unmatchedPeriodCount = unmatchedPeriodCount; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public void addToType(String timeType, BigDecimal delta) { if (delta == null) { return; } if ("1".equals(timeType)) { sharp = sharp.add(delta); } else if ("2".equals(timeType)) { peak = peak.add(delta); } else if ("3".equals(timeType)) { flat = flat.add(delta); } else if ("4".equals(timeType)) { valley = valley.add(delta); } else { // 未知时段先记入平,并计数 flat = flat.add(delta); unmatchedPeriodCount++; } totalFromDeltas = totalFromDeltas.add(delta); positiveDeltaCount++; } }