Преглед на файлове

仓单贸易
1.增加 查委托接口

zou.yingbin преди 4 години
родител
ревизия
e91e67fb07
променени са 6 файла, в които са добавени 641 реда и са изтрити 0 реда
  1. 18 0
      controllers/wrTrade2/qryWrTrade.go
  2. 191 0
      docs/docs.go
  3. 191 0
      docs/swagger.json
  4. 139 0
      docs/swagger.yaml
  5. 101 0
      models/wrTrade2.go
  6. 1 0
      routers/router.go

+ 18 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -75,3 +75,21 @@ func QueryWrPosition(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryWrOrderDetail
+// @Summary 查询仓单委托单(挂单)
+// @Description 页面 现货仓单 | 预售仓单 -> 挂单
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户id"
+// @Param haswr query int true "是否有仓单 0-没有 1-有(仓单贸易填1,仓单预售填0)"
+// @Success 200 {array} models.WrOrderDetail
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrOrderDetail [get]
+// @Tags 仓单贸易v2
+func QueryWrOrderDetail(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrOrderDetail{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 191 - 0
docs/docs.go

@@ -11094,6 +11094,56 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryWrOrderDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "页面 现货仓单 | 预售仓单 -\u003e 挂单",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询仓单委托单(挂单)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否有仓单 0-没有 1-有(仓单贸易填1,仓单预售填0)",
+                        "name": "haswr",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrOrderDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPosition": {
             "get": {
                 "security": [
@@ -28962,6 +29012,147 @@ var doc = `{
                 }
             }
         },
+        "models.WrOrderDetail": {
+            "type": "object",
+            "properties": {
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)",
+                    "type": "integer"
+                },
+                "cancelqty": {
+                    "description": "撤销数量",
+                    "type": "number"
+                },
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "deliverymonth": {
+                    "description": "交收月",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "fixedprice": {
+                    "description": "固定价格    -   [挂牌]",
+                    "type": "number"
+                },
+                "futupricemove": {
+                    "description": "期货升贴水",
+                    "type": "number"
+                },
+                "futushow": {
+                    "description": "期货合约/升贴水",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "期货合约",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "期货商品id",
+                    "type": "integer"
+                },
+                "haswr": {
+                    "description": "是否有仓单-卖方 - 0:无仓单 1:有仓单",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "optioncompare": {
+                    "description": "选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较",
+                    "type": "string"
+                },
+                "orderqty": {
+                    "description": "委托数量",
+                    "type": "number"
+                },
+                "ordertime": {
+                    "description": "委托时间(挂牌时间)",
+                    "type": "string"
+                },
+                "pricemove": {
+                    "description": "升贴水(浮动价时填写)    -   [挂牌]",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "tradeprice": {
+                    "description": "成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)",
+                    "type": "number"
+                },
+                "tradeqty": {
+                    "description": "成交数量",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "wrfactortypename": {
+                    "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
+                    "type": "string"
+                },
+                "wrpricetype": {
+                    "description": "价格方式 - 1:固定价 2-浮动价  -   [挂牌]",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "wrtradeorderstatus": {
+                    "description": "委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 10:挂牌部分成交 11:仓单生成失败 12:首付扣款失败 13:履约失败 14:撤单解冻贷款失败 15:部成部撤",
+                    "type": "integer"
+                },
+                "wrtradetype": {
+                    "description": "仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)",
+                    "type": "integer"
+                },
+                "wrtypename": {
+                    "description": "商品",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrOrderQuote": {
             "type": "object",
             "properties": {

+ 191 - 0
docs/swagger.json

@@ -11078,6 +11078,56 @@
                 }
             }
         },
+        "/WrTrade2/QueryWrOrderDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "页面 现货仓单 | 预售仓单 -\u003e 挂单",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询仓单委托单(挂单)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否有仓单 0-没有 1-有(仓单贸易填1,仓单预售填0)",
+                        "name": "haswr",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrOrderDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrPosition": {
             "get": {
                 "security": [
@@ -28946,6 +28996,147 @@
                 }
             }
         },
+        "models.WrOrderDetail": {
+            "type": "object",
+            "properties": {
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)",
+                    "type": "integer"
+                },
+                "cancelqty": {
+                    "description": "撤销数量",
+                    "type": "number"
+                },
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "品种ID",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "deliverymonth": {
+                    "description": "交收月",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "fixedprice": {
+                    "description": "固定价格    -   [挂牌]",
+                    "type": "number"
+                },
+                "futupricemove": {
+                    "description": "期货升贴水",
+                    "type": "number"
+                },
+                "futushow": {
+                    "description": "期货合约/升贴水",
+                    "type": "string"
+                },
+                "goodscode": {
+                    "description": "期货合约",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "期货商品id",
+                    "type": "integer"
+                },
+                "haswr": {
+                    "description": "是否有仓单-卖方 - 0:无仓单 1:有仓单",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "optioncompare": {
+                    "description": "选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较",
+                    "type": "string"
+                },
+                "orderqty": {
+                    "description": "委托数量",
+                    "type": "number"
+                },
+                "ordertime": {
+                    "description": "委托时间(挂牌时间)",
+                    "type": "string"
+                },
+                "pricemove": {
+                    "description": "升贴水(浮动价时填写)    -   [挂牌]",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "tradeprice": {
+                    "description": "成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)",
+                    "type": "number"
+                },
+                "tradeqty": {
+                    "description": "成交数量",
+                    "type": "number"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "wrfactortypename": {
+                    "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
+                    "type": "string"
+                },
+                "wrpricetype": {
+                    "description": "价格方式 - 1:固定价 2-浮动价  -   [挂牌]",
+                    "type": "integer"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "wrtradeorderstatus": {
+                    "description": "委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 10:挂牌部分成交 11:仓单生成失败 12:首付扣款失败 13:履约失败 14:撤单解冻贷款失败 15:部成部撤",
+                    "type": "integer"
+                },
+                "wrtradetype": {
+                    "description": "仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)",
+                    "type": "integer"
+                },
+                "wrtypename": {
+                    "description": "商品",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrOrderQuote": {
             "type": "object",
             "properties": {

+ 139 - 0
docs/swagger.yaml

@@ -13280,6 +13280,113 @@ definitions:
     - autoid
     - warehousecode
     type: object
+  models.WrOrderDetail:
+    properties:
+      buyorsell:
+        description: 买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)
+        type: integer
+      cancelqty:
+        description: 撤销数量
+        type: number
+      deliverygoodscode:
+        description: 品种代码
+        type: string
+      deliverygoodsid:
+        description: 品种ID
+        type: integer
+      deliverygoodsname:
+        description: 品种名称
+        type: string
+      deliverymonth:
+        description: 交收月
+        type: string
+      enumdicname:
+        description: 单位名称
+        type: string
+      fixedprice:
+        description: 固定价格    -   [挂牌]
+        type: number
+      futupricemove:
+        description: 期货升贴水
+        type: number
+      futushow:
+        description: 期货合约/升贴水
+        type: string
+      goodscode:
+        description: 期货合约
+        type: string
+      goodsid:
+        description: 期货商品id
+        type: integer
+      haswr:
+        description: 是否有仓单-卖方 - 0:无仓单 1:有仓单
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      optioncompare:
+        description: 选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+        type: string
+      orderqty:
+        description: 委托数量
+        type: number
+      ordertime:
+        description: 委托时间(挂牌时间)
+        type: string
+      pricemove:
+        description: 升贴水(浮动价时填写)    -   [挂牌]
+        type: number
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      tradeprice:
+        description: 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)*
+          商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+        type: number
+      tradeqty:
+        description: 成交数量
+        type: number
+      userid:
+        description: 用户ID
+        type: integer
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      warehousename:
+        description: 仓库名称
+        type: string
+      wrfactortypeid:
+        description: 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      wrfactortypename:
+        description: 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+        type: string
+      wrpricetype:
+        description: 价格方式 - 1:固定价 2-浮动价  -   [挂牌]
+        type: integer
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 商品名称
+        type: string
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      wrtradeorderstatus:
+        description: 委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝
+          10:挂牌部分成交 11:仓单生成失败 12:首付扣款失败 13:履约失败 14:撤单解冻贷款失败 15:部成部撤
+        type: integer
+      wrtradetype:
+        description: 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+        type: integer
+      wrtypename:
+        description: 商品
+        type: string
+    type: object
   models.WrOrderQuote:
     properties:
       buyprice:
@@ -22426,6 +22533,38 @@ paths:
       summary: 查询买卖大厅
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrOrderDetail:
+    get:
+      description: 页面 现货仓单 | 预售仓单 -> 挂单
+      parameters:
+      - description: 用户id
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 是否有仓单 0-没有 1-有(仓单贸易填1,仓单预售填0)
+        in: query
+        name: haswr
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrOrderDetail'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询仓单委托单(挂单)
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrPosition:
     get:
       description: 页面 现货仓单->现货汇总/库存汇总/现货明细 ; 预售仓单->订单汇总

+ 101 - 0
models/wrTrade2.go

@@ -479,3 +479,104 @@ func (r *WrPosition) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrOrderDetail 仓单贸易委托单
+type WrOrderDetail struct {
+	HASWR              int32   `json:"haswr"  xorm:"HASWR" form:"haswr"`                   // 是否有仓单-卖方 - 0:无仓单 1:有仓单
+	WRTRADEORDERID     string  `json:"wrtradeorderid"  xorm:"WRTRADEORDERID"`              // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+	TRADEDATE          string  `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`       // 交易日(yyyyMMdd)
+	WRTRADETYPE        int32   `json:"wrtradetype"  xorm:"WRTRADETYPE" form:"wrtradetype"` // 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+	BUYORSELL          int32   `json:"buyorsell"  xorm:"BUYORSELL" form:"buyorsell"`       // 买卖 - 0:买 1:卖(挂牌类型 买为采购 卖为销售)
+	MARKETID           int64   `json:"marketid"  xorm:"MARKETID" form:"marketid"`          // 市场ID
+	USERID             int64   `json:"userid"  xorm:"USERID" form:"userid"`                // 用户ID
+	WRFACTORTYPEID     int64   `json:"wrfactortypeid"  xorm:"WRFACTORTYPEID"`              // 仓单要素类型ID/商品ID(77)
+	ORDERQTY           float64 `json:"orderqty"  xorm:"ORDERQTY" form:"orderqty"`          // 委托数量
+	TRADEQTY           float64 `json:"tradeqty"  xorm:"TRADEQTY" form:"tradeqty"`          // 成交数量
+	CANCELQTY          float64 `json:"cancelqty"  xorm:"CANCELQTY" form:"cancelqty"`       // 撤销数量
+	WRPRICETYPE        int32   `json:"wrpricetype"  xorm:"WRPRICETYPE" form:"wrpricetype"` // 价格方式 - 1:固定价 2-浮动价  -   [挂牌]
+	FIXEDPRICE         float64 `json:"fixedprice"  xorm:"FIXEDPRICE" form:"fixedprice"`    // 固定价格    -   [挂牌]
+	PRICEMOVE          float64 `json:"pricemove"  xorm:"PRICEMOVE" form:"pricemove"`       // 升贴水(浮动价时填写)    -   [挂牌]
+	TRADEPRICE         float64 `json:"tradeprice"  xorm:"TRADEPRICE" form:"tradeprice"`    // 成交价格 - [摘牌] (浮动价  ((商品1价格*商品1价格系数+升贴水)* 商品1重量系数 + 商品2价格*商品2价格系数+商品2升贴水)* 商品2重量系数 ...)* 委托单价格系数 + 委托单升贴水)
+	ORDERTIME          string  `json:"ordertime"  xorm:"ORDERTIME" form:"ordertime"`       // 委托时间(挂牌时间)
+	WRTRADEORDERSTATUS int32   `json:"wrtradeorderstatus"  xorm:"WRTRADEORDERSTATUS"`      // 委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 10:挂牌部分成交 11:仓单生成失败 12:首付扣款失败 13:履约失败 14:撤单解冻贷款失败 15:部成部撤
+	GOODSID            int32   `json:"goodsid"  xorm:"'GOODSID'"`                          // 期货商品id
+	GOODSCODE          string  `json:"goodscode"  xorm:"'GOODSCODE'"`                      // 期货合约
+	FUTUPRICEMOVE      float64 `json:"futupricemove"  xorm:"'FUTUPRICEMOVE'"`              // 期货升贴水
+	DELIVERYMONTH      string  `json:"deliverymonth"  xorm:"'DELIVERYMONTH'"`              // 交收月
+	Wr2FactorType      `xorm:"extends"`
+
+	FUTUSHOW string `json:"futushow"` // 期货合约/升贴水
+}
+
+func (r *WrOrderDetail) calc() {
+	if r.GOODSCODE == "" {
+		r.FUTUSHOW = "-"
+	} else {
+		r.FUTUSHOW = fmt.Sprintf("%v//%.2f", r.GOODSCODE, r.FUTUPRICEMOVE)
+	}
+}
+
+func (r *WrOrderDetail) buildSql() string {
+	var sqlId utils.SQLVal = "with tmp as" +
+		" (select t.wrfactortypeid," +
+		"         t.wrfactortypename," +
+		"         t.wrstandardid," +
+		"         t.deliverygoodsid," +
+		"         g.deliverygoodscode," +
+		"         g.deliverygoodsname," +
+		"         w.wrstandardcode," +
+		"         w.wrstandardname," +
+		"         h.warehousecode," +
+		"         h.warehousename," +
+		"         e.enumdicname," +
+		"         w.wrstandardname || '-' || t.wrfactortypename as wrtypename" +
+		"    from wrfactortype t" +
+		"    left join deliverygoods g" +
+		"      on t.deliverygoodsid = g.deliverygoodsid" +
+		"    left join wrstandard w" +
+		"      on t.wrstandardid = w.wrstandardid" +
+		"    left join warehouseinfo h" +
+		"      on t.warehouseid = h.autoid" +
+		"    left join enumdicitem e on w.unitid = e.enumitemname and e.enumdiccode='goodsunit')" +
+		"select t.HASWR," +
+		"       t.WRTRADEORDERID," +
+		"       t.TRADEDATE," +
+		"       t.DELIVERYMONTH," +
+		"       t.WRTRADETYPE," +
+		"       t.BUYORSELL," +
+		"       t.MARKETID," +
+		"       t.USERID," +
+		"       t.WRFACTORTYPEID," +
+		"       t.ORDERQTY," +
+		"       t.TRADEQTY," +
+		"       t.CANCELQTY," +
+		"       t.WRPRICETYPE," +
+		"       t.FIXEDPRICE," +
+		"       t.PRICEMOVE," +
+		"       t.TRADEPRICE," +
+		"       to_char(t.ORDERTIME,'yyyy-mm-dd hh24:mi:ss') ORDERTIME," +
+		"       t.WRTRADEORDERSTATUS," +
+		"       c.GOODSID," +
+		"       c.GOODSCODE," +
+		"       c.pricemove FUTUPRICEMOVE," +
+		"       k.*" +
+		"  from wrtrade_orderdetail t" +
+		"  left join wrtrade_goodsconfig c" +
+		"    on t.wrtradeorderid = c.wrtradeorderid" +
+		"  left join tmp k" +
+		"    on t.wrfactortypeid = k.wrfactortypeid" +
+		"  where t.WRTRADETYPE = 1"
+	sqlId.And("t.USERID", r.USERID)
+	sqlId.And("t.haswr", r.HASWR)
+	return sqlId.String()
+}
+
+// GetDataEx 获取仓单贸易委托单
+func (r *WrOrderDetail) GetDataEx() (interface{}, error) {
+	sData := make([]WrOrderDetail, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -520,6 +520,7 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryOrderQuote", wrTrade2.QueryOrderQuote)
 		wrTrade2R.GET("QueryOrderQuoteDetail", wrTrade2.QueryOrderQuoteDetail)
 		wrTrade2R.GET("QueryWrPosition", wrTrade2.QueryWrPosition)
+		wrTrade2R.GET("QueryWrOrderDetail", wrTrade2.QueryWrOrderDetail)
 	}
 
 	return r