Browse Source

持仓汇总查询返回资金账户币种ID

zhou.xiaoning 1 năm trước cách đây
mục cha
commit
377a919648
4 tập tin đã thay đổi với 20 bổ sung6 xóa
  1. 6 3
      controllers/order/order.go
  2. 5 1
      docs/docs.go
  3. 5 1
      docs/swagger.json
  4. 4 1
      docs/swagger.yaml

+ 6 - 3
controllers/order/order.go

@@ -53,7 +53,8 @@ type QueryTradePositionRsp struct {
 	GoodsCode       string  `json:"goodscode" xorm:"GOODSCODE"`                   // 商品代码
 	GoodsName       string  `json:"goodsname" xorm:"GOODSNAME"`                   // 商品名称
 	AgreeUnit       float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`                // 合约单位
-	CurrencyID      int64   `json:"currencyid"  xorm:"'CURRENCYID'"`              // 报价货币ID
+	CurrencyID      int64   `json:"currencyid"  xorm:"'CURRENCYID'"`              // 报价货币ID - goods
+	TaCurrencyid    int64   `json:"tacurrencyid"  xorm:"'TACURRENCYID'"`          // 报价货币ID - taaccount
 	GoodUnitID      int64   `json:"goodunitid"  xorm:"'GOODUNITID'"`              // 报价单位ID
 	Goodunit        string  `json:"goodunit" xorm:"'GOODUNIT'"`                   // 报价单位
 	DecimalPlace    int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`          // 报价小数位
@@ -126,7 +127,8 @@ func GetTradePosition(accIds string, tradeModes string) (rst []QueryTradePositio
 		models.Tradeposition `xorm:"extends"`
 		Goodscode            string  `json:"goodscode"  xorm:"'GOODSCODE'"`             // 商品代码(内部)
 		Goodsname            string  `json:"goodsname"  xorm:"'GOODSNAME'"`             // 商品名称
-		Currencyid           int64   `json:"currencyid"  xorm:"'CURRENCYID'"`           // 报价货币ID
+		Currencyid           int64   `json:"currencyid"  xorm:"'CURRENCYID'"`           // 报价货币ID - goods
+		TaCurrencyid         int64   `json:"tacurrencyid"  xorm:"'TACURRENCYID'"`       // 报价货币ID - taaccount
 		Goodunitid           int64   `json:"goodunitid"  xorm:"'GOODUNITID'"`           // 报价单位ID
 		Goodunit             string  `json:"goodunit" xorm:"'GOODUNIT'"`                // 报价单位
 		Agreeunit            float64 `json:"agreeunit"  xorm:"'AGREEUNIT'"`             // 合约单位
@@ -148,7 +150,8 @@ func GetTradePosition(accIds string, tradeModes string) (rst []QueryTradePositio
 		Join("LEFT", "MARKET", "GOODS.MARKETID = MARKET.MARKETID").
 		Join("LEFT", "ENUMDICITEM", "GOODS.GOODUNITID = ENUMDICITEM.ENUMITEMNAME and ENUMDICITEM.ENUMDICCODE = 'goodsunit'").
 		Join("LEFT", "USERINFO UI", "UI.USERID = GOODS.PROVIDERUSERID").
-		Select("TRADEPOSITION.*, GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.CURRENCYID, GOODS.GOODUNITID,GOODS.QTYDECIMALPLACE, GOODS.REFGOODSID, GOODS.REFGOODSCODE, " +
+		Join("LEFT", "TAACCOUNT TA", "TA.ACCOUNTID = TRADEPOSITION.ACCOUNTID").
+		Select("TRADEPOSITION.*, GOODS.GOODSCODE, GOODS.GOODSNAME, GOODS.CURRENCYID, TA.CURRENCYID TACURRENCYID, GOODS.GOODUNITID,GOODS.QTYDECIMALPLACE, GOODS.REFGOODSID, GOODS.REFGOODSCODE, " +
 			"ENUMDICITEM.ENUMDICNAME as GOODUNIT, GOODS.AGREEUNIT, GOODS.DECIMALPLACE, MARKET.MARKETID, MARKET.TRADEMODE, UI.CUSTOMERNAME as MATCHNAME, nvl(EX.MINDELIVERYLOT, 1) MINDELIVERYLOT").
 		Where(fmt.Sprintf(`TRADEPOSITION.ACCOUNTID in (%s)`, accIds))
 	if len(tradeModes) > 0 {

+ 5 - 1
docs/docs.go

@@ -64173,7 +64173,7 @@ const docTemplate = `{
                     "type": "number"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID - goods",
                     "type": "integer"
                 },
                 "curtdposition": {
@@ -64280,6 +64280,10 @@ const docTemplate = `{
                     "description": "参考商品ID",
                     "type": "integer"
                 },
+                "tacurrencyid": {
+                    "description": "报价货币ID - taaccount",
+                    "type": "integer"
+                },
                 "tnqty": {
                     "description": "T+N冻结总量",
                     "type": "number"

+ 5 - 1
docs/swagger.json

@@ -64164,7 +64164,7 @@
                     "type": "number"
                 },
                 "currencyid": {
-                    "description": "报价货币ID",
+                    "description": "报价货币ID - goods",
                     "type": "integer"
                 },
                 "curtdposition": {
@@ -64271,6 +64271,10 @@
                     "description": "参考商品ID",
                     "type": "integer"
                 },
+                "tacurrencyid": {
+                    "description": "报价货币ID - taaccount",
+                    "type": "integer"
+                },
                 "tnqty": {
                     "description": "T+N冻结总量",
                     "type": "number"

+ 4 - 1
docs/swagger.yaml

@@ -30156,7 +30156,7 @@ definitions:
         description: 当前持仓总数量
         type: number
       currencyid:
-        description: 报价货币ID
+        description: 报价货币ID - goods
         type: integer
       curtdposition:
         description: 期末今日头寸
@@ -30237,6 +30237,9 @@ definitions:
       refgoodsid:
         description: 参考商品ID
         type: integer
+      tacurrencyid:
+        description: 报价货币ID - taaccount
+        type: integer
       tnqty:
         description: T+N冻结总量
         type: number