Przeglądaj źródła

1.增加查询指数接口
2.查套保品增加单位id
3.增加查板块接口
4.增加查资讯接口

zou.yingbin 4 lat temu
rodzic
commit
ef2ed58604

+ 47 - 0
controllers/wrTrade2/qryWrTrade.go

@@ -635,3 +635,50 @@ func QueryWrUserReceiptInfo(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QuerySiteColumnDetail
+// @Summary 查询资讯
+// @Produce json
+// @Security ApiKeyAuth
+// @Param page query int false "页码"
+// @Param pagesize query int false "每页条数"
+// @Success 200 {array} models.WrSiteColumnDetail
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QuerySiteColumnDetail [get]
+// @Tags 仓单贸易v2
+func QuerySiteColumnDetail(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrSiteColumnDetail{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryDeliveryGoodsSection
+// @Summary 查询板块(分类)
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} models.WrDeliveryGoodsSection
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryDeliveryGoodsSection [get]
+// @Tags 仓单贸易v2
+func QueryDeliveryGoodsSection(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrDeliveryGoodsSection{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QuerySpotGroupTradeSum
+// @Summary 查询指数
+// @Produce json
+// @Security ApiKeyAuth
+// @Success 200 {array} models.WrSpotGroupTradeSumEx
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QuerySpotGroupTradeSum [get]
+// @Tags 仓单贸易v2
+func QuerySpotGroupTradeSum(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrSpotGroupTradeSumEx{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 272 - 0
docs/docs.go

@@ -11940,6 +11940,39 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QueryDeliveryGoodsSection": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询板块(分类)",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrDeliveryGoodsSection"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryFaProductDetail": {
             "get": {
                 "security": [
@@ -12529,6 +12562,86 @@ var doc = `{
                 }
             }
         },
+        "/WrTrade2/QuerySiteColumnDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询资讯",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrSiteColumnDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/WrTrade2/QuerySpotGroupTradeSum": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询指数",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrSpotGroupTradeSumEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrAverageTradePrice": {
             "get": {
                 "security": [
@@ -31830,6 +31943,10 @@ var doc = `{
                     "description": "单位名称",
                     "type": "string"
                 },
+                "goodsunitid": {
+                    "description": "套保品种单位id",
+                    "type": "integer"
+                },
                 "gplst": {
                     "description": "期货品种列表",
                     "type": "array",
@@ -33705,6 +33822,59 @@ var doc = `{
                 }
             }
         },
+        "models.WrDeliveryGoodsSection": {
+            "type": "object",
+            "properties": {
+                "dglst": {
+                    "description": "板块商品列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.WrDeliveryGoodsSectionConfig"
+                    }
+                },
+                "imagepath": {
+                    "description": "图片地址",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "排序",
+                    "type": "integer"
+                },
+                "sectionid": {
+                    "description": "版块ID (SEQ_DELIVERYGOODSSECTION)  - 自增100开始, 前面ID预留给SectionType = 1的版块1 - 云融指数",
+                    "type": "integer"
+                },
+                "sectionname": {
+                    "description": "版块名称",
+                    "type": "string"
+                },
+                "sectiontype": {
+                    "description": "版块类型 - 1:指数版块 2:普通版块",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.WrDeliveryGoodsSectionConfig": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID(SEQ_DELIVERYGOODS)",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "排序",
+                    "type": "integer"
+                }
+            }
+        },
         "models.WrFAProductDetail": {
             "type": "object",
             "properties": {
@@ -35947,6 +36117,47 @@ var doc = `{
                 }
             }
         },
+        "models.WrSiteColumnDetail": {
+            "type": "object",
+            "properties": {
+                "brief": {
+                    "description": "简介",
+                    "type": "string"
+                },
+                "context": {
+                    "description": "内容",
+                    "type": "string"
+                },
+                "coverimage": {
+                    "description": "封面图片",
+                    "type": "string"
+                },
+                "creaedate": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "id": {
+                    "description": "ID(SEQ_SITE_COLUMNDETAIL)",
+                    "type": "integer"
+                },
+                "istop": {
+                    "description": "是否置顶 - 0:不置 1:置顶",
+                    "type": "integer"
+                },
+                "publishdate": {
+                    "description": "发布日期",
+                    "type": "string"
+                },
+                "title": {
+                    "description": "标题",
+                    "type": "string"
+                },
+                "updatedate": {
+                    "description": "修改时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrSpecialMatchOrder": {
             "type": "object",
             "properties": {
@@ -36088,6 +36299,67 @@ var doc = `{
                 }
             }
         },
+        "models.WrSpotGroupTradeSum": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "现货品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID(SEQ_DELIVERYGOODS)",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "现货品种名称",
+                    "type": "string"
+                },
+                "lastavgprice": {
+                    "description": "上上个交易日价格(前2天价格)",
+                    "type": "string"
+                },
+                "lastreckondate": {
+                    "description": "上上个交易日(前2天交易日)",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "上个交易日(前1天交易日)",
+                    "type": "string"
+                },
+                "todayavgprice": {
+                    "description": "上个交易日价格(前1天价格)",
+                    "type": "string"
+                },
+                "updown": {
+                    "description": "涨跌",
+                    "type": "string"
+                },
+                "updownratio": {
+                    "description": "涨幅(已格式化, 直接显示即可)",
+                    "type": "string"
+                }
+            }
+        },
+        "models.WrSpotGroupTradeSumEx": {
+            "type": "object",
+            "properties": {
+                "lst": {
+                    "description": "指数列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.WrSpotGroupTradeSum"
+                    }
+                },
+                "prereckondate": {
+                    "description": "上上个交易日(yyymmdd)",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "上个交易日(yyyymmdd)",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrStandardFactoryItem": {
             "type": "object",
             "properties": {

+ 272 - 0
docs/swagger.json

@@ -11924,6 +11924,39 @@
                 }
             }
         },
+        "/WrTrade2/QueryDeliveryGoodsSection": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询板块(分类)",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrDeliveryGoodsSection"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryFaProductDetail": {
             "get": {
                 "security": [
@@ -12513,6 +12546,86 @@
                 }
             }
         },
+        "/WrTrade2/QuerySiteColumnDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询资讯",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrSiteColumnDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/WrTrade2/QuerySpotGroupTradeSum": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询指数",
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrSpotGroupTradeSumEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/WrTrade2/QueryWrAverageTradePrice": {
             "get": {
                 "security": [
@@ -31814,6 +31927,10 @@
                     "description": "单位名称",
                     "type": "string"
                 },
+                "goodsunitid": {
+                    "description": "套保品种单位id",
+                    "type": "integer"
+                },
                 "gplst": {
                     "description": "期货品种列表",
                     "type": "array",
@@ -33689,6 +33806,59 @@
                 }
             }
         },
+        "models.WrDeliveryGoodsSection": {
+            "type": "object",
+            "properties": {
+                "dglst": {
+                    "description": "板块商品列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.WrDeliveryGoodsSectionConfig"
+                    }
+                },
+                "imagepath": {
+                    "description": "图片地址",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "排序",
+                    "type": "integer"
+                },
+                "sectionid": {
+                    "description": "版块ID (SEQ_DELIVERYGOODSSECTION)  - 自增100开始, 前面ID预留给SectionType = 1的版块1 - 云融指数",
+                    "type": "integer"
+                },
+                "sectionname": {
+                    "description": "版块名称",
+                    "type": "string"
+                },
+                "sectiontype": {
+                    "description": "版块类型 - 1:指数版块 2:普通版块",
+                    "type": "integer"
+                }
+            }
+        },
+        "models.WrDeliveryGoodsSectionConfig": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID(SEQ_DELIVERYGOODS)",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                },
+                "orderindex": {
+                    "description": "排序",
+                    "type": "integer"
+                }
+            }
+        },
         "models.WrFAProductDetail": {
             "type": "object",
             "properties": {
@@ -35931,6 +36101,47 @@
                 }
             }
         },
+        "models.WrSiteColumnDetail": {
+            "type": "object",
+            "properties": {
+                "brief": {
+                    "description": "简介",
+                    "type": "string"
+                },
+                "context": {
+                    "description": "内容",
+                    "type": "string"
+                },
+                "coverimage": {
+                    "description": "封面图片",
+                    "type": "string"
+                },
+                "creaedate": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "id": {
+                    "description": "ID(SEQ_SITE_COLUMNDETAIL)",
+                    "type": "integer"
+                },
+                "istop": {
+                    "description": "是否置顶 - 0:不置 1:置顶",
+                    "type": "integer"
+                },
+                "publishdate": {
+                    "description": "发布日期",
+                    "type": "string"
+                },
+                "title": {
+                    "description": "标题",
+                    "type": "string"
+                },
+                "updatedate": {
+                    "description": "修改时间",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrSpecialMatchOrder": {
             "type": "object",
             "properties": {
@@ -36072,6 +36283,67 @@
                 }
             }
         },
+        "models.WrSpotGroupTradeSum": {
+            "type": "object",
+            "properties": {
+                "deliverygoodscode": {
+                    "description": "现货品种代码",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID(SEQ_DELIVERYGOODS)",
+                    "type": "integer"
+                },
+                "deliverygoodsname": {
+                    "description": "现货品种名称",
+                    "type": "string"
+                },
+                "lastavgprice": {
+                    "description": "上上个交易日价格(前2天价格)",
+                    "type": "string"
+                },
+                "lastreckondate": {
+                    "description": "上上个交易日(前2天交易日)",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "上个交易日(前1天交易日)",
+                    "type": "string"
+                },
+                "todayavgprice": {
+                    "description": "上个交易日价格(前1天价格)",
+                    "type": "string"
+                },
+                "updown": {
+                    "description": "涨跌",
+                    "type": "string"
+                },
+                "updownratio": {
+                    "description": "涨幅(已格式化, 直接显示即可)",
+                    "type": "string"
+                }
+            }
+        },
+        "models.WrSpotGroupTradeSumEx": {
+            "type": "object",
+            "properties": {
+                "lst": {
+                    "description": "指数列表",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.WrSpotGroupTradeSum"
+                    }
+                },
+                "prereckondate": {
+                    "description": "上上个交易日(yyymmdd)",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "上个交易日(yyyymmdd)",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrStandardFactoryItem": {
             "type": "object",
             "properties": {

+ 184 - 0
docs/swagger.yaml

@@ -13339,6 +13339,9 @@ definitions:
       enumdicname:
         description: 单位名称
         type: string
+      goodsunitid:
+        description: 套保品种单位id
+        type: integer
       gplst:
         description: 期货品种列表
         items:
@@ -14726,6 +14729,44 @@ definitions:
         description: 商品名称
         type: string
     type: object
+  models.WrDeliveryGoodsSection:
+    properties:
+      dglst:
+        description: 板块商品列表
+        items:
+          $ref: '#/definitions/models.WrDeliveryGoodsSectionConfig'
+        type: array
+      imagepath:
+        description: 图片地址
+        type: string
+      orderindex:
+        description: 排序
+        type: integer
+      sectionid:
+        description: 版块ID (SEQ_DELIVERYGOODSSECTION)  - 自增100开始, 前面ID预留给SectionType = 1的版块1 - 云融指数
+        type: integer
+      sectionname:
+        description: 版块名称
+        type: string
+      sectiontype:
+        description: 版块类型 - 1:指数版块 2:普通版块
+        type: integer
+    type: object
+  models.WrDeliveryGoodsSectionConfig:
+    properties:
+      deliverygoodscode:
+        description: 现货商品代码
+        type: string
+      deliverygoodsid:
+        description: 现货品种ID(SEQ_DELIVERYGOODS)
+        type: integer
+      deliverygoodsname:
+        description: 现货商品名称
+        type: string
+      orderindex:
+        description: 排序
+        type: integer
+    type: object
   models.WrFAProductDetail:
     properties:
       accountid:
@@ -16389,6 +16430,36 @@ definitions:
         description: 更新时间
         type: string
     type: object
+  models.WrSiteColumnDetail:
+    properties:
+      brief:
+        description: 简介
+        type: string
+      context:
+        description: 内容
+        type: string
+      coverimage:
+        description: 封面图片
+        type: string
+      creaedate:
+        description: 创建时间
+        type: string
+      id:
+        description: ID(SEQ_SITE_COLUMNDETAIL)
+        type: integer
+      istop:
+        description: 是否置顶 - 0:不置 1:置顶
+        type: integer
+      publishdate:
+        description: 发布日期
+        type: string
+      title:
+        description: 标题
+        type: string
+      updatedate:
+        description: 修改时间
+        type: string
+    type: object
   models.WrSpecialMatchOrder:
     properties:
       amount:
@@ -16494,6 +16565,50 @@ definitions:
         description: 商品
         type: string
     type: object
+  models.WrSpotGroupTradeSum:
+    properties:
+      deliverygoodscode:
+        description: 现货品种代码
+        type: string
+      deliverygoodsid:
+        description: 现货品种ID(SEQ_DELIVERYGOODS)
+        type: integer
+      deliverygoodsname:
+        description: 现货品种名称
+        type: string
+      lastavgprice:
+        description: 上上个交易日价格(前2天价格)
+        type: string
+      lastreckondate:
+        description: 上上个交易日(前2天交易日)
+        type: string
+      reckondate:
+        description: 上个交易日(前1天交易日)
+        type: string
+      todayavgprice:
+        description: 上个交易日价格(前1天价格)
+        type: string
+      updown:
+        description: 涨跌
+        type: string
+      updownratio:
+        description: 涨幅(已格式化, 直接显示即可)
+        type: string
+    type: object
+  models.WrSpotGroupTradeSumEx:
+    properties:
+      lst:
+        description: 指数列表
+        items:
+          $ref: '#/definitions/models.WrSpotGroupTradeSum'
+        type: array
+      prereckondate:
+        description: 上上个交易日(yyymmdd)
+        type: string
+      reckondate:
+        description: 上个交易日(yyyymmdd)
+        type: string
+    type: object
   models.WrStandardFactoryItem:
     properties:
       dgfactoryitemid:
@@ -26304,6 +26419,26 @@ paths:
       tags:
       - 仓单贸易
       - 仓单贸易
+  /WrTrade2/QueryDeliveryGoodsSection:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrDeliveryGoodsSection'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询板块(分类)
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryFaProductDetail:
     get:
       description: 页面 买卖大厅 -> 选择融资方案
@@ -26682,6 +26817,55 @@ paths:
       summary: 查询履约模板
       tags:
       - 仓单贸易v2
+  /WrTrade2/QuerySiteColumnDetail:
+    get:
+      parameters:
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrSiteColumnDetail'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询资讯
+      tags:
+      - 仓单贸易v2
+  /WrTrade2/QuerySpotGroupTradeSum:
+    get:
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrSpotGroupTradeSumEx'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询指数
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrAverageTradePrice:
     get:
       parameters:

+ 2 - 0
models/ermcp3.go

@@ -2657,6 +2657,7 @@ type TBMiddleGoods struct {
 	NEEDARBITRAGERATIO float64 `json:"needarbitrageratio"  xorm:"'NEEDARBITRAGERATIO'"`            // 套利比率
 	GOODSGROUPID       int64   `json:"-"  xorm:"'GOODSGROUPID'"`                                   // 关联期货商品组id
 	ENUMDICNAME        string  `json:"enumdicname"  xorm:"'ENUMDICNAME'"`                          // 单位名称
+	GOODSUNITID        int32   `json:"goodsunitid"  xorm:"'GOODSUNITID'"`                          // 套保品种单位id
 
 	GPLST []TBGoodsGroup // 期货品种列表
 	WDLST []TBWrstandard // 商品信息列表(现货品类)
@@ -2676,6 +2677,7 @@ select t.areauserid,
        t.needhedgeratio,
        t.needarbitrageratio,
        t.goodsgroupid,
+       t.goodsunitid,
        e.enumdicname
   from erms_middlegoods t
   left join enumdicitem e

+ 2 - 5
models/ermcpCommon.go

@@ -167,11 +167,8 @@ func (r *SFLOAT64) SetByInt64(v int64, place int) {
 
 // Round
 func (r *SFLOAT64) Round(places int32) *SFLOAT64 {
-	d, ok := decimal.NewFromFloat(float64(*r)).Round(places).Float64()
-	if ok {
-		*r = SFLOAT64(d)
-		return r
-	}
+	d, _ := decimal.NewFromFloat(float64(*r)).Round(places).Float64()
+	*r = SFLOAT64(d)
 	return r
 }
 

+ 308 - 1
models/wrTrade2.go

@@ -972,7 +972,7 @@ func (r *WrSpecialMatchOrder) buildSql() string {
 		"  left join tmp k" +
 		"    on t.wrfactortypeid = k.wrfactortypeid" +
 		" where t.WRTRADETYPE = 1" +
-		"   and t.isspecified = 1" +
+		"   and t.isspecified in (1,2)" +
 		"   and t.WRTRADEORDERSTATUS = 3"
 	sqlId.And("t.USERID", r.USERID)
 	sqlId.And("t.haswr", r.HASWR)
@@ -3589,3 +3589,310 @@ func (r *WrUserReceiptInfo) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrSiteColumnDetail 资讯
+type WrSiteColumnDetail struct {
+	ID          int64            `json:"id"  xorm:"ID" form:"id"`                            // ID(SEQ_SITE_COLUMNDETAIL)
+	COLUMNID    int64            `json:"-"  xorm:"COLUMNID" form:"columnid"`                 // 所属栏目
+	USERID      int64            `json:"-"  xorm:"USERID" form:"userid"`                     // 用户ID(默认为0, 核心为为机构用户ID)
+	TITLE       string           `json:"title"  xorm:"TITLE"`                                // 标题
+	COVERIMAGE  string           `json:"coverimage"  xorm:"COVERIMAGE"`                      // 封面图片
+	AUTHOR      string           `json:"-"  xorm:"AUTHOR"`                                   // 作者
+	BRIEF       string           `json:"brief"  xorm:"BRIEF"`                                // 简介
+	CONTEXT     string           `json:"context"  xorm:"CONTEXT"`                            // 内容
+	STATUS      int32            `json:"-"  xorm:"STATUS"`                                   // 状态 - 1:暂存 10:待审核 20:审核通过 30:审核拒绝
+	ISTOP       int32            `json:"istop"  xorm:"ISTOP"`                                // 是否置顶 - 0:不置 1:置顶
+	HITS        int64            `json:"-"  xorm:"HITS"`                                     // 点击数
+	PUBLISHDATE string           `json:"publishdate"  xorm:"PUBLISHDATE" form:"publishdate"` // 发布日期
+	CREAEDATE   string           `json:"creaedate"  xorm:"CREAEDATE" form:"creaedate"`       // 创建时间
+	CREATORID   int64            `json:"-"  xorm:"CREATORID" form:"creatorid"`               // 创建人
+	UPDATEDATE  string           `json:"updatedate"  xorm:"UPDATEDATE" form:"updatedate"`    // 修改时间
+	MODIFIERID  int64            `json:"-"  xorm:"MODIFIERID" form:"modifierid"`             // 操作人
+	ISSHOW      int32            `json:"-"  xorm:"ISSHOW"`                                   // 是否展示 - 0:不展示 1:展示
+	PageEx      `xorm:"extends"` // 页码信息
+}
+
+func (r *WrSiteColumnDetail) calc() {
+
+}
+
+func (r *WrSiteColumnDetail) buildSql() string {
+	var sqlId utils.SQLVal = `
+SELECT t.ID,
+       t.COLUMNID,
+       t.USERID,
+       t.TITLE,
+       t.COVERIMAGE,
+       t.AUTHOR,
+       t.BRIEF,
+       t.CONTEXT,
+       t.STATUS,
+       t.ISTOP,
+       t.HITS,
+       to_char(t.PUBLISHDATE, 'yyyy-mm-dd hh24:mi:ss') PUBLISHDATE,
+       to_char(t.CREAEDATE, 'yyyy-mm-dd hh24:mi:ss') CREAEDATE,
+       t.CREATORID,
+       to_char(t.UPDATEDATE, 'yyyy-mm-dd hh24:mi:ss') UPDATEDATE,
+       t.MODIFIERID,
+       t.ISSHOW
+  FROM SITE_COLUMNDETAIL t
+ WHERE 1 = 1 and t.isshow  = 1 and t.status = 20
+ order by t.istop desc, t.updatedate desc
+`
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+// GetDataByPage 获取资讯
+func (r *WrSiteColumnDetail) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]WrSiteColumnDetail, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	if len(sData) > 0 {
+		r.Total = sData[0].Total
+	}
+	return sData, err, r.Page, r.PageSize, r.Total
+}
+
+// WrDeliveryGoodsSection 板块(分类)
+type WrDeliveryGoodsSection struct {
+	SECTIONID   int64  `json:"sectionid"  xorm:"SECTIONID" form:"sectionid"` // 版块ID (SEQ_DELIVERYGOODSSECTION)  - 自增100开始, 前面ID预留给SectionType = 1的版块1 - 云融指数
+	SECTIONTYPE int32  `json:"sectiontype"  xorm:"SECTIONTYPE"`              // 版块类型 - 1:指数版块 2:普通版块
+	SECTIONNAME string `json:"sectionname"  xorm:"SECTIONNAME"`              // 版块名称
+	ORDERINDEX  int32  `json:"orderindex"  xorm:"ORDERINDEX"`                // 排序
+	SHOWFLAG    int32  `json:"-"  xorm:"SHOWFLAG"`                           // 是否展示 - 0:不展示 1:展示
+	CREATORSRC  int32  `json:"-"  xorm:"CREATORSRC"`                         // 申请来源 - 1:管理端 2:终端 3:交易
+	CREATORID   int64  `json:"-"  xorm:"CREATORID" form:"creatorid"`         // 创建人
+	CREATETIME  string `json:"-"  xorm:"CREATETIME"`                         // 创建时间
+	IMAGEPATH   string `json:"imagepath"  xorm:"IMAGEPATH"`                  // 图片地址
+
+	DGLst []WrDeliveryGoodsSectionConfig `json:"dglst"` // 板块商品列表
+}
+
+func (r *WrDeliveryGoodsSection) calc() {
+	r.DGLst = make([]WrDeliveryGoodsSectionConfig, 0)
+}
+
+func (r *WrDeliveryGoodsSection) buildSql() string {
+	var sqlId utils.SQLVal = `
+select t.sectionid,
+       t.sectiontype,
+       t.sectionname,
+       t.orderindex,
+       t.showflag,
+       t.creatorsrc,
+       t.creatorid,
+       to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime,
+       t.imagepath
+  from DeliveryGoodsSection t
+ where t.sectiontype = 2
+   and t.showflag = 1
+ order by t.orderindex
+`
+	return sqlId.String()
+}
+
+// GetDataEx 获取板块(分类)
+func (r *WrDeliveryGoodsSection) GetDataEx() (interface{}, error) {
+	sData := make([]WrDeliveryGoodsSection, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	// 获取商品
+	m := WrDeliveryGoodsSectionConfig{}
+	if d, err := m.GetDataEx(); err == nil {
+		lst := d.([]WrDeliveryGoodsSectionConfig)
+		for i := range sData {
+			for _, v := range lst {
+				if sData[i].SECTIONID == v.SECTIONID {
+					sData[i].DGLst = append(sData[i].DGLst, v)
+				}
+			}
+		}
+	}
+	return sData, err
+}
+
+// WrDeliveryGoodsSectionConfig 板块商品
+type WrDeliveryGoodsSectionConfig struct {
+	SECTIONID         int64  `json:"-"  xorm:"'SECTIONID'"`                         // 版块ID (SEQ_DELIVERYGOODSSECTION)
+	DELIVERYGOODSID   int64  `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货品种ID(SEQ_DELIVERYGOODS)
+	ORDERINDEX        int32  `json:"orderindex"  xorm:"'ORDERINDEX'"`               // 排序
+	CREATORSRC        int32  `json:"-"  xorm:"'CREATORSRC'"`                        // 申请来源 - 1:管理端 2:终端 3:交易
+	CREATORID         int32  `json:"-"  xorm:"'CREATORID'"`                         // 创建人
+	CREATEDATE        string `json:"-"  xorm:"'CREATEDATE'"`                        // 创建时间
+	DELIVERYGOODSCODE string `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 现货商品代码
+	DELIVERYGOODSNAME string `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` //	现货商品名称
+}
+
+func (r *WrDeliveryGoodsSectionConfig) calc() {
+
+}
+
+func (r *WrDeliveryGoodsSectionConfig) buildSql() string {
+	var sqlId utils.SQLVal = `
+select t.sectionid,
+       t.deliverygoodsid,
+       t.orderindex,
+       t.creatorsrc,
+       t.creatorid,
+       to_char(t.createdate, 'yyyy-mm-dd hh24:mi:ss') createdate,
+       g.deliverygoodscode,
+       g.deliverygoodsname
+  from DeliveryGoodsSectionConfig t
+ inner join deliverygoods g
+    on t.deliverygoodsid = g.deliverygoodsid
+ inner join Deliverygoodssection s
+    on t.sectionid = s.sectionid
+ where t.sectionid = 1
+   and t.showflag = 1
+   and s.showflag = 1
+   and g.dgstatus = 1
+ order by t.sectionid, t.orderindex
+`
+	return sqlId.String()
+}
+
+// GetDataEx 获取板块商品
+func (r *WrDeliveryGoodsSectionConfig) GetDataEx() (interface{}, error) {
+	sData := make([]WrDeliveryGoodsSectionConfig, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// WrSpotGroupTradeSum 指数
+type WrSpotGroupTradeSum struct {
+	RECKONDATE        string  `json:"reckondate"  xorm:"'RECKONDATE'"`               // 上个交易日(前1天交易日)
+	LASTRECKONDATE    string  `json:"lastreckondate"  xorm:"'LASTRECKONDATE'"`       // 上上个交易日(前2天交易日)
+	MARKETID          int64   `json:"-"  xorm:"'MARKETID'" form:"marketid"`          // 市场id
+	TRADEQTY          float64 `json:"-"  xorm:"'TRADEQTY'"`                          // 成交量
+	TRADEAMOUNT       float64 `json:"-"  xorm:"'TRADEAMOUNT'"`                       // 成交额
+	LASTAVGPRICE      float64 `json:"-"  xorm:"'LASTAVGPRICE'"`                      // 上上个交易日价格(前2天价格)
+	TODAYAVGPRICE     float64 `json:"-"  xorm:"'TODAYAVGPRICE'"`                     // 上个交易日价格(前1天价格)
+	DELIVERYGOODSID   int64   `json:"deliverygoodsid"  xorm:"'DELIVERYGOODSID'"`     // 现货品种ID(SEQ_DELIVERYGOODS)
+	DELIVERYGOODSCODE string  `json:"deliverygoodscode"  xorm:"'DELIVERYGOODSCODE'"` // 现货品种代码
+	DELIVERYGOODSNAME string  `json:"deliverygoodsname"  xorm:"'DELIVERYGOODSNAME'"` // 现货品种名称
+	SECTIONID         int64   `json:"-"  xorm:"'SECTIONID'"`                         // 版块ID (SEQ_DELIVERYGOODSSECTION)
+	PRETRADEDATE      string  `json:"-"  xorm:"'PRETRADEDATE'"`                      // 上个交易日(从marketid=0表中取的, 系统)
+
+	LASTAVGPRICE2  string `json:"lastavgprice"`  // 上上个交易日价格(前2天价格)
+	TODAYAVGPRICE2 string `json:"todayavgprice"` // 上个交易日价格(前1天价格)
+	UPDOWN         string `json:"updown"`        // 涨跌
+	UPDOWNRATIO    string `json:"updownratio"`   // 涨幅(已格式化, 直接显示即可)
+}
+
+func (r *WrSpotGroupTradeSum) calc() {
+	if r.LASTAVGPRICE < 1e-8 {
+		r.LASTAVGPRICE2 = "-"
+	}
+	if r.TODAYAVGPRICE < 1e-8 {
+		r.TODAYAVGPRICE2 = "-"
+	}
+	if r.TODAYAVGPRICE > 1e-8 && r.LASTAVGPRICE > 1e-8 {
+		// 涨跌
+		var diff SFLOAT64
+		diff.Set(r.TODAYAVGPRICE - r.LASTAVGPRICE)
+		r.UPDOWN = diff.Round(2).string()
+
+		// 涨幅
+		var k SFLOAT64
+		k.Set(diff.Float64() * 100 / r.TODAYAVGPRICE)
+		k.Round(2)
+		if k.Float64() > 1e-8 {
+			r.UPDOWNRATIO = "+" + k.string() + `%`
+		} else {
+			r.UPDOWNRATIO = "-" + k.string() + `%`
+		}
+	} else {
+		r.UPDOWN = "-"
+		r.UPDOWNRATIO = "-"
+	}
+}
+
+func (r *WrSpotGroupTradeSum) buildSql() string {
+	var sqlId utils.SQLVal = `
+with tmp as
+ (select k.reckondate,
+         k.marketid,
+         k.tradeqty,
+         k.tradeamount,
+         k.lastreckondate,
+         k.lastavgprice,
+         k.todayavgprice,
+         k.deliverygoodsid deliverygoodsid1
+    from reckon_spotgrouptradesum k
+   inner join marketrun m
+      on k.reckondate = m.pretradedate
+     and m.marketid = 0)
+select tmp.*,
+       t.sectionid,
+       g.deliverygoodsid,
+       g.deliverygoodscode,
+       g.deliverygoodsname
+  from DeliveryGoodsSectionConfig t
+  left join tmp
+    on t.deliverygoodsid = tmp.deliverygoodsid1
+  left join deliverygoods g
+    on t.deliverygoodsid = g.deliverygoodsid
+ where t.sectionid = 1
+   and t.showflag = 1
+ order by t.orderindex
+`
+	return sqlId.String()
+}
+
+// GetDataEx 获取指数
+func (r *WrSpotGroupTradeSum) GetDataEx() (interface{}, error) {
+	sData := make([]WrSpotGroupTradeSum, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// WrSpotGroupTradeSumEx 指数(层级)
+type WrSpotGroupTradeSumEx struct {
+	RECKONDATE    string                `json:"reckondate"  xorm:"'RECKONDATE'"`       // 上个交易日(yyyymmdd)
+	PRERECKONDATE string                `json:"prereckondate"  xorm:"'PRERECKONDATE'"` // 上上个交易日(yyymmdd)
+	LST           []WrSpotGroupTradeSum `json:"lst"`                                   // 指数列表
+}
+
+func (r *WrSpotGroupTradeSumEx) calc() {
+	r.LST = make([]WrSpotGroupTradeSum, 0)
+}
+
+func (r *WrSpotGroupTradeSumEx) buildSql() string {
+	var sqlId utils.SQLVal = `
+select t.pretradedate RECKONDATE,
+        (select max(k.lastreckondate)
+           from reckon_spotgrouptradesum k
+          where k.reckondate = t.pretradedate) PRERECKONDATE
+   from marketrun t
+  where t.marketid = 0
+`
+	return sqlId.String()
+}
+
+// GetDataEx 获取指数(层级)
+func (r *WrSpotGroupTradeSumEx) GetDataEx() (interface{}, error) {
+	sData := make([]WrSpotGroupTradeSumEx, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	if err == nil && len(sData) > 0 {
+		m := WrSpotGroupTradeSum{}
+		if d, err := m.GetDataEx(); err == nil {
+			sData[0].LST = d.([]WrSpotGroupTradeSum)
+		}
+	}
+
+	return sData, err
+}

+ 3 - 0
routers/router.go

@@ -576,6 +576,9 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QueryWrTradeBargainApply", wrTrade2.QueryWrTradeBargainApply)
 		wrTrade2R.GET("QueryWrPerformanceStepType", wrTrade2.QueryWrPerformanceStepType)
 		wrTrade2R.GET("QueryWrUserReceiptInfo", wrTrade2.QueryWrUserReceiptInfo)
+		wrTrade2R.GET("QuerySiteColumnDetail", wrTrade2.QuerySiteColumnDetail)
+		wrTrade2R.GET("QueryDeliveryGoodsSection", wrTrade2.QueryDeliveryGoodsSection)
+		wrTrade2R.GET("QuerySpotGroupTradeSum", wrTrade2.QuerySpotGroupTradeSum)
 	}
 
 	// **************************天津麦顿*************************