Quellcode durchsuchen

修改“持仓汇总查询请求参数(合约市场)”返回参数

Simon Zhou vor 5 Jahren
Ursprung
Commit
da0181f155
9 geänderte Dateien mit 200 neuen und 100 gelöschten Zeilen
  1. 2 2
      config/config.xml
  2. 27 26
      controllers/order/order.go
  3. 9 2
      controllers/szdz/szdz.go
  4. 28 1
      docs/docs.go
  5. 28 1
      docs/swagger.json
  6. 20 1
      docs/swagger.yaml
  7. 7 0
      global/app/request.go
  8. 14 2
      global/app/response.go
  9. 65 65
      models/orderModels.go

+ 2 - 2
config/config.xml

@@ -16,12 +16,12 @@
         <DbAddress value="192.168.31.117"/>
         <DbName    value="orcl"/>
         <DbPort    value="1521"/>
-        <DbUser    value="mtp2_test82"/>
+        <DbUser    value="mtp2_test181"/>
         <DbPwd     value="muchinfo"/>
     </DbSetting>
 
     <RedisSetting>
-        <Address   value="192.168.30.182"/>
+        <Address   value="192.168.31.181"/>
         <Port      value="5007"/>
         <Timeout   value="3"/>
         <ConnNum   value="1"/>

+ 27 - 26
controllers/order/order.go

