Sfoglia il codice sorgente

1.查询持仓汇总增加交易属性字段
2.查询敞口现货明细增加折算系数字段
3.#1526 融资申请单查询修改

zou.yingbin 4 anni fa
parent
commit
0f156abe7a
6 ha cambiato i file con 27 aggiunte e 12 eliminazioni
  1. 3 0
      controllers/order/order.go
  2. 5 1
      docs/docs.go
  3. 5 1
      docs/swagger.json
  4. 4 1
      docs/swagger.yaml
  5. 3 2
      models/ermcp3.go
  6. 7 7
      models/wrTrade2.go

+ 3 - 0
controllers/order/order.go

@@ -79,6 +79,7 @@ type QueryTradePositionRsp struct {
 	PositionPLRate  float64 `json:"positionplrate"`                               // 持仓盈亏比例【实时行情更新】 = 持仓盈亏 / 开仓成本
 	MarketAmount    float64 `json:"marketamount"`                                 // 市值
 	LastPrice       float64 `json:"lastprice"`                                    // 最新价
+	Tradeproperty   int32   `json:"tradeproperty"`                                // 交易属性
 }
 
 // QueryTradePosition 持仓汇总查询(合约市场)
@@ -191,6 +192,7 @@ func GetTradePosition(accIds string, tradeModes string) (rst []QueryTradePositio
 				c := QtyCovert{QTYDECIMALPLACE: v.QTYDECIMALPLACE}
 				// json -> struct
 				_ = json.Unmarshal(jsonBytes, &tradePosition)
+				tradePosition.Tradeproperty = v.Tradeproperty
 				tradePosition.BuyOrSell = 0
 				tradePosition.PositionQTY = c.CovertQty(v.Buypositionqty)
 				tradePosition.HolderAmount = v.Buyholderamount
@@ -230,6 +232,7 @@ func GetTradePosition(accIds string, tradeModes string) (rst []QueryTradePositio
 				c := QtyCovert{QTYDECIMALPLACE: v.QTYDECIMALPLACE}
 				// json -> struct
 				_ = json.Unmarshal(jsonBytes, &tradePosition)
+				tradePosition.Tradeproperty = v.Tradeproperty
 				tradePosition.BuyOrSell = 1
 				tradePosition.PositionQTY = c.CovertQty(v.Sellpositionqty)
 				tradePosition.HolderAmount = v.Sellholderamount

+ 5 - 1
docs/docs.go

@@ -19894,7 +19894,7 @@ var doc = `{
                     "type": "number"
                 },
                 "convertratio": {
-                    "description": "套保系数",
+                    "description": "折算系数",
                     "type": "number"
                 },
                 "createtime": {
@@ -36608,6 +36608,10 @@ var doc = `{
                     "description": "交易模式",
                     "type": "integer"
                 },
+                "tradeproperty": {
+                    "description": "交易属性",
+                    "type": "integer"
+                },
                 "usedmargin": {
                     "description": "占用保证金[商品币种]",
                     "type": "number"

+ 5 - 1
docs/swagger.json

@@ -19878,7 +19878,7 @@
                     "type": "number"
                 },
                 "convertratio": {
-                    "description": "套保系数",
+                    "description": "折算系数",
                     "type": "number"
                 },
                 "createtime": {
@@ -36592,6 +36592,10 @@
                     "description": "交易模式",
                     "type": "integer"
                 },
+                "tradeproperty": {
+                    "description": "交易属性",
+                    "type": "integer"
+                },
                 "usedmargin": {
                     "description": "占用保证金[商品币种]",
                     "type": "number"

+ 4 - 1
docs/swagger.yaml

@@ -4807,7 +4807,7 @@ definitions:
         description: 标仓系数
         type: number
       convertratio:
-        description: 套保系数
+        description: 折算系数
         type: number
       createtime:
         description: 时间
@@ -17216,6 +17216,9 @@ definitions:
       trademode:
         description: 交易模式
         type: integer
+      tradeproperty:
+        description: 交易属性
+        type: integer
       usedmargin:
         description: 占用保证金[商品币种]
         type: number

File diff suppressed because it is too large
+ 3 - 2
models/ermcp3.go


+ 7 - 7
models/wrTrade2.go

@@ -2258,13 +2258,13 @@ func (r *WrFinanceBuyApply) buildSql() string {
 		"       t.DELIVERYMONTH," +
 		"       t.FINANCETYPE," +
 		"       f.PRODUCTNAME," +
-		"       p.FINANCINGDAYS," +
-		"       p.MARGINRATIO," +
-		"       p.INTERESTRATEMODE," +
-		"       p.INTERESTRATE," +
-		"       p.INTERESTMINLEN," +
-		"       p.INTERESTSETTLEMODE," +
-		"       p.INTERESTSETTLEVALUE," +
+		"       t.FINANCINGDAYS," +
+		"       t.MARGINRATIO," +
+		"       t.INTERESTRATEMODE," +
+		"       t.INTERESTRATE," +
+		"       t.INTERESTMINLEN," +
+		"       t.INTERESTSETTLEMODE," +
+		"       t.INTERESTSETTLEVALUE," +
 		"       u1.accountname BUYUSERNAME," +
 		"       u2.accountname FINANCENAME," +
 		"       tmp.*" +

Some files were not shown because too many files changed in this diff