Prechádzať zdrojové kódy

增加气象站测风塔文件生成

xusl 3 rokov pred
rodič
commit
71d1805d7d

+ 77 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/equipmentinfo/AbstractEquipmentInfo.java

@@ -0,0 +1,77 @@
+package com.jiayue.ipfcst.common.data.abst.equipmentinfo;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 设备
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/19 14:21
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@MappedSuperclass
+public class AbstractEquipmentInfo extends AbstractBaseEntity {
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+
+    /**
+     * 设备类型
+     */
+    protected EquipmentTypeEnum equipmentType;
+
+    /**
+     * 名称
+     */
+    @Column
+    private String name;
+
+    /**
+     * 制造商
+     */
+    private String manufacturer;
+
+    /**
+     * 型号
+     */
+    private String modelNumber;
+
+    /**
+     * 安装时间
+     */
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date installationTime;
+
+    /**
+     * 是否上报
+     */
+    private Boolean report;
+
+    /**
+     * 场站编号(运维标识)
+     */
+    @Column
+    private String stationCode;
+
+    /**
+     * 入库时间间隔  单位 s
+     */
+    @Column
+    private Integer interval;
+
+
+}

+ 33 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/WeatherStationInfo.java

@@ -0,0 +1,33 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.equipmentinfo.AbstractEquipmentInfo;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.Entity;
+
+/**
+ * 环境监测仪实体
+ * modifyInfo
+ * 修唯	2020.3.26		修改类名为 WeatherStationInfo
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/7/22 11:21
+ * modifyInfo
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class WeatherStationInfo extends AbstractEquipmentInfo {
+	public WeatherStationInfo() {
+		super.setEquipmentType(EquipmentTypeEnum.WEATHERSTATION);
+	}
+
+	/**
+	 * 绑定数据采集通道
+	 */
+	String bindTunnel;
+
+}

+ 143 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/WeatherStationStatusData.java

@@ -0,0 +1,143 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+
+import com.jiayue.ipfcst.common.data.abst.equipmentstatus.AbstractEquipmentStatusData;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.Type;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+
+/**
+ * 气象站
+ * 环境监测仪数据抽象实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/2 9:27
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class WeatherStationStatusData extends AbstractEquipmentStatusData {
+
+	/**
+	 * 总辐射(W/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal globalR = new BigDecimal(-99);
+
+	/**
+	 * 直接辐射(W/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal directR = new BigDecimal(-99);
+
+	/**
+	 * 散射辐射(W/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal diffuseR = new BigDecimal(-99);
+
+	/**
+	 * 斜面辐射(W/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal obliqueR = new BigDecimal(-99);
+
+	/**
+	 * 环境温度(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal airT = new BigDecimal(-99);
+
+	/**
+	 * 气压(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal p = new BigDecimal(-99);
+
+	/**
+	 * 湿度(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rh = new BigDecimal(-99);
+
+
+	/**
+	 * 光伏电池板温度(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal cellT = new BigDecimal(-99);
+
+	/**
+	 * 风速(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal ws = new BigDecimal(-99);
+
+	/**
+	 * 风向(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wd = new BigDecimal(-99);
+
+
+	/**
+	 * 日照小时数
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal hourDA = new BigDecimal(-99);
+
+	/**
+	 * 总辐射日累计(MJ/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal globalRDA = new BigDecimal(-99);
+
+	/**
+	 * 直接辐射日累计(MJ/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal directRDA = new BigDecimal(-99);
+
+	/**
+	 * 散射辐射日累计(MJ/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal diffuseRDA = new BigDecimal(-99);
+
+	/**
+	 * 斜面辐射日累计(MJ/㎡)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal obliqueRDA = new BigDecimal(-99);
+
+
+	/**
+	 * 数据是否是通过预测数据生成的
+	 */
+	@Column
+	@Type(type="yes_no")
+	private Boolean isGenerated=false;
+
+
+}

+ 923 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/WindTowerStatusData.java

