1
zj
2026-01-15 9e8557ce8e7ab694f21a9386cb61973c4ed31569
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
package com.nq.pojo;
 
import lombok.Data;
 
import java.math.BigDecimal;
import java.util.Map;
 
/**
 * @program: dabaogp
 * @description:
 * @create: 2026-01-15 19:49
 **/
@Data
public class StockRealTimeDto {
    private String Id;
    private String Name;
    private String Symbol;
    private String Last;
    private String High;
    private String Low;
    private String PrevClose;
    private String Time;
    private String Volume;
    private String Chg;
    private String ChgPct;
    private String country_id;
    private String type;
    private String Bid;
    private String Ask;
    private String Open;
    private String PrevLast;
    private String PrevChg;
    private String PrevChgPct;
    private String PrevPrevClose;
 
 
 
    /**
     * 从Map转换的静态方法
     */
    public static StockRealTimeDto fromMap(Map<String, Object> map) {
        if (map == null) {
            return null;
        }
 
        StockRealTimeDto stock = new StockRealTimeDto();
 
        // 逐个字段设置
        if (map.containsKey("Id")) {
            Object idObj = map.get("Id");
            if (idObj != null) {
                stock.setId(idObj.toString());
            }
        }
 
        if (map.containsKey("Name")) {
            Object nameObj = map.get("Name");
            if (nameObj != null) {
                stock.setName(nameObj.toString());
            }
        }
 
        if (map.containsKey("Symbol")) {
            Object symbolObj = map.get("Symbol");
            if (symbolObj != null) {
                stock.setSymbol(symbolObj.toString());
            }
        }
 
        if (map.containsKey("Last")) {
            Object lastObj = map.get("Last");
            if (lastObj != null) {
                stock.setLast(lastObj.toString());
            }
        }
 
        if (map.containsKey("High")) {
            Object highObj = map.get("High");
            if (highObj != null) {
                stock.setHigh(highObj.toString());
            }
        }
 
        if (map.containsKey("Low")) {
            Object lowObj = map.get("Low");
            if (lowObj != null) {
                stock.setLow(lowObj.toString());
            }
        }
 
        if (map.containsKey("PrevClose")) {
            Object prevCloseObj = map.get("PrevClose");
            if (prevCloseObj != null) {
                stock.setPrevClose(prevCloseObj.toString());
            }
        }
 
        if (map.containsKey("Time")) {
            Object timeObj = map.get("Time");
            if (timeObj != null) {
                stock.setTime(timeObj.toString());
            }
        }
 
        if (map.containsKey("Volume")) {
            Object volumeObj = map.get("Volume");
            if (volumeObj != null) {
                stock.setVolume(volumeObj.toString());
            }
        }
 
        if (map.containsKey("Chg")) {
            Object chgObj = map.get("Chg");
            if (chgObj != null) {
                stock.setChg(chgObj.toString());
            }
        }
 
        if (map.containsKey("ChgPct")) {
            Object chgPctObj = map.get("ChgPct");
            if (chgPctObj != null) {
                stock.setChgPct(chgPctObj.toString());
            }
        }
 
        if (map.containsKey("country_id")) {
            Object countryIdObj = map.get("country_id");
            if (countryIdObj != null) {
                stock.setCountry_id(countryIdObj.toString());
            }
        }
 
        if (map.containsKey("type")) {
            Object typeObj = map.get("type");
            if (typeObj != null) {
                stock.setType(typeObj.toString());
            }
        }
 
        if (map.containsKey("Bid")) {
            Object bidObj = map.get("Bid");
            if (bidObj != null) {
                stock.setBid(bidObj.toString());
            }
        }
 
        if (map.containsKey("Ask")) {
            Object askObj = map.get("Ask");
            if (askObj != null) {
                stock.setAsk(askObj.toString());
            }
        }
 
        if (map.containsKey("Open")) {
            Object openObj = map.get("Open");
            if (openObj != null) {
                stock.setOpen(openObj.toString());
            }
        }
 
        if (map.containsKey("PrevLast")) {
            Object prevLastObj = map.get("PrevLast");
            if (prevLastObj != null) {
                stock.setPrevLast(prevLastObj.toString());
            }
        }
 
        if (map.containsKey("PrevChg")) {
            Object prevChgObj = map.get("PrevChg");
            if (prevChgObj != null) {
                stock.setPrevChg(prevChgObj.toString());
            }
        }
 
        if (map.containsKey("PrevChgPct")) {
            Object prevChgPctObj = map.get("PrevChgPct");
            if (prevChgPctObj != null) {
                stock.setPrevChgPct(prevChgPctObj.toString());
            }
        }
 
        if (map.containsKey("PrevPrevClose")) {
            Object prevPrevCloseObj = map.get("PrevPrevClose");
            if (prevPrevCloseObj != null) {
                stock.setPrevPrevClose(prevPrevCloseObj.toString());
            }
        }
 
        return stock;
    }
}