@@ -24,32 +24,33 @@ type QueryTradePositionReq struct {
 
 // QueryTradePositionRsp 持仓汇总查询返回模型(合约市场)
 type QueryTradePositionRsp struct {
-	AccountID       uint64  `json:"accountid"  xorm:"'ACCOUNTID'"`             // 资金账户
-	BuyOrSell       int64   `json:"buyorsell"  xorm:"'BUYORSELL'" `            // 方向 - 0:买 1:卖
-	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
-	GoodUnitID      int64   `json:"goodunitid"  xorm:"'GOODUNITID'"`           // 报价单位ID
-	Goodunit        string  `json:"goodunit" xorm:"'GOODUNIT'"`                // 报价单位
-	DecimalPlace    int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`       // 报价小数位
-	MarketID        int64   `json:"marketid"  xorm:"'MARKETID'"`               // 所属市场ID
-	TradeMode       uint32  `json:"trademode"  xorm:"'TRADEMODE'"`             // 交易模式
-	PositionQTY     uint64  `json:"positionqty"  xorm:"'POSITIONQTY'"`         // 期初持仓数量
-	HolderAmount    float64 `json:"holderamount"  xorm:"'HOLDERAMOUNT'"`       // 期初持仓总金额[商品币种]
-	CurPositionQTY  uint64  `json:"curpositionqty"  xorm:"'CURPOSITIONQTY'"`   // 当前持仓总数量
-	CurHolderAmount float64 `json:"curholderamount"  xorm:"'CURHOLDERAMOUNT'"` // 当前持仓总金额[商品币种]
-	FrozenQTY       uint64  `json:"frozenqty"  xorm:"'FROZENQTY'"`             // 持仓冻结数量
-	OtherFrozenQTY  uint64  `json:"otherfrozenqty"  xorm:"'OTHERFROZENQTY'"`   // 持仓其他冻结数量(交割冻结)
-	OpenReqQTY      uint64  `json:"openreqqty"  xorm:"'OPENREQQTY'"`           // 开仓申请数量(用于比较最大持仓数量)
-	OpenTotalQTY    uint64  `json:"opentotalqty"  xorm:"'OPENTOTALQTY'"`       // 开仓总数量
-	CloseTotalQTY   uint64  `json:"closetotalqty"  xorm:"'CLOSETOTALQTY'"`     // 平仓总数量
-	TNQTY           uint64  `json:"tnqty"  xorm:"'TNQTY'"`                     // T+N冻结总量
-	TNUsedQTY       uint64  `json:"tnusedqty"  xorm:"'TNUSEDQTY'"`             // T+N使用量(可以使用T+N的冻结数量)
-	CurTDPosition   uint64  `json:"curtdposition"  xorm:"'CURTDPOSITION'"`     // 期末今日头寸
-	FreTDPosition   uint64  `json:"fretdposition"  xorm:"'FRETDPOSITION'"`     // 冻结今日头寸
-	EnableQTY       uint64  `json:"enableqty"  xorm:"'ENABLEQTY'"`             // 可用量
-	AveragePrice    float64 `json:"averageprice" xorm:"AVERAGEPRICE"`          // 持仓均价
+	AccountID       uint64  `json:"accountid"  xorm:"'ACCOUNTID'"`                // 资金账户
+	BuyOrSell       int64   `json:"buyorsell"  xorm:"'BUYORSELL'" `               // 方向 - 0:买 1:卖
+	Goodsid         uint32  `json:"goodsid"  xorm:"'GOODSID'" binding:"required"` // 商品Id
+	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
+	GoodUnitID      int64   `json:"goodunitid"  xorm:"'GOODUNITID'"`              // 报价单位ID
+	Goodunit        string  `json:"goodunit" xorm:"'GOODUNIT'"`                   // 报价单位
+	DecimalPlace    int64   `json:"decimalplace"  xorm:"'DECIMALPLACE'"`          // 报价小数位
+	MarketID        int64   `json:"marketid"  xorm:"'MARKETID'"`                  // 所属市场ID
+	TradeMode       uint32  `json:"trademode"  xorm:"'TRADEMODE'"`                // 交易模式
+	PositionQTY     uint64  `json:"positionqty"  xorm:"'POSITIONQTY'"`            // 期初持仓数量
+	HolderAmount    float64 `json:"holderamount"  xorm:"'HOLDERAMOUNT'"`          // 期初持仓总金额[商品币种]
+	CurPositionQTY  uint64  `json:"curpositionqty"  xorm:"'CURPOSITIONQTY'"`      // 当前持仓总数量
+	CurHolderAmount float64 `json:"curholderamount"  xorm:"'CURHOLDERAMOUNT'"`    // 当前持仓总金额[商品币种]
+	FrozenQTY       uint64  `json:"frozenqty"  xorm:"'FROZENQTY'"`                // 持仓冻结数量
+	OtherFrozenQTY  uint64  `json:"otherfrozenqty"  xorm:"'OTHERFROZENQTY'"`      // 持仓其他冻结数量(交割冻结)
+	OpenReqQTY      uint64  `json:"openreqqty"  xorm:"'OPENREQQTY'"`              // 开仓申请数量(用于比较最大持仓数量)
+	OpenTotalQTY    uint64  `json:"opentotalqty"  xorm:"'OPENTOTALQTY'"`          // 开仓总数量
+	CloseTotalQTY   uint64  `json:"closetotalqty"  xorm:"'CLOSETOTALQTY'"`        // 平仓总数量
+	TNQTY           uint64  `json:"tnqty"  xorm:"'TNQTY'"`                        // T+N冻结总量
+	TNUsedQTY       uint64  `json:"tnusedqty"  xorm:"'TNUSEDQTY'"`                // T+N使用量(可以使用T+N的冻结数量)
+	CurTDPosition   uint64  `json:"curtdposition"  xorm:"'CURTDPOSITION'"`        // 期末今日头寸
+	FreTDPosition   uint64  `json:"fretdposition"  xorm:"'FRETDPOSITION'"`        // 冻结今日头寸
+	EnableQTY       uint64  `json:"enableqty"  xorm:"'ENABLEQTY'"`                // 可用量
+	AveragePrice    float64 `json:"averageprice" xorm:"AVERAGEPRICE"`             // 持仓均价
 }
 
 // QueryTradePosition 持仓汇总查询(合约市场)

+ 9 - 2
controllers/szdz/szdz.go

@@ -14,6 +14,7 @@ import (
 
 // QueryRecieptOrderReq 点选挂牌委托单据查询参数
 type QueryRecieptOrderReq struct {
+	app.PageInfo
 	GoodsID     int    `form:"goodsID" binding:"required"` // 商品ID,必填
 	AccountName string `form:"accountName"`                // 所属账户名称
 	MarketID    int    `form:"marketID"`                   // 市场ID
@@ -24,8 +25,8 @@ type QueryRecieptOrderRsp struct {
 	Goodsid     int64   `json:"goodsid"  xorm:"'GOODSID'"`       // 商品ID
 	Goodscode   string  `json:"goodscode"  xorm:"'GOODSCODE'"`   // 商品代码
 	Goodsname   string  `json:"goodsname"  xorm:"'GOODSNAME'"`   // 商品名称
-	Buyorsell   int64   `json:"buyorsell"  xorm:"'BUYORSELL'"`   // 方向 - 0:买 1:卖
-	Orderid     int64   `json:"orderid"  xorm:"'ORDERID'"`       // 委托单号
+	Buyorsell   uint32  `json:"buyorsell"  xorm:"'BUYORSELL'"`   // 方向 - 0:买 1:卖
+	Orderid     uint64  `json:"orderid"  xorm:"'ORDERID'"`       // 委托单号
 	Tradedate   string  `json:"tradedate"  xorm:"'TRADEDATE'"`   // 交易日(yyyyMMdd)
 	Orderprice  float64 `json:"orderprice"  xorm:"'ORDERPRICE'"` // 委托价格
 	EnableQty   int64   `json:"enableqty" xorm:"ENABLEQTY"`      // 可摘数量
@@ -36,6 +37,8 @@ type QueryRecieptOrderRsp struct {
 // @Summary 点选挂牌委托单据查询(摘牌大厅)
 // @Produce json
 // @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param size query int false "每页条数"
 // @Param goodsID query int true "商品ID"
 // @Param accountName query string false "所属账户名称"
 // @Param marketID query int false "市场ID"
@@ -73,6 +76,10 @@ func QueryRecieptOrder(c *gin.Context) {
 	if req.MarketID > 0 {
 		s = s.And("TRADE_ORDERDETAIL.MARKETID = ?", req.MarketID)
 	}
+	// 判断是否要分页
+	if req.Size > 0 {
+		s = s.Limit(req.Size, req.Page*req.Size)
+	}
 	d1 := make([]QueryRecieptOrderRsp, 0)
 	if err := s.Find(&d1); err != nil {
 		// 查询失败

+ 28 - 1
docs/docs.go

@@ -899,6 +899,18 @@ var doc = `{
                 "parameters": [
                     {
                         "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "size",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "商品ID",
                         "name": "goodsID",
                         "in": "query",
@@ -1083,6 +1095,14 @@ var doc = `{
                 },
                 "msg": {
                     "type": "string"
+                },
+                "page": {
+                    "description": "页码",
+                    "type": "integer"
+                },
+                "size": {
+                    "description": "每页条数",
+                    "type": "integer"
                 }
             }
         },
@@ -2951,7 +2971,7 @@ var doc = `{
                     "type": "string"
                 },
                 "tradetype": {
-                    "description": "成交类别 - 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:预售商品结束清理",
+                    "description": "成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓",
                     "type": "integer"
                 }
             }
@@ -3149,6 +3169,9 @@ var doc = `{
         },
         "order.QueryTradePositionRsp": {
             "type": "object",
+            "required": [
+                "goodsid"
+            ],
             "properties": {
                 "accountid": {
                     "description": "资金账户",
@@ -3206,6 +3229,10 @@ var doc = `{
                     "description": "商品代码",
                     "type": "string"
                 },
+                "goodsid": {
+                    "description": "商品Id",
+                    "type": "integer"
+                },
                 "goodsname": {
                     "description": "商品名称",
                     "type": "string"

+ 28 - 1
docs/swagger.json

@@ -883,6 +883,18 @@
                 "parameters": [
                     {
                         "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "size",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
                         "description": "商品ID",
                         "name": "goodsID",
                         "in": "query",
@@ -1067,6 +1079,14 @@
                 },
                 "msg": {
                     "type": "string"
+                },
+                "page": {
+                    "description": "页码",
+                    "type": "integer"
+                },
+                "size": {
+                    "description": "每页条数",
+                    "type": "integer"
                 }
             }
         },
@@ -2935,7 +2955,7 @@
                     "type": "string"
                 },
                 "tradetype": {
-                    "description": "成交类别 - 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:预售商品结束清理",
+                    "description": "成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓",
                     "type": "integer"
                 }
             }
@@ -3133,6 +3153,9 @@
         },
         "order.QueryTradePositionRsp": {
             "type": "object",
+            "required": [
+                "goodsid"
+            ],
             "properties": {
                 "accountid": {
                     "description": "资金账户",
@@ -3190,6 +3213,10 @@
                     "description": "商品代码",
                     "type": "string"
                 },
+                "goodsid": {
+                    "description": "商品Id",
+                    "type": "integer"
+                },
                 "goodsname": {
                     "description": "商品名称",
                     "type": "string"

+ 20 - 1
docs/swagger.yaml

@@ -8,6 +8,12 @@ definitions:
         type: object
       msg:
         type: string
+      page:
+        description: 页码
+        type: integer
+      size:
+        description: 每页条数
+        type: integer
     type: object
   common.OperationPrimaryMenu:
     properties:
@@ -1387,7 +1393,7 @@ definitions:
         description: 成交时间
         type: string
       tradetype:
-        description: '成交类别 - 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:预售商品结束清理'
+        description: '成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓'
         type: integer
     required:
     - accountid
@@ -1592,6 +1598,9 @@ definitions:
       goodscode:
         description: 商品代码
         type: string
+      goodsid:
+        description: 商品Id
+        type: integer
       goodsname:
         description: 商品名称
         type: string
@@ -1628,6 +1637,8 @@ definitions:
       trademode:
         description: 交易模式
         type: integer
+    required:
+    - goodsid
     type: object
   szdz.QueryConvertLogRsp:
     properties:
@@ -2363,6 +2374,14 @@ paths:
   /SZDZ/QueryRecieptOrder:
     get:
       parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: size
+        type: integer
       - description: 商品ID
         in: query
         name: goodsID

+ 7 - 0
global/app/request.go

@@ -0,0 +1,7 @@
+package app
+
+// PageInfo 分页模型
+type PageInfo struct {
+	Page int `json:"page"` // 页码
+	Size int `json:"size"` // 每页条数
+}

+ 14 - 2
global/app/response.go

@@ -13,8 +13,9 @@ type Gin struct {
 
 // Response 通用Response数据结构
 type Response struct {
-	Code int         `json:"code"`
-	Msg  string      `json:"msg"`
+	Code int    `json:"code"`
+	Msg  string `json:"msg"`
+	PageInfo
 	Data interface{} `json:"data"`
 }
 
@@ -27,3 +28,14 @@ func (g *Gin) Response(httpCode, errCode int, data interface{}) {
 	})
 	return
 }
+
+// ResponseByPage 带分页信息返回方法
+func (g *Gin) ResponseByPage(httpCode, errCode int, data interface{}, page PageInfo) {
+	g.C.JSON(httpCode, Response{
+		Code:     errCode,
+		Msg:      e.GetMsg(errCode),
+		PageInfo: page,
+		Data:     data,
+	})
+	return
+}

+ 65 - 65
models/orderModels.go

@@ -44,27 +44,27 @@ func (Tradeposition) TableName() string {
 
 // Tradeorderdetail 交易委托单表 - 导历史
 type Tradeorderdetail struct {
-	Orderid                 int64     `json:"orderid"  xorm:"'ORDERID'" binding:"required"`              // 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	Orderid                 uint64    `json:"orderid"  xorm:"'ORDERID'" binding:"required"`              // 委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
 	Tradedate               string    `json:"tradedate"  xorm:"'TRADEDATE'" binding:"required"`          // 交易日(yyyyMMdd)
-	Buildtype               int64     `json:"buildtype"  xorm:"'BUILDTYPE'" binding:"required"`          // 委托单据类型 - 1:建仓 2:平仓 3:先平后建
-	Preorderid              int64     `json:"preorderid"  xorm:"'PREORDERID'"`                           // 关联预埋单号(止盈止损单时填写)
-	Cancelorderid           int64     `json:"cancelorderid"  xorm:"'CANCELORDERID'"`                     // 撤单单号(撤单时填写)
-	Relatedid               int64     `json:"relatedid"  xorm:"'RELATEDID'"`                             // 关联单号(交割单)
-	Marketid                int64     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`            // 市场ID
-	Goodsid                 int64     `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`              // 商品ID
-	Accountid               int64     `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"`          // 账户ID[报价币种]
-	Memberuserid            int64     `json:"memberuserid"  xorm:"'MEMBERUSERID'" binding:"required"`    // 所属会员UserID
-	Buyorsell               int64     `json:"buyorsell"  xorm:"'BUYORSELL'" binding:"required"`          // 买卖 - 0:买 1:卖
-	Pricemode               int64     `json:"pricemode"  xorm:"'PRICEMODE'" binding:"required"`          // 取价方式 - 1:市价 2: 限价
+	Buildtype               uint32    `json:"buildtype"  xorm:"'BUILDTYPE'" binding:"required"`          // 委托单据类型 - 1:建仓 2:平仓 3:先平后建
+	Preorderid              uint64    `json:"preorderid"  xorm:"'PREORDERID'"`                           // 关联预埋单号(止盈止损单时填写)
+	Cancelorderid           uint64    `json:"cancelorderid"  xorm:"'CANCELORDERID'"`                     // 撤单单号(撤单时填写)
+	Relatedid               uint64    `json:"relatedid"  xorm:"'RELATEDID'"`                             // 关联单号(交割单)
+	Marketid                uint32    `json:"marketid"  xorm:"'MARKETID'" binding:"required"`            // 市场ID
+	Goodsid                 uint32    `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`              // 商品ID
+	Accountid               uint64    `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"`          // 账户ID[报价币种]
+	Memberuserid            uint64    `json:"memberuserid"  xorm:"'MEMBERUSERID'" binding:"required"`    // 所属会员UserID
+	Buyorsell               uint32    `json:"buyorsell"  xorm:"'BUYORSELL'" binding:"required"`          // 买卖 - 0:买 1:卖
+	Pricemode               uint32    `json:"pricemode"  xorm:"'PRICEMODE'" binding:"required"`          // 取价方式 - 1:市价 2: 限价
 	Orderprice              float64   `json:"orderprice"  xorm:"'ORDERPRICE'"`                           // 委托价格
 	Marketmaxsub            float64   `json:"marketmaxsub"  xorm:"'MARKETMAXSUB'"`                       // 市价最大偏移范围
-	Orderqty                int64     `json:"orderqty"  xorm:"'ORDERQTY'" binding:"required"`            // 委托数量
-	Tradeqty                int64     `json:"tradeqty"  xorm:"'TRADEQTY'"`                               // 成交数量
-	Cancelqty               int64     `json:"cancelqty"  xorm:"'CANCELQTY'"`                             // 撤单数量
-	Openqty                 int64     `json:"openqty"  xorm:"'OPENQTY'"`                                 // 开仓数量(先建后平操作,需要记录)
-	Closeqty                int64     `json:"closeqty"  xorm:"'CLOSEQTY'"`                               // 平仓数量(先建后平操作 需要记录)
-	Opentradeqty            int64     `json:"opentradeqty"  xorm:"'OPENTRADEQTY'"`                       // 开仓成交数量(先建后平操作,需要记录)
-	Closetradeqty           int64     `json:"closetradeqty"  xorm:"'CLOSETRADEQTY'"`                     // 平仓成交数量(先建后平操作,需要记录)
+	Orderqty                uint64    `json:"orderqty"  xorm:"'ORDERQTY'" binding:"required"`            // 委托数量
+	Tradeqty                uint64    `json:"tradeqty"  xorm:"'TRADEQTY'"`                               // 成交数量
+	Cancelqty               uint64    `json:"cancelqty"  xorm:"'CANCELQTY'"`                             // 撤单数量
+	Openqty                 uint64    `json:"openqty"  xorm:"'OPENQTY'"`                                 // 开仓数量(先建后平操作,需要记录)
+	Closeqty                uint64    `json:"closeqty"  xorm:"'CLOSEQTY'"`                               // 平仓数量(先建后平操作 需要记录)
+	Opentradeqty            uint64    `json:"opentradeqty"  xorm:"'OPENTRADEQTY'"`                       // 开仓成交数量(先建后平操作,需要记录)
+	Closetradeqty           uint64    `json:"closetradeqty"  xorm:"'CLOSETRADEQTY'"`                     // 平仓成交数量(先建后平操作,需要记录)
 	Freezemargin            float64   `json:"freezemargin"  xorm:"'FREEZEMARGIN'"`                       // 冻结保证金(冻结交易金额)
 	Unfreezemargin          float64   `json:"unfreezemargin"  xorm:"'UNFREEZEMARGIN'"`                   // 解冻保证金
 	Freezecharge            float64   `json:"freezecharge"  xorm:"'FREEZECHARGE'"`                       // 冻结手续费
@@ -73,39 +73,39 @@ type Tradeorderdetail struct {
 	Closefreezecharge       float64   `json:"closefreezecharge"  xorm:"'CLOSEFREEZECHARGE'"`             // 平仓冻结手续费(先建后平操作,需要记录)
 	Openunfreezecharge      float64   `json:"openunfreezecharge"  xorm:"'OPENUNFREEZECHARGE'"`           // 开仓解冻手续费(先建后平操作,需要记录)
 	Closeunfreezecharge     float64   `json:"closeunfreezecharge"  xorm:"'CLOSEUNFREEZECHARGE'"`         // 平仓解冻手续费(先建后平操作,需要记录)
-	Validtype               int64     `json:"validtype"  xorm:"'VALIDTYPE'" binding:"required"`          // 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
+	Validtype               uint32    `json:"validtype"  xorm:"'VALIDTYPE'" binding:"required"`          // 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
 	Validtime               time.Time `json:"validtime"  xorm:"'VALIDTIME'"`                             // 有效期限
-	Volumetype              int64     `json:"volumetype"  xorm:"'VOLUMETYPE'"`                           // 当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量  1:最小量(暂时不支持) 2:全部量
-	Operatetype             int64     `json:"operatetype"  xorm:"'OPERATETYPE'" binding:"required"`      // 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
+	Volumetype              uint32    `json:"volumetype"  xorm:"'VOLUMETYPE'"`                           // 当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量  1:最小量(暂时不支持) 2:全部量
+	Operatetype             uint32    `json:"operatetype"  xorm:"'OPERATETYPE'" binding:"required"`      // 操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
 	Ordertime               time.Time `json:"ordertime"  xorm:"'ORDERTIME'" binding:"required"`          // 委托时间
-	Ordersrc                int64     `json:"ordersrc"  xorm:"'ORDERSRC'"`                               // 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
-	Orderstatus             int64     `json:"orderstatus"  xorm:"'ORDERSTATUS'"`                         // 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
-	Operatorid              int64     `json:"operatorid"  xorm:"'OPERATORID'"`                           // 登录账号(LoginID)
+	Ordersrc                uint32    `json:"ordersrc"  xorm:"'ORDERSRC'"`                               // 委托来源 -  1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+	Orderstatus             uint32    `json:"orderstatus"  xorm:"'ORDERSTATUS'"`                         // 委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
+	Operatorid              uint64    `json:"operatorid"  xorm:"'OPERATORID'"`                           // 登录账号(LoginID)
 	Updatetime              time.Time `json:"updatetime"  xorm:"'UPDATETIME'"`                           // 更新时间
 	Clientordertime         time.Time `json:"clientordertime"  xorm:"'CLIENTORDERTIME'"`                 // 客户端委托时间
 	Clientticket            string    `json:"clientticket"  xorm:"'CLIENTTICKET'"`                       // 客户端流水号
 	UUID                    string    `json:"uuid"  xorm:"'UUID'"`                                       // 发起端唯一id
-	Clienttype              int64     `json:"clienttype"  xorm:"'CLIENTTYPE'"`                           // 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
-	Retcode                 int64     `json:"retcode"  xorm:"'RETCODE'"`                                 // 错误代码
-	Tradeproperty           int64     `json:"tradeproperty"  xorm:"'TRADEPROPERTY'"`                     // 交易属性
-	Listingselecttype       int64     `json:"listingselecttype"  xorm:"'LISTINGSELECTTYPE'"`             // 挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
-	Delistingtype           int64     `json:"delistingtype"  xorm:"'DELISTINGTYPE'"`                     // 摘牌类型 - 1:价格最优 2:点选成交
-	Marginalgorithm         int64     `json:"marginalgorithm"  xorm:"'MARGINALGORITHM'"`                 // 保证金收取方式  1:比率  2:固定
+	Clienttype              uint32    `json:"clienttype"  xorm:"'CLIENTTYPE'"`                           // 客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+	Retcode                 uint32    `json:"retcode"  xorm:"'RETCODE'"`                                 // 错误代码
+	Tradeproperty           uint32    `json:"tradeproperty"  xorm:"'TRADEPROPERTY'"`                     // 交易属性
+	Listingselecttype       uint32    `json:"listingselecttype"  xorm:"'LISTINGSELECTTYPE'"`             // 挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+	Delistingtype           uint32    `json:"delistingtype"  xorm:"'DELISTINGTYPE'"`                     // 摘牌类型 - 1:价格最优 2:点选成交
+	Marginalgorithm         uint32    `json:"marginalgorithm"  xorm:"'MARGINALGORITHM'"`                 // 保证金收取方式  1:比率  2:固定
 	Marginvalue             float64   `json:"marginvalue"  xorm:"'MARGINVALUE'"`                         // 即市保证金设置值
-	Openfeealgorithm        int64     `json:"openfeealgorithm"  xorm:"'OPENFEEALGORITHM'"`               // 建仓手续费收取方式  1:比率  2:固定
+	Openfeealgorithm        uint32    `json:"openfeealgorithm"  xorm:"'OPENFEEALGORITHM'"`               // 建仓手续费收取方式  1:比率  2:固定
 	Openmemberchargevalue   float64   `json:"openmemberchargevalue"  xorm:"'OPENMEMBERCHARGEVALUE'"`     // 建仓会员手续费设置值
 	Openexchagechargevalue  float64   `json:"openexchagechargevalue"  xorm:"'OPENEXCHAGECHARGEVALUE'"`   // 建仓交易所手续费设置值
-	Closefeealgorithm       int64     `json:"closefeealgorithm"  xorm:"'CLOSEFEEALGORITHM'"`             // 平仓手续费收取方式 1:比率  2:固定
+	Closefeealgorithm       uint32    `json:"closefeealgorithm"  xorm:"'CLOSEFEEALGORITHM'"`             // 平仓手续费收取方式 1:比率  2:固定
 	Closememberchargevalue  float64   `json:"closememberchargevalue"  xorm:"'CLOSEMEMBERCHARGEVALUE'"`   // 平仓会员手续费设置值
 	Closeexchagechargevalue float64   `json:"closeexchagechargevalue"  xorm:"'CLOSEEXCHAGECHARGEVALUE'"` // 平仓交易所手续费设置值
-	Optiontype              int64     `json:"optiontype"  xorm:"'OPTIONTYPE'"`                           // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
+	Optiontype              uint32    `json:"optiontype"  xorm:"'OPTIONTYPE'"`                           // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
 	Premium                 float64   `json:"premium"  xorm:"'PREMIUM'"`                                 // 权利金
-	Ispreexercise           int64     `json:"ispreexercise"  xorm:"'ISPREEXERCISE'"`                     // 是否预申报- 0:否 1:是
+	Ispreexercise           uint32    `json:"ispreexercise"  xorm:"'ISPREEXERCISE'"`                     // 是否预申报- 0:否 1:是
 	Preexerciseprice        float64   `json:"preexerciseprice"  xorm:"'PREEXERCISEPRICE'"`               // 预申报价格
-	Isconfirmexercise       int64     `json:"isconfirmexercise"  xorm:"'ISCONFIRMEXERCISE'"`             // 是否确认行权- 0:否 1:是
-	Quoteid                 int64     `json:"quoteid"  xorm:"'QUOTEID'"`                                 // 报价单ID
-	Gcaccountid             int64     `json:"gcaccountid"  xorm:"'GCACCOUNTID'"`                         // 账户ID[合约币种]
-	Sessionid               int64     `json:"sessionid"  xorm:"'SESSIONID'"`                             // 会话ID
+	Isconfirmexercise       uint32    `json:"isconfirmexercise"  xorm:"'ISCONFIRMEXERCISE'"`             // 是否确认行权- 0:否 1:是
+	Quoteid                 uint64    `json:"quoteid"  xorm:"'QUOTEID'"`                                 // 报价单ID
+	Gcaccountid             uint64    `json:"gcaccountid"  xorm:"'GCACCOUNTID'"`                         // 账户ID[合约币种]
+	Sessionid               uint64    `json:"sessionid"  xorm:"'SESSIONID'"`                             // 会话ID
 }
 
 // TableName is TRADE_ORDERDETAIL
@@ -149,48 +149,48 @@ func (Tradequotedetailnew) TableName() string {
 
 // Tradetradedetail 交易成交单表 - 导历史
 type Tradetradedetail struct {
-	Tradeid                 int64     `json:"tradeid"  xorm:"'TRADEID'" binding:"required"`              // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
-	Buyorsell               int64     `json:"buyorsell"  xorm:"'BUYORSELL'" binding:"required"`          // 方向 - 0:买 1:卖
-	Orderid                 int64     `json:"orderid"  xorm:"'ORDERID'" binding:"required"`              // 委托单号
+	Tradeid                 uint64    `json:"tradeid"  xorm:"'TRADEID'" binding:"required"`              // 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	Buyorsell               uint32    `json:"buyorsell"  xorm:"'BUYORSELL'" binding:"required"`          // 方向 - 0:买 1:卖
+	Orderid                 uint64    `json:"orderid"  xorm:"'ORDERID'" binding:"required"`              // 委托单号
 	Tradedate               string    `json:"tradedate"  xorm:"'TRADEDATE'" binding:"required"`          // 交易日(yyyyMMdd)
-	Accountid               int64     `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"`          // 账户ID[报价币种]
-	Goodsid                 int64     `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`              // 商品ID
-	Marketid                int64     `json:"marketid"  xorm:"'MARKETID'" binding:"required"`            // 市场ID
-	Memberuserid            int64     `json:"memberuserid"  xorm:"'MEMBERUSERID'" binding:"required"`    // 会员id 个人投资者 需要填写
-	Matchaccountid          int64     `json:"matchaccountid"  xorm:"'MATCHACCOUNTID'"`                   // 对手账号id
+	Accountid               uint64    `json:"accountid"  xorm:"'ACCOUNTID'" binding:"required"`          // 账户ID[报价币种]
+	Goodsid                 uint32    `json:"goodsid"  xorm:"'GOODSID'" binding:"required"`              // 商品ID
+	Marketid                uint32    `json:"marketid"  xorm:"'MARKETID'" binding:"required"`            // 市场ID
+	Memberuserid            uint64    `json:"memberuserid"  xorm:"'MEMBERUSERID'" binding:"required"`    // 会员id 个人投资者 需要填写
+	Matchaccountid          uint64    `json:"matchaccountid"  xorm:"'MATCHACCOUNTID'"`                   // 对手账号id
 	Tradetime               time.Time `json:"tradetime"  xorm:"'TRADETIME'" binding:"required"`          // 成交时间
 	Tradeprice              float64   `json:"tradeprice"  xorm:"'TRADEPRICE'" binding:"required"`        // 成交价格
-	Tradeqty                int64     `json:"tradeqty"  xorm:"'TRADEQTY'" binding:"required"`            // 成交数量
+	Tradeqty                uint64    `json:"tradeqty"  xorm:"'TRADEQTY'" binding:"required"`            // 成交数量
 	Tradeamount             float64   `json:"tradeamount"  xorm:"'TRADEAMOUNT'" binding:"required"`      // 成交金额[账户币种,用于所有权]
 	Closepl                 float64   `json:"closepl"  xorm:"'CLOSEPL'"`                                 // 平仓盈亏
-	Intclosepl              int64     `json:"intclosepl"  xorm:"'INTCLOSEPL'"`                           // 整型盈亏(用于交易结算试算平衡-收益权)
+	Intclosepl              uint64    `json:"intclosepl"  xorm:"'INTCLOSEPL'"`                           // 整型盈亏(用于交易结算试算平衡-收益权)
 	Opencharge              float64   `json:"opencharge"  xorm:"'OPENCHARGE'"`                           // 建仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
 	Closecharge             float64   `json:"closecharge"  xorm:"'CLOSECHARGE'"`                         // 平仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
-	Tradetype               int64     `json:"tradetype"  xorm:"'TRADETYPE'"`                             // 成交类别 - 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:预售商品结束清理
-	Buildtype               int64     `json:"buildtype"  xorm:"'BUILDTYPE'"`                             // 委托单据类型 1:建仓 2:平仓 3:先平后建
-	Openqty                 int64     `json:"openqty"  xorm:"'OPENQTY'"`                                 // 开仓数量(先建后平操作 需要记录)
-	Closeqty                int64     `json:"closeqty"  xorm:"'CLOSEQTY'"`                               // 平仓数量(先建后平操作 需要记录)
-	Status                  int64     `json:"status"  xorm:"'STATUS'"`                                   // 处理状态 - 1:待处理 2:已处理 3:处理失败
-	Isreckoned              int64     `json:"isreckoned"  xorm:"'ISRECKONED'"`                           // 是否结算 - 0:未结算 1:已结算
-	Tradeproperty           int64     `json:"tradeproperty"  xorm:"'TRADEPROPERTY'"`                     // 交易属性
-	Openfeealgorithm        int64     `json:"openfeealgorithm"  xorm:"'OPENFEEALGORITHM'"`               // 建仓手续费收取方式  1:比率  2:固定
+	Tradetype               uint32    `json:"tradetype"  xorm:"'TRADETYPE'"`                             // 成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+	Buildtype               uint32    `json:"buildtype"  xorm:"'BUILDTYPE'"`                             // 委托单据类型 1:建仓 2:平仓 3:先平后建
+	Openqty                 uint64    `json:"openqty"  xorm:"'OPENQTY'"`                                 // 开仓数量(先建后平操作 需要记录)
+	Closeqty                uint64    `json:"closeqty"  xorm:"'CLOSEQTY'"`                               // 平仓数量(先建后平操作 需要记录)
+	Status                  uint32    `json:"status"  xorm:"'STATUS'"`                                   // 处理状态 - 1:待处理 2:已处理 3:处理失败
+	Isreckoned              uint32    `json:"isreckoned"  xorm:"'ISRECKONED'"`                           // 是否结算 - 0:未结算 1:已结算
+	Tradeproperty           uint32    `json:"tradeproperty"  xorm:"'TRADEPROPERTY'"`                     // 交易属性
+	Openfeealgorithm        uint32    `json:"openfeealgorithm"  xorm:"'OPENFEEALGORITHM'"`               // 建仓手续费收取方式  1:比率  2:固定
 	Openmemberchargevalue   float64   `json:"openmemberchargevalue"  xorm:"'OPENMEMBERCHARGEVALUE'"`     // 建仓会员手续费设置值
 	Openexchagechargevalue  float64   `json:"openexchagechargevalue"  xorm:"'OPENEXCHAGECHARGEVALUE'"`   // 建仓交易所手续费设置值
-	Closefeealgorithm       int64     `json:"closefeealgorithm"  xorm:"'CLOSEFEEALGORITHM'"`             // 平仓手续费收取方式 1:比率  2:固定
+	Closefeealgorithm       uint32    `json:"closefeealgorithm"  xorm:"'CLOSEFEEALGORITHM'"`             // 平仓手续费收取方式 1:比率  2:固定
 	Closememberchargevalue  float64   `json:"closememberchargevalue"  xorm:"'CLOSEMEMBERCHARGEVALUE'"`   // 平仓会员手续费设置值
 	Closeexchagechargevalue float64   `json:"closeexchagechargevalue"  xorm:"'CLOSEEXCHAGECHARGEVALUE'"` // 平仓交易所手续费设置值
-	Optiontype              int64     `json:"optiontype"  xorm:"'OPTIONTYPE'"`                           // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
+	Optiontype              uint32    `json:"optiontype"  xorm:"'OPTIONTYPE'"`                           // 期权类型 - 1:认购(看涨) 2:认沽(看跌)
 	Premium                 float64   `json:"premium"  xorm:"'PREMIUM'"`                                 // 权利金 - [持仓单的权利金]
-	Ispreexercise           int64     `json:"ispreexercise"  xorm:"'ISPREEXERCISE'"`                     // 是否预申报- 0:否 1:是
+	Ispreexercise           uint32    `json:"ispreexercise"  xorm:"'ISPREEXERCISE'"`                     // 是否预申报- 0:否 1:是
 	Preexerciseprice        float64   `json:"preexerciseprice"  xorm:"'PREEXERCISEPRICE'"`               // 预申报价格
-	Isconfirmexercise       int64     `json:"isconfirmexercise"  xorm:"'ISCONFIRMEXERCISE'"`             // 是否确认行权- 0:否 1:是
-	Ismain                  int64     `json:"ismain"  xorm:"'ISMAIN'"`                                   // 是否主单 - 0:不是 1:是
-	Performanceplanid       int64     `json:"performanceplanid"  xorm:"'PERFORMANCEPLANID'"`             // 履约计划ID[期权]
-	Performancestatus       int64     `json:"performancestatus"  xorm:"'PERFORMANCESTATUS'"`             // 履约状态[期权] - 0:无履约 1:未履约 2:履约中 3:履约完成
+	Isconfirmexercise       uint32    `json:"isconfirmexercise"  xorm:"'ISCONFIRMEXERCISE'"`             // 是否确认行权- 0:否 1:是
+	Ismain                  uint32    `json:"ismain"  xorm:"'ISMAIN'"`                                   // 是否主单 - 0:不是 1:是
+	Performanceplanid       uint64    `json:"performanceplanid"  xorm:"'PERFORMANCEPLANID'"`             // 履约计划ID[期权]
+	Performancestatus       uint32    `json:"performancestatus"  xorm:"'PERFORMANCESTATUS'"`             // 履约状态[期权] - 0:无履约 1:未履约 2:履约中 3:履约完成
 	Creditamount            float64   `json:"creditamount"  xorm:"'CREDITAMOUNT'"`                       // 授信金额
-	Gcaccountid             int64     `json:"gcaccountid"  xorm:"'GCACCOUNTID'"`                         // 账户ID[合约币种]
+	Gcaccountid             uint64    `json:"gcaccountid"  xorm:"'GCACCOUNTID'"`                         // 账户ID[合约币种]
 	Closepl2                float64   `json:"closepl2"  xorm:"'CLOSEPL2'"`                               // 平仓盈亏[逐笔]
-	Relatedouttradeid       int64     `json:"relatedouttradeid"  xorm:"'RELATEDOUTTRADEID'"`             // 关联外部成交单ID
+	Relatedouttradeid       uint64    `json:"relatedouttradeid"  xorm:"'RELATEDOUTTRADEID'"`             // 关联外部成交单ID
 }
 
 // TableName is TRADE_TRADEDETAIL