Procházet zdrojové kódy

增加接口 /sbyj/GetMyOrders 获取我的订单列表

zhou.xiaoning před 2 roky
rodič
revize
763795de5e
9 změnil soubory, kde provedl 1429 přidání a 28 odebrání
  1. 4 4
      controllers/guangzuan/tradeService.go
  2. 43 3
      controllers/sbyj/goods.go
  3. 231 0
      docs/docs.go
  4. 231 0
      docs/swagger.json
  5. 166 0
      docs/swagger.yaml
  6. 143 0
      models/sbyj.go
  7. 557 21
      pb/mtp2.pb.go
  8. 53 0
      pb/mtp2.proto
  9. 1 0
      routers/router.go

+ 4 - 4
controllers/guangzuan/tradeService.go

@@ -18,8 +18,8 @@ import (
 // @Security Group
 // @Param    userid   query    int    true  "用户ID"
 // @Param    executestatus query    int false "执行状态 - 1:未生效 2:进行中 3:已结束"
-// @Param    page          query    int false "页码"
-// @Param    pagesize      query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200           {array}  models.GzcjjcorderM
 // @Failure  500     {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrder [get]
@@ -39,8 +39,8 @@ func QueryGZCJJCOrder(c *gin.Context) {
 // @Security Group
 // @Param    userid        query    int true  "用户ID"
 // @Param    orderid  query    string false "单据ID"
-// @Param    page     query    int    false "页码"
-// @Param    pagesize query    int    false "每页条数"
+// @Param    page          query    int false "页码"
+// @Param    pagesize      query    int false "每页条数"
 // @Success  200      {array}  models.GzcjjcorderdetailM
 // @Failure  500           {object} app.Response
 // @Router   /Guangzuan/QueryGZCJJCOrderDetail [get]

+ 43 - 3
controllers/sbyj/goods.go

@@ -12,11 +12,11 @@ import (
 
 // GetTouristGoods 获取水贝亿爵游客商品列表
 // @Summary 获取水贝亿爵游客商品列表
-// @Produce json
+// @Produce  json
 // @Success 200 {array}  models.TouristGoods
-// @Failure 500 {object} app.Response
+// @Failure  500     {object} app.Response
 // @Router  /sbyj/GetTouristGoods [get]
-// @Tags    水贝亿爵
+// @Tags     水贝亿爵
 func GetTouristGoods(c *gin.Context) {
 	appG := app.Gin{C: c}
 
@@ -32,3 +32,43 @@ func GetTouristGoods(c *gin.Context) {
 	// 查询成功返回
 	appG.Response(http.StatusOK, e.SUCCESS, goodses)
 }
+
+type GetMyOrdersReq struct {
+	GoodsId int `form:"goodsId" binding:"required"` // 商品ID
+	UserId  int `form:"userId" binding:"required"`  // 用户ID
+}
+
+// GetTouristGoods 获取我的订单列表
+// @Summary  获取我的订单列表
+// @Produce json
+// @Security ApiKeyAuth
+// @Param    goodsId query    int true "商品ID"
+// @Param    userId  query    int true "用户ID"
+// @Success  200     {array}  models.RedisTradeHolderDetailEx
+// @Failure 500 {object} app.Response
+// @Router   /sbyj/GetMyOrders [get]
+// @Tags    水贝亿爵
+func GetMyOrders(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req GetMyOrdersReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	// 获取数据
+	d := models.RedisTradeHolderDetailEx{}
+	rsp, err := d.GetDataEx(req.UserId, req.GoodsId)
+	if err != nil {
+		// 查询失败
+		logger.GetLogger().Errorf("GetMyOrders failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		return
+	}
+
+	// 查询成功返回
+	appG.Response(http.StatusOK, e.SUCCESS, rsp)
+}

+ 231 - 0
docs/docs.go

@@ -21204,6 +21204,55 @@ const docTemplate = `{
                 }
             }
         },
+        "/sbyj/GetMyOrders": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "水贝亿爵"
+                ],
+                "summary": "获取我的订单列表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsId",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.RedisTradeHolderDetailEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/sbyj/GetTouristGoods": {
             "get": {
                 "produces": [
@@ -48140,6 +48189,55 @@ const docTemplate = `{
                 }
             }
         },
+        "models.RedisTradeHolderDetailEx": {
+            "type": "object",
+            "properties": {
+                "agreeUnit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "decimalPlace": {
+                    "description": "小数位位数",
+                    "type": "integer"
+                },
+                "depositRate": {
+                    "description": "订单定金率",
+                    "type": "number"
+                },
+                "floatPL": {
+                    "description": "浮动盈亏",
+                    "type": "number"
+                },
+                "goodsCode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsName": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsUnit": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodsUnitID": {
+                    "description": "单位",
+                    "type": "integer"
+                },
+                "quoteMinUnit": {
+                    "description": "行情最小变动单位",
+                    "type": "integer"
+                },
+                "refundableDeposit": {
+                    "description": "可退定金",
+                    "type": "number"
+                },
+                "tHDetailEx": {
+                    "description": "交易持仓扩展表记录",
+                    "$ref": "#/definitions/models.TradeHolderDetailEx"
+                }
+            }
+        },
         "models.RegisterMoney": {
             "type": "object",
             "properties": {
@@ -51558,6 +51656,139 @@ const docTemplate = `{
                 }
             }
         },
+        "models.TradeHolderDetailEx": {
+            "type": "object",
+            "properties": {
+                "accountID": {
+                    "description": "账号ID",
+                    "type": "integer"
+                },
+                "buyOrSell": {
+                    "description": "方向 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "callAteFee": {
+                    "description": "已计滞纳金",
+                    "type": "number"
+                },
+                "closePL": {
+                    "description": "平仓盈亏",
+                    "type": "number"
+                },
+                "cutDepositRate": {
+                    "description": "斩仓定金率",
+                    "type": "number"
+                },
+                "cutPrice": {
+                    "description": "斩仓价格",
+                    "type": "number"
+                },
+                "deliveryQty": {
+                    "description": "交收手数(已交收)",
+                    "type": "integer"
+                },
+                "depositRate": {
+                    "description": "订单定金率",
+                    "type": "number"
+                },
+                "floatPL": {
+                    "description": "浮动盈亏",
+                    "type": "number"
+                },
+                "freezeQty": {
+                    "description": "冻结数量",
+                    "type": "integer"
+                },
+                "goodsID": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "holdDays": {
+                    "description": "持仓天数",
+                    "type": "integer"
+                },
+                "holderAmount": {
+                    "description": "持仓金额",
+                    "type": "number"
+                },
+                "holderPrice": {
+                    "description": "持仓价格",
+                    "type": "number"
+                },
+                "holderQty": {
+                    "description": "持仓数量",
+                    "type": "integer"
+                },
+                "lateFeeAlgorithm": {
+                    "description": "滞纳金收取方式 1:比率 2:固定",
+                    "type": "integer"
+                },
+                "lateFeeDays": {
+                    "description": "滞纳金起计天数",
+                    "type": "integer"
+                },
+                "lateFeeValue": {
+                    "description": "滞纳金收取值",
+                    "type": "number"
+                },
+                "marketID": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "matchAccountID": {
+                    "description": "对手账号ID",
+                    "type": "integer"
+                },
+                "matchUserID": {
+                    "description": "对手用户ID",
+                    "type": "integer"
+                },
+                "openPrice": {
+                    "description": "建仓价格",
+                    "type": "number"
+                },
+                "openQty": {
+                    "description": "建仓数量",
+                    "type": "integer"
+                },
+                "payedDeposit": {
+                    "description": "已付定金",
+                    "type": "number"
+                },
+                "promptDepositRate": {
+                    "description": "提示定金率",
+                    "type": "number"
+                },
+                "promptPrice": {
+                    "description": "提示价格",
+                    "type": "number"
+                },
+                "refundableDeposit": {
+                    "description": "可退定金",
+                    "type": "number"
+                },
+                "restockDeposit": {
+                    "description": "补充定金",
+                    "type": "number"
+                },
+                "tradeAmount": {
+                    "description": "成交金额",
+                    "type": "number"
+                },
+                "tradeDate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "tradeID": {
+                    "description": "成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "userID": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Unlinkermcphedgeplan": {
             "type": "object",
             "required": [

+ 231 - 0
docs/swagger.json

@@ -21195,6 +21195,55 @@
                 }
             }
         },
+        "/sbyj/GetMyOrders": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "水贝亿爵"
+                ],
+                "summary": "获取我的订单列表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "商品ID",
+                        "name": "goodsId",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userId",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.RedisTradeHolderDetailEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/sbyj/GetTouristGoods": {
             "get": {
                 "produces": [
@@ -48131,6 +48180,55 @@
                 }
             }
         },
+        "models.RedisTradeHolderDetailEx": {
+            "type": "object",
+            "properties": {
+                "agreeUnit": {
+                    "description": "合约单位",
+                    "type": "number"
+                },
+                "decimalPlace": {
+                    "description": "小数位位数",
+                    "type": "integer"
+                },
+                "depositRate": {
+                    "description": "订单定金率",
+                    "type": "number"
+                },
+                "floatPL": {
+                    "description": "浮动盈亏",
+                    "type": "number"
+                },
+                "goodsCode": {
+                    "description": "商品代码",
+                    "type": "string"
+                },
+                "goodsName": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsUnit": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "goodsUnitID": {
+                    "description": "单位",
+                    "type": "integer"
+                },
+                "quoteMinUnit": {
+                    "description": "行情最小变动单位",
+                    "type": "integer"
+                },
+                "refundableDeposit": {
+                    "description": "可退定金",
+                    "type": "number"
+                },
+                "tHDetailEx": {
+                    "description": "交易持仓扩展表记录",
+                    "$ref": "#/definitions/models.TradeHolderDetailEx"
+                }
+            }
+        },
         "models.RegisterMoney": {
             "type": "object",
             "properties": {
@@ -51549,6 +51647,139 @@
                 }
             }
         },
+        "models.TradeHolderDetailEx": {
+            "type": "object",
+            "properties": {
+                "accountID": {
+                    "description": "账号ID",
+                    "type": "integer"
+                },
+                "buyOrSell": {
+                    "description": "方向 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "callAteFee": {
+                    "description": "已计滞纳金",
+                    "type": "number"
+                },
+                "closePL": {
+                    "description": "平仓盈亏",
+                    "type": "number"
+                },
+                "cutDepositRate": {
+                    "description": "斩仓定金率",
+                    "type": "number"
+                },
+                "cutPrice": {
+                    "description": "斩仓价格",
+                    "type": "number"
+                },
+                "deliveryQty": {
+                    "description": "交收手数(已交收)",
+                    "type": "integer"
+                },
+                "depositRate": {
+                    "description": "订单定金率",
+                    "type": "number"
+                },
+                "floatPL": {
+                    "description": "浮动盈亏",
+                    "type": "number"
+                },
+                "freezeQty": {
+                    "description": "冻结数量",
+                    "type": "integer"
+                },
+                "goodsID": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "holdDays": {
+                    "description": "持仓天数",
+                    "type": "integer"
+                },
+                "holderAmount": {
+                    "description": "持仓金额",
+                    "type": "number"
+                },
+                "holderPrice": {
+                    "description": "持仓价格",
+                    "type": "number"
+                },
+                "holderQty": {
+                    "description": "持仓数量",
+                    "type": "integer"
+                },
+                "lateFeeAlgorithm": {
+                    "description": "滞纳金收取方式 1:比率 2:固定",
+                    "type": "integer"
+                },
+                "lateFeeDays": {
+                    "description": "滞纳金起计天数",
+                    "type": "integer"
+                },
+                "lateFeeValue": {
+                    "description": "滞纳金收取值",
+                    "type": "number"
+                },
+                "marketID": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "matchAccountID": {
+                    "description": "对手账号ID",
+                    "type": "integer"
+                },
+                "matchUserID": {
+                    "description": "对手用户ID",
+                    "type": "integer"
+                },
+                "openPrice": {
+                    "description": "建仓价格",
+                    "type": "number"
+                },
+                "openQty": {
+                    "description": "建仓数量",
+                    "type": "integer"
+                },
+                "payedDeposit": {
+                    "description": "已付定金",
+                    "type": "number"
+                },
+                "promptDepositRate": {
+                    "description": "提示定金率",
+                    "type": "number"
+                },
+                "promptPrice": {
+                    "description": "提示价格",
+                    "type": "number"
+                },
+                "refundableDeposit": {
+                    "description": "可退定金",
+                    "type": "number"
+                },
+                "restockDeposit": {
+                    "description": "补充定金",
+                    "type": "number"
+                },
+                "tradeAmount": {
+                    "description": "成交金额",
+                    "type": "number"
+                },
+                "tradeDate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "tradeID": {
+                    "description": "成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "userID": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Unlinkermcphedgeplan": {
             "type": "object",
             "required": [

+ 166 - 0
docs/swagger.yaml

@@ -20002,6 +20002,42 @@ definitions:
     required:
     - userid
     type: object
+  models.RedisTradeHolderDetailEx:
+    properties:
+      agreeUnit:
+        description: 合约单位
+        type: number
+      decimalPlace:
+        description: 小数位位数
+        type: integer
+      depositRate:
+        description: 订单定金率
+        type: number
+      floatPL:
+        description: 浮动盈亏
+        type: number
+      goodsCode:
+        description: 商品代码
+        type: string
+      goodsName:
+        description: 商品名称
+        type: string
+      goodsUnit:
+        description: 单位名称
+        type: string
+      goodsUnitID:
+        description: 单位
+        type: integer
+      quoteMinUnit:
+        description: 行情最小变动单位
+        type: integer
+      refundableDeposit:
+        description: 可退定金
+        type: number
+      tHDetailEx:
+        $ref: '#/definitions/models.TradeHolderDetailEx'
+        description: 交易持仓扩展表记录
+    type: object
   models.RegisterMoney:
     properties:
       amount:
@@ -22523,6 +22559,105 @@ definitions:
         description: 用户名称
         type: string
     type: object
+  models.TradeHolderDetailEx:
+    properties:
+      accountID:
+        description: 账号ID
+        type: integer
+      buyOrSell:
+        description: 方向 - 0:买 1:卖
+        type: integer
+      callAteFee:
+        description: 已计滞纳金
+        type: number
+      closePL:
+        description: 平仓盈亏
+        type: number
+      cutDepositRate:
+        description: 斩仓定金率
+        type: number
+      cutPrice:
+        description: 斩仓价格
+        type: number
+      deliveryQty:
+        description: 交收手数(已交收)
+        type: integer
+      depositRate:
+        description: 订单定金率
+        type: number
+      floatPL:
+        description: 浮动盈亏
+        type: number
+      freezeQty:
+        description: 冻结数量
+        type: integer
+      goodsID:
+        description: 商品ID
+        type: integer
+      holdDays:
+        description: 持仓天数
+        type: integer
+      holderAmount:
+        description: 持仓金额
+        type: number
+      holderPrice:
+        description: 持仓价格
+        type: number
+      holderQty:
+        description: 持仓数量
+        type: integer
+      lateFeeAlgorithm:
+        description: 滞纳金收取方式 1:比率 2:固定
+        type: integer
+      lateFeeDays:
+        description: 滞纳金起计天数
+        type: integer
+      lateFeeValue:
+        description: 滞纳金收取值
+        type: number
+      marketID:
+        description: 市场ID
+        type: integer
+      matchAccountID:
+        description: 对手账号ID
+        type: integer
+      matchUserID:
+        description: 对手用户ID
+        type: integer
+      openPrice:
+        description: 建仓价格
+        type: number
+      openQty:
+        description: 建仓数量
+        type: integer
+      payedDeposit:
+        description: 已付定金
+        type: number
+      promptDepositRate:
+        description: 提示定金率
+        type: number
+      promptPrice:
+        description: 提示价格
+        type: number
+      refundableDeposit:
+        description: 可退定金
+        type: number
+      restockDeposit:
+        description: 补充定金
+        type: number
+      tradeAmount:
+        description: 成交金额
+        type: number
+      tradeDate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      tradeID:
+        description: 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: integer
+      userID:
+        description: 用户ID
+        type: integer
+    type: object
   models.Unlinkermcphedgeplan:
     properties:
       accountid:
@@ -42148,6 +42283,37 @@ paths:
       summary: 获取中江出入金渠道显示列表
       tags:
       - 中江
+  /sbyj/GetMyOrders:
+    get:
+      parameters:
+      - description: 商品ID
+        in: query
+        name: goodsId
+        required: true
+        type: integer
+      - description: 用户ID
+        in: query
+        name: userId
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.RedisTradeHolderDetailEx'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取我的订单列表
+      tags:
+      - 水贝亿爵
   /sbyj/GetTouristGoods:
     get:
       produces:

+ 143 - 0
models/sbyj.go

@@ -1,8 +1,15 @@
 package models
 
 import (
+	"fmt"
 	"mtp2_if/db"
+	"mtp2_if/mtpcache"
+	"mtp2_if/pb"
+	"mtp2_if/rediscli"
+	"sort"
 	"time"
+
+	"google.golang.org/protobuf/proto"
 )
 
 type TouristGoods struct {
@@ -68,3 +75,139 @@ func GetTouristGoods(tradeModes []int) (goods []TouristGoods, err error) {
 
 	return
 }
+
+// TradeHolderDetailEx 交易持仓扩展表
+type TradeHolderDetailEx struct {
+	TradeID           uint64  `json:"tradeID"`           // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	BuyOrSell         uint32  `json:"buyOrSell"`         // 方向 - 0:买 1:卖
+	TradeDate         string  `json:"tradeDate"`         // 交易日(yyyyMMdd)
+	MarketID          uint32  `json:"marketID"`          // 市场ID
+	GoodsID           uint32  `json:"goodsID"`           // 商品ID
+	UserID            uint32  `json:"userID"`            // 用户ID
+	AccountID         uint64  `json:"accountID"`         // 账号ID
+	MatchUserID       uint32  `json:"matchUserID"`       // 对手用户ID
+	MatchAccountID    uint64  `json:"matchAccountID"`    // 对手账号ID
+	OpenQty           uint64  `json:"openQty"`           // 建仓数量
+	TradeAmount       float64 `json:"tradeAmount"`       // 成交金额
+	OpenPrice         float64 `json:"openPrice"`         // 建仓价格
+	HolderQty         uint64  `json:"holderQty"`         // 持仓数量
+	HolderAmount      float64 `json:"holderAmount"`      // 持仓金额
+	HolderPrice       float64 `json:"holderPrice"`       // 持仓价格
+	FreezeQty         uint64  `json:"freezeQty"`         // 冻结数量
+	DeliveryQty       uint64  `json:"deliveryQty"`       // 交收手数(已交收)
+	HoldDays          uint64  `json:"holdDays"`          // 持仓天数
+	PayedDeposit      float64 `json:"payedDeposit"`      // 已付定金
+	RestockDeposit    float64 `json:"restockDeposit"`    // 补充定金
+	LateFeeDays       uint64  `json:"lateFeeDays"`       // 滞纳金起计天数
+	LateFeeAlgorithm  uint32  `json:"lateFeeAlgorithm"`  // 滞纳金收取方式 1:比率 2:固定
+	LateFeeValue      float64 `json:"lateFeeValue"`      // 滞纳金收取值
+	CallAteFee        float64 `json:"callAteFee"`        // 已计滞纳金
+	PromptDepositRate float64 `json:"promptDepositRate"` // 提示定金率
+	CutDepositRate    float64 `json:"cutDepositRate"`    // 斩仓定金率
+	PromptPrice       float64 `json:"promptPrice"`       // 提示价格
+	CutPrice          float64 `json:"cutPrice"`          // 斩仓价格
+	ClosePL           float64 `json:"closePL"`           // 平仓盈亏
+	FloatPL           float64 `json:"floatPL"`           // 浮动盈亏
+	DepositRate       float64 `json:"depositRate"`       // 订单定金率
+	RefundableDeposit float64 `json:"refundableDeposit"` // 可退定金
+}
+
+// RedisTradeHolderDetailEx redis存储交易持仓扩展表
+type RedisTradeHolderDetailEx struct {
+	THDetailEx        TradeHolderDetailEx `json:"tHDetailEx"`        // 交易持仓扩展表记录
+	FloatPL           float64             `json:"floatPL"`           // 浮动盈亏
+	DepositRate       float64             `json:"depositRate"`       // 订单定金率
+	RefundableDeposit float64             `json:"refundableDeposit"` // 可退定金
+	GoodsCode         string              `json:"goodsCode"`         // 商品代码
+	GoodsName         string              `json:"goodsName"`         // 商品名称
+	GoodsUnitID       uint32              `json:"goodsUnitID"`       // 单位
+	AgreeUnit         float64             `json:"agreeUnit"`         // 合约单位
+	DecimalPlace      uint32              `json:"decimalPlace"`      // 小数位位数
+	QuoteMinUnit      uint32              `json:"quoteMinUnit"`      // 行情最小变动单位
+
+	GoodsUnit string `json:"goodsUnit"` // 单位名称
+}
+
+type RedisTradeHolderDetailExArray []RedisTradeHolderDetailEx
+
+func (s RedisTradeHolderDetailExArray) Len() int { return len(s) }
+func (s RedisTradeHolderDetailExArray) Less(i, j int) bool {
+	return s[i].THDetailEx.TradeID > s[j].THDetailEx.TradeID
+}
+func (s RedisTradeHolderDetailExArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+
+// GetDataEx 从数据库中查询数据
+func (r *RedisTradeHolderDetailEx) GetDataEx(userId int, goodsId int) (sData RedisTradeHolderDetailExArray, err error) {
+	redisCli := rediscli.GetRedisClient()
+
+	sData = make([]RedisTradeHolderDetailEx, 0)
+	key := fmt.Sprintf("TradeHolderDetailEx:%d:*:%d:*", goodsId, userId)
+	if ret, err := redisCli.Do("keys", key).Result(); err == nil {
+		datas := ret.([]interface{})
+		for _, item := range datas {
+			itemKey := item.(string)
+			if itemValue, err := redisCli.Get(itemKey).Result(); err == nil {
+				var data pb.RedisTradeHolderDetailEx
+				if err = proto.Unmarshal([]byte(itemValue), &data); err == nil {
+					m := RedisTradeHolderDetailEx{}
+					m.ParseFromProto(&data)
+					sData = append(sData, m)
+				}
+			}
+		}
+	}
+	// 按 TradeID 倒序排序
+	sort.Sort(sort.Reverse(RedisTradeHolderDetailExArray(sData)))
+
+	return sData, nil
+}
+
+func (r *RedisTradeHolderDetailEx) ParseFromProto(p *pb.RedisTradeHolderDetailEx) {
+	r.FloatPL = p.GetFloatPL()
+	r.DepositRate = p.GetDepositRate()
+	r.RefundableDeposit = p.GetRefundableDeposit()
+	r.GoodsCode = p.GetGoodsCode()
+	r.GoodsName = p.GetGoodsName()
+	r.GoodsUnitID = p.GetGoodsUnitID()
+	r.AgreeUnit = p.GetAgreeUnit()
+	r.DecimalPlace = p.GetDecimalPlace()
+	r.QuoteMinUnit = p.GetQuoteMinUnit()
+
+	r.THDetailEx = TradeHolderDetailEx{
+		TradeID:           p.GetTHDetailEx().GetTradeID(),
+		BuyOrSell:         p.GetTHDetailEx().GetBuyOrSell(),
+		TradeDate:         p.GetTHDetailEx().GetTradeDate(),
+		MarketID:          p.GetTHDetailEx().GetMarketID(),
+		GoodsID:           p.GetTHDetailEx().GetGoodsID(),
+		UserID:            p.GetTHDetailEx().GetUserID(),
+		AccountID:         p.GetTHDetailEx().GetAccountID(),
+		MatchUserID:       p.GetTHDetailEx().GetMatchUserID(),
+		MatchAccountID:    p.GetTHDetailEx().GetMatchAccountID(),
+		OpenQty:           p.GetTHDetailEx().GetOpenQty(),
+		TradeAmount:       p.GetTHDetailEx().GetTradeAmount(),
+		OpenPrice:         p.GetTHDetailEx().GetOpenPrice(),
+		HolderQty:         p.GetTHDetailEx().GetHolderQty(),
+		HolderAmount:      p.GetTHDetailEx().GetHolderAmount(),
+		HolderPrice:       p.GetTHDetailEx().GetHolderPrice(),
+		FreezeQty:         p.GetTHDetailEx().GetFreezeQty(),
+		DeliveryQty:       p.GetTHDetailEx().GetDeliveryQty(),
+		HoldDays:          p.GetTHDetailEx().GetHoldDays(),
+		PayedDeposit:      p.GetTHDetailEx().GetPayedDeposit(),
+		RestockDeposit:    p.GetTHDetailEx().GetRestockDeposit(),
+		LateFeeDays:       p.GetTHDetailEx().GetLateFeeDays(),
+		LateFeeAlgorithm:  p.GetTHDetailEx().GetLateFeeAlgorithm(),
+		LateFeeValue:      p.GetTHDetailEx().GetLateFeeValue(),
+		CallAteFee:        p.GetTHDetailEx().GetCallAteFee(),
+		PromptDepositRate: p.GetTHDetailEx().GetPromptDepositRate(),
+		CutDepositRate:    p.GetTHDetailEx().GetCutDepositRate(),
+		PromptPrice:       p.GetTHDetailEx().GetPromptPrice(),
+		CutPrice:          p.GetTHDetailEx().GetCutPrice(),
+		ClosePL:           p.GetTHDetailEx().GetClosePL(),
+		FloatPL:           p.GetTHDetailEx().GetFloatPL(),
+		DepositRate:       p.GetTHDetailEx().GetDepositRate(),
+		RefundableDeposit: p.GetTHDetailEx().GetRefundableDeposit(),
+	}
+
+	// 单位
+	r.GoodsUnit = mtpcache.GetEnumDicitemName(int32(r.GoodsUnitID))
+}

+ 557 - 21
pb/mtp2.pb.go

@@ -2056,6 +2056,423 @@ func (x *Ermcp2AreaExposure) GetGoodsUnitID() uint32 {
 	return 0
 }
 
+// TRADE_HOLDERDETAILEX 交易持仓扩展表
+type TradeHolderDetailEx struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	//mkey: 1 2
+	TradeID           *uint64  `protobuf:"varint,1,opt,name=TradeID" json:"TradeID,omitempty"`                       // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	BuyOrSell         *uint32  `protobuf:"varint,2,opt,name=BuyOrSell" json:"BuyOrSell,omitempty"`                   // 方向 - 0:买 1:卖
+	TradeDate         *string  `protobuf:"bytes,3,opt,name=TradeDate" json:"TradeDate,omitempty"`                    // 交易日(yyyyMMdd)
+	MarketID          *uint32  `protobuf:"varint,4,opt,name=MarketID" json:"MarketID,omitempty"`                     // 市场ID
+	GoodsID           *uint32  `protobuf:"varint,5,opt,name=GoodsID" json:"GoodsID,omitempty"`                       // 商品ID
+	UserID            *uint32  `protobuf:"varint,6,opt,name=UserID" json:"UserID,omitempty"`                         // 用户ID
+	AccountID         *uint64  `protobuf:"varint,7,opt,name=AccountID" json:"AccountID,omitempty"`                   // 账号ID
+	MatchUserID       *uint32  `protobuf:"varint,8,opt,name=MatchUserID" json:"MatchUserID,omitempty"`               // 对手用户ID
+	MatchAccountID    *uint64  `protobuf:"varint,9,opt,name=MatchAccountID" json:"MatchAccountID,omitempty"`         // 对手账号ID
+	OpenQty           *uint64  `protobuf:"varint,10,opt,name=OpenQty" json:"OpenQty,omitempty"`                      // 建仓数量
+	TradeAmount       *float64 `protobuf:"fixed64,11,opt,name=TradeAmount" json:"TradeAmount,omitempty"`             // 成交金额
+	OpenPrice         *float64 `protobuf:"fixed64,12,opt,name=OpenPrice" json:"OpenPrice,omitempty"`                 // 建仓价格
+	HolderQty         *uint64  `protobuf:"varint,13,opt,name=HolderQty" json:"HolderQty,omitempty"`                  // 持仓数量
+	HolderAmount      *float64 `protobuf:"fixed64,14,opt,name=HolderAmount" json:"HolderAmount,omitempty"`           // 持仓金额
+	HolderPrice       *float64 `protobuf:"fixed64,15,opt,name=HolderPrice" json:"HolderPrice,omitempty"`             // 持仓价格
+	FreezeQty         *uint64  `protobuf:"varint,16,opt,name=FreezeQty" json:"FreezeQty,omitempty"`                  // 冻结数量
+	DeliveryQty       *uint64  `protobuf:"varint,17,opt,name=DeliveryQty" json:"DeliveryQty,omitempty"`              // 交收手数(已交收)
+	HoldDays          *uint64  `protobuf:"varint,18,opt,name=HoldDays" json:"HoldDays,omitempty"`                    // 持仓天数
+	PayedDeposit      *float64 `protobuf:"fixed64,19,opt,name=PayedDeposit" json:"PayedDeposit,omitempty"`           // 已付定金
+	RestockDeposit    *float64 `protobuf:"fixed64,20,opt,name=RestockDeposit" json:"RestockDeposit,omitempty"`       // 补充定金
+	LateFeeDays       *uint64  `protobuf:"varint,21,opt,name=LateFeeDays" json:"LateFeeDays,omitempty"`              // 滞纳金起计天数
+	LateFeeAlgorithm  *uint32  `protobuf:"varint,22,opt,name=LateFeeAlgorithm" json:"LateFeeAlgorithm,omitempty"`    // 滞纳金收取方式 1:比率  2:固定
+	LateFeeValue      *float64 `protobuf:"fixed64,23,opt,name=LateFeeValue" json:"LateFeeValue,omitempty"`           // 滞纳金收取值
+	CallAteFee        *float64 `protobuf:"fixed64,24,opt,name=CallAteFee" json:"CallAteFee,omitempty"`               // 已计滞纳金
+	PromptDepositRate *float64 `protobuf:"fixed64,25,opt,name=PromptDepositRate" json:"PromptDepositRate,omitempty"` // 提示定金率
+	CutDepositRate    *float64 `protobuf:"fixed64,26,opt,name=CutDepositRate" json:"CutDepositRate,omitempty"`       // 斩仓定金率
+	PromptPrice       *float64 `protobuf:"fixed64,27,opt,name=PromptPrice" json:"PromptPrice,omitempty"`             // 提示价格
+	CutPrice          *float64 `protobuf:"fixed64,28,opt,name=CutPrice" json:"CutPrice,omitempty"`                   // 斩仓价格
+	ClosePL           *float64 `protobuf:"fixed64,29,opt,name=ClosePL" json:"ClosePL,omitempty"`                     // 平仓盈亏
+	FloatPL           *float64 `protobuf:"fixed64,30,opt,name=FloatPL" json:"FloatPL,omitempty"`                     // 浮动盈亏
+	DepositRate       *float64 `protobuf:"fixed64,31,opt,name=DepositRate" json:"DepositRate,omitempty"`             // 订单定金率
+	RefundableDeposit *float64 `protobuf:"fixed64,32,opt,name=RefundableDeposit" json:"RefundableDeposit,omitempty"` // 可退定金
+}
+
+func (x *TradeHolderDetailEx) Reset() {
+	*x = TradeHolderDetailEx{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[13]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TradeHolderDetailEx) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TradeHolderDetailEx) ProtoMessage() {}
+
+func (x *TradeHolderDetailEx) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[13]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use TradeHolderDetailEx.ProtoReflect.Descriptor instead.
+func (*TradeHolderDetailEx) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *TradeHolderDetailEx) GetTradeID() uint64 {
+	if x != nil && x.TradeID != nil {
+		return *x.TradeID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetBuyOrSell() uint32 {
+	if x != nil && x.BuyOrSell != nil {
+		return *x.BuyOrSell
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetTradeDate() string {
+	if x != nil && x.TradeDate != nil {
+		return *x.TradeDate
+	}
+	return ""
+}
+
+func (x *TradeHolderDetailEx) GetMarketID() uint32 {
+	if x != nil && x.MarketID != nil {
+		return *x.MarketID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetGoodsID() uint32 {
+	if x != nil && x.GoodsID != nil {
+		return *x.GoodsID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetUserID() uint32 {
+	if x != nil && x.UserID != nil {
+		return *x.UserID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetAccountID() uint64 {
+	if x != nil && x.AccountID != nil {
+		return *x.AccountID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetMatchUserID() uint32 {
+	if x != nil && x.MatchUserID != nil {
+		return *x.MatchUserID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetMatchAccountID() uint64 {
+	if x != nil && x.MatchAccountID != nil {
+		return *x.MatchAccountID
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetOpenQty() uint64 {
+	if x != nil && x.OpenQty != nil {
+		return *x.OpenQty
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetTradeAmount() float64 {
+	if x != nil && x.TradeAmount != nil {
+		return *x.TradeAmount
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetOpenPrice() float64 {
+	if x != nil && x.OpenPrice != nil {
+		return *x.OpenPrice
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetHolderQty() uint64 {
+	if x != nil && x.HolderQty != nil {
+		return *x.HolderQty
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetHolderAmount() float64 {
+	if x != nil && x.HolderAmount != nil {
+		return *x.HolderAmount
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetHolderPrice() float64 {
+	if x != nil && x.HolderPrice != nil {
+		return *x.HolderPrice
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetFreezeQty() uint64 {
+	if x != nil && x.FreezeQty != nil {
+		return *x.FreezeQty
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetDeliveryQty() uint64 {
+	if x != nil && x.DeliveryQty != nil {
+		return *x.DeliveryQty
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetHoldDays() uint64 {
+	if x != nil && x.HoldDays != nil {
+		return *x.HoldDays
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetPayedDeposit() float64 {
+	if x != nil && x.PayedDeposit != nil {
+		return *x.PayedDeposit
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetRestockDeposit() float64 {
+	if x != nil && x.RestockDeposit != nil {
+		return *x.RestockDeposit
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetLateFeeDays() uint64 {
+	if x != nil && x.LateFeeDays != nil {
+		return *x.LateFeeDays
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetLateFeeAlgorithm() uint32 {
+	if x != nil && x.LateFeeAlgorithm != nil {
+		return *x.LateFeeAlgorithm
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetLateFeeValue() float64 {
+	if x != nil && x.LateFeeValue != nil {
+		return *x.LateFeeValue
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetCallAteFee() float64 {
+	if x != nil && x.CallAteFee != nil {
+		return *x.CallAteFee
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetPromptDepositRate() float64 {
+	if x != nil && x.PromptDepositRate != nil {
+		return *x.PromptDepositRate
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetCutDepositRate() float64 {
+	if x != nil && x.CutDepositRate != nil {
+		return *x.CutDepositRate
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetPromptPrice() float64 {
+	if x != nil && x.PromptPrice != nil {
+		return *x.PromptPrice
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetCutPrice() float64 {
+	if x != nil && x.CutPrice != nil {
+		return *x.CutPrice
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetClosePL() float64 {
+	if x != nil && x.ClosePL != nil {
+		return *x.ClosePL
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetFloatPL() float64 {
+	if x != nil && x.FloatPL != nil {
+		return *x.FloatPL
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetDepositRate() float64 {
+	if x != nil && x.DepositRate != nil {
+		return *x.DepositRate
+	}
+	return 0
+}
+
+func (x *TradeHolderDetailEx) GetRefundableDeposit() float64 {
+	if x != nil && x.RefundableDeposit != nil {
+		return *x.RefundableDeposit
+	}
+	return 0
+}
+
+// RedisTradeHolderDetailEx redis存储交易持仓扩展表
+type RedisTradeHolderDetailEx struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	THDetailEx        *TradeHolderDetailEx `protobuf:"bytes,1,opt,name=THDetailEx" json:"THDetailEx,omitempty"`                 // 交易持仓扩展表记录
+	FloatPL           *float64             `protobuf:"fixed64,2,opt,name=FloatPL" json:"FloatPL,omitempty"`                     // 浮动盈亏
+	DepositRate       *float64             `protobuf:"fixed64,3,opt,name=DepositRate" json:"DepositRate,omitempty"`             // 订单定金率
+	RefundableDeposit *float64             `protobuf:"fixed64,4,opt,name=RefundableDeposit" json:"RefundableDeposit,omitempty"` // 可退定金
+	GoodsCode         *string              `protobuf:"bytes,5,opt,name=GoodsCode" json:"GoodsCode,omitempty"`                   //商品代码
+	GoodsName         *string              `protobuf:"bytes,6,opt,name=GoodsName" json:"GoodsName,omitempty"`                   //商品名称
+	GoodsUnitID       *uint32              `protobuf:"varint,7,opt,name=GoodsUnitID" json:"GoodsUnitID,omitempty"`              //单位
+	AgreeUnit         *float64             `protobuf:"fixed64,8,opt,name=AgreeUnit" json:"AgreeUnit,omitempty"`                 //合约单位
+	DecimalPlace      *uint32              `protobuf:"varint,9,opt,name=DecimalPlace" json:"DecimalPlace,omitempty"`            //小数位位数
+	QuoteMinUnit      *uint32              `protobuf:"varint,10,opt,name=QuoteMinUnit" json:"QuoteMinUnit,omitempty"`           //行情最小变动单位
+}
+
+func (x *RedisTradeHolderDetailEx) Reset() {
+	*x = RedisTradeHolderDetailEx{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[14]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *RedisTradeHolderDetailEx) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RedisTradeHolderDetailEx) ProtoMessage() {}
+
+func (x *RedisTradeHolderDetailEx) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[14]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use RedisTradeHolderDetailEx.ProtoReflect.Descriptor instead.
+func (*RedisTradeHolderDetailEx) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *RedisTradeHolderDetailEx) GetTHDetailEx() *TradeHolderDetailEx {
+	if x != nil {
+		return x.THDetailEx
+	}
+	return nil
+}
+
+func (x *RedisTradeHolderDetailEx) GetFloatPL() float64 {
+	if x != nil && x.FloatPL != nil {
+		return *x.FloatPL
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetDepositRate() float64 {
+	if x != nil && x.DepositRate != nil {
+		return *x.DepositRate
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetRefundableDeposit() float64 {
+	if x != nil && x.RefundableDeposit != nil {
+		return *x.RefundableDeposit
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetGoodsCode() string {
+	if x != nil && x.GoodsCode != nil {
+		return *x.GoodsCode
+	}
+	return ""
+}
+
+func (x *RedisTradeHolderDetailEx) GetGoodsName() string {
+	if x != nil && x.GoodsName != nil {
+		return *x.GoodsName
+	}
+	return ""
+}
+
+func (x *RedisTradeHolderDetailEx) GetGoodsUnitID() uint32 {
+	if x != nil && x.GoodsUnitID != nil {
+		return *x.GoodsUnitID
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetAgreeUnit() float64 {
+	if x != nil && x.AgreeUnit != nil {
+		return *x.AgreeUnit
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetDecimalPlace() uint32 {
+	if x != nil && x.DecimalPlace != nil {
+		return *x.DecimalPlace
+	}
+	return 0
+}
+
+func (x *RedisTradeHolderDetailEx) GetQuoteMinUnit() uint32 {
+	if x != nil && x.QuoteMinUnit != nil {
+		return *x.QuoteMinUnit
+	}
+	return 0
+}
+
 var File_mtp2_proto protoreflect.FileDescriptor
 
 var file_mtp2_proto_rawDesc = []byte{
@@ -2506,7 +2923,99 @@ var file_mtp2_proto_rawDesc = []byte{
 	0x61, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4d, 0x69, 0x64, 0x64, 0x6c,
 	0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x47, 0x6f,
 	0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0d, 0x52,
-	0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44,
+	0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x22, 0xb1, 0x08, 0x0a,
+	0x13, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
+	0x69, 0x6c, 0x45, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x64, 0x65, 0x49, 0x44, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x54, 0x72, 0x61, 0x64, 0x65, 0x49, 0x44, 0x12, 0x1c,
+	0x0a, 0x09, 0x42, 0x75, 0x79, 0x4f, 0x72, 0x53, 0x65, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x09, 0x42, 0x75, 0x79, 0x4f, 0x72, 0x53, 0x65, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09,
+	0x54, 0x72, 0x61, 0x64, 0x65, 0x44, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x54, 0x72, 0x61, 0x64, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61,
+	0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x4d, 0x61,
+	0x72, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49,
+	0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x44,
+	0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d,
+	0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x63, 0x63, 0x6f,
+	0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x41, 0x63, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x55,
+	0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x4d, 0x61, 0x74,
+	0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63,
+	0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04,
+	0x52, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44,
+	0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x51, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x51, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x54, 0x72,
+	0x61, 0x64, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52,
+	0x0b, 0x54, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09,
+	0x4f, 0x70, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52,
+	0x09, 0x4f, 0x70, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x48, 0x6f,
+	0x6c, 0x64, 0x65, 0x72, 0x51, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x48,
+	0x6f, 0x6c, 0x64, 0x65, 0x72, 0x51, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x48, 0x6f, 0x6c, 0x64,
+	0x65, 0x72, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c,
+	0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b,
+	0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28,
+	0x01, 0x52, 0x0b, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c,
+	0x0a, 0x09, 0x46, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x51, 0x74, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x09, 0x46, 0x72, 0x65, 0x65, 0x7a, 0x65, 0x51, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b,
+	0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x51, 0x74, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28,
+	0x04, 0x52, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x51, 0x74, 0x79, 0x12, 0x1a,
+	0x0a, 0x08, 0x48, 0x6f, 0x6c, 0x64, 0x44, 0x61, 0x79, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x04,
+	0x52, 0x08, 0x48, 0x6f, 0x6c, 0x64, 0x44, 0x61, 0x79, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x61,
+	0x79, 0x65, 0x64, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x01,
+	0x52, 0x0c, 0x50, 0x61, 0x79, 0x65, 0x64, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x26,
+	0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
+	0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x44,
+	0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x4c, 0x61, 0x74, 0x65, 0x46, 0x65,
+	0x65, 0x44, 0x61, 0x79, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x4c, 0x61, 0x74,
+	0x65, 0x46, 0x65, 0x65, 0x44, 0x61, 0x79, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x4c, 0x61, 0x74, 0x65,
+	0x46, 0x65, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x16, 0x20, 0x01,
+	0x28, 0x0d, 0x52, 0x10, 0x4c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72,
+	0x69, 0x74, 0x68, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x4c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x56,
+	0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x4c, 0x61, 0x74, 0x65,
+	0x46, 0x65, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x61, 0x6c, 0x6c,
+	0x41, 0x74, 0x65, 0x46, 0x65, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x43, 0x61,
+	0x6c, 0x6c, 0x41, 0x74, 0x65, 0x46, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x6d,
+	0x70, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18, 0x19, 0x20,
+	0x01, 0x28, 0x01, 0x52, 0x11, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73,
+	0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x43, 0x75, 0x74, 0x44, 0x65, 0x70,
+	0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e,
+	0x43, 0x75, 0x74, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x20,
+	0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x1b, 0x20,
+	0x01, 0x28, 0x01, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65,
+	0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x1c, 0x20, 0x01,
+	0x28, 0x01, 0x52, 0x08, 0x43, 0x75, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07,
+	0x43, 0x6c, 0x6f, 0x73, 0x65, 0x50, 0x4c, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x43,
+	0x6c, 0x6f, 0x73, 0x65, 0x50, 0x4c, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50,
+	0x4c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50, 0x4c,
+	0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18,
+	0x1f, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61,
+	0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65,
+	0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x52,
+	0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
+	0x22, 0x81, 0x03, 0x0a, 0x18, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48,
+	0x6f, 0x6c, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x37, 0x0a,
+	0x0a, 0x54, 0x48, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x48, 0x6f, 0x6c, 0x64,
+	0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x52, 0x0a, 0x54, 0x48, 0x44, 0x65,
+	0x74, 0x61, 0x69, 0x6c, 0x45, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50,
+	0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x50, 0x4c,
+	0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x65, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61,
+	0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65,
+	0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x52,
+	0x65, 0x66, 0x75, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
+	0x12, 0x1c, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c,
+	0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b,
+	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x0d, 0x52, 0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x44, 0x12, 0x1c,
+	0x0a, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
+	0x01, 0x52, 0x09, 0x41, 0x67, 0x72, 0x65, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c,
+	0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01,
+	0x28, 0x0d, 0x52, 0x0c, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x63, 0x65,
+	0x12, 0x22, 0x0a, 0x0c, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x4d, 0x69, 0x6e, 0x55, 0x6e, 0x69, 0x74,
+	0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x4d, 0x69, 0x6e,
+	0x55, 0x6e, 0x69, 0x74,
 }
 
 var (
@@ -2521,21 +3030,23 @@ func file_mtp2_proto_rawDescGZIP() []byte {
 	return file_mtp2_proto_rawDescData
 }
 
-var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
+var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
 var file_mtp2_proto_goTypes = []interface{}{
-	(*TradeRule)(nil),              // 0: pb.TradeRule
-	(*TradeRuleInfoStruct)(nil),    // 1: pb.TradeRuleInfoStruct
-	(*Date)(nil),                   // 2: pb.Date
-	(*Erms2ArbitrageStrategy)(nil), // 3: pb.Erms2ArbitrageStrategy
-	(*ErmcpAreaSpot)(nil),          // 4: pb.ErmcpAreaSpot
-	(*ErmcpAreaExposure)(nil),      // 5: pb.ErmcpAreaExposure
-	(*GoodsMarginCfgStruct)(nil),   // 6: pb.GoodsMarginCfgStruct
-	(*Ermcp2HedgedItem)(nil),       // 7: pb.Ermcp2HedgedItem
-	(*Ermcp2HedgedItemExt)(nil),    // 8: pb.Ermcp2HedgedItemExt
-	(*Ermcp2HIMiddleGoods)(nil),    // 9: pb.Ermcp2HIMiddleGoods
-	(*Ermcp2HIMiddleGoodsExt)(nil), // 10: pb.Ermcp2HIMiddleGoodsExt
-	(*Ermcp2HedgedItemInfo)(nil),   // 11: pb.Ermcp2HedgedItemInfo
-	(*Ermcp2AreaExposure)(nil),     // 12: pb.Ermcp2AreaExposure
+	(*TradeRule)(nil),                // 0: pb.TradeRule
+	(*TradeRuleInfoStruct)(nil),      // 1: pb.TradeRuleInfoStruct
+	(*Date)(nil),                     // 2: pb.Date
+	(*Erms2ArbitrageStrategy)(nil),   // 3: pb.Erms2ArbitrageStrategy
+	(*ErmcpAreaSpot)(nil),            // 4: pb.ErmcpAreaSpot
+	(*ErmcpAreaExposure)(nil),        // 5: pb.ErmcpAreaExposure
+	(*GoodsMarginCfgStruct)(nil),     // 6: pb.GoodsMarginCfgStruct
+	(*Ermcp2HedgedItem)(nil),         // 7: pb.Ermcp2HedgedItem
+	(*Ermcp2HedgedItemExt)(nil),      // 8: pb.Ermcp2HedgedItemExt
+	(*Ermcp2HIMiddleGoods)(nil),      // 9: pb.Ermcp2HIMiddleGoods
+	(*Ermcp2HIMiddleGoodsExt)(nil),   // 10: pb.Ermcp2HIMiddleGoodsExt
+	(*Ermcp2HedgedItemInfo)(nil),     // 11: pb.Ermcp2HedgedItemInfo
+	(*Ermcp2AreaExposure)(nil),       // 12: pb.Ermcp2AreaExposure
+	(*TradeHolderDetailEx)(nil),      // 13: pb.TradeHolderDetailEx
+	(*RedisTradeHolderDetailEx)(nil), // 14: pb.RedisTradeHolderDetailEx
 }
 var file_mtp2_proto_depIdxs = []int32{
 	0,  // 0: pb.TradeRuleInfoStruct.TradeRules:type_name -> pb.TradeRule
@@ -2554,11 +3065,12 @@ var file_mtp2_proto_depIdxs = []int32{
 	8,  // 13: pb.Ermcp2HedgedItemInfo.hedgeditemext:type_name -> pb.Ermcp2HedgedItemExt
 	10, // 14: pb.Ermcp2HedgedItemInfo.himiddlegoodsext:type_name -> pb.Ermcp2HIMiddleGoodsExt
 	2,  // 15: pb.Ermcp2AreaExposure.UpdateTime:type_name -> pb.Date
-	16, // [16:16] is the sub-list for method output_type
-	16, // [16:16] is the sub-list for method input_type
-	16, // [16:16] is the sub-list for extension type_name
-	16, // [16:16] is the sub-list for extension extendee
-	0,  // [0:16] is the sub-list for field type_name
+	13, // 16: pb.RedisTradeHolderDetailEx.THDetailEx:type_name -> pb.TradeHolderDetailEx
+	17, // [17:17] is the sub-list for method output_type
+	17, // [17:17] is the sub-list for method input_type
+	17, // [17:17] is the sub-list for extension type_name
+	17, // [17:17] is the sub-list for extension extendee
+	0,  // [0:17] is the sub-list for field type_name
 }
 
 func init() { file_mtp2_proto_init() }
@@ -2723,6 +3235,30 @@ func file_mtp2_proto_init() {
 				return nil
 			}
 		}
+		file_mtp2_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TradeHolderDetailEx); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_mtp2_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*RedisTradeHolderDetailEx); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -2730,7 +3266,7 @@ func file_mtp2_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_mtp2_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   13,
+			NumMessages:   15,
 			NumExtensions: 0,
 			NumServices:   0,
 		},

+ 53 - 0
pb/mtp2.proto

@@ -257,4 +257,57 @@ message Ermcp2AreaExposure
   optional Date   UpdateTime = 21;    // 更新时间  --DATE
   optional string MiddleGoodsName = 22; //套保品种名称
   optional uint32 GoodsUnitID = 23;  //单位ID
+}
+
+// TRADE_HOLDERDETAILEX 交易持仓扩展表
+message TradeHolderDetailEx
+{
+  //mkey: 1 2
+  optional uint64 TradeID = 1;    // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+  optional uint32 BuyOrSell = 2;    // 方向 - 0:买 1:卖
+  optional string TradeDate = 3;    // 交易日(yyyyMMdd)
+  optional uint32 MarketID = 4;    // 市场ID
+  optional uint32 GoodsID = 5;    // 商品ID
+  optional uint32 UserID = 6;    // 用户ID
+  optional uint64 AccountID = 7;    // 账号ID
+  optional uint32 MatchUserID = 8;    // 对手用户ID
+  optional uint64 MatchAccountID = 9;    // 对手账号ID
+  optional uint64 OpenQty = 10;    // 建仓数量
+  optional double TradeAmount = 11;    // 成交金额
+  optional double OpenPrice = 12;    // 建仓价格
+  optional uint64 HolderQty = 13;    // 持仓数量
+  optional double HolderAmount = 14;    // 持仓金额
+  optional double HolderPrice = 15;    // 持仓价格
+  optional uint64 FreezeQty = 16;    // 冻结数量
+  optional uint64 DeliveryQty = 17;    // 交收手数(已交收)
+  optional uint64 HoldDays = 18;    // 持仓天数
+  optional double PayedDeposit = 19;    // 已付定金
+  optional double RestockDeposit = 20;    // 补充定金
+  optional uint64 LateFeeDays = 21;    // 滞纳金起计天数
+  optional uint32 LateFeeAlgorithm = 22;    // 滞纳金收取方式 1:比率  2:固定
+  optional double LateFeeValue = 23;    // 滞纳金收取值
+  optional double CallAteFee = 24;    // 已计滞纳金
+  optional double PromptDepositRate = 25;    // 提示定金率
+  optional double CutDepositRate = 26;    // 斩仓定金率
+  optional double PromptPrice = 27;    // 提示价格
+  optional double CutPrice = 28;    // 斩仓价格
+  optional double ClosePL = 29;    // 平仓盈亏
+  optional double FloatPL = 30;    // 浮动盈亏
+  optional double DepositRate = 31;    // 订单定金率
+  optional double RefundableDeposit = 32;    // 可退定金
+}
+
+// RedisTradeHolderDetailEx redis存储交易持仓扩展表
+message RedisTradeHolderDetailEx
+{  
+  optional TradeHolderDetailEx THDetailEx = 1;    // 交易持仓扩展表记录
+  optional double FloatPL = 2;    // 浮动盈亏
+  optional double DepositRate = 3;    // 订单定金率 
+  optional double RefundableDeposit = 4;    // 可退定金  
+  optional string GoodsCode = 5;  //商品代码
+  optional string GoodsName = 6;  //商品名称
+  optional uint32 GoodsUnitID = 7; //单位
+  optional double AgreeUnit = 8; //合约单位
+  optional uint32 DecimalPlace = 9; //小数位位数
+  optional uint32 QuoteMinUnit = 10; //行情最小变动单位
 }

+ 1 - 0
routers/router.go

@@ -783,6 +783,7 @@ func InitRouter() *gin.Engine {
 	sbyjR.Use()
 	{
 		sbyjR.Use().GET("GetTouristGoods", sbyj.GetTouristGoods)
+		sbyjR.Use(token.Auth()).GET("GetMyOrders", sbyj.GetMyOrders)
 	}
 
 	return r