1
zj
2024-08-12 11bb86a81c99672e5e51ca7289f49a57346739e8
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
package project.contract;
 
import java.io.Serializable;
import java.util.Date;
 
import javax.persistence.Column;
import javax.persistence.Table;
 
import com.alibaba.fastjson.JSON;
 
import kernel.bo.EntityObject;
 
/**
 * 委托单
 */
@Table(name="T_CONTRACT_APPLY_ORDER")
public class ContractApplyOrder extends EntityObject {
 
    public final static String STATE_SUBMITTED = "submitted";
    public final static String STATE_CANCELED = "canceled";
    public final static String STATE_CREATED = "created";
    /**
     * 多仓
     */
    public final static String DIRECTION_BUY = "buy";
    /**
     * 空仓
     */
    public final static String DIRECTION_SELL = "sell";
    /**
     * 开仓
     */
    public final static String OFFSET_OPEN = "open";
 
    /**
     * 平仓
     */
    public final static String OFFSET_CLOSE = "close";
 
    /**
     * 限价单
     */
    public final static String ORDER_PRICE_TYPE_LIMIT = "limit";
 
    /**
     * 对手价(市价)
     */
    public final static String ORDER_PRICE_TYPE_OPPONENT = "opponent";
 
    private static final long serialVersionUID = 3005514385287413248L;
 
    @Column(name="PARTY_ID")
    private Serializable partyId;
 
    /**
     * 订单 号
     */
    @Column(name="ORDER_NO")
    private String order_no;
 
    @Column(name="SYMBOL")
    private String symbol;
    /**
     * "buy":多 "sell":空
     */
    @Column(name="DIRECTION")
    private String direction;
 
    /**
     * "open":开 "close":平
     */
    @Column(name="OFFSET")
    private String offset;
    /**
     * 委托数量(剩余)(张)
     */
    @Column(name="VOLUME")
    private Double volume;
    /**
     * 委托数量(张)
     */
    @Column(name="VOLUME_OPEN")
    private Double volume_open;
    /**
     * 杠杆倍数[“开仓”若有10倍多单,就不能再下20倍多单]
     */
    @Column(name="LEVER_RATE")
    private Double lever_rate;
 
    /**
     * limit order的交易价格
     */
    @Column(name="PRICE")
    private Double price;
    /**
     * 止盈触发价格
     */
    @Column(name="STOP_PRICE_PROFIT")
    private Double stop_price_profit;
    /**
     * 止损触发价格
     */
    @Column(name="STOP_PRICE_LOSS")
    private Double stop_price_loss;
    /**
     * 订单报价类型。 "limit":限价 "opponent":对手价(市价)
     */
    @Column(name="ORDER_PRICE_TYPE")
    private String order_price_type;
    /**
     * 状态。submitted 已提交,canceled 已撤销, created 委托完成
     */
    @Column(name="STATE")
    private String state = "submitted";
 
    @Column(name="CREATE_TIME")
    private Date create_time;
 
    /**
     * 手续费
     */
    @Column(name="FEE")
    private double fee;
 
    /**
     * 保证金
     */
    @Column(name="DEPOSIT")
    private double deposit;
 
    /**
     * 每手金额
     */
    @Column(name="UNIT_AMOUNT")
    private double unit_amount;
    
    public String toString() {
        return JSON.toJSONString(this);
    }
 
    public Serializable getPartyId() {
        return partyId;
    }
 
    public void setPartyId(Serializable partyId) {
        this.partyId = partyId;
    }
 
    public String getOrder_no() {
        return order_no;
    }
 
    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }
 
    public String getSymbol() {
        return symbol;
    }
 
    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }
 
    public String getDirection() {
        return direction;
    }
 
    public void setDirection(String direction) {
        this.direction = direction;
    }
 
    public String getOffset() {
        return offset;
    }
 
    public void setOffset(String offset) {
        this.offset = offset;
    }
 
    public Double getVolume() {
        return volume;
    }
 
    public void setVolume(Double volume) {
        this.volume = volume;
    }
 
    public Double getLever_rate() {
        return lever_rate;
    }
 
    public void setLever_rate(Double lever_rate) {
        if (lever_rate != null && lever_rate == 1) {
            lever_rate = null;
        }
        this.lever_rate = lever_rate;
    }
 
    public Double getPrice() {
        return price;
    }
 
    public void setPrice(Double price) {
        this.price = price;
    }
 
    public Double getStop_price_profit() {
        return stop_price_profit;
    }
 
    public void setStop_price_profit(Double stop_price_profit) {
        this.stop_price_profit = stop_price_profit;
    }
 
    public Double getStop_price_loss() {
        return stop_price_loss;
    }
 
    public void setStop_price_loss(Double stop_price_loss) {
        this.stop_price_loss = stop_price_loss;
    }
 
    public String getOrder_price_type() {
        return order_price_type;
    }
 
    public void setOrder_price_type(String order_price_type) {
        this.order_price_type = order_price_type;
    }
 
    public String getState() {
        return state;
    }
 
    public void setState(String state) {
        this.state = state;
    }
 
    public Date getCreate_time() {
        return create_time;
    }
 
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
 
    public double getFee() {
        return fee;
    }
 
    public void setFee(double fee) {
        this.fee = fee;
    }
 
    public double getDeposit() {
        return deposit;
    }
 
    public void setDeposit(double deposit) {
        this.deposit = deposit;
    }
 
    public Double getVolume_open() {
        return volume_open;
    }
 
    public void setVolume_open(Double volume_open) {
        this.volume_open = volume_open;
    }
 
    public double getUnit_amount() {
        return unit_amount;
    }
 
    public void setUnit_amount(double unit_amount) {
        this.unit_amount = unit_amount;
    }
 
}