Selaa lähdekoodia

增加查询价格走势接口

zou.yingbin 3 vuotta sitten
vanhempi
commit
45022329d8
7 muutettua tiedostoa jossa 767 lisäystä ja 11 poistoa
  1. 1 1
      config/config.xml
  2. 24 3
      controllers/wrTrade2/qryWrTrade.go
  3. 249 2
      docs/docs.go
  4. 249 2
      docs/swagger.json
  5. 178 2
      docs/swagger.yaml
  6. 65 1
      models/wrTrade2.go
  7. 1 0
      routers/router.go

+ 1 - 1
config/config.xml

@@ -13,7 +13,7 @@
     <DbAddress value="192.168.31.88"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test203"/>
+    <DbUser value="mtp2_test176"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>

+ 24 - 3
controllers/wrTrade2/qryWrTrade.go

@@ -659,13 +659,14 @@ func QueryWrUserReceiptInfo(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param page query int false "页码"
 // @Param pagesize query int false "每页条数"
+// @Param columnid query int false "所属栏目id"
 // @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{}
+	m := models.WrSiteColumnDetail{COLUMNID: -9999999999}
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }
@@ -725,8 +726,8 @@ func QuerySpotGroupTradeSumDetail(c *gin.Context) {
 // @param marketid query int false "市场id"
 // @param presalestatus query string false "预售状态(逗号隔开,如1,2,3)  1:未开始 2:进行中 3:已结束 4:已关闭"
 // @param lotteryflag query int false "摇号标识 - 0:未摇号 1:已摇号"
-// @param lastnum query int false "最近多少条记录(按创建时间序)"
-// @Success 200 {array} models.WrSpotGroupTradeSumDetail
+// @param lastnum query int false "最近多少条记录(按创建时间序)"
+// @Success 200 {array} models.WrPreSaleInfo
 // @Failure 500 {object} app.Response
 // @Router /WrTrade2/QueryWrPreSaleInfo [get]
 // @Tags 仓单贸易v2
@@ -736,3 +737,23 @@ func QueryWrPreSaleInfo(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryWrReckonSpotGoodsTradeSum
+// @Summary 查询价格走势
+// @Produce json
+// @Security ApiKeyAuth
+// @param marketid query int true "市场id"
+// @param wrstandardid query int true "现货商品id"
+// @Param begindate query string false "开始交易日(yyyymmdd)"
+// @Param enddate query string false "结束交易日(yyyymmdd)"
+// @param lastnum query int false "最近多少条记录(按交易日倒序)"
+// @Success 200 {array} models.WrReckonSpotGoodsTradeSum
+// @Failure 500 {object} app.Response
+// @Router /WrTrade2/QueryWrReckonSpotGoodsTradeSum [get]
+// @Tags 仓单贸易v2
+func QueryWrReckonSpotGoodsTradeSum(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WrReckonSpotGoodsTradeSum{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 249 - 2
docs/docs.go

@@ -12689,6 +12689,12 @@ var doc = `{
                         "description": "每页条数",
                         "name": "pagesize",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "所属栏目id",
+                        "name": "columnid",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -13648,7 +13654,7 @@ var doc = `{
                     },
                     {
                         "type": "integer",
-                        "description": "最近多少条记录(按创建时间序)",
+                        "description": "最近多少条记录(按创建时间序)",
                         "name": "lastnum",
                         "in": "query"
                     }
@@ -13659,7 +13665,74 @@ var doc = `{
                         "schema": {
                             "type": "array",
                             "items": {
-                                "$ref": "#/definitions/models.WrSpotGroupTradeSumDetail"
+                                "$ref": "#/definitions/models.WrPreSaleInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/WrTrade2/QueryWrReckonSpotGoodsTradeSum": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询价格走势",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "市场id",
+                        "name": "marketid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "现货商品id",
+                        "name": "wrstandardid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "最近多少条记录(按交易日倒序)",
+                        "name": "lastnum",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrReckonSpotGoodsTradeSum"
                             }
                         }
                     },
@@ -36396,6 +36469,143 @@ var doc = `{
                 }
             }
         },
+        "models.WrPreSaleInfo": {
+            "type": "object",
+            "properties": {
+                "bannerpicurl": {
+                    "description": "Banner图",
+                    "type": "string"
+                },
+                "baseqty": {
+                    "description": "中签基数",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID",
+                    "type": "integer"
+                },
+                "enddate": {
+                    "description": "预售结束日期",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "lotteryflag": {
+                    "description": "摇号标识 - 0:未摇号 1:已摇号",
+                    "type": "integer"
+                },
+                "lotteryqty": {
+                    "description": "摇号总量",
+                    "type": "number"
+                },
+                "luckyqty": {
+                    "description": "已中签量",
+                    "type": "number"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "maxbuyqty": {
+                    "description": "单人最大申购量",
+                    "type": "number"
+                },
+                "maxluckyqty": {
+                    "description": "单人最大中签量",
+                    "type": "number"
+                },
+                "pictureurls": {
+                    "description": "详情图片(逗号分隔)",
+                    "type": "string"
+                },
+                "placeqty": {
+                    "description": "已配售量",
+                    "type": "number"
+                },
+                "presaleapplyid": {
+                    "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "presaleqty": {
+                    "description": "预售总量",
+                    "type": "number"
+                },
+                "presalestatus": {
+                    "description": "预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭",
+                    "type": "integer"
+                },
+                "sellaccountid": {
+                    "description": "发行方资金账户ID",
+                    "type": "integer"
+                },
+                "selluserid": {
+                    "description": "发行方用户ID",
+                    "type": "integer"
+                },
+                "sellwrtradeorderid": {
+                    "description": "发行方卖委托单ID",
+                    "type": "string"
+                },
+                "startdate": {
+                    "description": "预售开始日期",
+                    "type": "string"
+                },
+                "takestartdate": {
+                    "description": "提货开始日期",
+                    "type": "string"
+                },
+                "thumurls": {
+                    "description": "缩略图片(1:1)(逗号分隔)",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "unitprice": {
+                    "description": "商品单价",
+                    "type": "number"
+                },
+                "username": {
+                    "description": "发行方用户名称",
+                    "type": "string"
+                },
+                "warehousecode": {
+                    "description": "仓库代码(仓库简称)",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID - 根据现货商品\\仓库生成",
+                    "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrQuoteOrderMyq": {
             "type": "object",
             "properties": {
@@ -36521,6 +36731,43 @@ var doc = `{
                 }
             }
         },
+        "models.WrReckonSpotGoodsTradeSum": {
+            "type": "object",
+            "properties": {
+                "begindate": {
+                    "description": "开始日期(结果含开始日期) yyyymmdd",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "结束日期(结果含结束日期) yyyymmdd",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "price": {
+                    "description": "价格 = 日成交金额 / 日成交数量",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "日期 格式 yyyymmdd",
+                    "type": "string"
+                },
+                "tradeamount": {
+                    "description": "日成交金额(当日单方向成交金额)",
+                    "type": "number"
+                },
+                "tradeqty": {
+                    "description": "日成交数量(当日单方向成交数量)",
+                    "type": "number"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.WrScfContract": {
             "type": "object",
             "properties": {

+ 249 - 2
docs/swagger.json

@@ -12674,6 +12674,12 @@
                         "description": "每页条数",
                         "name": "pagesize",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "所属栏目id",
+                        "name": "columnid",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -13633,7 +13639,7 @@
                     },
                     {
                         "type": "integer",
-                        "description": "最近多少条记录(按创建时间序)",
+                        "description": "最近多少条记录(按创建时间序)",
                         "name": "lastnum",
                         "in": "query"
                     }
@@ -13644,7 +13650,74 @@
                         "schema": {
                             "type": "array",
                             "items": {
-                                "$ref": "#/definitions/models.WrSpotGroupTradeSumDetail"
+                                "$ref": "#/definitions/models.WrPreSaleInfo"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/WrTrade2/QueryWrReckonSpotGoodsTradeSum": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "仓单贸易v2"
+                ],
+                "summary": "查询价格走势",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "市场id",
+                        "name": "marketid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "现货商品id",
+                        "name": "wrstandardid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "最近多少条记录(按交易日倒序)",
+                        "name": "lastnum",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.WrReckonSpotGoodsTradeSum"
                             }
                         }
                     },
@@ -36381,6 +36454,143 @@
                 }
             }
         },
+        "models.WrPreSaleInfo": {
+            "type": "object",
+            "properties": {
+                "bannerpicurl": {
+                    "description": "Banner图",
+                    "type": "string"
+                },
+                "baseqty": {
+                    "description": "中签基数",
+                    "type": "number"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID",
+                    "type": "integer"
+                },
+                "enddate": {
+                    "description": "预售结束日期",
+                    "type": "string"
+                },
+                "enumdicname": {
+                    "description": "单位名称",
+                    "type": "string"
+                },
+                "lotteryflag": {
+                    "description": "摇号标识 - 0:未摇号 1:已摇号",
+                    "type": "integer"
+                },
+                "lotteryqty": {
+                    "description": "摇号总量",
+                    "type": "number"
+                },
+                "luckyqty": {
+                    "description": "已中签量",
+                    "type": "number"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "maxbuyqty": {
+                    "description": "单人最大申购量",
+                    "type": "number"
+                },
+                "maxluckyqty": {
+                    "description": "单人最大中签量",
+                    "type": "number"
+                },
+                "pictureurls": {
+                    "description": "详情图片(逗号分隔)",
+                    "type": "string"
+                },
+                "placeqty": {
+                    "description": "已配售量",
+                    "type": "number"
+                },
+                "presaleapplyid": {
+                    "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "presaleqty": {
+                    "description": "预售总量",
+                    "type": "number"
+                },
+                "presalestatus": {
+                    "description": "预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭",
+                    "type": "integer"
+                },
+                "sellaccountid": {
+                    "description": "发行方资金账户ID",
+                    "type": "integer"
+                },
+                "selluserid": {
+                    "description": "发行方用户ID",
+                    "type": "integer"
+                },
+                "sellwrtradeorderid": {
+                    "description": "发行方卖委托单ID",
+                    "type": "string"
+                },
+                "startdate": {
+                    "description": "预售开始日期",
+                    "type": "string"
+                },
+                "takestartdate": {
+                    "description": "提货开始日期",
+                    "type": "string"
+                },
+                "thumurls": {
+                    "description": "缩略图片(1:1)(逗号分隔)",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "unitid": {
+                    "description": "单位ID",
+                    "type": "integer"
+                },
+                "unitprice": {
+                    "description": "商品单价",
+                    "type": "number"
+                },
+                "username": {
+                    "description": "发行方用户名称",
+                    "type": "string"
+                },
+                "warehousecode": {
+                    "description": "仓库代码(仓库简称)",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "warehousename": {
+                    "description": "仓库名称",
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID - 根据现货商品\\仓库生成",
+                    "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.WrQuoteOrderMyq": {
             "type": "object",
             "properties": {
@@ -36506,6 +36716,43 @@
                 }
             }
         },
+        "models.WrReckonSpotGoodsTradeSum": {
+            "type": "object",
+            "properties": {
+                "begindate": {
+                    "description": "开始日期(结果含开始日期) yyyymmdd",
+                    "type": "string"
+                },
+                "enddate": {
+                    "description": "结束日期(结果含结束日期) yyyymmdd",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "price": {
+                    "description": "价格 = 日成交金额 / 日成交数量",
+                    "type": "string"
+                },
+                "reckondate": {
+                    "description": "日期 格式 yyyymmdd",
+                    "type": "string"
+                },
+                "tradeamount": {
+                    "description": "日成交金额(当日单方向成交金额)",
+                    "type": "number"
+                },
+                "tradeqty": {
+                    "description": "日成交数量(当日单方向成交数量)",
+                    "type": "number"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                }
+            }
+        },
         "models.WrScfContract": {
             "type": "object",
             "properties": {

+ 178 - 2
docs/swagger.yaml

@@ -16523,6 +16523,108 @@ definitions:
         description: 持有人ID
         type: integer
     type: object
+  models.WrPreSaleInfo:
+    properties:
+      bannerpicurl:
+        description: Banner图
+        type: string
+      baseqty:
+        description: 中签基数
+        type: number
+      createtime:
+        description: 创建时间
+        type: string
+      deliverygoodsid:
+        description: 现货品种ID
+        type: integer
+      enddate:
+        description: 预售结束日期
+        type: string
+      enumdicname:
+        description: 单位名称
+        type: string
+      lotteryflag:
+        description: 摇号标识 - 0:未摇号 1:已摇号
+        type: integer
+      lotteryqty:
+        description: 摇号总量
+        type: number
+      luckyqty:
+        description: 已中签量
+        type: number
+      marketid:
+        description: 市场ID
+        type: integer
+      maxbuyqty:
+        description: 单人最大申购量
+        type: number
+      maxluckyqty:
+        description: 单人最大中签量
+        type: number
+      pictureurls:
+        description: 详情图片(逗号分隔)
+        type: string
+      placeqty:
+        description: 已配售量
+        type: number
+      presaleapplyid:
+        description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      presaleqty:
+        description: 预售总量
+        type: number
+      presalestatus:
+        description: 预售状态 - 1:未开始 2:进行中 3:已结束 4:已关闭
+        type: integer
+      sellaccountid:
+        description: 发行方资金账户ID
+        type: integer
+      selluserid:
+        description: 发行方用户ID
+        type: integer
+      sellwrtradeorderid:
+        description: 发行方卖委托单ID
+        type: string
+      startdate:
+        description: 预售开始日期
+        type: string
+      takestartdate:
+        description: 提货开始日期
+        type: string
+      thumurls:
+        description: 缩略图片(1:1)(逗号分隔)
+        type: string
+      tradedate:
+        description: 交易日
+        type: string
+      unitid:
+        description: 单位ID
+        type: integer
+      unitprice:
+        description: 商品单价
+        type: number
+      username:
+        description: 发行方用户名称
+        type: string
+      warehousecode:
+        description: 仓库代码(仓库简称)
+        type: string
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      warehousename:
+        description: 仓库名称
+        type: string
+      wrfactortypeid:
+        description: 仓单要素类型ID - 根据现货商品\仓库生成
+        type: integer
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+    type: object
   models.WrQuoteOrderMyq:
     properties:
       buyorsell:
@@ -16616,6 +16718,33 @@ definitions:
         description: 商品
         type: string
     type: object
+  models.WrReckonSpotGoodsTradeSum:
+    properties:
+      begindate:
+        description: 开始日期(结果含开始日期) yyyymmdd
+        type: string
+      enddate:
+        description: 结束日期(结果含结束日期) yyyymmdd
+        type: string
+      marketid:
+        description: 市场ID
+        type: integer
+      price:
+        description: 价格 = 日成交金额 / 日成交数量
+        type: string
+      reckondate:
+        description: 日期 格式 yyyymmdd
+        type: string
+      tradeamount:
+        description: 日成交金额(当日单方向成交金额)
+        type: number
+      tradeqty:
+        description: 日成交数量(当日单方向成交数量)
+        type: number
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+    type: object
   models.WrScfContract:
     properties:
       borroweruserid:
@@ -27363,6 +27492,10 @@ paths:
         in: query
         name: pagesize
         type: integer
+      - description: 所属栏目id
+        in: query
+        name: columnid
+        type: integer
       produces:
       - application/json
       responses:
@@ -27965,7 +28098,7 @@ paths:
         in: query
         name: lotteryflag
         type: integer
-      - description: 最近多少条记录(按创建时间序)
+      - description: 最近多少条记录(按创建时间序)
         in: query
         name: lastnum
         type: integer
@@ -27976,7 +28109,7 @@ paths:
           description: OK
           schema:
             items:
-              $ref: '#/definitions/models.WrSpotGroupTradeSumDetail'
+              $ref: '#/definitions/models.WrPreSaleInfo'
             type: array
         "500":
           description: Internal Server Error
@@ -27987,6 +28120,49 @@ paths:
       summary: 查询新品发布
       tags:
       - 仓单贸易v2
+  /WrTrade2/QueryWrReckonSpotGoodsTradeSum:
+    get:
+      parameters:
+      - description: 市场id
+        in: query
+        name: marketid
+        required: true
+        type: integer
+      - description: 现货商品id
+        in: query
+        name: wrstandardid
+        required: true
+        type: integer
+      - description: 开始交易日(yyyymmdd)
+        in: query
+        name: begindate
+        type: string
+      - description: 结束交易日(yyyymmdd)
+        in: query
+        name: enddate
+        type: string
+      - description: 最近多少条记录(按交易日倒序)
+        in: query
+        name: lastnum
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.WrReckonSpotGoodsTradeSum'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询价格走势
+      tags:
+      - 仓单贸易v2
   /WrTrade2/QueryWrScfContract:
     get:
       parameters:

+ 65 - 1
models/wrTrade2.go

@@ -4150,6 +4150,7 @@ SELECT t.ID,
  WHERE 1 = 1 and t.isshow  = 1 and t.status = 20
  order by t.istop desc, t.updatedate desc
 `
+	sqlId.AndEx("t.COLUMNID", r.COLUMNID, r.COLUMNID > 0)
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()
 }
@@ -4167,7 +4168,7 @@ func (r *WrSiteColumnDetail) GetDataByPage() (interface{}, error, int, int, int)
 	return sData, err, r.Page, r.PageSize, r.Total
 }
 
-// WrDeliveryGoodsSection 板块(分类)
+// 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:普通版块
@@ -4568,3 +4569,66 @@ func (r *WrPreSaleInfo) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// WrReckonSpotGoodsTradeSum 价格走势
+type WrReckonSpotGoodsTradeSum struct {
+	RECKONDATE   string   `json:"reckondate"  xorm:"'RECKONDATE'"`                         // 日期 格式 yyyymmdd
+	MARKETID     int      `json:"marketid"  xorm:"'MARKETID'" form:"marketid"`             // 市场ID
+	WRSTANDARDID int      `json:"wrstandardid"  xorm:"'WRSTANDARDID'" form:"wrstandardid"` // 现货商品ID
+	TRADEQTY     SFLOAT64 `json:"tradeqty"  xorm:"'TRADEQTY'"`                             // 日成交数量(当日单方向成交数量)
+	TRADEAMOUNT  SFLOAT64 `json:"tradeamount"  xorm:"'TRADEAMOUNT'"`                       // 日成交金额(当日单方向成交金额)
+	PRICE        string   `json:"price"`                                                   // 价格 = 日成交金额 / 日成交数量
+
+	BEGINDATE string `json:"begindate" form:"begindate"` // 开始日期(结果含开始日期) yyyymmdd
+	ENDDATE   string `json:"enddate" form:"enddate"`     // 结束日期(结果含结束日期) yyyymmdd
+	LastNum   int    `json:"-" form:"lastnum"`           // 最近多少条记录
+
+}
+
+func (r *WrReckonSpotGoodsTradeSum) calc() {
+	if r.TRADEQTY > 1e-10 {
+		d := r.TRADEAMOUNT / r.TRADEQTY
+		r.PRICE = d.Round(2).string()
+	}
+}
+
+func (r *WrReckonSpotGoodsTradeSum) buildSql() string {
+	var sqlId utils.SQLVal = `
+select t.reckondate,
+       t.marketid,
+       t.wrstandardid,
+       sum(t.tradeqty) tradeqty,
+       sum(t.tradeamount) tradeamount
+  from reckon_spotgoodstradesum t
+ where 1 = 1 %v
+ group by t.reckondate, t.marketid, t.wrstandardid
+ order by t.reckondate desc
+`
+	var sqlParam utils.SQLVal
+	sqlParam.And("t.marketid", r.MARKETID)
+	sqlParam.And("t.wrstandardid", r.WRSTANDARDID)
+
+	// 格式 yyyymmdd
+	if len(r.BEGINDATE) > 0 {
+		sqlParam.JoinFormat(" and t.reckondate >= '%v'", r.BEGINDATE)
+	}
+
+	if len(r.ENDDATE) > 0 {
+		sqlParam.JoinFormat(" and t.reckondate <= '%v'", r.ENDDATE)
+	}
+	sqlId.FormatParam(sqlParam.String())
+	sqlId.Page(1, r.LastNum)
+	return sqlId.String()
+}
+
+// GetDataEx 获取价格走势
+func (r *WrReckonSpotGoodsTradeSum) GetDataEx() (interface{}, error) {
+	sData := make([]WrReckonSpotGoodsTradeSum, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+		sData[i].BEGINDATE = r.BEGINDATE
+		sData[i].ENDDATE = r.ENDDATE
+	}
+	return sData, err
+}

+ 1 - 0
routers/router.go

@@ -581,6 +581,7 @@ func InitRouter() *gin.Engine {
 		wrTrade2R.GET("QuerySpotGroupTradeSum", wrTrade2.QuerySpotGroupTradeSum)
 		wrTrade2R.GET("QuerySpotGroupTradeSumDetail", wrTrade2.QuerySpotGroupTradeSumDetail)
 		wrTrade2R.GET("QueryWrPreSaleInfo", wrTrade2.QueryWrPreSaleInfo)
+		wrTrade2R.GET("QueryWrReckonSpotGoodsTradeSum", wrTrade2.QueryWrReckonSpotGoodsTradeSum)
 	}
 
 	// **************************天津麦顿*************************