@@ -0,0 +1,923 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+
+import com.jiayue.ipfcst.common.data.abst.equipmentstatus.AbstractEquipmentStatusData;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.Type;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+
+/**
+ * 测风塔数据实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/2 9:28
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class WindTowerStatusData extends AbstractEquipmentStatusData {
+
+
+	/**
+	 * 温度瞬时值(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal tInst = new BigDecimal(-99);
+
+	/**
+	 * 温度最大值(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal tMax = new BigDecimal(-99);
+
+	/**
+	 * 温度最小值(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal tMin = new BigDecimal(-99);
+
+	/**
+	 * 温度平均值(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal tAve = new BigDecimal(-99);
+
+	/**
+	 * 温度标准差(℃)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal tSta = new BigDecimal(-99);
+
+	/**
+	 * 湿度瞬时值(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rhInst = new BigDecimal(-99);
+
+	/**
+	 * 湿度最大值(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rhMax = new BigDecimal(-99);
+
+	/**
+	 * 湿度最小值(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rhMin = new BigDecimal(-99);
+
+	/**
+	 * 湿度平均值(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rhAve = new BigDecimal(-99);
+
+	/**
+	 * 湿度标准差(%)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal rhSta = new BigDecimal(-99);
+
+	/**
+	 * 气压瞬时值(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal paInst = new BigDecimal(-99);
+
+	/**
+	 * 气压最大值(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal paMax = new BigDecimal(-99);
+
+	/**
+	 * 气压最小值(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal paMin = new BigDecimal(-99);
+
+	/**
+	 * 气压平均值(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal paAve = new BigDecimal(-99);
+
+	/**
+	 * 气压标准差(KPa)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal paSta = new BigDecimal(-99);
+
+	/**
+	 * 10米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve10 = new BigDecimal(-99);
+
+	/**
+	 * 10米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta10 = new BigDecimal(-99);
+
+
+	/**
+	 * 30米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve30 = new BigDecimal(-99);
+
+	/**
+	 * 30米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta30 = new BigDecimal(-99);
+
+	/**
+	 * 50米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve50 = new BigDecimal(-99);
+
+	/**
+	 * 50米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta50 = new BigDecimal(-99);
+
+
+
+
+	/**
+	 * 60米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve60 = new BigDecimal(-99);
+
+	/**
+	 * 60米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta60 = new BigDecimal(-99);
+
+	/**
+	 * 70米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve70 = new BigDecimal(-99);
+
+	/**
+	 * 70米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta70 = new BigDecimal(-99);
+
+	/**
+	 * 80米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve80 = new BigDecimal(-99);
+
+	/**
+	 * 80米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta80 = new BigDecimal(-99);
+
+	/**
+	 * 90米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve90 = new BigDecimal(-99);
+
+	/**
+	 * 90米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta90 = new BigDecimal(-99);
+
+	/**
+	 * 100米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风速最大值(m/s)
+	 */
+	@Column(precision = 7, scale = 4)
+	private BigDecimal wsMax100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve100 = new BigDecimal(-99);
+
+	/**
+	 * 100米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta100 = new BigDecimal(-99);
+
+	/**
+	 * 110米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve110 = new BigDecimal(-99);
+
+	/**
+	 * 110米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta110 = new BigDecimal(-99);
+
+
+	/**
+	 * 120米风速瞬时值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInst120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMax120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMin120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAve120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsSta120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInst120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMax120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMin120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAve120 = new BigDecimal(-99);
+
+	/**
+	 * 120米风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdSta120 = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风速瞬时值
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsInstHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风速最大值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMaxHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风速最小值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsMinHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风速平均值(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsAveHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风速标准差(m/s)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wsStaHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风向瞬时值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdInstHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风向最大值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMaxHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风向最小值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdMinHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风向平均值(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdAveHubHeight = new BigDecimal(-99);
+
+	/**
+	 * 风机轮毂高度风向标准差(°)
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal wdStaHubHeight = new BigDecimal(-99);
+
+
+	/**
+	 * 空气密度  Kg/m³
+	 */
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal airDensity = new BigDecimal(-99);
+
+
+	/**
+	 * 数据是否是通过预测数据生成的
+	 */
+	@Column
+	@Type(type="yes_no")
+	private Boolean isGenerated=false;
+
+
+}

+ 22 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WeatherStationInfoRepository.java

@@ -0,0 +1,22 @@
+package com.jiayue.ipfcst.common.data.repository;
+
+import com.jiayue.ipfcst.common.data.entity.WeatherStationInfo;
+
+import java.util.List;
+
+/**
+ * 环境检测仪实体仓储
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/6 13:10
+ */
+public interface WeatherStationInfoRepository extends BaseRepository<WeatherStationInfo, Integer> {
+    /**
+     * 根据ID排序查出所有气象设备信息
+     * yh
+     */
+    List<WeatherStationInfo> findAllByOrderByIdAsc();
+
+    WeatherStationInfo findByName(String name);
+}

+ 1 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/job/UploadFileE1Job.java

@@ -20,7 +20,7 @@ public class UploadFileE1Job extends BaseJob {
 
   @Override
   public boolean execute(JobDataMap jobDataMap) {
-    e63UploadFileService.generateE1File(null);
+    e63UploadFileService.generateDqFile(null);
     return true;
   }
 }

+ 352 - 86
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java

@@ -3,9 +3,8 @@ package com.jiayue.ipfcst.fileupload.service;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.util.DateMomentUtil;
 import com.jiayue.ipfcst.common.data.constant.enums.FileTypeEnum;
-import com.jiayue.ipfcst.common.data.entity.ElectricField;
-import com.jiayue.ipfcst.common.data.entity.ForecastPowerShortTermHis;
-import com.jiayue.ipfcst.common.data.entity.ForecastPowerUltraShortTermHis;
+import com.jiayue.ipfcst.common.data.entity.*;
+import com.jiayue.ipfcst.common.data.repository.WeatherStationInfoRepository;
 import com.jiayue.ipfcst.common.data.service.uploadfilerule.E63UploadFileRuleService;
 import com.jiayue.ipfcst.console.service.ForecastPowerShortTermService;
 import com.jiayue.ipfcst.console.service.ForecastPowerUltraShortTermService;
