Просмотр исходного кода

1.增加查询融资产品列表接口
2.增加查询仓单要素详细信息接口

zou.yingbin 4 лет назад
Родитель
Сommit
af52754bbe
7 измененных файлов с 766 добавлено и 43 удалено
  1. 33 0
      controllers/wrTrade2/qryWrTrade.go
  2. 220 6
      docs/docs.go
  3. 220 6
      docs/swagger.json
  4. 153 5
      docs/swagger.yaml
  5. 9 0
      models/ermcpCommon.go
  6. 129 26
      models/wrTrade2.go
  7. 2 0
      routers/router.go

+ 33 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -206,3 +206,36 @@ func QueryFilterItem(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryFaProductDetail
+// @Summary 查询融资产品列表
+// @Description 页面 买卖大厅 -> 选择融资方案
+// @Produce json
+// @Security ApiKeyAuth
+// @Param wrfactortypeid query int true "仓单要素id"
+// @Success 200 {array} models.WrFAProductDetail
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryFaProductDetail [get]
+// @Tags 仓单贸易v2
+func QueryFaProductDetail(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrFAProductDetail{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryWrFactorTypeInfo
+// @Summary 查询仓单要素详细信息
+// @Produce json
+// @Security ApiKeyAuth
+// @Param wrfactortypeid query int true "仓单要素id"
+// @Success 200 {array} models.WrFactorTypeInfo
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrFactorTypeInfo [get]
+// @Tags 仓单贸易v2
+func QueryWrFactorTypeInfo(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrFactorTypeInfo{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 220 - 6
docs/docs.go

@@ -10933,6 +10933,49 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryFaProductDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "页面 买卖大厅 -\u003e 选择融资方案",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询融资产品列表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "仓单要素id",
+                        "name": "wrfactortypeid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrFAProductDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryFilterItem": {
             "get": {
                 "security": [
@@ -11165,10 +11208,9 @@ var doc = `{
                     },
                     {
                         "type": "integer",
-                        "description": "期货商品id",
+                        "description": "期货商品id(浮动价方式时填)",
                         "name": "goodsid",
-                        "in": "query",
-                        "required": true
+                        "in": "query"
                     },
                     {
                         "type": "integer",
@@ -11246,6 +11288,48 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryWrFactorTypeInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询仓单要素详细信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "仓单要素id",
+                        "name": "wrfactortypeid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrFactorTypeInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrGoodsInfo": {
             "get": {
                 "security": [
@@ -29372,6 +29456,136 @@ var doc = `{
                 }
             }
         },
+        "models.WrFAProductDetail": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "资金账号",
+                    "type": "integer"
+                },
+                "areauserid": {
+                    "description": "金融机构ID",
+                    "type": "integer"
+                },
+                "financingdays": {
+                    "description": "天数(天)",
+                    "type": "integer"
+                },
+                "interestminlen": {
+                    "description": "最小起息天数",
+                    "type": "integer"
+                },
+                "interestrate": {
+                    "description": "利率",
+                    "type": "number"
+                },
+                "interestratemode": {
+                    "description": "利率方式 - 1:年利率 2:日利率",
+                    "type": "integer"
+                },
+                "interestsettlemode": {
+                    "description": "结息方式 - 1:按日结息  3:按月结息",
+                    "type": "integer"
+                },
+                "interestsettlevalue": {
+                    "description": "结息方式值",
+                    "type": "integer"
+                },
+                "isautoloan": {
+                    "description": "是否自动放款 0-手动 1-自动 (当为自动放款时,显示\"放款快\")",
+                    "type": "integer"
+                },
+                "marginratio": {
+                    "description": "保证金比率质押率 - [仓单质押]",
+                    "type": "number"
+                },
+                "productdetailid": {
+                    "description": "产品组合ID(SEQ_FINANCEAREAPRODUCTDETAIL)",
+                    "type": "integer"
+                },
+                "productid": {
+                    "description": "金融产品ID",
+                    "type": "integer"
+                },
+                "productname": {
+                    "description": "产品名称",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "username": {
+                    "description": "融出方",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素ID",
+                    "type": "string"
+                }
+            }
+        },
+        "models.WrFactorTypeInfo": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "dgfactoryitemid": {
+                    "description": "选择项id",
+                    "type": "integer"
+                },
+                "dgfactoryitemtypeid": {
+                    "description": "要素选择项ID (1-仓库 2-品牌)",
+                    "type": "integer"
+                },
+                "dgfactoryitemvalue": {
+                    "description": "要素项值",
+                    "type": "string"
+                },
+                "itemtypename": {
+                    "description": "要素项名称",
+                    "type": "string"
+                },
+                "optioncompare": {
+                    "description": "选择比较串",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库id",
+                    "type": "integer"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素ID",
+                    "type": "string"
+                },
+                "wrfactortypename": {
+                    "description": "要素名称",
+                    "type": "string"
+                },
+                "wrfactortypename2": {
+                    "description": "要素名称(不含仓库)",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "品类代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "品类id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "品类名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrFilterItem": {
             "type": "object",
             "properties": {
@@ -29784,7 +29998,7 @@ var doc = `{
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素id",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrfactortypename": {
                     "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
@@ -30117,7 +30331,7 @@ var doc = `{
                     "type": "number"
                 },
                 "querytype": {
-                    "description": "查询类型  1-现货汇总 2-库存汇总(订单汇总) 3-现货明细",
+                    "description": "查询类型  1-现货汇总 2-库存汇总(订单汇总)",
                     "type": "integer"
                 },
                 "sellexcuteqty": {
@@ -30146,7 +30360,7 @@ var doc = `{
                 },
                 "wrpositionid": {
                     "description": "仓单头寸ID(201+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrpositionno": {
                     "description": "仓单编号",

+ 220 - 6
docs/swagger.json

@@ -10917,6 +10917,49 @@
                 }
             }
         },
+        "/WrTrade2/QueryFaProductDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "页面 买卖大厅 -\u003e 选择融资方案",
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询融资产品列表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "仓单要素id",
+                        "name": "wrfactortypeid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrFAProductDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryFilterItem": {
             "get": {
                 "security": [
@@ -11149,10 +11192,9 @@
                     },
                     {
                         "type": "integer",
-                        "description": "期货商品id",
+                        "description": "期货商品id(浮动价方式时填)",
                         "name": "goodsid",
-                        "in": "query",
-                        "required": true
+                        "in": "query"
                     },
                     {
                         "type": "integer",
@@ -11230,6 +11272,48 @@
                 }
             }
         },
+        "/WrTrade2/QueryWrFactorTypeInfo": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询仓单要素详细信息",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "仓单要素id",
+                        "name": "wrfactortypeid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrFactorTypeInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrGoodsInfo": {
             "get": {
                 "security": [
@@ -29356,6 +29440,136 @@
                 }
             }
         },
+        "models.WrFAProductDetail": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "资金账号",
+                    "type": "integer"
+                },
+                "areauserid": {
+                    "description": "金融机构ID",
+                    "type": "integer"
+                },
+                "financingdays": {
+                    "description": "天数(天)",
+                    "type": "integer"
+                },
+                "interestminlen": {
+                    "description": "最小起息天数",
+                    "type": "integer"
+                },
+                "interestrate": {
+                    "description": "利率",
+                    "type": "number"
+                },
+                "interestratemode": {
+                    "description": "利率方式 - 1:年利率 2:日利率",
+                    "type": "integer"
+                },
+                "interestsettlemode": {
+                    "description": "结息方式 - 1:按日结息  3:按月结息",
+                    "type": "integer"
+                },
+                "interestsettlevalue": {
+                    "description": "结息方式值",
+                    "type": "integer"
+                },
+                "isautoloan": {
+                    "description": "是否自动放款 0-手动 1-自动 (当为自动放款时,显示\"放款快\")",
+                    "type": "integer"
+                },
+                "marginratio": {
+                    "description": "保证金比率质押率 - [仓单质押]",
+                    "type": "number"
+                },
+                "productdetailid": {
+                    "description": "产品组合ID(SEQ_FINANCEAREAPRODUCTDETAIL)",
+                    "type": "integer"
+                },
+                "productid": {
+                    "description": "金融产品ID",
+                    "type": "integer"
+                },
+                "productname": {
+                    "description": "产品名称",
+                    "type": "string"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "username": {
+                    "description": "融出方",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素ID",
+                    "type": "string"
+                }
+            }
+        },
+        "models.WrFactorTypeInfo": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsname": {
+                    "description": "品种名称",
+                    "type": "string"
+                },
+                "dgfactoryitemid": {
+                    "description": "选择项id",
+                    "type": "integer"
+                },
+                "dgfactoryitemtypeid": {
+                    "description": "要素选择项ID (1-仓库 2-品牌)",
+                    "type": "integer"
+                },
+                "dgfactoryitemvalue": {
+                    "description": "要素项值",
+                    "type": "string"
+                },
+                "itemtypename": {
+                    "description": "要素项名称",
+                    "type": "string"
+                },
+                "optioncompare": {
+                    "description": "选择比较串",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库id",
+                    "type": "integer"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素ID",
+                    "type": "string"
+                },
+                "wrfactortypename": {
+                    "description": "要素名称",
+                    "type": "string"
+                },
+                "wrfactortypename2": {
+                    "description": "要素名称(不含仓库)",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "品类代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "品类id",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "品类名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrFilterItem": {
             "type": "object",
             "properties": {
@@ -29768,7 +29982,7 @@
                 },
                 "wrfactortypeid": {
                     "description": "仓单要素id",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrfactortypename": {
                     "description": "仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)",
@@ -30101,7 +30315,7 @@
                     "type": "number"
                 },
                 "querytype": {
-                    "description": "查询类型  1-现货汇总 2-库存汇总(订单汇总) 3-现货明细",
+                    "description": "查询类型  1-现货汇总 2-库存汇总(订单汇总)",
                     "type": "integer"
                 },
                 "sellexcuteqty": {
@@ -30130,7 +30344,7 @@
                 },
                 "wrpositionid": {
                     "description": "仓单头寸ID(201+Unix秒时间戳(10位)+xxxxxx)",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "wrpositionno": {
                     "description": "仓单编号",

+ 153 - 5
docs/swagger.yaml

@@ -13280,6 +13280,102 @@ definitions:
     - autoid
     - warehousecode
     type: object
+  models.WrFAProductDetail:
+    properties:
+      accountid:
+        description: 资金账号
+        type: integer
+      areauserid:
+        description: 金融机构ID
+        type: integer
+      financingdays:
+        description: 天数(天)
+        type: integer
+      interestminlen:
+        description: 最小起息天数
+        type: integer
+      interestrate:
+        description: 利率
+        type: number
+      interestratemode:
+        description: 利率方式 - 1:年利率 2:日利率
+        type: integer
+      interestsettlemode:
+        description: 结息方式 - 1:按日结息  3:按月结息
+        type: integer
+      interestsettlevalue:
+        description: 结息方式值
+        type: integer
+      isautoloan:
+        description: 是否自动放款 0-手动 1-自动 (当为自动放款时,显示"放款快")
+        type: integer
+      marginratio:
+        description: 保证金比率质押率 - [仓单质押]
+        type: number
+      productdetailid:
+        description: 产品组合ID(SEQ_FINANCEAREAPRODUCTDETAIL)
+        type: integer
+      productid:
+        description: 金融产品ID
+        type: integer
+      productname:
+        description: 产品名称
+        type: string
+      updatetime:
+        description: 更新时间
+        type: string
+      username:
+        description: 融出方
+        type: string
+      wrfactortypeid:
+        description: 仓单要素ID
+        type: string
+    type: object
+  models.WrFactorTypeInfo:
+    properties:
+      deliverygoodscode:
+        description: 品种代码
+        type: string
+      deliverygoodsname:
+        description: 品种名称
+        type: string
+      dgfactoryitemid:
+        description: 选择项id
+        type: integer
+      dgfactoryitemtypeid:
+        description: 要素选择项ID (1-仓库 2-品牌)
+        type: integer
+      dgfactoryitemvalue:
+        description: 要素项值
+        type: string
+      itemtypename:
+        description: 要素项名称
+        type: string
+      optioncompare:
+        description: 选择比较串
+        type: string
+      warehouseid:
+        description: 仓库id
+        type: integer
+      wrfactortypeid:
+        description: 仓单要素ID
+        type: string
+      wrfactortypename:
+        description: 要素名称
+        type: string
+      wrfactortypename2:
+        description: 要素名称(不含仓库)
+        type: string
+      wrstandardcode:
+        description: 品类代码
+        type: string
+      wrstandardid:
+        description: 品类id
+        type: integer
+      wrstandardname:
+        description: 品类名称
+        type: string
+    type: object
   models.WrFilterItem:
     properties:
       itemcode:
@@ -13588,7 +13684,7 @@ definitions:
         type: string
       wrfactortypeid:
         description: 仓单要素id
-        type: integer
+        type: string
       wrfactortypename:
         description: 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
         type: string
@@ -13837,7 +13933,7 @@ definitions:
         description: 质押数量
         type: number
       querytype:
-        description: 查询类型  1-现货汇总 2-库存汇总(订单汇总) 3-现货明细
+        description: 查询类型  1-现货汇总 2-库存汇总(订单汇总)
         type: integer
       sellexcuteqty:
         description: 销售履约中数量
@@ -13859,7 +13955,7 @@ definitions:
         type: string
       wrpositionid:
         description: 仓单头寸ID(201+Unix秒时间戳(10位)+xxxxxx)
-        type: integer
+        type: string
       wrpositionno:
         description: 仓单编号
         type: string
@@ -22936,6 +23032,33 @@ paths:
       tags:
       - 仓单贸易
       - 仓单贸易
+  /WrTrade2/QueryFaProductDetail:
+    get:
+      description: 页面 买卖大厅 -> 选择融资方案
+      parameters:
+      - description: 仓单要素id
+        in: query
+        name: wrfactortypeid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrFAProductDetail'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询融资产品列表
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryFilterItem:
     get:
       parameters:
@@ -23078,10 +23201,9 @@ paths:
         name: wrfactortypeid
         required: true
         type: integer
-      - description: 期货商品id
+      - description: 期货商品id(浮动价方式时填)
         in: query
         name: goodsid
-        required: true
         type: integer
       - description: 买卖方向 0-买 1-卖
         in: query
@@ -23137,6 +23259,32 @@ paths:
       summary: 查询履约信息
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrFactorTypeInfo:
+    get:
+      parameters:
+      - description: 仓单要素id
+        in: query
+        name: wrfactortypeid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrFactorTypeInfo'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询仓单要素详细信息
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrGoodsInfo:
     get:
       parameters:

+ 9 - 0
models/ermcpCommon.go

@@ -59,6 +59,15 @@ func DecodeStr(condition bool, strTrue, strFalse string) string {
 	return strFalse
 }
 
+// IFValue 类似于三元表达式
+func IFValue(condition bool, trueValue interface{}, falseValue interface{}) interface{} {
+	if condition {
+		return trueValue
+	} else {
+		return falseValue
+	}
+}
+
 // InStrBuilder 构建InStr字串
 type InStrBuilder struct {
 	Value []interface{}

+ 129 - 26
models/wrTrade2.go

@@ -15,28 +15,28 @@ import (
 
 // WrOrderQuote 买卖大厅行情
 type WrOrderQuote struct {
-	WRFACTORTYPEID    string  `json:"wrfactortypeid"  xorm:"'WRFACTORTYPEID'" form:"wrfactortypeid"` // 仓单要素id
-	BUYPRICE          float64 `json:"buyprice"  xorm:"'BUYPRICE'"`                                   // 买价
-	BUYQTY            float64 `json:"buyqty"  xorm:"'BUYQTY'"`                                       // 买量
-	SELLPRICE         float64 `json:"sellprice"  xorm:"'SELLPRICE'"`                                 // 卖价
-	SELLQTY           float64 `json:"sellqty"  xorm:"'SELLQTY'"`                                     // 卖量
-	WRFACTORTYPENAME  string  `json:"wrfactortypename"  xorm:"'WRFACTORTYPENAME'"`                   // 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
-	DELIVERYGOODSID   int32   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`                     // 品种id
-	WRSTANDARDID      int32   `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`                           // 商品id
-	WAREHOUSEID       int32   `json:"warehouseid"  xorm:"'WAREHOUSEID'" form:"warehouseid"`          // 仓库id
-	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`                 // 品种名称
-	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`                 // 品种代码
-	WAREHOUSENAME     string  `json:"warehousename"  xorm:"'WAREHOUSENAME'"`                         // 仓库名称
-	WAREHOUSECODE     string  `json:"warehousecode"  xorm:"'WAREHOUSECODE'"`                         // 仓库代码
-	WRSTANDARDNAME    string  `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'" form:"wrstandardname"` // 商品名称
-	WRSTANDARDCODE    string  `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`                       // 商品代码
-	WRGOODSNAME       string  `json:"wrgoodsname"  xorm:"'WRGOODSNAME'"`                             // 商品(商品名称+仓库要素名称 拼接)
-	BUYPRICEMOVE      float64 `json:"buypricemove"  xorm:"'BUYPRICEMOVE'"`                           // 买升贴水(基差)
-	SELLPRICEMOVE     float64 `json:"sellpricemove"  xorm:"'SELLPRICEMOVE'"`                         // 卖升贴水(基差)
-	GOODSID           int32   `json:"goodsid"  xorm:"'GOODSID'"`                                     // 商品id(浮动价列表才有)
-	GOODSCODE         string  `json:"goodscode"  xorm:"'GOODSCODE'"`                                 // 商品合约(浮动价列表才有)
-	DELIVERYMONTH     string  `json:"deliverymonth"  xorm:"'DELIVERYMONTH'"`                         // 交收月
-	PageEx            `xorm:"extends"`                                                               // 页码信息
+	WRFACTORTYPEID    string           `json:"wrfactortypeid"  xorm:"'WRFACTORTYPEID'" form:"wrfactortypeid"` // 仓单要素id
+	BUYPRICE          float64          `json:"buyprice"  xorm:"'BUYPRICE'"`                                   // 买价
+	BUYQTY            float64          `json:"buyqty"  xorm:"'BUYQTY'"`                                       // 买量
+	SELLPRICE         float64          `json:"sellprice"  xorm:"'SELLPRICE'"`                                 // 卖价
+	SELLQTY           float64          `json:"sellqty"  xorm:"'SELLQTY'"`                                     // 卖量
+	WRFACTORTYPENAME  string           `json:"wrfactortypename"  xorm:"'WRFACTORTYPENAME'"`                   // 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+	DELIVERYGOODSID   int32            `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`                     // 品种id
+	WRSTANDARDID      int32            `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`                           // 商品id
+	WAREHOUSEID       int32            `json:"warehouseid"  xorm:"'WAREHOUSEID'" form:"warehouseid"`          // 仓库id
+	DELIVERYGOODSNAME string           `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"`                 // 品种名称
+	DELIVERYGOODSCODE string           `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"`                 // 品种代码
+	WAREHOUSENAME     string           `json:"warehousename"  xorm:"'WAREHOUSENAME'"`                         // 仓库名称
+	WAREHOUSECODE     string           `json:"warehousecode"  xorm:"'WAREHOUSECODE'"`                         // 仓库代码
+	WRSTANDARDNAME    string           `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'" form:"wrstandardname"` // 商品名称
+	WRSTANDARDCODE    string           `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`                       // 商品代码
+	WRGOODSNAME       string           `json:"wrgoodsname"  xorm:"'WRGOODSNAME'"`                             // 商品(商品名称+仓库要素名称 拼接)
+	BUYPRICEMOVE      float64          `json:"buypricemove"  xorm:"'BUYPRICEMOVE'"`                           // 买升贴水(基差)
+	SELLPRICEMOVE     float64          `json:"sellpricemove"  xorm:"'SELLPRICEMOVE'"`                         // 卖升贴水(基差)
+	GOODSID           int32            `json:"goodsid"  xorm:"'GOODSID'"`                                     // 商品id(浮动价列表才有)
+	GOODSCODE         string           `json:"goodscode"  xorm:"'GOODSCODE'"`                                 // 商品合约(浮动价列表才有)
+	DELIVERYMONTH     string           `json:"deliverymonth"  xorm:"'DELIVERYMONTH'"`                         // 交收月
+	PageEx            `xorm:"extends"` // 页码信息
 
 	HasWr       int32  `json:"-" form:"haswr"`       // 是否有仓单 0-没有 1-有
 	WrPriceType int32  `json:"-" form:"wrpricetype"` // 价格方式 - 1:固定价 2-浮动价  -   [挂牌]
@@ -834,8 +834,8 @@ func (r *WrSpecialMatchOrder) GetDataByPage() (interface{}, error, int, int, int
 
 // WrFactorTypeInfo 仓单要素选择项
 type WrFactorTypeInfo struct {
-	WRFACTORTYPEID      int64  `json:"wrfactortypeid"  xorm:"'WRFACTORTYPEID'" form:"wrfactortypeid"` // 仓单要素ID
-	DGFACTORYITEMTYPEID int64  `json:"dgfactoryitemtypeid"  xorm:"'DGFACTORYITEMTYPEID'"`             // 要素选择项ID
+	WRFACTORTYPEID      string `json:"wrfactortypeid"  xorm:"'WRFACTORTYPEID'" form:"wrfactortypeid"` // 仓单要素ID
+	DGFACTORYITEMTYPEID int64  `json:"dgfactoryitemtypeid"  xorm:"'DGFACTORYITEMTYPEID'"`             // 要素选择项ID (1-仓库 2-品牌)
 	ITEMTYPENAME        string `json:"itemtypename"  xorm:"'ITEMTYPENAME'"`                           // 要素项名称
 	DGFACTORYITEMVALUE  string `json:"dgfactoryitemvalue"  xorm:"'DGFACTORYITEMVALUE'"`               // 要素项值
 	OPTIONCOMPARE       string `json:"optioncompare"  xorm:"'OPTIONCOMPARE'"`                         // 选择比较串
@@ -845,6 +845,9 @@ type WrFactorTypeInfo struct {
 	WRSTANDARDCODE      string `json:"wrstandardcode"  xorm:"'WRSTANDARDCODE'"`                       // 品类代码
 	WRSTANDARDNAME      string `json:"wrstandardname"  xorm:"'WRSTANDARDNAME'"`                       // 品类名称
 	WRSTANDARDID        int64  `json:"wrstandardid"  xorm:"'WRSTANDARDID'"`                           // 品类id
+	DGFACTORYITEMID     int64  `json:"dgfactoryitemid"  xorm:"'DGFACTORYITEMID'"`                     // 选择项id
+	WRFACTORTYPENAME    string `json:"wrfactortypename"  xorm:"'WRFACTORTYPENAME'"`                   // 要素名称
+	WRFACTORTYPENAME2   string `json:"wrfactortypename2"  xorm:"'WRFACTORTYPENAME2'"`                 // 要素名称(不含仓库)
 }
 
 func (r *WrFactorTypeInfo) calc() {
@@ -862,7 +865,10 @@ func (r *WrFactorTypeInfo) buildSql() string {
 		"       g.deliverygoodsname," +
 		"       g.deliverygoodscode," +
 		"       w.wrstandardcode," +
-		"       w.wrstandardname" +
+		"       w.wrstandardname," +
+		"       c.dgfactoryitemid," +
+		"       t.wrfactortypename," +
+		"       t.wrfactortypename2" +
 		"  from wrfactortype t" +
 		" inner join wrfactortypeitem a" +
 		"    on t.wrfactortypeid = a.wrfactortypeid" +
@@ -889,6 +895,11 @@ func (r *WrFactorTypeInfo) GetData() ([]WrFactorTypeInfo, error) {
 	return sData, err
 }
 
+// GetDataEx 获取仓单要素选择项
+func (r *WrFactorTypeInfo) GetDataEx() (interface{}, error) {
+	return r.GetData()
+}
+
 // WrGoodsPerformanceStep 商品履约步骤
 type WrGoodsPerformanceStep struct {
 	AUTOID       int64    `json:"autoid"  xorm:"AUTOID" form:"autoid"`             // AutoID
@@ -962,7 +973,7 @@ type WrTypeItem struct {
 
 // WrGoodsInfo 仓单商品信息(仓单要素列展开+履约计划步骤)
 type WrGoodsInfo struct {
-	WRFACTORTYPEID int64                    `json:"-" form:"wrfactortypeid"`  // 仓单要素ID
+	WRFACTORTYPEID string                   `json:"-" form:"wrfactortypeid"`  // 仓单要素ID
 	MARKETID       int64                    `json:"marketid" form:"marketid"` // 市场id
 	HASWR          int32                    `json:"haswr" form:"haswr"`       // 0:仓单预售 1:仓单贸易
 	LstItem        []WrTypeItem             `json:"lstitem"`                  // 商品信息项
@@ -1426,3 +1437,95 @@ func (r *WrPerformanPlanSum) GetData() ([]WrPerformanPlanSum, error) {
 	}
 	return sData, err
 }
+
+// WrFAProductDetail 融资产品列表
+type WrFAProductDetail struct {
+	PRODUCTDETAILID     int64   `json:"productdetailid"  xorm:"PRODUCTDETAILID"`         // 产品组合ID(SEQ_FINANCEAREAPRODUCTDETAIL)
+	PRODUCTID           int64   `json:"productid"  xorm:"PRODUCTID"`                     // 金融产品ID
+	AREAUSERID          int64   `json:"areauserid"  xorm:"AREAUSERID"`                   // 金融机构ID
+	FINANCINGDAYS       int32   `json:"financingdays"  xorm:"FINANCINGDAYS"`             // 天数(天)
+	MARGINRATIO         float64 `json:"marginratio"  xorm:"MARGINRATIO"`                 // 保证金比率质押率 - [仓单质押]
+	INTERESTRATEMODE    int32   `json:"interestratemode"  xorm:"INTERESTRATEMODE"`       // 利率方式 - 1:年利率 2:日利率
+	INTERESTRATE        float64 `json:"interestrate"  xorm:"INTERESTRATE"`               // 利率
+	INTERESTMINLEN      int32   `json:"interestminlen"  xorm:"INTERESTMINLEN"`           // 最小起息天数
+	INTERESTSETTLEMODE  int32   `json:"interestsettlemode"  xorm:"INTERESTSETTLEMODE"`   // 结息方式 - 1:按日结息  3:按月结息
+	INTERESTSETTLEVALUE int32   `json:"interestsettlevalue"  xorm:"INTERESTSETTLEVALUE"` // 结息方式值
+	UPDATETIME          string  `json:"updatetime"  xorm:"UPDATETIME"`                   // 更新时间
+	ISAUTOLOAN          int32   `json:"isautoloan"  xorm:"'ISAUTOLOAN'"`                 // 是否自动放款 0-手动 1-自动 (当为自动放款时,显示"放款快")
+	PRODUCTNAME         string  `json:"productname"  xorm:"'PRODUCTNAME'"`               // 产品名称
+	USERNAME            string  `json:"username"  xorm:"'USERNAME'"`                     // 融出方
+	ACCOUNTID           int64   `json:"accountid"  xorm:"'ACCOUNTID'"`                   // 资金账号
+
+	LOANTAG string `json:"-"` // 放款标识:  "放款快" 或者为空
+
+	WRSTANDARDID   int64  `json:"-"`                                    // 品类(商品)id
+	BRANDID        int64  `json:"-"`                                    // 品牌id
+	WAREHOUSEID    int64  `json:"-"`                                    // 仓库id
+	WRFACTORTYPEID string `json:"wrfactortypeid" form:"wrfactortypeid"` // 仓单要素ID
+}
+
+func (r *WrFAProductDetail) calc() {
+	r.LOANTAG = IFValue(r.ISAUTOLOAN == 1, "放款快", "").(string)
+}
+
+func (r *WrFAProductDetail) buildSql() string {
+	var sqlId utils.SQLVal = "with tmp as" +
+		" (select distinct f.productid, f.isautoloan" +
+		"    from FinanceAreaProductLimit f" +
+		"   where 1 = 1" +
+		"     and f.wrstandardid = %v" +
+		"     and (f.spotgoodsbrandid like '%%,%v,%%' or f.spotgoodsbrandid like '%%,0,%%')" +
+		"     and (f.warehouseinfoid like '%%,%v,%%' or f.warehouseinfoid like '%%,0,%%'))" +
+		"select t.PRODUCTDETAILID," +
+		"       t.PRODUCTID," +
+		"       t.AREAUSERID," +
+		"       t.FINANCINGDAYS," +
+		"       t.MARGINRATIO," +
+		"       t.INTERESTRATEMODE," +
+		"       t.INTERESTRATE," +
+		"       t.INTERESTMINLEN," +
+		"       t.INTERESTSETTLEMODE," +
+		"       t.INTERESTSETTLEVALUE," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       p.productname," +
+		"       p.accountid," +
+		"       u.accountname username," +
+		"       k.isautoloan" +
+		"  from FinanceAreaProductDetail t" +
+		"  left join FinanceAreaProduct p" +
+		"    on t.productid = p.productid" +
+		"  left join useraccount u" +
+		"    on t.areauserid = u.userid" +
+		" inner join tmp k" +
+		"    on t.productid = k.productid"
+	sqlId.FormatParam(r.WRSTANDARDID, r.BRANDID, r.WAREHOUSEID)
+	return sqlId.String()
+}
+
+// GetDataEx 获取融资产品列表
+func (r *WrFAProductDetail) GetDataEx() (interface{}, error) {
+	sData := make([]WrFAProductDetail, 0)
+	m := WrFactorTypeInfo{WRFACTORTYPEID: r.WRFACTORTYPEID}
+	if d, err := m.GetData(); err == nil {
+		var brandid int64 = 0
+		for _, v := range d {
+			if v.DGFACTORYITEMTYPEID == 2 {
+				brandid = v.DGFACTORYITEMID
+			}
+		}
+		if brandid > 0 && len(d) > 0 {
+			r.BRANDID = brandid
+			r.WRSTANDARDID = d[0].WRSTANDARDID
+			r.WAREHOUSEID = d[0].WAREHOUSEID
+			_ = db.GetEngine().SQL(r.buildSql()).Find(&sData)
+			for i := range sData {
+				sData[i].calc()
+				sData[i].WRSTANDARDID = r.WRSTANDARDID
+				sData[i].BRANDID = r.BRANDID
+				sData[i].WAREHOUSEID = r.WAREHOUSEID
+				sData[i].WRFACTORTYPEID = r.WRFACTORTYPEID
+			}
+		}
+	}
+	return sData, nil
+}

+ 2 - 0
routers/router.go

@@ -528,6 +528,8 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryPerformancePlan", wrTrade2.QueryPerformancePlan)
 		wrTrade2R.GET("QueryHoldLB", wrTrade2.QueryHoldLB)
 		wrTrade2R.GET("QueryFilterItem", wrTrade2.QueryFilterItem)
+		wrTrade2R.GET("QueryFaProductDetail", wrTrade2.QueryFaProductDetail)
+		wrTrade2R.GET("QueryWrFactorTypeInfo", wrTrade2.QueryWrFactorTypeInfo)
 	}
 
 	return r