|
|
@@ -0,0 +1,362 @@
|
|
|
+package com.ufo.project.data.domain.vo;
|
|
|
+
|
|
|
+import java.io.Serializable;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import com.ufo.base.framework.aspectj.lang.annotation.Excel;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 日辐照度频率分布统计视图对象
|
|
|
+ * <p>每个区间包含条数(Num)、占比(Percent,%)与组合展示文本(Text,形如 18(29.51%),用于Excel导出列)。</p>
|
|
|
+ * <p>区间单位为 W/m²,直接取 data_weather_local.irradiance 总辐照度,不做单位换算。</p>
|
|
|
+ *
|
|
|
+ * @author ufo
|
|
|
+ * @date 2026-10-23
|
|
|
+ */
|
|
|
+public class IrradianceFrequencyDistributionVO implements Serializable
|
|
|
+{
|
|
|
+ private static final long serialVersionUID = 1L;
|
|
|
+
|
|
|
+ /** 日期 yyyy-MM-dd */
|
|
|
+ @Excel(name = "时间")
|
|
|
+ private String day;
|
|
|
+
|
|
|
+ /** 数据总条数 */
|
|
|
+ @Excel(name = "数据总条数")
|
|
|
+ private int totalRecord;
|
|
|
+
|
|
|
+ /** [0,600)w/㎡ 条数 */
|
|
|
+ private int lt600Num;
|
|
|
+
|
|
|
+ /** [0,600)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal lt600Percent;
|
|
|
+
|
|
|
+ /** [0,600)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "[0-600)w/㎡")
|
|
|
+ private String lt600Text;
|
|
|
+
|
|
|
+ /** [600,800)w/㎡ 条数 */
|
|
|
+ private int lt800Num;
|
|
|
+
|
|
|
+ /** [600,800)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal lt800Percent;
|
|
|
+
|
|
|
+ /** [600,800)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "[600-800)w/㎡")
|
|
|
+ private String lt800Text;
|
|
|
+
|
|
|
+ /** [800,1000)w/㎡ 条数 */
|
|
|
+ private int lt1000Num;
|
|
|
+
|
|
|
+ /** [800,1000)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal lt1000Percent;
|
|
|
+
|
|
|
+ /** [800,1000)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "[800-1000)w/㎡")
|
|
|
+ private String lt1000Text;
|
|
|
+
|
|
|
+ /** [1000,1200)w/㎡ 条数 */
|
|
|
+ private int lt1200Num;
|
|
|
+
|
|
|
+ /** [1000,1200)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal lt1200Percent;
|
|
|
+
|
|
|
+ /** [1000,1200)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "[1000-1200)w/㎡")
|
|
|
+ private String lt1200Text;
|
|
|
+
|
|
|
+ /** [1200,1400)w/㎡ 条数 */
|
|
|
+ private int lt1400Num;
|
|
|
+
|
|
|
+ /** [1200,1400)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal lt1400Percent;
|
|
|
+
|
|
|
+ /** [1200,1400)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "[1200-1400)w/㎡")
|
|
|
+ private String lt1400Text;
|
|
|
+
|
|
|
+ /** [1400,+∞)w/㎡ 条数 */
|
|
|
+ private int ge1400Num;
|
|
|
+
|
|
|
+ /** [1400,+∞)w/㎡ 占比(%) */
|
|
|
+ private BigDecimal ge1400Percent;
|
|
|
+
|
|
|
+ /** [1400,+∞)w/㎡ 组合展示文本 */
|
|
|
+ @Excel(name = "≥1400w/㎡")
|
|
|
+ private String ge1400Text;
|
|
|
+
|
|
|
+ public IrradianceFrequencyDistributionVO()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ public IrradianceFrequencyDistributionVO(String day)
|
|
|
+ {
|
|
|
+ this.day = day;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按辐照度值(W/m²)累加到对应区间
|
|
|
+ */
|
|
|
+ public void bump(double w)
|
|
|
+ {
|
|
|
+ totalRecord++;
|
|
|
+ if (w < 600)
|
|
|
+ {
|
|
|
+ lt600Num++;
|
|
|
+ }
|
|
|
+ else if (w < 800)
|
|
|
+ {
|
|
|
+ lt800Num++;
|
|
|
+ }
|
|
|
+ else if (w < 1000)
|
|
|
+ {
|
|
|
+ lt1000Num++;
|
|
|
+ }
|
|
|
+ else if (w < 1200)
|
|
|
+ {
|
|
|
+ lt1200Num++;
|
|
|
+ }
|
|
|
+ else if (w < 1400)
|
|
|
+ {
|
|
|
+ lt1400Num++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ge1400Num++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算各区间占比(保留两位小数,四舍五入)与组合展示文本 num(percent%)
|
|
|
+ */
|
|
|
+ public void buildPercentAndText()
|
|
|
+ {
|
|
|
+ lt600Percent = percentOf(lt600Num);
|
|
|
+ lt600Text = buildText(lt600Num, lt600Percent);
|
|
|
+ lt800Percent = percentOf(lt800Num);
|
|
|
+ lt800Text = buildText(lt800Num, lt800Percent);
|
|
|
+ lt1000Percent = percentOf(lt1000Num);
|
|
|
+ lt1000Text = buildText(lt1000Num, lt1000Percent);
|
|
|
+ lt1200Percent = percentOf(lt1200Num);
|
|
|
+ lt1200Text = buildText(lt1200Num, lt1200Percent);
|
|
|
+ lt1400Percent = percentOf(lt1400Num);
|
|
|
+ lt1400Text = buildText(lt1400Num, lt1400Percent);
|
|
|
+ ge1400Percent = percentOf(ge1400Num);
|
|
|
+ ge1400Text = buildText(ge1400Num, ge1400Percent);
|
|
|
+ }
|
|
|
+
|
|
|
+ private BigDecimal percentOf(int num)
|
|
|
+ {
|
|
|
+ if (totalRecord == 0)
|
|
|
+ {
|
|
|
+ return new BigDecimal("0.00");
|
|
|
+ }
|
|
|
+ return BigDecimal.valueOf((long) num * 100L)
|
|
|
+ .divide(BigDecimal.valueOf(totalRecord), 2, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+
|
|
|
+ private String buildText(int num, BigDecimal percent)
|
|
|
+ {
|
|
|
+ return num + "(" + percent.toPlainString() + "%)";
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getDay()
|
|
|
+ {
|
|
|
+ return day;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setDay(String day)
|
|
|
+ {
|
|
|
+ this.day = day;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getTotalRecord()
|
|
|
+ {
|
|
|
+ return totalRecord;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setTotalRecord(int totalRecord)
|
|
|
+ {
|
|
|
+ this.totalRecord = totalRecord;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getLt600Num()
|
|
|
+ {
|
|
|
+ return lt600Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt600Num(int lt600Num)
|
|
|
+ {
|
|
|
+ this.lt600Num = lt600Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLt600Percent()
|
|
|
+ {
|
|
|
+ return lt600Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt600Percent(BigDecimal lt600Percent)
|
|
|
+ {
|
|
|
+ this.lt600Percent = lt600Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLt600Text()
|
|
|
+ {
|
|
|
+ return lt600Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt600Text(String lt600Text)
|
|
|
+ {
|
|
|
+ this.lt600Text = lt600Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getLt800Num()
|
|
|
+ {
|
|
|
+ return lt800Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt800Num(int lt800Num)
|
|
|
+ {
|
|
|
+ this.lt800Num = lt800Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLt800Percent()
|
|
|
+ {
|
|
|
+ return lt800Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt800Percent(BigDecimal lt800Percent)
|
|
|
+ {
|
|
|
+ this.lt800Percent = lt800Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLt800Text()
|
|
|
+ {
|
|
|
+ return lt800Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt800Text(String lt800Text)
|
|
|
+ {
|
|
|
+ this.lt800Text = lt800Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getLt1000Num()
|
|
|
+ {
|
|
|
+ return lt1000Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1000Num(int lt1000Num)
|
|
|
+ {
|
|
|
+ this.lt1000Num = lt1000Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLt1000Percent()
|
|
|
+ {
|
|
|
+ return lt1000Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1000Percent(BigDecimal lt1000Percent)
|
|
|
+ {
|
|
|
+ this.lt1000Percent = lt1000Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLt1000Text()
|
|
|
+ {
|
|
|
+ return lt1000Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1000Text(String lt1000Text)
|
|
|
+ {
|
|
|
+ this.lt1000Text = lt1000Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getLt1200Num()
|
|
|
+ {
|
|
|
+ return lt1200Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1200Num(int lt1200Num)
|
|
|
+ {
|
|
|
+ this.lt1200Num = lt1200Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLt1200Percent()
|
|
|
+ {
|
|
|
+ return lt1200Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1200Percent(BigDecimal lt1200Percent)
|
|
|
+ {
|
|
|
+ this.lt1200Percent = lt1200Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLt1200Text()
|
|
|
+ {
|
|
|
+ return lt1200Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1200Text(String lt1200Text)
|
|
|
+ {
|
|
|
+ this.lt1200Text = lt1200Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getLt1400Num()
|
|
|
+ {
|
|
|
+ return lt1400Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1400Num(int lt1400Num)
|
|
|
+ {
|
|
|
+ this.lt1400Num = lt1400Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLt1400Percent()
|
|
|
+ {
|
|
|
+ return lt1400Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1400Percent(BigDecimal lt1400Percent)
|
|
|
+ {
|
|
|
+ this.lt1400Percent = lt1400Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLt1400Text()
|
|
|
+ {
|
|
|
+ return lt1400Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLt1400Text(String lt1400Text)
|
|
|
+ {
|
|
|
+ this.lt1400Text = lt1400Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getGe1400Num()
|
|
|
+ {
|
|
|
+ return ge1400Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setGe1400Num(int ge1400Num)
|
|
|
+ {
|
|
|
+ this.ge1400Num = ge1400Num;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getGe1400Percent()
|
|
|
+ {
|
|
|
+ return ge1400Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setGe1400Percent(BigDecimal ge1400Percent)
|
|
|
+ {
|
|
|
+ this.ge1400Percent = ge1400Percent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getGe1400Text()
|
|
|
+ {
|
|
|
+ return ge1400Text;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setGe1400Text(String ge1400Text)
|
|
|
+ {
|
|
|
+ this.ge1400Text = ge1400Text;
|
|
|
+ }
|
|
|
+}
|