package com.ld.igds.models; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; import org.apache.commons.lang3.time.DateFormatUtils; import lombok.Data; import com.bstek.dorado.annotation.PropertyDef; import com.ld.igds.weather.WeatherUtil; /** * 气象信息,气象信息来源包括外网和库区气象站,当前定义即作为DATA又作为DTO使用因此会定义虚拟的扩展字段 * * @author Andy * */ @Data @Entity @Table(name = "D_WEATHER_INFO") public class WeatherInfo implements Serializable { /** * * */ private static final long serialVersionUID = 1L; @Id @Column(name = "ID_",length = 40) @PropertyDef(label = "主键ID") private String id; @Column(name = "COMPANY_ID_", length = 10) @PropertyDef(label = "组织编码") private String companyId; @Column(name = "DEPT_ID_", length = 40) @PropertyDef(label = "分库编码") private String deptId; @Column(name = "CITY_", length = 40) @PropertyDef(label = "所属城市") private String city; @Column(name = "TEMP_", length = 20) @PropertyDef(label = "温度") private String temp = "0.0℃"; @Column(name = "HUMIDITY_", length = 20) @PropertyDef(label = "湿度") private String humidity = "0.0%"; @Column(name = "WIND_SPEED_", length = 20) @PropertyDef(label = "风级") private String windSpeed = "0级"; @Column(name = "WIND_METER_", length = 20) @PropertyDef(label = "风速", description = "风速 如: 12km/h") private String windMeter = "0km/h"; @Column(name = "WIND_DIRECTION_", length = 20) @PropertyDef(label = "风向") private String windDirection = "无风"; @Column(name = "WEATHER_", length = 20) @PropertyDef(label = "天气") private String weather = "晴天"; @Column(name = "RAINFALL_", length = 20) @PropertyDef(label = "雨量") private String rainfall = "0.0mm/h"; @Column(name = "PM25_", length = 20) @PropertyDef(label = "PM2.5") private String pm25 = "0μg/m3"; @Column(name = "AIR_LEVEL_", length = 20) @PropertyDef(label = "空气质量等级") private String airLevel = "优"; @Column(name = "PRESSURE_", length = 20) @PropertyDef(label = "大气压") private String pressure; @Column(name = "SOURCE_", length = 20) @PropertyDef(label = "信息来源", description = "01-库区气象站,02-外网") private String source = WeatherUtil.SOURCE_01; @Column(name = "UPDATE_TIME_") @PropertyDef(label = "更新时间") private Date updateTime = new Date(); @Transient @PropertyDef(label = "更新时间", description = "更新时间:yyyy-MM-dd HH:mm") private String updateTimeStr; public String getUpdateTimeStr() { return DateFormatUtils.format(this.updateTime, "yyyy-MM-dd HH:mm"); } }