ws183
2025-04-28 b306d1106b915bb13fd7a02217ae9c65de2fd03d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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");
    }
}