Explorar el Código

增加查询交易报表接口

zhou.xiaoning hace 3 años
padre
commit
71b902805f
Se han modificado 6 ficheros con 648 adiciones y 4 borrados
  1. 29 4
      controllers/guangzuan/report.go
  2. 181 0
      docs/docs.go
  3. 181 0
      docs/swagger.json
  4. 123 0
      docs/swagger.yaml
  5. 133 0
      models/guangzuan.go
  6. 1 0
      routers/router.go

+ 29 - 4
controllers/guangzuan/report.go

@@ -36,6 +36,31 @@ func QueryMemberReport(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Security LoginID
 // @Security Group
+// @Param    userid         query    int    true  "用户ID"
+// @Param    page           query    int    false "页码"
+// @Param    pagesize       query    int    false "每页条数"
+// @Param    cycletype      query    string false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表 (日报表不传此参数)"
+// @Param    begindate      query    string true  "开始时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)"
+// @Param    enddate        query    string true  "结束时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)"
+// @Param    zscategory     query    int    false "商品分类"
+// @Param    zscurrencytype query    int    false "商品币种"
+// @Success  200            {array}  models.WRPositionReport
+// @Failure  500            {object} app.Response
+// @Router   /Guangzuan/QueryWRPositionReport [get]
+// @Tags     广钻
+func QueryWRPositionReport(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.WRPositionReport{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryTradeReport
+// @Summary  查询交易报表
+// @Produce  json
+// @Security ApiKeyAuth
+// @Security LoginID
+// @Security Group
 // @Param    userid    query    int    true  "用户ID"
 // @Param    page      query    int    false "页码"
 // @Param    pagesize  query    int    false "每页条数"
@@ -44,13 +69,13 @@ func QueryMemberReport(c *gin.Context) {
 // @Param    enddate        query    string true  "结束时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)"
 // @Param    zscategory     query    int    false "商品分类"
 // @Param    zscurrencytype query    int    false "商品币种"
-// @Success  200            {array}  models.WRPositionReport
+// @Success  200            {array}  models.Reckongzmemtradesum
 // @Failure  500       {object} app.Response
-// @Router   /Guangzuan/QueryWRPositionReport [get]
+// @Router   /Guangzuan/QueryTradeReport [get]
 // @Tags     广钻
-func QueryWRPositionReport(c *gin.Context) {
+func QueryTradeReport(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
-	m := models.WRPositionReport{}
+	m := models.Reckongzmemtradesum{}
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }

+ 181 - 0
docs/docs.go

@@ -9133,6 +9133,98 @@ const docTemplate = `{
                 }
             }
         },
+        "/Guangzuan/QueryTradeReport": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询交易报表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "周期类型 - 1:月 2:季 3:年 4:周 5:全报表 (日报表不传此参数)",
+                        "name": "cycletype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)",
+                        "name": "begindate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)",
+                        "name": "enddate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品分类",
+                        "name": "zscategory",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品币种",
+                        "name": "zscurrencytype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Reckongzmemtradesum"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryWRPositionReport": {
             "get": {
                 "security": [
@@ -38166,6 +38258,95 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Reckongzmemtradesum": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "buylistingamount": {
+                    "description": "买挂牌金额 - 无数据,预留",
+                    "type": "number"
+                },
+                "buylistinglot": {
+                    "description": "买挂牌宗数",
+                    "type": "integer"
+                },
+                "buylistingqty": {
+                    "description": "买挂牌数量 - 无数据,预留",
+                    "type": "number"
+                },
+                "buytradeamount": {
+                    "description": "购买金额",
+                    "type": "number"
+                },
+                "buytradelot": {
+                    "description": "购买宗数",
+                    "type": "integer"
+                },
+                "buytradeqty": {
+                    "description": "购买数量",
+                    "type": "number"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "reckondate": {
+                    "description": "日照日期(yyyyMMdd)",
+                    "type": "string"
+                },
+                "selllistingamount": {
+                    "description": "卖挂牌金额",
+                    "type": "number"
+                },
+                "selllistinglot": {
+                    "description": "卖挂牌宗数",
+                    "type": "integer"
+                },
+                "selllistingqty": {
+                    "description": "卖挂牌数量",
+                    "type": "number"
+                },
+                "selltradeamount": {
+                    "description": "销售金额",
+                    "type": "number"
+                },
+                "selltradelot": {
+                    "description": "销售宗数",
+                    "type": "integer"
+                },
+                "selltradeqty": {
+                    "description": "销售数量",
+                    "type": "number"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "zscategory": {
+                    "description": "钻石分类 - 枚举”ZSCategory“",
+                    "type": "integer"
+                },
+                "zscategorydisplay": {
+                    "type": "string"
+                },
+                "zscurrencytype": {
+                    "description": "货币类型 - 枚举“ZSCurrencyType”",
+                    "type": "integer"
+                },
+                "zscurrencytypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplayunit": {
+                    "type": "string"
+                }
+            }
+        },
         "models.RelatedTaAccount": {
             "type": "object",
             "properties": {

+ 181 - 0
docs/swagger.json

@@ -9124,6 +9124,98 @@
                 }
             }
         },
+        "/Guangzuan/QueryTradeReport": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    },
+                    {
+                        "LoginID": []
+                    },
+                    {
+                        "Group": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "广钻"
+                ],
+                "summary": "查询交易报表",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "页码",
+                        "name": "page",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "每页条数",
+                        "name": "pagesize",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "周期类型 - 1:月 2:季 3:年 4:周 5:全报表 (日报表不传此参数)",
+                        "name": "cycletype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)",
+                        "name": "begindate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)",
+                        "name": "enddate",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品分类",
+                        "name": "zscategory",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "商品币种",
+                        "name": "zscurrencytype",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Reckongzmemtradesum"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryWRPositionReport": {
             "get": {
                 "security": [
@@ -38157,6 +38249,95 @@
                 }
             }
         },
+        "models.Reckongzmemtradesum": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "buylistingamount": {
+                    "description": "买挂牌金额 - 无数据,预留",
+                    "type": "number"
+                },
+                "buylistinglot": {
+                    "description": "买挂牌宗数",
+                    "type": "integer"
+                },
+                "buylistingqty": {
+                    "description": "买挂牌数量 - 无数据,预留",
+                    "type": "number"
+                },
+                "buytradeamount": {
+                    "description": "购买金额",
+                    "type": "number"
+                },
+                "buytradelot": {
+                    "description": "购买宗数",
+                    "type": "integer"
+                },
+                "buytradeqty": {
+                    "description": "购买数量",
+                    "type": "number"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "reckondate": {
+                    "description": "日照日期(yyyyMMdd)",
+                    "type": "string"
+                },
+                "selllistingamount": {
+                    "description": "卖挂牌金额",
+                    "type": "number"
+                },
+                "selllistinglot": {
+                    "description": "卖挂牌宗数",
+                    "type": "integer"
+                },
+                "selllistingqty": {
+                    "description": "卖挂牌数量",
+                    "type": "number"
+                },
+                "selltradeamount": {
+                    "description": "销售金额",
+                    "type": "number"
+                },
+                "selltradelot": {
+                    "description": "销售宗数",
+                    "type": "integer"
+                },
+                "selltradeqty": {
+                    "description": "销售数量",
+                    "type": "number"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "zscategory": {
+                    "description": "钻石分类 - 枚举”ZSCategory“",
+                    "type": "integer"
+                },
+                "zscategorydisplay": {
+                    "type": "string"
+                },
+                "zscurrencytype": {
+                    "description": "货币类型 - 枚举“ZSCurrencyType”",
+                    "type": "integer"
+                },
+                "zscurrencytypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplayunit": {
+                    "type": "string"
+                }
+            }
+        },
         "models.RelatedTaAccount": {
             "type": "object",
             "properties": {

+ 123 - 0
docs/swagger.yaml

@@ -15936,6 +15936,71 @@ definitions:
     required:
     - userid
     type: object
+  models.Reckongzmemtradesum:
+    properties:
+      buylistingamount:
+        description: 买挂牌金额 - 无数据,预留
+        type: number
+      buylistinglot:
+        description: 买挂牌宗数
+        type: integer
+      buylistingqty:
+        description: 买挂牌数量 - 无数据,预留
+        type: number
+      buytradeamount:
+        description: 购买金额
+        type: number
+      buytradelot:
+        description: 购买宗数
+        type: integer
+      buytradeqty:
+        description: 购买数量
+        type: number
+      marketid:
+        description: 市场ID
+        type: integer
+      reckondate:
+        description: 日照日期(yyyyMMdd)
+        type: string
+      selllistingamount:
+        description: 卖挂牌金额
+        type: number
+      selllistinglot:
+        description: 卖挂牌宗数
+        type: integer
+      selllistingqty:
+        description: 卖挂牌数量
+        type: number
+      selltradeamount:
+        description: 销售金额
+        type: number
+      selltradelot:
+        description: 销售宗数
+        type: integer
+      selltradeqty:
+        description: 销售数量
+        type: number
+      updatetime:
+        description: 更新时间
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+      zscategory:
+        description: 钻石分类 - 枚举”ZSCategory“
+        type: integer
+      zscategorydisplay:
+        type: string
+      zscurrencytype:
+        description: 货币类型 - 枚举“ZSCurrencyType”
+        type: integer
+      zscurrencytypedisplay:
+        type: string
+      zscurrencytypedisplayunit:
+        type: string
+    required:
+    - userid
+    type: object
   models.RelatedTaAccount:
     properties:
       accountid:
@@ -29026,6 +29091,64 @@ paths:
       summary: 查询出售大厅委托单
       tags:
       - 广钻
+  /Guangzuan/QueryTradeReport:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 页码
+        in: query
+        name: page
+        type: integer
+      - description: 每页条数
+        in: query
+        name: pagesize
+        type: integer
+      - description: 周期类型 - 1:月 2:季 3:年 4:周 5:全报表 (日报表不传此参数)
+        in: query
+        name: cycletype
+        type: string
+      - description: 开始时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)
+        in: query
+        name: begindate
+        required: true
+        type: string
+      - description: 结束时段(日报表:yyyymmdd 月报表:yyyymm 年报表:yyyy)
+        in: query
+        name: enddate
+        required: true
+        type: string
+      - description: 商品分类
+        in: query
+        name: zscategory
+        type: integer
+      - description: 商品币种
+        in: query
+        name: zscurrencytype
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Reckongzmemtradesum'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: 查询交易报表
+      tags:
+      - 广钻
   /Guangzuan/QueryWRPositionReport:
     get:
       parameters:

+ 133 - 0
models/guangzuan.go

@@ -3132,3 +3132,136 @@ func (r *WRPositionReport) GetDataByPage() (interface{}, error, int, int, int) {
 	}
 	return sData, err, r.Page, r.PageSize, total
 }
+
+// Reckongzmemtradesum 会员钻石交易日汇总表
+type Reckongzmemtradesum struct {
+	MARKETID          int64     `json:"marketid" xorm:"MARKETID"`                                   // 市场ID
+	USERID            int64     `json:"userid" xorm:"USERID" form:"userid" binding:"required"`      // 用户ID
+	ZSCATEGORY        int32     `json:"zscategory" xorm:"ZSCATEGORY" form:"zscategory"`             // 钻石分类 - 枚举”ZSCategory“
+	ZSCURRENCYTYPE    int32     `json:"zscurrencytype" xorm:"ZSCURRENCYTYPE" form:"zscurrencytype"` // 货币类型 - 枚举“ZSCurrencyType”
+	BUYLISTINGLOT     int32     `json:"buylistinglot" xorm:"BUYLISTINGLOT"`                         // 买挂牌宗数
+	BUYLISTINGQTY     float64   `json:"buylistingqty" xorm:"BUYLISTINGQTY"`                         // 买挂牌数量 - 无数据,预留
+	BUYLISTINGAMOUNT  float64   `json:"buylistingamount" xorm:"BUYLISTINGAMOUNT"`                   // 买挂牌金额 - 无数据,预留
+	SELLLISTINGLOT    int32     `json:"selllistinglot" xorm:"SELLLISTINGLOT"`                       // 卖挂牌宗数
+	SELLLISTINGQTY    float64   `json:"selllistingqty" xorm:"SELLLISTINGQTY"`                       // 卖挂牌数量
+	SELLLISTINGAMOUNT float64   `json:"selllistingamount" xorm:"SELLLISTINGAMOUNT"`                 // 卖挂牌金额
+	BUYTRADELOT       int32     `json:"buytradelot" xorm:"BUYTRADELOT"`                             // 购买宗数
+	BUYTRADEQTY       float64   `json:"buytradeqty" xorm:"BUYTRADEQTY"`                             // 购买数量
+	BUYTRADEAMOUNT    float64   `json:"buytradeamount" xorm:"BUYTRADEAMOUNT"`                       // 购买金额
+	SELLTRADELOT      int32     `json:"selltradelot" xorm:"SELLTRADELOT"`                           // 销售宗数
+	SELLTRADEQTY      float64   `json:"selltradeqty" xorm:"SELLTRADEQTY"`                           // 销售数量
+	SELLTRADEAMOUNT   float64   `json:"selltradeamount" xorm:"SELLTRADEAMOUNT"`                     // 销售金额
+	UPDATETIME        time.Time `json:"updatetime" xorm:"UPDATETIME"`                               // 更新时间
+	RECKONDATE        string    `json:"reckondate" xorm:"RECKONDATE"`                               // 日照日期(yyyyMMdd)
+
+	ZSCATEGORYDISPLAY         string `json:"zscategorydisplay" xorm:"ZSCATEGORYDISPLAY"`                 //
+	ZSCURRENCYTYPEDISPLAY     string `json:"zscurrencytypedisplay" xorm:"ZSCURRENCYTYPEDISPLAY"`         //
+	ZSCURRENCYTYPEDISPLAYUNIT string `json:"zscurrencytypedisplayunit" xorm:"ZSCURRENCYTYPEDISPLAYUNIT"` //
+
+	CYCLETYPE int32  `json:"-" form:"cycletype"`                    // 周期类型 - 1:月 2:季 3:年 4:周 5:全报表 (日报表不传此参数)
+	BeginDate string `json:"-" form:"begindate" binding:"required"` // 开始时段
+	EndDate   string `json:"-" form:"enddate" binding:"required"`   // 结束时段
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *Reckongzmemtradesum) calc() {
+
+}
+
+func (r *Reckongzmemtradesum) buildSql() string {
+	var sqlId utils.SQLVal
+	if r.CYCLETYPE == 0 {
+		// 日报表
+		sqlId = `
+			select 
+				DIC1.ENUMDICNAME ZSCATEGORYDISPLAY,
+				DIC2.ENUMDICNAME ZSCURRENCYTYPEDISPLAY,
+				DIC2.PARAM2      ZSCURRENCYTYPEDISPLAYUNIT,
+				t.*
+			from Reckon_GZ_MemTradeSum t
+			LEFT JOIN ENUMDICITEM DIC1 ON t.ZSCATEGORY = DIC1.ENUMITEMNAME AND DIC1.ENUMDICCODE = 'ZSCategory'
+			LEFT JOIN ENUMDICITEM DIC2 ON t.ZSCURRENCYTYPE = DIC2.ENUMITEMNAME AND DIC2.ENUMDICCODE = 'ZSCurrencyType'
+			where t.userid = %v
+				and t.tradedate >= '%v'
+				and t.tradedate <= '%v'
+				and %v
+				and %v
+			order by t.tradedate, t.zscategory, t.zscurrencytype
+		`
+		// 【登录用户ID】 【开始时段】 【结束时段】 t.ZSCATEGORY = 【商品分类】 t.ZSCURRENCYTYPE = 【商品币种】
+		p1 := "1=1"
+		if r.ZSCATEGORY > 0 {
+			p1 = fmt.Sprintf("t.ZSCATEGORY = %v", r.ZSCATEGORY)
+		}
+		p2 := "1=1"
+		if r.ZSCURRENCYTYPE > 0 {
+			p1 = fmt.Sprintf("t.ZSCURRENCYTYPE = %v", r.ZSCURRENCYTYPE)
+		}
+		sqlId.FormatParam(r.USERID, r.BeginDate, r.EndDate, p1, p2)
+	} else {
+		// 周期报表
+		sqlId = `
+			select 
+				DIC1.ENUMDICNAME ZSCATEGORYDISPLAY,
+				DIC2.ENUMDICNAME ZSCURRENCYTYPEDISPLAY,
+				DIC2.PARAM2      ZSCURRENCYTYPEDISPLAYUNIT,
+				t.MARKETID         ,
+				t.USERID           ,
+				t.ZSCATEGORY       ,
+				t.ZSCURRENCYTYPE   ,
+				t.BUYLISTINGLOT    ,
+				t.BUYLISTINGQTY    ,
+				t.BUYLISTINGAMOUNT ,
+				t.SELLLISTINGLOT   ,
+				t.SELLLISTINGQTY   ,
+				t.SELLLISTINGAMOUNT,
+				t.BUYTRADELOT      ,
+				t.BUYTRADEQTY      ,
+				t.BUYTRADEAMOUNT   ,
+				t.SELLTRADELOT     ,
+				t.SELLTRADEQTY     ,
+				t.SELLTRADEAMOUNT  ,
+				t.UPDATETIME       ,
+				t.CYCLETIME RECKONDATE       
+			from Report_GZ_MemTradeSum t
+			LEFT JOIN ENUMDICITEM DIC1 ON t.ZSCATEGORY = DIC1.ENUMITEMNAME AND DIC1.ENUMDICCODE = 'ZSCategory'
+			LEFT JOIN ENUMDICITEM DIC2 ON t.ZSCURRENCYTYPE = DIC2.ENUMITEMNAME AND DIC2.ENUMDICCODE = 'ZSCurrencyType'
+			where t.userid = %v
+				and %v
+				and t.cycletime >= %v
+				and t.cycletime <= %v
+				and %v
+				and %v
+			order by t.cycletime, t.zscategory, t.zscurrencytype
+		`
+		// 【登录用户ID】 t.cycletype = 【报表类型】【开始时段】 【结束时段】 t.ZSCATEGORY = 【商品分类】 t.ZSCURRENCYTYPE = 【商品币种】
+		p0 := "1=1"
+		if r.CYCLETYPE > 0 {
+			p0 = fmt.Sprintf("t.CYCLETYPE = %v", r.CYCLETYPE)
+		}
+		p1 := "1=1"
+		if r.ZSCATEGORY > 0 {
+			p1 = fmt.Sprintf("t.ZSCATEGORY = %v", r.ZSCATEGORY)
+		}
+		p2 := "1=1"
+		if r.ZSCURRENCYTYPE > 0 {
+			p1 = fmt.Sprintf("t.ZSCURRENCYTYPE = %v", r.ZSCURRENCYTYPE)
+		}
+		sqlId.FormatParam(r.USERID, p0, r.BeginDate, r.EndDate, p1, p2)
+	}
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *Reckongzmemtradesum) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]Reckongzmemtradesum, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	total := 0
+	for i := range sData {
+		sData[i].calc()
+		total = sData[i].Total
+	}
+	return sData, err, r.Page, r.PageSize, total
+}

+ 1 - 0
routers/router.go

@@ -681,6 +681,7 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("GZBSFWOrderOperate", guangzuan.GZBSFWOrderOperate)
 		guangzuanR.GET("QueryMemberReport", guangzuan.QueryMemberReport)
 		guangzuanR.GET("QueryWRPositionReport", guangzuan.QueryWRPositionReport)
+		guangzuanR.GET("QueryTradeReport", guangzuan.QueryTradeReport)
 	}
 
 	return r