@@ -17,15 +16,15 @@ import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.springframework.stereotype.Service;
-import org.springframework.util.ResourceUtils;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.StringWriter;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 青海上报文件生成
@@ -47,17 +46,20 @@ public class E63UploadFileService extends BaseUploadFileService {
 
   private final E63UploadFileRuleService e63UploadFileRuleService;
 
-  public E63UploadFileService(VelocityEngine velocityEngine, ForecastPowerShortTermService forecastPowerShortTermService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, E63UploadFileRuleService e63UploadFileRuleService) {
+  private final WeatherStationInfoRepository weatherStationInfoRepository;
+
+  public E63UploadFileService(VelocityEngine velocityEngine, ForecastPowerShortTermService forecastPowerShortTermService, ForecastPowerUltraShortTermService forecastPowerUltraShortTermService, E63UploadFileRuleService e63UploadFileRuleService, WeatherStationInfoRepository weatherStationInfoRepository) {
     this.velocityEngine = velocityEngine;
     this.forecastPowerShortTermService = forecastPowerShortTermService;
     this.forecastPowerUltraShortTermService = forecastPowerUltraShortTermService;
     this.e63UploadFileRuleService = e63UploadFileRuleService;
+    this.weatherStationInfoRepository = weatherStationInfoRepository;
   }
 
   /**
    * 生成短期预测上报文件。
    */
-  public void generateE1File(Date date) {
+  public void generateDqFile(Date date) {
     List<ElectricField> electricFieldList = null;
     try {
       electricFieldList = super.getMultipleStation();
@@ -129,7 +131,7 @@ public class E63UploadFileService extends BaseUploadFileService {
           log.error(stationCode + "短期上报模板不存在!");
         }
       } catch (Exception e) {
-        log.error(stationCode + "生成短期异常");
+        log.error(stationCode + "生成短期异常", e);
       }
     }
   }
@@ -137,7 +139,7 @@ public class E63UploadFileService extends BaseUploadFileService {
   /**
    * 生成短期可用预测上报文件。
    */
-  public void generateE26File(Date date) {
+  public void generateDqUseFile(Date date) {
     List<ElectricField> electricFieldList = null;
     try {
       electricFieldList = super.getMultipleStation();
@@ -168,41 +170,41 @@ public class E63UploadFileService extends BaseUploadFileService {
             systemDate = date;
           }
           // 短期默认天数
-          int dqDays = super.getTranSysParameter("FILE_FORECAST_DAYS", "3",stationCode);
-            // 开始时间
-            Long startTime = DateMomentUtil.getDayStartTime(DateUtils.addDays(systemDate, 1).getTime());
-            // 结束时间(开始加24小时再减去1秒)
-            Long endTime = DateMomentUtil.getDayLastTime(DateUtils.addDays(systemDate, dqDays).getTime());
-            // 生成上报文件名格式
-            fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E26", startTime);
-            if (getFileName(fileName, "E26",stationCode)) {
-              // 查询短期预测功率
-              List<ForecastPowerShortTermHis> forecastPowerShortTermHisList = this.forecastPowerShortTermService.getForecastPowerShortTerm(startTime, endTime,stationCode);
-              if (forecastPowerShortTermHisList.size() > 0) {
-                // 按照预测时间进行升序
-                forecastPowerShortTermHisList.sort(Comparator.comparing(ForecastPowerShortTermHis::getForecastTime));
-              }
-              // 创建上报文件
-              file = super.createTempFile(fileName);
-              // 根据模板生成文件内容
-              velocityContext = new VelocityContext();
-              velocityContext.put("vList", forecastPowerShortTermHisList);
-              //场站标识
-              velocityContext.put("sign", electricFieldInfo.getSign());
-              //系统当前日期
-              velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_" + "00:00:00"));
-              //上报数据开始日期
-              velocityContext.put("uploadTime", DateFormatUtils.format(startTime, "yyyy-MM-dd_") + "00:00");
-              writer = new StringWriter();
-              template.merge(velocityContext, writer);
-              // 将文件复制到上报路径中
-              super.copyUploadFile(writer, file, FileTypeEnum.E26.name(), null, date,stationCode);
+          int dqDays = super.getTranSysParameter("FILE_FORECAST_DAYS", "3", stationCode);
+          // 开始时间
+          Long startTime = DateMomentUtil.getDayStartTime(DateUtils.addDays(systemDate, 1).getTime());
+          // 结束时间(开始加24小时再减去1秒)
+          Long endTime = DateMomentUtil.getDayLastTime(DateUtils.addDays(systemDate, dqDays).getTime());
+          // 生成上报文件名格式
+          fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E26", startTime);
+          if (getFileName(fileName, "E26", stationCode)) {
+            // 查询短期预测功率
+            List<ForecastPowerShortTermHis> forecastPowerShortTermHisList = this.forecastPowerShortTermService.getForecastPowerShortTerm(startTime, endTime, stationCode);
+            if (forecastPowerShortTermHisList.size() > 0) {
+              // 按照预测时间进行升序
+              forecastPowerShortTermHisList.sort(Comparator.comparing(ForecastPowerShortTermHis::getForecastTime));
             }
+            // 创建上报文件
+            file = super.createTempFile(fileName);
+            // 根据模板生成文件内容
+            velocityContext = new VelocityContext();
+            velocityContext.put("vList", forecastPowerShortTermHisList);
+            //场站标识
+            velocityContext.put("sign", electricFieldInfo.getSign());
+            //系统当前日期
+            velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_" + "00:00:00"));
+            //上报数据开始日期
+            velocityContext.put("uploadTime", DateFormatUtils.format(startTime, "yyyy-MM-dd_") + "00:00");
+            writer = new StringWriter();
+            template.merge(velocityContext, writer);
+            // 将文件复制到上报路径中
+            super.copyUploadFile(writer, file, FileTypeEnum.E26.name(), null, date, stationCode);
+          }
         } else {
-          log.error(stationCode+"可用短期上报模板不存在!");
+          log.error(stationCode + "可用短期上报模板不存在!");
         }
       } catch (Exception e) {
-        log.error(stationCode + "生成可用短期异常");
+        log.error(stationCode + "生成可用短期异常", e);
       }
     }
   }
@@ -210,7 +212,7 @@ public class E63UploadFileService extends BaseUploadFileService {
   /**
    * 生成超短期预测上报文件。
    */
-  public void generateE2File(Date date) {
+  public void generateCdqFile(Date date) {
     List<ElectricField> electricFieldList = null;
     try {
       electricFieldList = super.getMultipleStation();
@@ -240,49 +242,49 @@ public class E63UploadFileService extends BaseUploadFileService {
             systemDate = date;
           }
           // 短期默认天数
-          int cdqPoint = super.getTranSysParameter("FILE_CDQ_POINT", "16",stationCode);
+          int cdqPoint = super.getTranSysParameter("FILE_CDQ_POINT", "16", stationCode);
           // 获取提前几分钟生成超短期
-          int cdqUpMin = super.getTranSysParameter("CDQ_UP_MIN", "0",stationCode);
-            // 开始时间
-            Long startTime = DateMomentUtil.getMomentTime(systemDate.getTime() + 15 * 60 * 1000 + cdqUpMin * 1000 * 60, 1, 15 * 60 * 1000L);
-            // 结束时间
-            Long endTime = startTime + cdqPoint * 15 * 60 * 1000 - 1000;
-            // 生成上报文件名格式
-            fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E2", startTime);
-
-            if (getFileName(fileName, "E2",stationCode)) {
-              // 查询超短期预测功率
-              List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = this.forecastPowerUltraShortTermService.getForecastPowerUltraShortTerm(startTime, endTime,stationCode);
-              // 按照预测时间进行升序
-              forecastPowerUltraShortTermHisList.sort(Comparator.comparing(ForecastPowerUltraShortTermHis::getForecastTime));
+          int cdqUpMin = super.getTranSysParameter("CDQ_UP_MIN", "0", stationCode);
+          // 开始时间
+          Long startTime = DateMomentUtil.getMomentTime(systemDate.getTime() + 15 * 60 * 1000 + cdqUpMin * 1000 * 60, 1, 15 * 60 * 1000L);
+          // 结束时间
+          Long endTime = startTime + cdqPoint * 15 * 60 * 1000 - 1000;
+          // 生成上报文件名格式
+          fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E2", startTime);
+
+          if (getFileName(fileName, "E2", stationCode)) {
+            // 查询超短期预测功率
+            List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = this.forecastPowerUltraShortTermService.getForecastPowerUltraShortTerm(startTime, endTime, stationCode);
+            // 按照预测时间进行升序
+            forecastPowerUltraShortTermHisList.sort(Comparator.comparing(ForecastPowerUltraShortTermHis::getForecastTime));
 
-              // 创建上报文件
-              file = super.createTempFile(fileName);
-              // 根据模板生成文件内容
-              velocityContext = new VelocityContext();
-              velocityContext.put("vList", forecastPowerUltraShortTermHisList);
-              // 场站标识
-              velocityContext.put("sign", electricFieldInfo.getSign());
-              // 场站装机容量
-              velocityContext.put("capacity", electricFieldInfo.getCapacity());
-              // 系统当前日期
-              if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
-                velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_HH:mm" + ":00"));
-              } else {
-                velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd HH:mm" + ":00"));
-              }
-              // 上报数据开始日期
-              velocityContext.put("uploadTime", DateFormatUtils.format(startTime, "yyyy-MM-dd_HH:mm"));
-              writer = new StringWriter();
-              template.merge(velocityContext, writer);
-
-              super.copyUploadFile(writer, file, FileTypeEnum.E2.name(), null, date,stationCode);
+            // 创建上报文件
+            file = super.createTempFile(fileName);
+            // 根据模板生成文件内容
+            velocityContext = new VelocityContext();
+            velocityContext.put("vList", forecastPowerUltraShortTermHisList);
+            // 场站标识
+            velocityContext.put("sign", electricFieldInfo.getSign());
+            // 场站装机容量
+            velocityContext.put("capacity", electricFieldInfo.getCapacity());
+            // 系统当前日期
+            if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+              velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_HH:mm" + ":00"));
+            } else {
+              velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd HH:mm" + ":00"));
             }
+            // 上报数据开始日期
+            velocityContext.put("uploadTime", DateFormatUtils.format(startTime, "yyyy-MM-dd_HH:mm"));
+            writer = new StringWriter();
+            template.merge(velocityContext, writer);
+
+            super.copyUploadFile(writer, file, FileTypeEnum.E2.name(), null, date, stationCode);
+          }
         } else {
-          log.error(stationCode+"超短期上报模板不存在!");
+          log.error(stationCode + "超短期上报模板不存在!");
         }
       } catch (Exception e) {
-        log.error(stationCode + "生成超短期异常");
+        log.error(stationCode + "生成超短期异常", e);
       }
     }
   }
@@ -290,7 +292,7 @@ public class E63UploadFileService extends BaseUploadFileService {
   /**
    * 生成超短期可用预测上报文件。
    */
-  public void generateE27File(Date date) {
+  public void generateCdqUseFile(Date date) {
     List<ElectricField> electricFieldList = null;
     try {
       electricFieldList = super.getMultipleStation();
@@ -320,9 +322,9 @@ public class E63UploadFileService extends BaseUploadFileService {
             systemDate = date;
           }
           // 短期默认天数
-          int cdqPoint = super.getTranSysParameter("FILE_CDQ_POINT", "16",stationCode);
+          int cdqPoint = super.getTranSysParameter("FILE_CDQ_POINT", "16", stationCode);
           // 获取提前几分钟生成超短期
-          int cdqUpMin = super.getTranSysParameter("CDQ_UP_MIN", "0",stationCode);
+          int cdqUpMin = super.getTranSysParameter("CDQ_UP_MIN", "0", stationCode);
 
           // 开始时间
           Long startTime = DateMomentUtil.getMomentTime(systemDate.getTime() + 15 * 60 * 1000 + cdqUpMin * 1000 * 60, 1, 15 * 60 * 1000L);
@@ -332,8 +334,8 @@ public class E63UploadFileService extends BaseUploadFileService {
           // 生成上报文件名格式
           fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E27", startTime);
 
-          if (getFileName(fileName, "E27",stationCode)) {
-            List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = this.forecastPowerUltraShortTermService.getForecastPowerUltraShortTerm(startTime, endTime,stationCode);
+          if (getFileName(fileName, "E27", stationCode)) {
+            List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = this.forecastPowerUltraShortTermService.getForecastPowerUltraShortTerm(startTime, endTime, stationCode);
             // 按照预测时间进行升序
             if (forecastPowerUltraShortTermHisList.size() > 0) {
               forecastPowerUltraShortTermHisList.sort(Comparator.comparing(ForecastPowerUltraShortTermHis::getForecastTime));
@@ -358,19 +360,283 @@ public class E63UploadFileService extends BaseUploadFileService {
             velocityContext.put("uploadTime", DateFormatUtils.format(startTime - 15 * 60 * 1000, "yyyy-MM-dd_HH:mm"));
             writer = new StringWriter();
             template.merge(velocityContext, writer);
-            super.copyUploadFile(writer, file, FileTypeEnum.E27.name(), null, date,stationCode);
+            super.copyUploadFile(writer, file, FileTypeEnum.E27.name(), null, date, stationCode);
           }
         } else {
-          log.error(stationCode+"可用超短期上报模板不存在!");
+          log.error(stationCode + "可用超短期上报模板不存在!");
         }
       } catch (Exception e) {
-        log.error(stationCode + "生成可用超短期异常");
+        log.error(stationCode + "生成可用超短期异常", e);
       }
     }
   }
 
+  /**
+   * 生成气象站或者测风塔上报文件
+   */
+  public void generateQxzOrCftFile(ElectricField electricFieldInfo,Date date) {
+      String stationCode = electricFieldInfo.getStationCode();
+      try {
+        String fileName;
+        // 获取当前系统时间
+        Date systemDate = new Date();
+        if (date != null) {
+          systemDate = date;
+        }
+        Long startTime = DateMomentUtil.getMomentTime(systemDate.getTime() - 5 * 60 * 1000, 1, 5 * 60 * 1000L);
+        Long endTime = startTime + 5 * 60 * 1000 - 1000;
+        // 生成上报文件名格式
+        Template template = null;
+        VelocityContext velocityContext = new VelocityContext();
+        if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
+          // 获取气象站模板
+          template = this.velocityEngine.getTemplate(this.vmsPath + "/QXZ.vm");
+          fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E6", endTime + 1000);
+          if (getFileName(fileName, "E6", stationCode)) {
+            generateQxzFile(fileName, velocityContext, template, electricFieldInfo, date, startTime, endTime);
+          }
+        } else {
+          template = this.velocityEngine.getTemplate(this.vmsPath + "/CFT.vm");
+          fileName = e63UploadFileRuleService.getFileNameRule(electricFieldInfo, "E7", endTime + 1000);
+          if (getFileName(fileName, "E7", stationCode)) {
+            generateCftFile(fileName, velocityContext, template, electricFieldInfo, date, startTime, endTime);
+          }
+        }
+      } catch (Exception e) {
+        log.error(stationCode + "生成文件异常", e);
+      }
+  }
 
+  /**
+   * 生成测风塔上报文件
+   */
+  public void generateQxzFile(String fileName, VelocityContext velocityContext, Template template, ElectricField electricFieldInfo, Date date, Long startTime, Long endTime) throws Exception{
+    ///////////////////此处从缓存取///////////////////////////////////////
+    WeatherStationStatusData weatherStationStatusData = null;
+    // 数据格式化
+    DecimalFormat df = new DecimalFormat("0.00");
+    BigDecimal globalR = new BigDecimal(0);
+    BigDecimal directR = new BigDecimal(0);
+    BigDecimal diffuseR = new BigDecimal(0);
+    BigDecimal ws = new BigDecimal(0);
+    BigDecimal wd = new BigDecimal(0);
+    BigDecimal airT = new BigDecimal(0);
+    BigDecimal p = new BigDecimal(0);
+    BigDecimal rh = new BigDecimal(0);
+    BigDecimal cellT = new BigDecimal(0);
+
+    if (weatherStationStatusData == null) {
+      // 总辐射产生500-1000随机数
+      globalR = new BigDecimal(df.format(Math.random() * 500 + 500));
+      // 直辐射产生400-500随机数
+      directR = new BigDecimal(df.format(Math.random() * 100 + 400));
+      // 散辐射 = 总 - 直
+      diffuseR = globalR.subtract(directR);
+      airT = new BigDecimal(df.format(Math.random() * 4 + 8));
+      p = new BigDecimal(df.format(Math.random() * 200 + 800));
+      rh = new BigDecimal(df.format(Math.random() * 10 + 30));
+      cellT = new BigDecimal(df.format(Math.random() * 26 + 4));
+      ws = new BigDecimal(df.format(Math.random() * 9 + 1));
+      wd = new BigDecimal(df.format(Math.random() * 100 + 200));
+    } else {
+      globalR = weatherStationStatusData.getGlobalR();
+      directR = weatherStationStatusData.getDirectR();
+      diffuseR = weatherStationStatusData.getDiffuseR();
+      airT = weatherStationStatusData.getAirT();
+      p = weatherStationStatusData.getP();
+      rh = weatherStationStatusData.getRh();
+      cellT = weatherStationStatusData.getCellT();
+      ws = weatherStationStatusData.getWs();
+      wd = weatherStationStatusData.getWd();
+    }
+    // 创建上报文件
+    File file = super.createTempFile(fileName);
+    //青海要求 直=总-散;但是当散辐射大于总辐射时直辐射为负数不符合该规则。所以比较总直散三个值,用最大的当总辐射去减去
+    log.info("qxz  实际值 总GlobalR:" + globalR + " 直DirectR:" + directR + " 散DiffuseR:" + diffuseR);
+    if (globalR.compareTo(diffuseR) == -1) {
+      //当散辐射大于总辐射时,数值互换
+      BigDecimal a = globalR;
+      globalR = diffuseR;
+      diffuseR = a;
+    }
+    directR = globalR.subtract(diffuseR);
+    // 根据模板生成文件内容
+    velocityContext.put("GlobalR", globalR.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(globalR));
+    velocityContext.put("AirT", airT.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(airT));
+    velocityContext.put("P", p.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(p));
+    velocityContext.put("RH", rh.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(rh));
+    velocityContext.put("CellT", cellT.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(cellT));
+    velocityContext.put("DirectR", directR.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(directR));
+    velocityContext.put("DiffuseR", diffuseR.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(diffuseR));
+    velocityContext.put("WS", ws.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(ws));
+    velocityContext.put("WD", wd.compareTo(new BigDecimal(-99)) == 0 ? "0.00" : df.format(wd));
+    // 场站标识
+    velocityContext.put("sign", electricFieldInfo.getSign());
+    // 场站装机容量
+    velocityContext.put("capacity", electricFieldInfo.getCapacity());
+    // 系统当前日期
+    velocityContext.put("currentTime", DateFormatUtils.format(endTime + 1000, "yyyy-MM-dd_HH:mm") + ":00");
+    // 上报数据开始日期
+    velocityContext.put("uploadTime", DateFormatUtils.format(endTime + 1000, "yyyy-MM-dd_HH:mm"));
+    StringWriter writer = new StringWriter();
+    template.merge(velocityContext, writer);
+    super.copyUploadFile(writer, file, FileTypeEnum.E6.name(), null, date, electricFieldInfo.getStationCode());
+  }
 
+  /**
+   * 生成测风塔上报文件
+   */
+  public void generateCftFile(String fileName, VelocityContext velocityContext, Template template, ElectricField electricFieldInfo, Date date, Long startTime, Long endTime) throws Exception{
+    WindTowerStatusData windTowerStatusData = null;
+    // 数据格式化
+    DecimalFormat df = new DecimalFormat("0.00");
+    BigDecimal ws10 = new BigDecimal(0);
+    BigDecimal wd10 = new BigDecimal(0);
+    BigDecimal ws30 = new BigDecimal(0);
+    BigDecimal wd30 = new BigDecimal(0);
+    BigDecimal ws50 = new BigDecimal(0);
+    BigDecimal wd50 = new BigDecimal(0);
+    BigDecimal ws60 = new BigDecimal(0);
+    BigDecimal wd60 = new BigDecimal(0);
+    BigDecimal ws70 = new BigDecimal(0);
+    BigDecimal wd70 = new BigDecimal(0);
+    BigDecimal ws80 = new BigDecimal(0);
+    BigDecimal wd80 = new BigDecimal(0);
+    BigDecimal ws90 = new BigDecimal(0);
+    BigDecimal wd90 = new BigDecimal(0);
+    BigDecimal ws100 = new BigDecimal(0);
+    BigDecimal wd100 = new BigDecimal(0);
+    BigDecimal wsHubHeight = new BigDecimal(0);
+    BigDecimal wdHubHeight = new BigDecimal(0);
+    BigDecimal t8 = new BigDecimal(0);
+    BigDecimal p8 = new BigDecimal(0);
+    BigDecimal rh8 = new BigDecimal(0);
+
+    if (windTowerStatusData == null) {
+      // 10米风速产生1-5随机数
+      BigDecimal ws10RandomValue = new BigDecimal(df.format(Math.random() * 4 + 1));
+      ws10 = ws10.add(ws10RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 10米风向产生40-60随机数
+      BigDecimal wd10RandomValue = new BigDecimal(df.format(Math.random() * 20 + 40));
+      wd10 = wd10.add(wd10RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 30米风速产生6-10随机数
+      BigDecimal ws30RandomValue = new BigDecimal(df.format(Math.random() * 4 + 6));
+      ws30 = ws30.add(ws30RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 30米风向产生70-90随机数
+      BigDecimal wd30RandomValue = new BigDecimal(df.format(Math.random() * 20 + 70));
+      wd30 = wd30.add(wd30RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 50米风速产生16-20随机数
+      BigDecimal ws50RandomValue = new BigDecimal(df.format(Math.random() * 4 + 16));
+      ws50 = ws50.add(ws50RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 50米风向产生130-150随机数
+      BigDecimal wd50RandomValue = new BigDecimal(df.format(Math.random() * 20 + 130));
+      wd50 = wd50.add(wd50RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 70米风速产生31-35随机数
+      BigDecimal ws70RandomValue = new BigDecimal(df.format(Math.random() * 4 + 31));
+      ws70 = ws70.add(ws70RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 70米风向产生220-240随机数
+      BigDecimal wd70RandomValue = new BigDecimal(df.format(Math.random() * 20 + 220));
+      wd70 = wd70.add(wd70RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+
+      // 80米风速产生35-40随机数
+      BigDecimal ws80RandomValue = new BigDecimal(df.format(Math.random() * 5 + 35));
+      ws80 = ws80.add(ws80RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 80米风向产生240-250随机数
+      BigDecimal wd80RandomValue = new BigDecimal(df.format(Math.random() * 10 + 240));
+      wd80 = wd80.add(wd80RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+
+      // 90米风速产生45-50随机数
+      BigDecimal ws90RandomValue = new BigDecimal(df.format(Math.random() * 5 + 45));
+      ws90 = ws90.add(ws90RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 90米风向产生260-270随机数
+      BigDecimal wd90RandomValue = new BigDecimal(df.format(Math.random() * 10 + 260));
+      wd90 = wd90.add(wd90RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+
+      // 100米风速产生60-70随机数
+      BigDecimal ws100RandomValue = new BigDecimal(df.format(Math.random() * 10 + 60));
+      ws100 = ws100.add(ws100RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 100米风向产生280-290随机数
+      BigDecimal wd100RandomValue = new BigDecimal(df.format(Math.random() * 10 + 280));
+      wd100 = wd100.add(wd100RandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+
+      BigDecimal wsRandomValue = new BigDecimal(df.format(Math.random() * 4 + 70));
+      wsHubHeight = wsHubHeight.add(wsRandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      BigDecimal wdRandomValue = new BigDecimal(df.format(Math.random() * 20 + 250));
+      wdHubHeight = wdHubHeight.add(wdRandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 湿度产生50-60随机数
+      BigDecimal rhRandomValue = new BigDecimal(df.format(Math.random() * 10 + 50));
+      rh8 = rh8.add(rhRandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 温度产生20-35随机数
+      BigDecimal tRandomValue = new BigDecimal(df.format(Math.random() * 15 + 20));
+      t8 = t8.add(rhRandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+      // 气压产生75-90随机数
+      BigDecimal paRandomValue = new BigDecimal(df.format(Math.random() * 15 + 75));
+      p8 = p8.add(paRandomValue).setScale(2, BigDecimal.ROUND_HALF_UP);
+    } else {
+
+      ws10 = windTowerStatusData.getWsInst10().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst10();
+      wd10 = windTowerStatusData.getWdInst10().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst10();
+      ws30 = windTowerStatusData.getWsInst30().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst30();
+      wd30 = windTowerStatusData.getWdInst30().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst30();
+      ws50 = windTowerStatusData.getWsInst50().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst50();
+      wd50 = windTowerStatusData.getWdInst50().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst50();
+      ws70 = windTowerStatusData.getWsInst70().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst70();
+      wd70 = windTowerStatusData.getWdInst70().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst70();
+      ws80 = windTowerStatusData.getWsInst80().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst80();
+      wd80 = windTowerStatusData.getWdInst80().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst80();
+      ws90 = windTowerStatusData.getWsInst90().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst90();
+      wd90 = windTowerStatusData.getWdInst90().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst90();
+      ws100 = windTowerStatusData.getWsInst100().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInst100();
+      wd100 = windTowerStatusData.getWdInst100().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInst100();
+      wsHubHeight = windTowerStatusData.getWsInstHubHeight().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWsInstHubHeight();
+      wdHubHeight = windTowerStatusData.getWdInstHubHeight().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getWdInstHubHeight();
+      p8 = windTowerStatusData.getPaInst().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getPaInst();
+      rh8 = windTowerStatusData.getRhInst().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getRhInst();
+      t8 = windTowerStatusData.getTInst().compareTo(new BigDecimal(-99)) == 0 ? new BigDecimal(0) : windTowerStatusData.getTInst();
+    }
+    // 创建上报文件
+    File file = super.createTempFile(fileName);
+    // 根据模板生成文件内容
+    velocityContext.put("WS_10", df.format(ws10));
+    velocityContext.put("WD_10", df.format(wd10));
+
+    velocityContext.put("WS_30", df.format(ws30));
+    velocityContext.put("WD_30", df.format(wd30));
+
+    velocityContext.put("WS_50", df.format(ws50));
+    velocityContext.put("WD_50", df.format(wd50));
+
+    velocityContext.put("WS_60", df.format(ws60));
+    velocityContext.put("WD_60", df.format(wd60));
+
+    velocityContext.put("WS_70", df.format(ws70));
+    velocityContext.put("WD_70", df.format(wd70));
+
+    velocityContext.put("WS_80", df.format(ws80));
+    velocityContext.put("WD_80", df.format(wd80));
+
+    velocityContext.put("WS_90", df.format(ws90));
+    velocityContext.put("WD_90", df.format(wd90));
+
+    velocityContext.put("WS_100", df.format(ws100));
+    velocityContext.put("WD_100", df.format(wd100));
+
+    velocityContext.put("WS_HubHeight", df.format(wsHubHeight));
+    velocityContext.put("WD_HubHeight", df.format(wdHubHeight));
+
+    velocityContext.put("T_8", df.format(t8));
+    velocityContext.put("P_8", df.format(p8));
+    velocityContext.put("RH_8", df.format(rh8));
+    // 场站标识
+    velocityContext.put("sign", electricFieldInfo.getSign());
+    // 系统当前日期
+    velocityContext.put("currentTime", DateFormatUtils.format(endTime + 1000, "yyyy-MM-dd_HH:mm") + ":00");
+    // 上报数据开始日期
+    velocityContext.put("uploadTime", DateFormatUtils.format(endTime + 1000, "yyyy-MM-dd_HH:mm"));
+    StringWriter writer = new StringWriter();
+    template.merge(velocityContext, writer);
+    super.copyUploadFile(writer, file, FileTypeEnum.E7.name(), null, date, electricFieldInfo.getStationCode());
+  }
 
   /**
    * 除法

+ 20 - 2
ipfcst-console/src/test/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileServiceTest.java

@@ -1,12 +1,17 @@
 package com.jiayue.ipfcst.fileupload.service;
 
 import com.jiayue.ipfcst.BaseTest;
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.console.service.ElectricFieldService;
+import lombok.extern.slf4j.Slf4j;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import javax.xml.ws.Action;
 
 import java.util.Date;
+import java.util.List;
 
 import static org.junit.jupiter.api.Assertions.*;
 
@@ -16,13 +21,26 @@ import static org.junit.jupiter.api.Assertions.*;
  * @author xsl
  * @version 3.0
  */
+@Slf4j
 public class E63UploadFileServiceTest extends BaseTest {
   @Autowired
   E63UploadFileService e63UploadFileService;
+  @Autowired
+  ElectricFieldService electricFieldService;
 
   @Test
   public void testCreateFile() throws Exception{
-    Thread.sleep(60000L);
-    e63UploadFileService.generateE27File(new Date());
+    List<ElectricField> electricFieldList = null;
+    try {
+      electricFieldList = electricFieldService.getAll();
+    } catch (Exception e) {
+      log.error("场站获取失败", e);
+    }
+
+    // 循环场站生成短期
+    for (ElectricField electricFieldInfo : electricFieldList) {
+      e63UploadFileService.generateQxzOrCftFile(electricFieldInfo,new Date());
+    }
+
   }
 }