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

1、增加“查询我的收藏”接口;
2、“我的求购”和“我的出售”增加历史查询功能。

zhou.xiaoning 3 лет назад
Родитель
Сommit
38261a96ec
6 измененных файлов с 724 добавлено и 8 удалено
  1. 31 5
      controllers/guangzuan/wrposition.go
  2. 213 0
      docs/docs.go
  3. 213 0
      docs/swagger.json
  4. 141 0
      docs/swagger.yaml
  5. 125 3
      models/guangzuan.go
  6. 1 0
      routers/router.go

+ 31 - 5
controllers/guangzuan/wrposition.go

@@ -17,7 +17,7 @@ import (
 // @Param    pagesize    query    int false "每页条数"
 // @Param    wruserid        query    int    true  "登录用户ID"
 // @Param    zsallproperties query    string false "商品(查询字段-模糊查询)"
-// @Param    zscategorys     query    string false "钻石分类, 格式:1,2,3"
+// @Param    zscategorys query    string false "钻石分类, 格式:1,2,3"
 // @Param    warehouseid     query    int    false "仓库ID"
 // @Param    marketflag      query    int    false "是否上架,0-全部 1-是 2-否"
 // @Success  200             {array}  models.MyWRPosition
@@ -44,6 +44,8 @@ func QueryMyWRPosition(c *gin.Context) {
 // @Param    zscategorys     query    string false "钻石分类, 格式:1,2,3"
 // @Param    wrtradeorderid  query    int    false "委托单号"
 // @Param    ishis           query    bool   false "是否历史查询"
+// @Param    begindate       query    string false "开始交易日(yyyymmdd)"
+// @Param    enddate         query    string false "结束交易日(yyyymmdd)"
 // @Success  200             {array}  models.MyBuyOrder
 // @Failure  500         {object} app.Response
 // @Router   /Guangzuan/QueryMyBuyOrder [get]
@@ -62,14 +64,16 @@ func QueryMyBuyOrder(c *gin.Context) {
 // @Security LoginID
 // @Security Group
 // @Param    userid      query    int true  "用户ID"
-// @Param    page            query    int    false "页码"
-// @Param    pagesize        query    int    false "每页条数"
+// @Param    page        query    int    false "页码"
+// @Param    pagesize    query    int    false "每页条数"
 // @Param    zsallproperties query    string false "商品(查询字段-模糊查询)"
 // @Param    zscategorys     query    string false "钻石分类, 格式:1,2,3"
 // @Param    wrtradeorderid  query    int    false "委托单号"
 // @Param    ishis           query    bool   false "是否历史查询"
+// @Param    begindate       query    string false "开始交易日(yyyymmdd)"
+// @Param    enddate         query    string false "结束交易日(yyyymmdd)"
 // @Success  200             {array}  models.MySellOrder
-// @Failure  500             {object} app.Response
+// @Failure  500         {object} app.Response
 // @Router   /Guangzuan/QueryMySellOrder [get]
 // @Tags     广钻
 func QueryMySellOrder(c *gin.Context) {
@@ -85,7 +89,7 @@ func QueryMySellOrder(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Security LoginID
 // @Security Group
-// @Param    userid          query    int    true  "用户ID"
+// @Param    userid      query    int    true  "用户ID"
 // @Param    page            query    int    false "页码"
 // @Param    pagesize        query    int    false "每页条数"
 // @Param    zsallproperties query    string false "商品(查询字段-模糊查询)"
@@ -159,6 +163,7 @@ func QueryMyDelistingApply(c *gin.Context) {
 // @Param    pagesize        query    int    false "每页条数"
 // @Param    zsallproperties query    string false "商品(查询字段-模糊查询)"
 // @Param    buyorsell       query    int    false "方向,0-买 1-卖"
+// @Param    ishis           query    bool   false "是否历史查询"
 // @Param    begindate       query    string false "开始交易日(yyyymmdd)"
 // @Param    enddate         query    string false "结束交易日(yyyymmdd)"
 // @Success  200             {array}  models.MyPerformanc
@@ -171,3 +176,24 @@ func QueryMyPerformanc(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }
+
+// QueryMyFavorite
+// @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 "每页条数"
+// @Param    zscategorys     query    string false "钻石分类, 格式:1,2,3"
+// @Success  200         {array}  models.MyFavorite
+// @Failure  500             {object} app.Response
+// @Router   /Guangzuan/QueryMyFavorite [get]
+// @Tags     广钻
+func QueryMyFavorite(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.MyFavorite{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 213 - 0
docs/docs.go

@@ -7850,6 +7850,18 @@ const docTemplate = `{
                         "description": "是否历史查询",
                         "name": "ishis",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -8039,6 +8051,72 @@ const docTemplate = `{
                 }
             }
         },
+        "/Guangzuan/QueryMyFavorite": {
+            "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",
+                        "name": "zscategorys",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.MyFavorite"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryMyPerformanc": {
             "get": {
                 "security": [
@@ -8092,6 +8170,12 @@ const docTemplate = `{
                         "in": "query"
                     },
                     {
+                        "type": "boolean",
+                        "description": "是否历史查询",
+                        "name": "ishis",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "开始交易日(yyyymmdd)",
                         "name": "begindate",
@@ -8186,6 +8270,18 @@ const docTemplate = `{
                         "description": "是否历史查询",
                         "name": "ishis",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -28505,6 +28601,123 @@ const docTemplate = `{
                 }
             }
         },
+        "models.MyFavorite": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "favoritestatus": {
+                    "description": "收藏状态 - 1:正常 2:失效",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "price": {
+                    "description": "价格",
+                    "type": "number"
+                },
+                "priceper": {
+                    "description": "克拉单价",
+                    "type": "string"
+                },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "warehousenamedisplay": {
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID/商品ID(77)",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(自增 SEQ_GOODS 确保不重复)",
+                    "type": "integer"
+                },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "zscategorydisplay": {
+                    "type": "string"
+                },
+                "zscerttypedisplay": {
+                    "type": "string"
+                },
+                "zsclaritytype1display": {
+                    "type": "string"
+                },
+                "zsclaritytype2display": {
+                    "type": "string"
+                },
+                "zscolortype1display": {
+                    "type": "string"
+                },
+                "zscolortype2display": {
+                    "type": "string"
+                },
+                "zscrystaltypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplayunit": {
+                    "type": "string"
+                },
+                "zscuttype1display": {
+                    "type": "string"
+                },
+                "zscuttype2display": {
+                    "type": "string"
+                },
+                "zsczcolor1typedisplay": {
+                    "type": "string"
+                },
+                "zsczcolor2typedisplay": {
+                    "type": "string"
+                },
+                "zsczcolor3typedisplay": {
+                    "type": "string"
+                },
+                "zsfluorescencetype1display": {
+                    "type": "string"
+                },
+                "zsfluorescencetype2display": {
+                    "type": "string"
+                },
+                "zspolishtype1display": {
+                    "type": "string"
+                },
+                "zspolishtype2display": {
+                    "type": "string"
+                },
+                "zsshapetypedisplay": {
+                    "type": "string"
+                },
+                "zsstyletypedisplay": {
+                    "type": "string"
+                },
+                "zssymmetrytype1display": {
+                    "type": "string"
+                },
+                "zssymmetrytype2display": {
+                    "type": "string"
+                }
+            }
+        },
         "models.MyPerformanc": {
             "type": "object",
             "properties": {

+ 213 - 0
docs/swagger.json

@@ -7841,6 +7841,18 @@
                         "description": "是否历史查询",
                         "name": "ishis",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -8030,6 +8042,72 @@
                 }
             }
         },
+        "/Guangzuan/QueryMyFavorite": {
+            "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",
+                        "name": "zscategorys",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.MyFavorite"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Guangzuan/QueryMyPerformanc": {
             "get": {
                 "security": [
@@ -8083,6 +8161,12 @@
                         "in": "query"
                     },
                     {
+                        "type": "boolean",
+                        "description": "是否历史查询",
+                        "name": "ishis",
+                        "in": "query"
+                    },
+                    {
                         "type": "string",
                         "description": "开始交易日(yyyymmdd)",
                         "name": "begindate",
@@ -8177,6 +8261,18 @@
                         "description": "是否历史查询",
                         "name": "ishis",
                         "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "开始交易日(yyyymmdd)",
+                        "name": "begindate",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "结束交易日(yyyymmdd)",
+                        "name": "enddate",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -28496,6 +28592,123 @@
                 }
             }
         },
+        "models.MyFavorite": {
+            "type": "object",
+            "required": [
+                "userid"
+            ],
+            "properties": {
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "favoritestatus": {
+                    "description": "收藏状态 - 1:正常 2:失效",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "price": {
+                    "description": "价格",
+                    "type": "number"
+                },
+                "priceper": {
+                    "description": "克拉单价",
+                    "type": "string"
+                },
+                "sizedisplay": {
+                    "description": "尺寸",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "warehousenamedisplay": {
+                    "type": "string"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID/商品ID(77)",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(自增 SEQ_GOODS 确保不重复)",
+                    "type": "integer"
+                },
+                "wrtradeorderid": {
+                    "description": "仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "zscategorydisplay": {
+                    "type": "string"
+                },
+                "zscerttypedisplay": {
+                    "type": "string"
+                },
+                "zsclaritytype1display": {
+                    "type": "string"
+                },
+                "zsclaritytype2display": {
+                    "type": "string"
+                },
+                "zscolortype1display": {
+                    "type": "string"
+                },
+                "zscolortype2display": {
+                    "type": "string"
+                },
+                "zscrystaltypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplay": {
+                    "type": "string"
+                },
+                "zscurrencytypedisplayunit": {
+                    "type": "string"
+                },
+                "zscuttype1display": {
+                    "type": "string"
+                },
+                "zscuttype2display": {
+                    "type": "string"
+                },
+                "zsczcolor1typedisplay": {
+                    "type": "string"
+                },
+                "zsczcolor2typedisplay": {
+                    "type": "string"
+                },
+                "zsczcolor3typedisplay": {
+                    "type": "string"
+                },
+                "zsfluorescencetype1display": {
+                    "type": "string"
+                },
+                "zsfluorescencetype2display": {
+                    "type": "string"
+                },
+                "zspolishtype1display": {
+                    "type": "string"
+                },
+                "zspolishtype2display": {
+                    "type": "string"
+                },
+                "zsshapetypedisplay": {
+                    "type": "string"
+                },
+                "zsstyletypedisplay": {
+                    "type": "string"
+                },
+                "zssymmetrytype1display": {
+                    "type": "string"
+                },
+                "zssymmetrytype2display": {
+                    "type": "string"
+                }
+            }
+        },
         "models.MyPerformanc": {
             "type": "object",
             "properties": {

+ 141 - 0
docs/swagger.yaml

@@ -11258,6 +11258,87 @@ definitions:
     required:
     - selluserid
     type: object
+  models.MyFavorite:
+    properties:
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
+      favoritestatus:
+        description: 收藏状态 - 1:正常 2:失效
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      price:
+        description: 价格
+        type: number
+      priceper:
+        description: 克拉单价
+        type: string
+      sizedisplay:
+        description: 尺寸
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+      warehousenamedisplay:
+        type: string
+      wrfactortypeid:
+        description: 仓单要素类型ID/商品ID(77)
+        type: string
+      wrstandardid:
+        description: 现货商品ID(自增 SEQ_GOODS 确保不重复)
+        type: integer
+      wrtradeorderid:
+        description: 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      zscategorydisplay:
+        type: string
+      zscerttypedisplay:
+        type: string
+      zsclaritytype1display:
+        type: string
+      zsclaritytype2display:
+        type: string
+      zscolortype1display:
+        type: string
+      zscolortype2display:
+        type: string
+      zscrystaltypedisplay:
+        type: string
+      zscurrencytypedisplay:
+        type: string
+      zscurrencytypedisplayunit:
+        type: string
+      zscuttype1display:
+        type: string
+      zscuttype2display:
+        type: string
+      zsczcolor1typedisplay:
+        type: string
+      zsczcolor2typedisplay:
+        type: string
+      zsczcolor3typedisplay:
+        type: string
+      zsfluorescencetype1display:
+        type: string
+      zsfluorescencetype2display:
+        type: string
+      zspolishtype1display:
+        type: string
+      zspolishtype2display:
+        type: string
+      zsshapetypedisplay:
+        type: string
+      zsstyletypedisplay:
+        type: string
+      zssymmetrytype1display:
+        type: string
+      zssymmetrytype2display:
+        type: string
+    required:
+    - userid
+    type: object
   models.MyPerformanc:
     properties:
       accountname:
@@ -24311,6 +24392,14 @@ paths:
         in: query
         name: ishis
         type: boolean
+      - description: 开始交易日(yyyymmdd)
+        in: query
+        name: begindate
+        type: string
+      - description: 结束交易日(yyyymmdd)
+        in: query
+        name: enddate
+        type: string
       produces:
       - application/json
       responses:
@@ -24435,6 +24524,46 @@ paths:
       summary: 查询我的询价-出售
       tags:
       - 广钻
+  /Guangzuan/QueryMyFavorite:
+    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
+        in: query
+        name: zscategorys
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.MyFavorite'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      - LoginID: []
+      - Group: []
+      summary: 查询我的收藏
+      tags:
+      - 广钻
   /Guangzuan/QueryMyPerformanc:
     get:
       parameters:
@@ -24459,6 +24588,10 @@ paths:
         in: query
         name: buyorsell
         type: integer
+      - description: 是否历史查询
+        in: query
+        name: ishis
+        type: boolean
       - description: 开始交易日(yyyymmdd)
         in: query
         name: begindate
@@ -24519,6 +24652,14 @@ paths:
         in: query
         name: ishis
         type: boolean
+      - description: 开始交易日(yyyymmdd)
+        in: query
+        name: begindate
+        type: string
+      - description: 结束交易日(yyyymmdd)
+        in: query
+        name: enddate
+        type: string
       produces:
       - application/json
       responses:

+ 125 - 3
models/guangzuan.go

@@ -837,7 +837,9 @@ type MyBuyOrder struct {
 	WAREHOUSEIDS       string `json:"warehouseids" xorm:"WAREHOUSEIDS"`             // 仓库ID - 多个, 逗号分隔
 	MARKETID           int32  `json:"marketid" xorm:"MARKETID"`                     // 市场ID
 
-	IsHis bool `json:"-" form:"ishis"` // 是否历史查询
+	IsHis     bool   `json:"-" form:"ishis"`     // 是否历史查询
+	BeginDate string `json:"-" form:"begindate"` // 开始交易日
+	EndDate   string `json:"-" form:"enddate"`   // 结束交易日
 
 	PageEx `xorm:"extends"` // 页码信息
 }
@@ -887,6 +889,9 @@ func (r *MyBuyOrder) buildSql_His() string {
 	}
 	sqlId.AndLike("q.ZSALLPROPERTIES", r.ZSALLPROPERTIES)
 	sqlId.AndEx("t.WRTRADEORDERID", r.WRTRADEORDERID, r.WRTRADEORDERID != "")
+	if r.BeginDate != "" && r.EndDate != "" {
+		sqlId.JoinFormat(" AND (t.TRADEDATE >= '%v' AND t.TRADEDATE <= '%v')", r.BeginDate, r.EndDate)
+	}
 	sqlId.OrderByDesc("t.WRTRADEORDERID")
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()
@@ -1015,7 +1020,9 @@ type MySellOrder struct {
 	TOTALQTY  float64 `json:"totalqty" xorm:"TOTALQTY"`   // 总重量
 	SELLEDQTY float64 `json:"selledqty" xorm:"SELLEDQTY"` // 成交重量
 
-	IsHis bool `json:"-" form:"ishis"` // 是否历史查询
+	IsHis     bool   `json:"-" form:"ishis"`     // 是否历史查询
+	BeginDate string `json:"-" form:"begindate"` // 开始交易日
+	EndDate   string `json:"-" form:"enddate"`   // 结束交易日
 
 	PageEx `xorm:"extends"` // 页码信息
 }
@@ -1249,6 +1256,9 @@ func (r *MySellOrder) buildSql_His() string {
 	}
 	sqlId.AndLike("q.ZSALLPROPERTIES", r.ZSALLPROPERTIES)
 	sqlId.AndEx("t.WRTRADEORDERID", r.WRTRADEORDERID, r.WRTRADEORDERID != "")
+	if r.BeginDate != "" && r.EndDate != "" {
+		sqlId.JoinFormat(" AND (t.TRADEDATE >= '%v' AND t.TRADEDATE <= '%v')", r.BeginDate, r.EndDate)
+	}
 	sqlId.OrderByDesc("t.WRTRADEORDERID")
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()
@@ -1864,6 +1874,7 @@ type MyPerformanc struct {
 
 	USERID    int64  `json:"-" form:"userid" binding:"required"` // 用户ID
 	BuyOrSell int64  `json:"buyorsell" form:"buyorsell"`         // 方向 - 0:买 1:卖
+	IsHis     bool   `json:"-" form:"ishis"`                     // 是否历史查询
 	BeginDate string `json:"-" form:"begindate"`                 // 开始交易日
 	EndDate   string `json:"-" form:"enddate"`                   // 结束交易日
 
@@ -2020,7 +2031,7 @@ func (r *MyPerformanc) buildSql_His() string {
 func (r *MyPerformanc) GetDataByPage() (interface{}, error, int, int, int) {
 	sData := make([]MyPerformanc, 0)
 	sql := ""
-	if r.BeginDate != "" && r.EndDate != "" {
+	if r.IsHis {
 		sql = r.buildSql_His()
 	} else {
 		sql = r.buildSql()
@@ -2033,3 +2044,114 @@ func (r *MyPerformanc) GetDataByPage() (interface{}, error, int, int, int) {
 	}
 	return sData, err, r.Page, r.PageSize, total
 }
+
+// MyFavorite 我的收藏
+type MyFavorite struct {
+	USERID         int64  `json:"userid" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
+	WRTRADEORDERID string `json:"wrtradeorderid" xorm:"WRTRADEORDERID1"`                 // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+	BUYORSELL      int32  `json:"buyorsell" xorm:"BUYORSELL"`                            // 买卖 - 0:买 1:卖
+	WRFACTORTYPEID string `json:"wrfactortypeid" xorm:"WRFACTORTYPEID1"`                 // 仓单要素类型ID/商品ID(77)
+	WRSTANDARDID   int64  `json:"wrstandardid" xorm:"WRSTANDARDID"`                      // 现货商品ID(自增 SEQ_GOODS 确保不重复)
+	FAVORITESTATUS int32  `json:"favoritestatus" xorm:"FAVORITESTATUS"`                  // 收藏状态 - 1:正常 2:失效
+	MARKETID       int32  `json:"marketid" xorm:"MARKETID"`                              // 市场ID
+
+	ZSCATEGORYDISPLAY          string  `json:"zscategorydisplay" xorm:"ZSCATEGORYDISPLAY"`                   //
+	ZSCURRENCYTYPEDISPLAY      string  `json:"zscurrencytypedisplay" xorm:"ZSCURRENCYTYPEDISPLAY"`           //
+	ZSCURRENCYTYPEDISPLAYUNIT  string  `json:"zscurrencytypedisplayunit" xorm:"ZSCURRENCYTYPEDISPLAYUNIT"`   //
+	WAREHOUSENAMEDISPLAY       string  `json:"warehousenamedisplay" xorm:"WAREHOUSENAMEDISPLAY"`             //
+	ZSSHAPETYPEDISPLAY         string  `json:"zsshapetypedisplay" xorm:"ZSSHAPETYPEDISPLAY"`                 //
+	ZSCOLORTYPE1DISPLAY        string  `json:"zscolortype1display" xorm:"ZSCOLORTYPE1DISPLAY"`               //
+	ZSCOLORTYPE2DISPLAY        string  `json:"zscolortype2display" xorm:"ZSCOLORTYPE2DISPLAY"`               //
+	ZSCLARITYTYPE1DISPLAY      string  `json:"zsclaritytype1display" xorm:"ZSCLARITYTYPE1DISPLAY"`           //
+	ZSCLARITYTYPE2DISPLAY      string  `json:"zsclaritytype2display" xorm:"ZSCLARITYTYPE2DISPLAY"`           //
+	ZSCUTTYPE1DISPLAY          string  `json:"zscuttype1display" xorm:"ZSCUTTYPE1DISPLAY"`                   //
+	ZSCUTTYPE2DISPLAY          string  `json:"zscuttype2display" xorm:"ZSCUTTYPE2DISPLAY"`                   //
+	ZSSYMMETRYTYPE1DISPLAY     string  `json:"zssymmetrytype1display" xorm:"ZSSYMMETRYTYPE1DISPLAY"`         //
+	ZSSYMMETRYTYPE2DISPLAY     string  `json:"zssymmetrytype2display" xorm:"ZSSYMMETRYTYPE2DISPLAY"`         //
+	ZSPOLISHTYPE1DISPLAY       string  `json:"zspolishtype1display" xorm:"ZSPOLISHTYPE1DISPLAY"`             //
+	ZSPOLISHTYPE2DISPLAY       string  `json:"zspolishtype2display" xorm:"ZSPOLISHTYPE2DISPLAY"`             //
+	ZSFLUORESCENCETYPE1DISPLAY string  `json:"zsfluorescencetype1display" xorm:"ZSFLUORESCENCETYPE1DISPLAY"` //
+	ZSFLUORESCENCETYPE2DISPLAY string  `json:"zsfluorescencetype2display" xorm:"ZSFLUORESCENCETYPE2DISPLAY"` //
+	ZSCERTTYPEDISPLAY          string  `json:"zscerttypedisplay" xorm:"ZSCERTTYPEDISPLAY"`                   //
+	ZSCRYSTALTYPEDISPLAY       string  `json:"zscrystaltypedisplay" xorm:"ZSCRYSTALTYPEDISPLAY"`             //
+	ZSSTYLETYPEDISPLAY         string  `json:"zsstyletypedisplay" xorm:"ZSSTYLETYPEDISPLAY"`                 //
+	ZSCZCOLOR1TYPEDISPLAY      string  `json:"zsczcolor1typedisplay" xorm:"ZSCZCOLOR1TYPEDISPLAY"`           //
+	ZSCZCOLOR2TYPEDISPLAY      string  `json:"zsczcolor2typedisplay" xorm:"ZSCZCOLOR2TYPEDISPLAY"`           //
+	ZSCZCOLOR3TYPEDISPLAY      string  `json:"zsczcolor3typedisplay" xorm:"ZSCZCOLOR3TYPEDISPLAY"`           //
+	PRICE                      float64 `json:"price" xorm:"PRICE"`                                           // 价格
+	PRICEPER                   string  `json:"priceper" xorm:"PRICEPER"`                                     // 克拉单价
+	SIZEDISPLAY                string  `json:"sizedisplay" xorm:"SIZEDISPLAY"`                               // 尺寸
+
+	PageEx `xorm:"extends"` // 页码信息
+
+	ZSCATEGORYS string `json:"-" form:"zscategorys"` // 钻石分类,格式: 1,2,3
+}
+
+func (r *MyFavorite) calc() {
+
+}
+
+func (r *MyFavorite) buildSql() string {
+	var sqlId utils.SQLVal = `
+	SELECT 
+		t.USERID        ,
+		to_char(t.WRTRADEORDERID) WRTRADEORDERID1,
+		t.BUYORSELL     ,
+		to_char(t.WRFACTORTYPEID) WRFACTORTYPEID1,
+		t.WRSTANDARDID  ,
+		t.FAVORITESTATUS,
+		t.MARKETID      ,
+		q.ZSCATEGORYDISPLAY         ,
+		q.ZSCURRENCYTYPEDISPLAY     ,
+		q.ZSCURRENCYTYPEDISPLAYUNIT ,
+		q.WAREHOUSENAMEDISPLAY      ,
+		q.ZSSHAPETYPEDISPLAY        ,
+		q.ZSCOLORTYPE1DISPLAY       ,
+		q.ZSCOLORTYPE2DISPLAY       ,
+		q.ZSCLARITYTYPE1DISPLAY     ,
+		q.ZSCLARITYTYPE2DISPLAY     ,
+		q.ZSCUTTYPE1DISPLAY         ,
+		q.ZSCUTTYPE2DISPLAY         ,
+		q.ZSSYMMETRYTYPE1DISPLAY    ,
+		q.ZSSYMMETRYTYPE2DISPLAY    ,
+		q.ZSPOLISHTYPE1DISPLAY      ,
+		q.ZSPOLISHTYPE2DISPLAY      ,
+		q.ZSFLUORESCENCETYPE1DISPLAY,
+		q.ZSFLUORESCENCETYPE2DISPLAY,
+		q.ZSCERTTYPEDISPLAY         ,
+		q.ZSCRYSTALTYPEDISPLAY      ,
+		q.ZSSTYLETYPEDISPLAY        ,
+		q.ZSCZCOLOR1TYPEDISPLAY     ,
+		q.ZSCZCOLOR2TYPEDISPLAY     ,
+		q.ZSCZCOLOR3TYPEDISPLAY     ,
+		q.PRICE                     ,
+		q.PRICEPER                  ,
+		CASE WHEN
+			q.SIZE1 IS NOT NULL AND q.SIZE2 IS NOT NULL AND q.SIZE2 IS NOT NULL THEN q.SIZE1 || '*' || q.SIZE2 || '*' || q.SIZE3
+			ELSE q.SIZE1
+		END AS SIZEDISPLAY	         
+	FROM Wrtrade_Myfavorite t
+	LEFT JOIN view_GZ_WRStandard_Ex_Query q ON t.WRSTANDARDID = q.WRSTANDARDID
+	WHERE t.marketid=67201
+	`
+
+	sqlId.And("t.USERID", r.USERID)
+	if r.ZSCATEGORYS != "" {
+		sqlId.JoinFormat(" AND q.ZSCATEGORY in (%v)", r.ZSCATEGORYS)
+	}
+	sqlId.OrderByDesc("t.CREATETIME")
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *MyFavorite) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]MyFavorite, 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

@@ -668,6 +668,7 @@ func InitRouter() *gin.Engine {
 		guangzuanR.GET("QueryMyDelistingApply", guangzuan.QueryMyDelistingApply)
 		guangzuanR.GET("GetGoods", guangzuan.GetGoods)
 		guangzuanR.GET("QueryMyPerformanc", guangzuan.QueryMyPerformanc)
+		guangzuanR.GET("QueryMyFavorite", guangzuan.QueryMyFavorite)
 	}
 
 	return r