Procházet zdrojové kódy

查企业风管持仓汇总 增加外部交易所id字段

zou.yingbin před 4 roky
rodič
revize
b47a39385a
4 změnil soubory, kde provedl 26 přidání a 0 odebrání
  1. 4 0
      controllers/ermcp/qryOrder.go
  2. 8 0
      docs/docs.go
  3. 8 0
      docs/swagger.json
  4. 6 0
      docs/swagger.yaml

+ 4 - 0
controllers/ermcp/qryOrder.go

@@ -33,6 +33,8 @@ type QueryErmcpTradePositionRsp struct {
 	OpenPL               float64 `json:"openpl"`               // 逐笔浮盈【实时行情更新】(MTP:开仓盈亏、平仓盈亏) 买方向 = (最新价 - 开仓均价) * 买期末头寸 * 合约单位;卖方向 = (开仓均价 - 最新价) * 卖期末头寸 * 合约单位
 	PositionPLRate       float64 `json:"positionplrate"`       // 持仓盈亏比例【实时行情更新】 = 持仓盈亏 / 开仓成本
 	UsedMargin           float64 `json:"usedmargin"`           // 占用保证金
+	ExExehangeID         uint64  `json:"exexehangeid"`         // 外部交易所id
+	ExExehangeCode       string  `json:"exexehangecode"`       // 外部交易所代码
 	ExExehangeName       string  `json:"exexchangename"`       // 外部交易所名称
 	OpenCost             float64 `json:"opencost"`             // 开仓成本
 	PositionCost         float64 `json:"positioncost"`         // 持仓成本
@@ -334,6 +336,8 @@ func QueryErmcpTradePosition(c *gin.Context) {
 					appG.Response(http.StatusBadRequest, e.ERROR_GET_EXEXCHANGE_FAILED, nil)
 					return
 				}
+				item.ExExehangeID = exchange.Autoid
+				item.ExExehangeCode = exchange.Exexchangecode
 				item.ExExehangeName = exchange.Exchangefullname
 				// 获取对应商品盘面信息
 				quoteDays, err := models.GetQuoteDays("'" + goods.Outgoodscode + "'")

+ 8 - 0
docs/docs.go

@@ -17018,6 +17018,14 @@ var doc = `{
                     "description": "外部交易所名称",
                     "type": "string"
                 },
+                "exexehangecode": {
+                    "description": "外部交易所代码",
+                    "type": "string"
+                },
+                "exexehangeid": {
+                    "description": "外部交易所id",
+                    "type": "integer"
+                },
                 "goodscode": {
                     "description": "商品代码(内部)",
                     "type": "string"

+ 8 - 0
docs/swagger.json

@@ -17002,6 +17002,14 @@
                     "description": "外部交易所名称",
                     "type": "string"
                 },
+                "exexehangecode": {
+                    "description": "外部交易所代码",
+                    "type": "string"
+                },
+                "exexehangeid": {
+                    "description": "外部交易所id",
+                    "type": "integer"
+                },
                 "goodscode": {
                     "description": "商品代码(内部)",
                     "type": "string"

+ 6 - 0
docs/swagger.yaml

@@ -2119,6 +2119,12 @@ definitions:
       exexchangename:
         description: 外部交易所名称
         type: string
+      exexehangecode:
+        description: 外部交易所代码
+        type: string
+      exexehangeid:
+        description: 外部交易所id
+        type: integer
       goodscode:
         description: 商品代码(内部)
         type: string