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

添加接口:
1、查询我的订单-转让订单;
2、查询我的推广-推广收益;
3、查询我的推广-推广收益-明细;

zhou.xiaoning 3 лет назад
Родитель
Сommit
c787e4fa85
8 измененных файлов с 1172 добавлено и 10 удалено
  1. 6 6
      controllers/ferroalloy/quote.go
  2. 58 3
      controllers/ferroalloy/trade.go
  3. 340 0
      docs/docs.go
  4. 340 0
      docs/swagger.json
  5. 233 0
      docs/swagger.yaml
  6. 189 0
      models/ferroalloy.go
  7. 3 1
      models/wrTrade2.go
  8. 3 0
      routers/router.go

+ 6 - 6
controllers/ferroalloy/quote.go

@@ -14,10 +14,10 @@ import (
 // @Summary  获取现货行情
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    page         query    int  false "页码"
-// @Param    pagesize     query    int  false "每页条数"
+// @Param    page           query    int    false "页码"
+// @Param    pagesize       query    int    false "每页条数"
 // @Success  200      {array}  models.GErmcpspotgoodsprice
-// @Failure  500          {object} app.Response
+// @Failure  500            {object} app.Response
 // @Router   /Ferroalloy/GetSpotGoodsPrice [get]
 // @Tags     铁合金
 func GetSpotGoodsPrice(c *gin.Context) {
@@ -33,10 +33,10 @@ func GetSpotGoodsPrice(c *gin.Context) {
 // @Security ApiKeyAuth
 // @Param    userid       query    int  true  "用户ID"
 // @Param    favoriteflag query    bool false "关注标志 true-已关注 false-未关注"
-// @Param    page           query    int    false "页码"
-// @Param    pagesize       query    int    false "每页条数"
+// @Param    page         query    int  false "页码"
+// @Param    pagesize     query    int  false "每页条数"
 // @Success  200          {array}  models.THJProduct
-// @Failure  500            {object} app.Response
+// @Failure  500          {object} app.Response
 // @Router   /Ferroalloy/QueryTHJProduct [get]
 // @Tags     铁合金
 func QueryTHJProduct(c *gin.Context) {

+ 58 - 3
controllers/ferroalloy/trade.go

@@ -11,10 +11,10 @@ import (
 // @Summary  查询我的订单-采购订单
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    userid   query    int true  "用户ID"
+// @Param    userid   query    int    true  "用户ID"
 // @Param    type     query    int false "类型 - 0:未完成 1:已完成"
-// @Param    page     query    int false "页码"
-// @Param    pagesize query    int false "每页条数"
+// @Param    page     query    int    false "页码"
+// @Param    pagesize query    int    false "每页条数"
 // @Success  200      {array}  models.Thjpurchasetradedetail
 // @Failure  500      {object} app.Response
 // @Router   /Ferroalloy/QueryTHJPurchaseTradeDetail [get]
@@ -44,3 +44,58 @@ func QueryTHJTradeData(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataByPage(&m)
 }
+
+// QueryTHJPurchaseTransferOrder
+// @Summary  查询我的订单-转让订单
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int true  "用户ID"
+// @Param    page     query    int false "页码"
+// @Param    pagesize query    int false "每页条数"
+// @Success  200      {array}  models.Thjpurchasetransfer
+// @Failure  500      {object} app.Response
+// @Router   /Ferroalloy/QueryTHJPurchaseTransferOrder [get]
+// @Tags     铁合金
+func QueryTHJPurchaseTransferOrder(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Thjpurchasetransfer{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryTHJPromotionIncome
+// @Summary  查询我的推广-推广收益
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int true  "用户ID"
+// @Param    page     query    int false "页码"
+// @Param    pagesize query    int false "每页条数"
+// @Success  200      {array}  models.PromotionIncome
+// @Failure  500      {object} app.Response
+// @Router   /Ferroalloy/QueryTHJPromotionIncome [get]
+// @Tags     铁合金
+func QueryTHJPromotionIncome(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.PromotionIncome{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryTHJPromotionIncomeDetail
+// @Summary  查询我的推广-推广收益-明细
+// @Produce  json
+// @Security ApiKeyAuth
+// @Param    userid   query    int true  "用户ID"
+// @Param    mouth    query    string true  "月份,格式:yyyymm"
+// @Param    page     query    int false "页码"
+// @Param    pagesize query    int false "每页条数"
+// @Success  200      {array}  models.PromotionIncomeDetail
+// @Failure  500      {object} app.Response
+// @Router   /Ferroalloy/QueryTHJPromotionIncomeDetail [get]
+// @Tags     铁合金
+func QueryTHJPromotionIncomeDetail(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.PromotionIncomeDetail{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 340 - 0
docs/docs.go

@@ -7795,6 +7795,121 @@ const docTemplate = `{
                 }
             }
         },
+        "/Ferroalloy/QueryTHJPromotionIncome": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "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"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.PromotionIncome"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Ferroalloy/QueryTHJPromotionIncomeDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "查询我的推广-推广收益-明细",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "月份,格式:yyyymm",
+                        "name": "mouth",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "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.PromotionIncomeDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ferroalloy/QueryTHJPurchaseTradeDetail": {
             "get": {
                 "security": [
@@ -7950,6 +8065,60 @@ const docTemplate = `{
                 }
             }
         },
+        "/Ferroalloy/QueryTHJPurchaseTransferOrder": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "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"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Thjpurchasetransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ferroalloy/QueryTHJScoreConfig": {
             "get": {
                 "security": [
@@ -34820,6 +34989,72 @@ const docTemplate = `{
                 }
             }
         },
+        "models.PromotionIncome": {
+            "type": "object",
+            "properties": {
+                "profitmonth": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "profitstatus": {
+                    "description": "状态 - 1:已支付 2:未支付",
+                    "type": "integer"
+                },
+                "sumamount": {
+                    "description": "金额",
+                    "type": "number"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
+        "models.PromotionIncomeDetail": {
+            "type": "object",
+            "properties": {
+                "buyorsell": {
+                    "description": "方向",
+                    "type": "string"
+                },
+                "market": {
+                    "description": "市场",
+                    "type": "string"
+                },
+                "profitamount": {
+                    "description": "金额",
+                    "type": "number"
+                },
+                "profitroletype": {
+                    "description": "级别",
+                    "type": "string"
+                },
+                "tradetime": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(自增 SEQ_GOODS 确保不重复)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.PurchaseTransfer": {
             "type": "object",
             "properties": {
@@ -41094,6 +41329,107 @@ const docTemplate = `{
                 }
             }
         },
+        "models.Thjpurchasetransfer": {
+            "type": "object",
+            "properties": {
+                "buyaccountid": {
+                    "description": "买方账号ID",
+                    "type": "integer"
+                },
+                "buyuserid": {
+                    "description": "买方用户ID",
+                    "type": "integer"
+                },
+                "contractaddr": {
+                    "description": "协议转让合同地址",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID",
+                    "type": "integer"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID(固定为(64202)",
+                    "type": "integer"
+                },
+                "presaleapplyid": {
+                    "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "sellaccountid": {
+                    "description": "卖方账号ID",
+                    "type": "integer"
+                },
+                "sellcharge": {
+                    "description": "卖方手续费值",
+                    "type": "number"
+                },
+                "sellchargealgorithm": {
+                    "description": "卖方手续费收取方式 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "sellchargealgorithmvalue": {
+                    "description": "手续费设置值(交易所部分)",
+                    "type": "number"
+                },
+                "selluserid": {
+                    "description": "卖方用户ID",
+                    "type": "integer"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让金额",
+                    "type": "number"
+                },
+                "transferid": {
+                    "description": "协议转让ID(332+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transferqty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "transferstatus": {
+                    "description": "转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让",
+                    "type": "integer"
+                },
+                "transfertradedate": {
+                    "description": "转让交易日",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID",
+                    "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrtradedetailid": {
+                    "description": "采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Thjscoreconfig": {
             "type": "object",
             "properties": {
@@ -46752,6 +47088,10 @@ const docTemplate = `{
                     "description": "联系方式",
                     "type": "string"
                 },
+                "email": {
+                    "description": "收件邮箱",
+                    "type": "string"
+                },
                 "idnum": {
                     "description": "身份证号码[发票类型:个人]",
                     "type": "string"

+ 340 - 0
docs/swagger.json

@@ -7786,6 +7786,121 @@
                 }
             }
         },
+        "/Ferroalloy/QueryTHJPromotionIncome": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "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"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.PromotionIncome"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Ferroalloy/QueryTHJPromotionIncomeDetail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "铁合金"
+                ],
+                "summary": "查询我的推广-推广收益-明细",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "月份,格式:yyyymm",
+                        "name": "mouth",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "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.PromotionIncomeDetail"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ferroalloy/QueryTHJPurchaseTradeDetail": {
             "get": {
                 "security": [
@@ -7941,6 +8056,60 @@
                 }
             }
         },
+        "/Ferroalloy/QueryTHJPurchaseTransferOrder": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "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"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Thjpurchasetransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ferroalloy/QueryTHJScoreConfig": {
             "get": {
                 "security": [
@@ -34811,6 +34980,72 @@
                 }
             }
         },
+        "models.PromotionIncome": {
+            "type": "object",
+            "properties": {
+                "profitmonth": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "profitstatus": {
+                    "description": "状态 - 1:已支付 2:未支付",
+                    "type": "integer"
+                },
+                "sumamount": {
+                    "description": "金额",
+                    "type": "number"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
+        "models.PromotionIncomeDetail": {
+            "type": "object",
+            "properties": {
+                "buyorsell": {
+                    "description": "方向",
+                    "type": "string"
+                },
+                "market": {
+                    "description": "市场",
+                    "type": "string"
+                },
+                "profitamount": {
+                    "description": "金额",
+                    "type": "number"
+                },
+                "profitroletype": {
+                    "description": "级别",
+                    "type": "string"
+                },
+                "tradetime": {
+                    "description": "时间",
+                    "type": "string"
+                },
+                "wrstandardcode": {
+                    "description": "现货商品代码",
+                    "type": "string"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID(自增 SEQ_GOODS 确保不重复)",
+                    "type": "integer"
+                },
+                "wrstandardname": {
+                    "description": "现货商品名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.PurchaseTransfer": {
             "type": "object",
             "properties": {
@@ -41085,6 +41320,107 @@
                 }
             }
         },
+        "models.Thjpurchasetransfer": {
+            "type": "object",
+            "properties": {
+                "buyaccountid": {
+                    "description": "买方账号ID",
+                    "type": "integer"
+                },
+                "buyuserid": {
+                    "description": "买方用户ID",
+                    "type": "integer"
+                },
+                "contractaddr": {
+                    "description": "协议转让合同地址",
+                    "type": "string"
+                },
+                "deliverygoodsid": {
+                    "description": "现货品种ID",
+                    "type": "integer"
+                },
+                "handlestatus": {
+                    "description": "处理状态",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID(固定为(64202)",
+                    "type": "integer"
+                },
+                "presaleapplyid": {
+                    "description": "预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "sellaccountid": {
+                    "description": "卖方账号ID",
+                    "type": "integer"
+                },
+                "sellcharge": {
+                    "description": "卖方手续费值",
+                    "type": "number"
+                },
+                "sellchargealgorithm": {
+                    "description": "卖方手续费收取方式 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "sellchargealgorithmvalue": {
+                    "description": "手续费设置值(交易所部分)",
+                    "type": "number"
+                },
+                "selluserid": {
+                    "description": "卖方用户ID",
+                    "type": "integer"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让金额",
+                    "type": "number"
+                },
+                "transferid": {
+                    "description": "协议转让ID(332+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transferqty": {
+                    "description": "数量",
+                    "type": "integer"
+                },
+                "transferstatus": {
+                    "description": "转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让",
+                    "type": "integer"
+                },
+                "transfertradedate": {
+                    "description": "转让交易日",
+                    "type": "string"
+                },
+                "warehouseid": {
+                    "description": "仓库ID",
+                    "type": "integer"
+                },
+                "wrfactortypeid": {
+                    "description": "仓单要素类型ID",
+                    "type": "integer"
+                },
+                "wrstandardid": {
+                    "description": "现货商品ID",
+                    "type": "integer"
+                },
+                "wrtradedetailid": {
+                    "description": "采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Thjscoreconfig": {
             "type": "object",
             "properties": {
@@ -46743,6 +47079,10 @@
                     "description": "联系方式",
                     "type": "string"
                 },
+                "email": {
+                    "description": "收件邮箱",
+                    "type": "string"
+                },
                 "idnum": {
                     "description": "身份证号码[发票类型:个人]",
                     "type": "string"

+ 233 - 0
docs/swagger.yaml

@@ -12802,6 +12802,54 @@ definitions:
         description: 成交交易日(yyyyMMdd)
         type: string
     type: object
+  models.PromotionIncome:
+    properties:
+      profitmonth:
+        description: 时间
+        type: string
+      profitstatus:
+        description: 状态 - 1:已支付 2:未支付
+        type: integer
+      sumamount:
+        description: 金额
+        type: number
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+    type: object
+  models.PromotionIncomeDetail:
+    properties:
+      buyorsell:
+        description: 方向
+        type: string
+      market:
+        description: 市场
+        type: string
+      profitamount:
+        description: 金额
+        type: number
+      profitroletype:
+        description: 级别
+        type: string
+      tradetime:
+        description: 时间
+        type: string
+      wrstandardcode:
+        description: 现货商品代码
+        type: string
+      wrstandardid:
+        description: 现货商品ID(自增 SEQ_GOODS 确保不重复)
+        type: integer
+      wrstandardname:
+        description: 现货商品名称
+        type: string
+    type: object
   models.PurchaseTransfer:
     properties:
       pictureurls:
@@ -17452,6 +17500,81 @@ definitions:
     required:
     - buyuserid
     type: object
+  models.Thjpurchasetransfer:
+    properties:
+      buyaccountid:
+        description: 买方账号ID
+        type: integer
+      buyuserid:
+        description: 买方用户ID
+        type: integer
+      contractaddr:
+        description: 协议转让合同地址
+        type: string
+      deliverygoodsid:
+        description: 现货品种ID
+        type: integer
+      handlestatus:
+        description: 处理状态
+        type: integer
+      marketid:
+        description: 市场ID(固定为(64202)
+        type: integer
+      presaleapplyid:
+        description: 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      remark:
+        description: 备注
+        type: string
+      sellaccountid:
+        description: 卖方账号ID
+        type: integer
+      sellcharge:
+        description: 卖方手续费值
+        type: number
+      sellchargealgorithm:
+        description: 卖方手续费收取方式 1:比率  2:固定
+        type: integer
+      sellchargealgorithmvalue:
+        description: 手续费设置值(交易所部分)
+        type: number
+      selluserid:
+        description: 卖方用户ID
+        type: integer
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      transferamount:
+        description: 转让金额
+        type: number
+      transferid:
+        description: 协议转让ID(332+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+      transferprice:
+        description: 转让价格
+        type: number
+      transferqty:
+        description: 数量
+        type: integer
+      transferstatus:
+        description: 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
+        type: integer
+      transfertradedate:
+        description: 转让交易日
+        type: string
+      warehouseid:
+        description: 仓库ID
+        type: integer
+      wrfactortypeid:
+        description: 仓单要素类型ID
+        type: integer
+      wrstandardid:
+        description: 现货商品ID
+        type: integer
+      wrtradedetailid:
+        description: 采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
+        type: integer
+    type: object
   models.Thjscoreconfig:
     properties:
       parma1:
@@ -21668,6 +21791,9 @@ definitions:
       contactinfo:
         description: 联系方式
         type: string
+      email:
+        description: 收件邮箱
+        type: string
       idnum:
         description: 身份证号码[发票类型:个人]
         type: string
@@ -28904,6 +29030,79 @@ paths:
       summary: 获取产品介绍列表
       tags:
       - 铁合金
+  /Ferroalloy/QueryTHJPromotionIncome:
+    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
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.PromotionIncome'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的推广-推广收益
+      tags:
+      - 铁合金
+  /Ferroalloy/QueryTHJPromotionIncomeDetail:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 月份,格式:yyyymm
+        in: query
+        name: mouth
+        required: true
+        type: string
+      - 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.PromotionIncomeDetail'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的推广-推广收益-明细
+      tags:
+      - 铁合金
   /Ferroalloy/QueryTHJPurchaseTradeDetail:
     get:
       parameters:
@@ -29001,6 +29200,40 @@ paths:
       summary: 查询合同转让详情
       tags:
       - 铁合金
+  /Ferroalloy/QueryTHJPurchaseTransferOrder:
+    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
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Thjpurchasetransfer'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的订单-转让订单
+      tags:
+      - 铁合金
   /Ferroalloy/QueryTHJScoreConfig:
     get:
       parameters:

+ 189 - 0
models/ferroalloy.go

@@ -1203,3 +1203,192 @@ func (r *THJPurchaseTradeDetailReq) GetData() (rsp *THJPurchaseTradeDetailRsp, e
 
 	return
 }
+
+// Thjpurchasetransfer 铁合金采购协议表
+type Thjpurchasetransfer struct {
+	TRANSFERID               int64   `json:"transferid" xorm:"TRANSFERID"`                             // 协议转让ID(332+Unix秒时间戳(10位)+xxxxxx)
+	WRTRADEDETAILID          int64   `json:"wrtradedetailid" xorm:"WRTRADEDETAILID"`                   // 采购成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
+	PRESALEAPPLYID           int64   `json:"presaleapplyid" xorm:"PRESALEAPPLYID"`                     // 预售申请ID(184+Unix秒时间戳(10位)+xxxxxx)
+	TRADEDATE                string  `json:"tradedate" xorm:"TRADEDATE"`                               // 交易日(yyyyMMdd)
+	WRFACTORTYPEID           int64   `json:"wrfactortypeid" xorm:"WRFACTORTYPEID"`                     // 仓单要素类型ID
+	DELIVERYGOODSID          int32   `json:"deliverygoodsid" xorm:"DELIVERYGOODSID"`                   // 现货品种ID
+	WRSTANDARDID             int32   `json:"wrstandardid" xorm:"WRSTANDARDID"`                         // 现货商品ID
+	WAREHOUSEID              int64   `json:"warehouseid" xorm:"WAREHOUSEID"`                           // 仓库ID
+	MARKETID                 int32   `json:"marketid" xorm:"MARKETID"`                                 // 市场ID(固定为(64202)
+	SELLUSERID               int64   `json:"selluserid" xorm:"SELLUSERID"`                             // 卖方用户ID
+	SELLACCOUNTID            int64   `json:"sellaccountid" xorm:"SELLACCOUNTID"`                       // 卖方账号ID
+	TRANSFERQTY              int64   `json:"transferqty" xorm:"TRANSFERQTY"`                           // 数量
+	TRANSFERPRICE            float64 `json:"transferprice" xorm:"TRANSFERPRICE"`                       // 转让价格
+	TRANSFERAMOUNT           float64 `json:"transferamount" xorm:"TRANSFERAMOUNT"`                     // 转让金额
+	REMARK                   string  `json:"remark" xorm:"REMARK"`                                     // 备注
+	BUYUSERID                int64   `json:"buyuserid" xorm:"BUYUSERID"`                               // 买方用户ID
+	BUYACCOUNTID             int64   `json:"buyaccountid" xorm:"BUYACCOUNTID"`                         // 买方账号ID
+	CONTRACTADDR             string  `json:"contractaddr" xorm:"CONTRACTADDR"`                         // 协议转让合同地址
+	SELLCHARGEALGORITHM      int32   `json:"sellchargealgorithm" xorm:"SELLCHARGEALGORITHM"`           // 卖方手续费收取方式 1:比率  2:固定
+	SELLCHARGEALGORITHMVALUE float64 `json:"sellchargealgorithmvalue" xorm:"SELLCHARGEALGORITHMVALUE"` // 手续费设置值(交易所部分)
+	SELLCHARGE               float64 `json:"sellcharge" xorm:"SELLCHARGE"`                             // 卖方手续费值
+	TRANSFERTRADEDATE        string  `json:"transfertradedate" xorm:"TRANSFERTRADEDATE"`               // 转让交易日
+	TRANSFERSTATUS           int32   `json:"transferstatus" xorm:"TRANSFERSTATUS"`                     // 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
+	HANDLESTATUS             int32   `json:"handlestatus" xorm:"HANDLESTATUS"`                         // 处理状态
+
+	USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *Thjpurchasetransfer) calc() {
+
+}
+
+func (r *Thjpurchasetransfer) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+	    wr.WRSTANDARDNAME, 
+		p.TRADEPRICE, 
+		p.PAYEDDEPOSIT, 
+		t.TRANSFERID,
+		t.WRTRADEDETAILID,
+		t.PRESALEAPPLYID,
+		t.TRADEDATE,
+		t.WRFACTORTYPEID,
+		t.DELIVERYGOODSID,
+		t.WRSTANDARDID,
+		t.WAREHOUSEID,
+		t.MARKETID,
+		t.SELLUSERID,
+		t.SELLACCOUNTID,
+		t.TRANSFERQTY,
+		t.TRANSFERPRICE,
+		t.TRANSFERAMOUNT,
+		t.REMARK,
+		t.BUYUSERID,
+		t.BUYACCOUNTID,
+		t.CONTRACTADDR,
+		t.SELLCHARGEALGORITHM,
+		t.SELLCHARGEALGORITHMVALUE,
+		t.SELLCHARGE,
+		t.TRANSFERTRADEDATE,
+		t.TRANSFERSTATUS,
+		t.HANDLESTATUS
+	from THJ_PurchaseTransfer t
+	inner join THJ_PurchaseTradeDetail p on t.wrtradedetailid = p.wrtradedetailid
+	inner join wrstandard wr on t.wrstandardid = wr.wrstandardid
+	where t.selluserid = %v and t.transferstatus = 1
+`
+	sqlId.FormatParam(r.USERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *Thjpurchasetransfer) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]Thjpurchasetransfer, 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
+}
+
+type PromotionIncome struct {
+	PROFITMONTH    string  `json:"profitmonth" xorm:"PROFITMONTH"`       // 时间
+	WRSTANDARDID   int32   `json:"wrstandardid" xorm:"WRSTANDARDID"`     // 现货商品ID
+	WRSTANDARDCODE string  `json:"wrstandardcode" xorm:"WRSTANDARDCODE"` // 现货商品代码
+	WRSTANDARDNAME string  `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
+	SUMAMOUNT      float64 `json:"sumamount" xorm:"SUMAMOUNT"`           // 金额
+	PROFITSTATUS   int32   `json:"profitstatus" xorm:"PROFITSTATUS"`     // 状态 - 1:已支付 2:未支付
+
+	USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *PromotionIncome) calc() {
+
+}
+
+func (r *PromotionIncome) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		substr(t.reckondate, 0, 6) PROFITMONTH,
+		t.WRSTANDARDID,
+		wr.WRSTANDARDCODE
+		wr.WRSTANDARDNAME,
+		sum(t.profitamount) SUMAMOUNT
+	from THJ_Reckon_ProfitSum t
+	left join wrstandard wr on t.wrstandardid = wr.wrstandardid
+	where t.userid = %v and t.profitstatus = 1
+	group by substr(t.reckondate, 0, 6), t.wrstandardid, wr.wrstandardname
+	order by substr(t.reckondate, 0, 6) desc, t.wrstandardid, wr.wrstandardname
+`
+	sqlId.FormatParam(r.USERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *PromotionIncome) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]PromotionIncome, 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
+}
+
+type PromotionIncomeDetail struct {
+	TRADETIME      string  `json:"tradetime" xorm:"TRADETIME"`           // 时间
+	WRSTANDARDID   int64   `json:"wrstandardid" xorm:"WRSTANDARDID"`     // 现货商品ID(自增 SEQ_GOODS 确保不重复)
+	WRSTANDARDCODE string  `json:"wrstandardcode" xorm:"WRSTANDARDCODE"` // 现货商品代码
+	WRSTANDARDNAME string  `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
+	MARKET         string  `json:"market" xorm:"MARKET"`                 // 市场
+	BUYORSELL      string  `json:"buyorsell" xorm:"BUYORSELL"`           // 方向
+	PROFITROLETYPE string  `json:"profitroletype" xorm:"PROFITROLETYPE"` // 级别
+	PROFITAMOUNT   float64 `json:"profitamount" xorm:"PROFITAMOUNT"`     // 金额
+
+	USERID int64  `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
+	MOUTH  string `json:"-" xorm:"-" form:"mouth" binding:"required"`  // 月份,格式:yyyymm
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *PromotionIncomeDetail) calc() {
+
+}
+
+func (r *PromotionIncomeDetail) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		to_char(t.TRADETIME,'yyyy-mm-dd hh24:mi:ss) TRADETIME', 
+		wr.WRSTANDARDID,
+		wr.WRSTANDARDCODE,
+		wr.WRSTANDARDNAME, 
+		case t.marketid when 64201 then '采购' else '供求' end MARKET,
+		case t.buyorsell when 0 then '采购' else '销售' end BUYORSELL,
+		case t.profitroletype when 3 then '一级' else '二级' end PROFITROLETYPE,
+		t.PROFITAMOUNT
+	from THJ_Reckon_ProfitRecode t
+	left join wrstandard wr on t.wrstandardid = wr.wrstandardid
+	where substr(t.tradedate,0,6) = '%v' and t.userid = %v and t.profitroletype in (3,4)
+	order by t.tradeid desc
+`
+	sqlId.FormatParam(r.MOUTH, r.USERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *PromotionIncomeDetail) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]PromotionIncomeDetail, 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
+}

+ 3 - 1
models/wrTrade2.go

@@ -4161,6 +4161,7 @@ type WrUserReceiptInfo struct {
 	ADDRESS        string `json:"address"  xorm:"ADDRESS"`                            // 地址[发票类型:企业]
 	IDNUM          string `json:"idnum"  xorm:"IDNUM"`                                // 身份证号码[发票类型:个人]
 	ISDEFAULT      int32  `json:"isdefault"  xorm:"'ISDEFAULT'"`                      // 是否默认地址 - 0:否 1:是
+	EMAIL          string `json:"email" xorm:"EMAIL"`                                 // 收件邮箱
 }
 
 func (r *WrUserReceiptInfo) calc() {
@@ -4178,7 +4179,8 @@ SELECT t.AUTOID,
        t.RECEIPTBANK,
        t.RECEIPTACCOUNT,
        t.ADDRESS,
-       t.IDNUM
+       t.IDNUM,
+	   t.EMAIL
   FROM USERRECEIPTINFO t
  WHERE 1 = 1
 `

+ 3 - 0
routers/router.go

@@ -704,6 +704,9 @@ func InitRouter() *gin.Engine {
 		ferroalloyR.Use(token.Auth()).GET("QueryTHJGoodsDetail", ferroalloy.QueryTHJGoodsDetail)
 		ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransfer", ferroalloy.QueryTHJPurchaseTransfer)
 		ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransferDetail", ferroalloy.QueryTHJPurchaseTransferDetail)
+		ferroalloyR.Use(token.Auth()).GET("QueryTHJPurchaseTransferOrder", ferroalloy.QueryTHJPurchaseTransferOrder)
+		ferroalloyR.Use(token.Auth()).GET("QueryTHJPromotionIncome", ferroalloy.QueryTHJPromotionIncome)
+		ferroalloyR.Use(token.Auth()).GET("QueryTHJPromotionIncomeDetail", ferroalloy.QueryTHJPromotionIncomeDetail)
 	}
 
 	return r