Browse Source

增加接口:
/Zhongrong/GetUserInfo
/Zhongrong/QueryInTradePositionTransfer
/Zhongrong/QueryOutTradepositiontransfer

zhou.xiaoning 2 years ago
parent
commit
37a9f9cbd3
7 changed files with 1733 additions and 0 deletions
  1. 54 0
      controllers/zhongrong/account.go
  2. 44 0
      controllers/zhongrong/order.go
  3. 497 0
      docs/docs.go
  4. 497 0
      docs/swagger.json
  5. 353 0
      docs/swagger.yaml
  6. 278 0
      models/zhongrong.go
  7. 10 0
      routers/router.go

+ 54 - 0
controllers/zhongrong/account.go

@@ -0,0 +1,54 @@
+package zhongrong
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/global/e"
+	"mtp2_if/logger"
+	"mtp2_if/models"
+	"net/http"
+
+	"github.com/gin-gonic/gin"
+)
+
+type GetUserInfoReq struct {
+	Param string `form:"param" binding:"required"` // 登录账号、手机号精确查询用户
+}
+
+type GetUserInfoRsp struct {
+	UserId       int64  `json:"userid"`       // 用户ID
+	Customername string `json:"customername"` // 客户名称
+}
+
+// GetUserInfo 登录账号、手机号精确查询用户
+// @Summary 登录账号、手机号精确查询用户
+// @Produce json
+// @accept  application/json
+// @Param   param query    int true "登录账号或手机号"
+// @Success 200   {array}  GetUserInfoRsp
+// @Failure 500   {object} app.Response
+// @Router  /Zhongrong/GetUserInfo [get]
+// @Tags    中融
+func GetUserInfo(c *gin.Context) {
+	appG := app.Gin{C: c}
+
+	// 获取请求参数
+	var req GetUserInfoReq
+	if err := appG.C.ShouldBindQuery(&req); err != nil {
+		logger.GetLogger().Errorf("GetUserInfo failed: %s", err.Error())
+		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
+		return
+	}
+
+	if userinfo, err := models.GetUserInfoByUserIDorMobile(req.Param); err == nil {
+		rsp := make([]GetUserInfoRsp, 0)
+		if userinfo != nil {
+			rsp = append(rsp, GetUserInfoRsp{
+				UserId:       userinfo.Userid,
+				Customername: userinfo.Customername,
+			})
+		}
+		appG.Response(http.StatusOK, e.SUCCESS, rsp)
+	} else {
+		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+	}
+}

+ 44 - 0
controllers/zhongrong/order.go

@@ -0,0 +1,44 @@
+package zhongrong
+
+import (
+	"mtp2_if/global/app"
+	"mtp2_if/models"
+
+	"github.com/gin-gonic/gin"
+)
+
+// QueryInTradePositionTransfer
+// @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.InTradepositiontransfer
+// @Failure  500      {object} app.Response
+// @Router   /Zhongrong/QueryInTradePositionTransfer [get]
+// @Tags     中融
+func QueryInTradePositionTransfer(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.InTradepositiontransfer{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}
+
+// QueryOutTradepositiontransfer
+// @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.OutTradepositiontransfer
+// @Failure  500      {object} app.Response
+// @Router   /Zhongrong/QueryOutTradepositiontransfer [get]
+// @Tags     中融
+func QueryOutTradepositiontransfer(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.OutTradepositiontransfer{}
+	a.DoBindReq(&m)
+	a.DoGetDataByPage(&m)
+}

+ 497 - 0
docs/docs.go

@@ -21930,6 +21930,154 @@ const docTemplate = `{
                 }
             }
         },
+        "/Zhongrong/GetUserInfo": {
+            "get": {
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "中融"
+                ],
+                "summary": "登录账号、手机号精确查询用户",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "登录账号或手机号",
+                        "name": "param",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/zhongrong.GetUserInfoRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Zhongrong/QueryInTradePositionTransfer": {
+            "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.InTradepositiontransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Zhongrong/QueryOutTradepositiontransfer": {
+            "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.OutTradepositiontransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/sbyj/GetMyOrders": {
             "get": {
                 "security": [
@@ -40173,6 +40321,174 @@ const docTemplate = `{
                 }
             }
         },
+        "models.InTradepositiontransfer": {
+            "type": "object",
+            "required": [
+                "inuserid"
+            ],
+            "properties": {
+                "applicantid": {
+                    "description": "申请人ID",
+                    "type": "integer"
+                },
+                "applyid": {
+                    "description": "申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "状态",
+                    "type": "string"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "closeexchagechargevalue": {
+                    "description": "平仓交易所手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "closefeealgorithm": {
+                    "description": "平仓手续费收取方式(转出方) 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "closememberchargevalue": {
+                    "description": "平仓会员手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "confirmdate": {
+                    "description": "确认时间",
+                    "type": "string"
+                },
+                "freezedays": {
+                    "description": "冻结天数(T+N)",
+                    "type": "integer"
+                },
+                "goodscuramount": {
+                    "description": "商品实时价金额",
+                    "type": "number"
+                },
+                "goodscurprice": {
+                    "description": "商品实时价格",
+                    "type": "number"
+                },
+                "goodsdisplay": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "inaccountid": {
+                    "description": "转入方资金ID(确认方)",
+                    "type": "integer"
+                },
+                "incharge": {
+                    "description": "转入方手续费",
+                    "type": "number"
+                },
+                "inloginid": {
+                    "description": "转入方登录账号",
+                    "type": "integer"
+                },
+                "inuserid": {
+                    "description": "转入方用户ID(确认方)",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "openexchagechargevalue": {
+                    "description": "建仓交易所手续费设置值",
+                    "type": "number"
+                },
+                "openfeealgorithm": {
+                    "description": "建仓手续费收取方式  1:比率  2:固定",
+                    "type": "integer"
+                },
+                "openmemberchargevalue": {
+                    "description": "建仓会员手续费设置值",
+                    "type": "number"
+                },
+                "outaccountid": {
+                    "description": "转出方资金ID(申请方)",
+                    "type": "integer"
+                },
+                "outcharge": {
+                    "description": "转出方手续费",
+                    "type": "number"
+                },
+                "outloginid": {
+                    "description": "转出方登录账号",
+                    "type": "integer"
+                },
+                "outuserid": {
+                    "description": "转出方用户ID(申请方)",
+                    "type": "integer"
+                },
+                "outusername": {
+                    "description": "转出方",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "转让数量",
+                    "type": "integer"
+                },
+                "retcode": {
+                    "description": "错误代码",
+                    "type": "integer"
+                },
+                "retremark": {
+                    "description": "返回信息",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让总金额",
+                    "type": "number"
+                },
+                "transferapplystatus": {
+                    "description": "过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举\"transferapplystatus\"",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transfertype": {
+                    "description": "转让类型 - 1.协议转让",
+                    "type": "integer"
+                }
+            }
+        },
         "models.InternalEnableTradeDetail": {
             "type": "object",
             "required": [
@@ -44377,6 +44693,174 @@ const docTemplate = `{
                 }
             }
         },
+        "models.OutTradepositiontransfer": {
+            "type": "object",
+            "required": [
+                "outuserid"
+            ],
+            "properties": {
+                "applicantid": {
+                    "description": "申请人ID",
+                    "type": "integer"
+                },
+                "applyid": {
+                    "description": "申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "状态",
+                    "type": "string"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "closeexchagechargevalue": {
+                    "description": "平仓交易所手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "closefeealgorithm": {
+                    "description": "平仓手续费收取方式(转出方) 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "closememberchargevalue": {
+                    "description": "平仓会员手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "confirmdate": {
+                    "description": "确认时间",
+                    "type": "string"
+                },
+                "freezedays": {
+                    "description": "冻结天数(T+N)",
+                    "type": "integer"
+                },
+                "goodscuramount": {
+                    "description": "商品实时价金额",
+                    "type": "number"
+                },
+                "goodscurprice": {
+                    "description": "商品实时价格",
+                    "type": "number"
+                },
+                "goodsdisplay": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "inaccountid": {
+                    "description": "转入方资金ID(确认方)",
+                    "type": "integer"
+                },
+                "incharge": {
+                    "description": "转入方手续费",
+                    "type": "number"
+                },
+                "inloginid": {
+                    "description": "转入方登录账号",
+                    "type": "integer"
+                },
+                "inuserid": {
+                    "description": "转入方用户ID(确认方)",
+                    "type": "integer"
+                },
+                "inusername": {
+                    "description": "转入方",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "openexchagechargevalue": {
+                    "description": "建仓交易所手续费设置值",
+                    "type": "number"
+                },
+                "openfeealgorithm": {
+                    "description": "建仓手续费收取方式  1:比率  2:固定",
+                    "type": "integer"
+                },
+                "openmemberchargevalue": {
+                    "description": "建仓会员手续费设置值",
+                    "type": "number"
+                },
+                "outaccountid": {
+                    "description": "转出方资金ID(申请方)",
+                    "type": "integer"
+                },
+                "outcharge": {
+                    "description": "转出方手续费",
+                    "type": "number"
+                },
+                "outloginid": {
+                    "description": "转出方登录账号",
+                    "type": "integer"
+                },
+                "outuserid": {
+                    "description": "转出方用户ID(申请方)",
+                    "type": "integer"
+                },
+                "qty": {
+                    "description": "转让数量",
+                    "type": "integer"
+                },
+                "retcode": {
+                    "description": "错误代码",
+                    "type": "integer"
+                },
+                "retremark": {
+                    "description": "返回信息",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让总金额",
+                    "type": "number"
+                },
+                "transferapplystatus": {
+                    "description": "过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举\"transferapplystatus\"",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transfertype": {
+                    "description": "转让类型 - 1.协议转让",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Patradelinkdetail": {
             "type": "object",
             "properties": {
@@ -62680,6 +63164,19 @@ const docTemplate = `{
                     "type": "integer"
                 }
             }
+        },
+        "zhongrong.GetUserInfoRsp": {
+            "type": "object",
+            "properties": {
+                "customername": {
+                    "description": "客户名称",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 497 - 0
docs/swagger.json

@@ -21921,6 +21921,154 @@
                 }
             }
         },
+        "/Zhongrong/GetUserInfo": {
+            "get": {
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "中融"
+                ],
+                "summary": "登录账号、手机号精确查询用户",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "登录账号或手机号",
+                        "name": "param",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/zhongrong.GetUserInfoRsp"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Zhongrong/QueryInTradePositionTransfer": {
+            "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.InTradepositiontransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Zhongrong/QueryOutTradepositiontransfer": {
+            "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.OutTradepositiontransfer"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/sbyj/GetMyOrders": {
             "get": {
                 "security": [
@@ -40164,6 +40312,174 @@
                 }
             }
         },
+        "models.InTradepositiontransfer": {
+            "type": "object",
+            "required": [
+                "inuserid"
+            ],
+            "properties": {
+                "applicantid": {
+                    "description": "申请人ID",
+                    "type": "integer"
+                },
+                "applyid": {
+                    "description": "申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "状态",
+                    "type": "string"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "closeexchagechargevalue": {
+                    "description": "平仓交易所手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "closefeealgorithm": {
+                    "description": "平仓手续费收取方式(转出方) 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "closememberchargevalue": {
+                    "description": "平仓会员手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "confirmdate": {
+                    "description": "确认时间",
+                    "type": "string"
+                },
+                "freezedays": {
+                    "description": "冻结天数(T+N)",
+                    "type": "integer"
+                },
+                "goodscuramount": {
+                    "description": "商品实时价金额",
+                    "type": "number"
+                },
+                "goodscurprice": {
+                    "description": "商品实时价格",
+                    "type": "number"
+                },
+                "goodsdisplay": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "inaccountid": {
+                    "description": "转入方资金ID(确认方)",
+                    "type": "integer"
+                },
+                "incharge": {
+                    "description": "转入方手续费",
+                    "type": "number"
+                },
+                "inloginid": {
+                    "description": "转入方登录账号",
+                    "type": "integer"
+                },
+                "inuserid": {
+                    "description": "转入方用户ID(确认方)",
+                    "type": "integer"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "openexchagechargevalue": {
+                    "description": "建仓交易所手续费设置值",
+                    "type": "number"
+                },
+                "openfeealgorithm": {
+                    "description": "建仓手续费收取方式  1:比率  2:固定",
+                    "type": "integer"
+                },
+                "openmemberchargevalue": {
+                    "description": "建仓会员手续费设置值",
+                    "type": "number"
+                },
+                "outaccountid": {
+                    "description": "转出方资金ID(申请方)",
+                    "type": "integer"
+                },
+                "outcharge": {
+                    "description": "转出方手续费",
+                    "type": "number"
+                },
+                "outloginid": {
+                    "description": "转出方登录账号",
+                    "type": "integer"
+                },
+                "outuserid": {
+                    "description": "转出方用户ID(申请方)",
+                    "type": "integer"
+                },
+                "outusername": {
+                    "description": "转出方",
+                    "type": "string"
+                },
+                "qty": {
+                    "description": "转让数量",
+                    "type": "integer"
+                },
+                "retcode": {
+                    "description": "错误代码",
+                    "type": "integer"
+                },
+                "retremark": {
+                    "description": "返回信息",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让总金额",
+                    "type": "number"
+                },
+                "transferapplystatus": {
+                    "description": "过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举\"transferapplystatus\"",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transfertype": {
+                    "description": "转让类型 - 1.协议转让",
+                    "type": "integer"
+                }
+            }
+        },
         "models.InternalEnableTradeDetail": {
             "type": "object",
             "required": [
@@ -44368,6 +44684,174 @@
                 }
             }
         },
+        "models.OutTradepositiontransfer": {
+            "type": "object",
+            "required": [
+                "outuserid"
+            ],
+            "properties": {
+                "applicantid": {
+                    "description": "申请人ID",
+                    "type": "integer"
+                },
+                "applyid": {
+                    "description": "申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)",
+                    "type": "integer"
+                },
+                "applyremark": {
+                    "description": "申请备注",
+                    "type": "string"
+                },
+                "applystatus": {
+                    "description": "状态",
+                    "type": "string"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "buyorsell": {
+                    "description": "买卖 - 0:买 1:卖",
+                    "type": "integer"
+                },
+                "clientticket": {
+                    "description": "客户端流水号",
+                    "type": "string"
+                },
+                "closeexchagechargevalue": {
+                    "description": "平仓交易所手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "closefeealgorithm": {
+                    "description": "平仓手续费收取方式(转出方) 1:比率  2:固定",
+                    "type": "integer"
+                },
+                "closememberchargevalue": {
+                    "description": "平仓会员手续费设置值(转出方)",
+                    "type": "number"
+                },
+                "confirmdate": {
+                    "description": "确认时间",
+                    "type": "string"
+                },
+                "freezedays": {
+                    "description": "冻结天数(T+N)",
+                    "type": "integer"
+                },
+                "goodscuramount": {
+                    "description": "商品实时价金额",
+                    "type": "number"
+                },
+                "goodscurprice": {
+                    "description": "商品实时价格",
+                    "type": "number"
+                },
+                "goodsdisplay": {
+                    "description": "商品名称",
+                    "type": "string"
+                },
+                "goodsid": {
+                    "description": "商品ID",
+                    "type": "integer"
+                },
+                "inaccountid": {
+                    "description": "转入方资金ID(确认方)",
+                    "type": "integer"
+                },
+                "incharge": {
+                    "description": "转入方手续费",
+                    "type": "number"
+                },
+                "inloginid": {
+                    "description": "转入方登录账号",
+                    "type": "integer"
+                },
+                "inuserid": {
+                    "description": "转入方用户ID(确认方)",
+                    "type": "integer"
+                },
+                "inusername": {
+                    "description": "转入方",
+                    "type": "string"
+                },
+                "marketid": {
+                    "description": "市场ID",
+                    "type": "integer"
+                },
+                "openexchagechargevalue": {
+                    "description": "建仓交易所手续费设置值",
+                    "type": "number"
+                },
+                "openfeealgorithm": {
+                    "description": "建仓手续费收取方式  1:比率  2:固定",
+                    "type": "integer"
+                },
+                "openmemberchargevalue": {
+                    "description": "建仓会员手续费设置值",
+                    "type": "number"
+                },
+                "outaccountid": {
+                    "description": "转出方资金ID(申请方)",
+                    "type": "integer"
+                },
+                "outcharge": {
+                    "description": "转出方手续费",
+                    "type": "number"
+                },
+                "outloginid": {
+                    "description": "转出方登录账号",
+                    "type": "integer"
+                },
+                "outuserid": {
+                    "description": "转出方用户ID(申请方)",
+                    "type": "integer"
+                },
+                "qty": {
+                    "description": "转让数量",
+                    "type": "integer"
+                },
+                "retcode": {
+                    "description": "错误代码",
+                    "type": "integer"
+                },
+                "retremark": {
+                    "description": "返回信息",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日",
+                    "type": "string"
+                },
+                "transferamount": {
+                    "description": "转让总金额",
+                    "type": "number"
+                },
+                "transferapplystatus": {
+                    "description": "过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举\"transferapplystatus\"",
+                    "type": "integer"
+                },
+                "transferprice": {
+                    "description": "转让价格",
+                    "type": "number"
+                },
+                "transfertype": {
+                    "description": "转让类型 - 1.协议转让",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Patradelinkdetail": {
             "type": "object",
             "properties": {
@@ -62671,6 +63155,19 @@
                     "type": "integer"
                 }
             }
+        },
+        "zhongrong.GetUserInfoRsp": {
+            "type": "object",
+            "properties": {
+                "customername": {
+                    "description": "客户名称",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                }
+            }
         }
     },
     "securityDefinitions": {

+ 353 - 0
docs/swagger.yaml

@@ -13323,6 +13323,131 @@ definitions:
     - ordertime
     - trademode
     type: object
+  models.InTradepositiontransfer:
+    properties:
+      applicantid:
+        description: 申请人ID
+        type: integer
+      applyid:
+        description: 申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: integer
+      applyremark:
+        description: 申请备注
+        type: string
+      applystatus:
+        description: 状态
+        type: string
+      applytime:
+        description: 申请时间
+        type: string
+      auditorid:
+        description: 审核人
+        type: integer
+      auditremark:
+        description: 审核备注
+        type: string
+      audittime:
+        description: 审核时间
+        type: string
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
+      clientticket:
+        description: 客户端流水号
+        type: string
+      closeexchagechargevalue:
+        description: 平仓交易所手续费设置值(转出方)
+        type: number
+      closefeealgorithm:
+        description: 平仓手续费收取方式(转出方) 1:比率  2:固定
+        type: integer
+      closememberchargevalue:
+        description: 平仓会员手续费设置值(转出方)
+        type: number
+      confirmdate:
+        description: 确认时间
+        type: string
+      freezedays:
+        description: 冻结天数(T+N)
+        type: integer
+      goodscuramount:
+        description: 商品实时价金额
+        type: number
+      goodscurprice:
+        description: 商品实时价格
+        type: number
+      goodsdisplay:
+        description: 商品名称
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      inaccountid:
+        description: 转入方资金ID(确认方)
+        type: integer
+      incharge:
+        description: 转入方手续费
+        type: number
+      inloginid:
+        description: 转入方登录账号
+        type: integer
+      inuserid:
+        description: 转入方用户ID(确认方)
+        type: integer
+      marketid:
+        description: 市场ID
+        type: integer
+      openexchagechargevalue:
+        description: 建仓交易所手续费设置值
+        type: number
+      openfeealgorithm:
+        description: 建仓手续费收取方式  1:比率  2:固定
+        type: integer
+      openmemberchargevalue:
+        description: 建仓会员手续费设置值
+        type: number
+      outaccountid:
+        description: 转出方资金ID(申请方)
+        type: integer
+      outcharge:
+        description: 转出方手续费
+        type: number
+      outloginid:
+        description: 转出方登录账号
+        type: integer
+      outuserid:
+        description: 转出方用户ID(申请方)
+        type: integer
+      outusername:
+        description: 转出方
+        type: string
+      qty:
+        description: 转让数量
+        type: integer
+      retcode:
+        description: 错误代码
+        type: integer
+      retremark:
+        description: 返回信息
+        type: string
+      tradedate:
+        description: 交易日
+        type: string
+      transferamount:
+        description: 转让总金额
+        type: number
+      transferapplystatus:
+        description: '过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举"transferapplystatus"'
+        type: integer
+      transferprice:
+        description: 转让价格
+        type: number
+      transfertype:
+        description: 转让类型 - 1.协议转让
+        type: integer
+    required:
+    - inuserid
+    type: object
   models.InternalEnableTradeDetail:
     properties:
       agreeunit:
@@ -16428,6 +16553,131 @@ definitions:
         description: 菜单标题
         type: string
     type: object
+  models.OutTradepositiontransfer:
+    properties:
+      applicantid:
+        description: 申请人ID
+        type: integer
+      applyid:
+        description: 申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+        type: integer
+      applyremark:
+        description: 申请备注
+        type: string
+      applystatus:
+        description: 状态
+        type: string
+      applytime:
+        description: 申请时间
+        type: string
+      auditorid:
+        description: 审核人
+        type: integer
+      auditremark:
+        description: 审核备注
+        type: string
+      audittime:
+        description: 审核时间
+        type: string
+      buyorsell:
+        description: 买卖 - 0:买 1:卖
+        type: integer
+      clientticket:
+        description: 客户端流水号
+        type: string
+      closeexchagechargevalue:
+        description: 平仓交易所手续费设置值(转出方)
+        type: number
+      closefeealgorithm:
+        description: 平仓手续费收取方式(转出方) 1:比率  2:固定
+        type: integer
+      closememberchargevalue:
+        description: 平仓会员手续费设置值(转出方)
+        type: number
+      confirmdate:
+        description: 确认时间
+        type: string
+      freezedays:
+        description: 冻结天数(T+N)
+        type: integer
+      goodscuramount:
+        description: 商品实时价金额
+        type: number
+      goodscurprice:
+        description: 商品实时价格
+        type: number
+      goodsdisplay:
+        description: 商品名称
+        type: string
+      goodsid:
+        description: 商品ID
+        type: integer
+      inaccountid:
+        description: 转入方资金ID(确认方)
+        type: integer
+      incharge:
+        description: 转入方手续费
+        type: number
+      inloginid:
+        description: 转入方登录账号
+        type: integer
+      inuserid:
+        description: 转入方用户ID(确认方)
+        type: integer
+      inusername:
+        description: 转入方
+        type: string
+      marketid:
+        description: 市场ID
+        type: integer
+      openexchagechargevalue:
+        description: 建仓交易所手续费设置值
+        type: number
+      openfeealgorithm:
+        description: 建仓手续费收取方式  1:比率  2:固定
+        type: integer
+      openmemberchargevalue:
+        description: 建仓会员手续费设置值
+        type: number
+      outaccountid:
+        description: 转出方资金ID(申请方)
+        type: integer
+      outcharge:
+        description: 转出方手续费
+        type: number
+      outloginid:
+        description: 转出方登录账号
+        type: integer
+      outuserid:
+        description: 转出方用户ID(申请方)
+        type: integer
+      qty:
+        description: 转让数量
+        type: integer
+      retcode:
+        description: 错误代码
+        type: integer
+      retremark:
+        description: 返回信息
+        type: string
+      tradedate:
+        description: 交易日
+        type: string
+      transferamount:
+        description: 转让总金额
+        type: number
+      transferapplystatus:
+        description: '过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举"transferapplystatus"'
+        type: integer
+      transferprice:
+        description: 转让价格
+        type: number
+      transfertype:
+        description: 转让类型 - 1.协议转让
+        type: integer
+    required:
+    - outuserid
+    type: object
   models.Patradelinkdetail:
     properties:
       accountname:
@@ -30077,6 +30327,15 @@ definitions:
     - headurl
     - userID
     type: object
+  zhongrong.GetUserInfoRsp:
+    properties:
+      customername:
+        description: 客户名称
+        type: string
+      userid:
+        description: 用户ID
+        type: integer
+    type: object
 info:
   contact: {}
   description: 新的查询服务,替代原通用查询服务。游客Token:c886a057f3d820d4dbc41473686c7c2d
@@ -43920,6 +44179,100 @@ paths:
       summary: 获取中江出入金渠道显示列表
       tags:
       - 中江
+  /Zhongrong/GetUserInfo:
+    get:
+      consumes:
+      - application/json
+      parameters:
+      - description: 登录账号或手机号
+        in: query
+        name: param
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/zhongrong.GetUserInfoRsp'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      summary: 登录账号、手机号精确查询用户
+      tags:
+      - 中融
+  /Zhongrong/QueryInTradePositionTransfer:
+    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.InTradepositiontransfer'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取持仓过户申请表信息 - 我的转入
+      tags:
+      - 中融
+  /Zhongrong/QueryOutTradepositiontransfer:
+    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.OutTradepositiontransfer'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 获取持仓过户申请表信息 - 我的转出
+      tags:
+      - 中融
   /sbyj/GetMyOrders:
     get:
       parameters:

+ 278 - 0
models/zhongrong.go

@@ -0,0 +1,278 @@
+package models
+
+import (
+	"encoding/hex"
+	"fmt"
+	"mtp2_if/db"
+	"mtp2_if/utils"
+	"time"
+)
+
+// Tradepositiontransfer 持仓过户申请表 - 16所有权(中融需求)
+type InTradepositiontransfer struct {
+	APPLYID                 int64     `json:"applyid" xorm:"APPLYID"`                                    // 申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	OUTUSERID               int64     `json:"outuserid" xorm:"OUTUSERID"`                                // 转出方用户ID(申请方)
+	OUTLOGINID              int64     `json:"outloginid" xorm:"OUTLOGINID"`                              // 转出方登录账号
+	OUTACCOUNTID            int64     `json:"outaccountid" xorm:"OUTACCOUNTID"`                          // 转出方资金ID(申请方)
+	INUSERID                int64     `json:"inuserid" xorm:"INUSERID" form:"userid" binding:"required"` // 转入方用户ID(确认方)
+	INACCOUNTID             int64     `json:"inaccountid" xorm:"INACCOUNTID"`                            // 转入方资金ID(确认方)
+	INLOGINID               int64     `json:"inloginid" xorm:"INLOGINID"`                                // 转入方登录账号
+	GOODSID                 int32     `json:"goodsid" xorm:"GOODSID"`                                    // 商品ID
+	MARKETID                int32     `json:"marketid" xorm:"MARKETID"`                                  // 市场ID
+	BUYORSELL               int32     `json:"buyorsell" xorm:"BUYORSELL"`                                // 买卖 - 0:买 1:卖
+	QTY                     int64     `json:"qty" xorm:"QTY"`                                            // 转让数量
+	TRANSFERPRICE           float64   `json:"transferprice" xorm:"TRANSFERPRICE"`                        // 转让价格
+	TRANSFERAPPLYSTATUS     int32     `json:"transferapplystatus" xorm:"TRANSFERAPPLYSTATUS"`            // 过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举"transferapplystatus"
+	FREEZEDAYS              int64     `json:"freezedays" xorm:"FREEZEDAYS"`                              // 冻结天数(T+N)
+	APPLYREMARK             string    `json:"applyremark" xorm:"APPLYREMARK"`                            // 申请备注
+	RETREMARK               string    `json:"retremark" xorm:"RETREMARK"`                                // 返回信息
+	RETCODE                 int32     `json:"retcode" xorm:"RETCODE"`                                    // 错误代码
+	TRADEDATE               string    `json:"tradedate" xorm:"TRADEDATE"`                                // 交易日
+	APPLICANTID             int64     `json:"applicantid" xorm:"APPLICANTID"`                            // 申请人ID
+	APPLYTIME               string    `json:"applytime" xorm:"APPLYTIME"`                                // 申请时间
+	TRANSFERTYPE            int32     `json:"transfertype" xorm:"TRANSFERTYPE"`                          // 转让类型 - 1.协议转让
+	TRANSFERAMOUNT          float64   `json:"transferamount" xorm:"TRANSFERAMOUNT"`                      // 转让总金额
+	GOODSCURPRICE           float64   `json:"goodscurprice" xorm:"GOODSCURPRICE"`                        // 商品实时价格
+	GOODSCURAMOUNT          float64   `json:"goodscuramount" xorm:"GOODSCURAMOUNT"`                      // 商品实时价金额
+	OPENFEEALGORITHM        int32     `json:"openfeealgorithm" xorm:"OPENFEEALGORITHM"`                  // 建仓手续费收取方式  1:比率  2:固定
+	OPENMEMBERCHARGEVALUE   float64   `json:"openmemberchargevalue" xorm:"OPENMEMBERCHARGEVALUE"`        // 建仓会员手续费设置值
+	OPENEXCHAGECHARGEVALUE  float64   `json:"openexchagechargevalue" xorm:"OPENEXCHAGECHARGEVALUE"`      // 建仓交易所手续费设置值
+	CLOSEFEEALGORITHM       int32     `json:"closefeealgorithm" xorm:"CLOSEFEEALGORITHM"`                // 平仓手续费收取方式(转出方) 1:比率  2:固定
+	CLOSEMEMBERCHARGEVALUE  float64   `json:"closememberchargevalue" xorm:"CLOSEMEMBERCHARGEVALUE"`      // 平仓会员手续费设置值(转出方)
+	CLOSEEXCHAGECHARGEVALUE float64   `json:"closeexchagechargevalue" xorm:"CLOSEEXCHAGECHARGEVALUE"`    // 平仓交易所手续费设置值(转出方)
+	OUTCHARGE               float64   `json:"outcharge" xorm:"OUTCHARGE"`                                // 转出方手续费
+	INCHARGE                float64   `json:"incharge" xorm:"INCHARGE"`                                  // 转入方手续费
+	CONFIRMDATE             time.Time `json:"confirmdate" xorm:"CONFIRMDATE"`                            // 确认时间
+	AUDITORID               int64     `json:"auditorid" xorm:"AUDITORID"`                                // 审核人
+	AUDITTIME               time.Time `json:"audittime" xorm:"AUDITTIME"`                                // 审核时间
+	AUDITREMARK             string    `json:"auditremark" xorm:"AUDITREMARK"`                            // 审核备注
+	CLIENTTICKET            string    `json:"clientticket" xorm:"CLIENTTICKET"`                          // 客户端流水号
+
+	GOODSDISPLAY string `json:"goodsdisplay" xorm:"GOODSDISPLAY"` // 商品名称
+	OUTUSERNAME  string `json:"outusername" xorm:"OUTUSERNAME"`   // 转出方
+	APPLYSTATUS  string `json:"applystatus" xorm:"APPLYSTATUS"`   // 状态
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *InTradepositiontransfer) calc() {
+
+}
+
+func (r *InTradepositiontransfer) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		g.goodscode || '/' || g.goodsname as GOODSDISPLAY,
+		vlogin.LOGINIDS || '/' || ui.customername as OUTUSERNAME,
+		en.enumdicname as APPLYSTATUS,
+		t.applyid,
+		t.outaccountid,
+		t.inaccountid,
+		t.marketid,
+		t.transferprice,
+		t.transferapplystatus,
+		t.freezedays,
+		t.applyremark,
+		t.retremark,
+		t.tradedate,
+		t.applicantid,
+		to_char(t.applytime, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME,
+		t.transfertype,
+		t.transferamount,
+		t.goodscuramount,
+		t.openfeealgorithm,
+		t.openmemberchargevalue,
+		t.openexchagechargevalue,
+		t.closefeealgorithm,
+		t.closememberchargevalue,
+		t.closeexchagechargevalue,
+		t.outcharge,
+		t.incharge,
+		t.confirmdate,
+		t.auditorid,
+		t.audittime,
+		t.auditremark
+	from Trade_PositionTransfer t
+	left join goods g
+		on t.goodsid = g.goodsid
+	left join userinfo ui
+		on t.outuserid = ui.userid
+	left join VIEW_USER_LOGINIDS vlogin
+		on t.outuserid = vlogin.USERID
+	left join enumdicitem en
+		on en.enumdiccode = 'transferapplystatus'
+	and en.enumitemname = t.transferapplystatus
+	where t.inuserid = %v 
+	and t.transferapplystatus not in (1, 5)
+	order by t.applytime desc
+`
+
+	sqlId.FormatParam(r.INUSERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *InTradepositiontransfer) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]InTradepositiontransfer, 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
+}
+
+// OutTradepositiontransfer 持仓过户申请表 - 16所有权(中融需求)
+type OutTradepositiontransfer struct {
+	APPLYID                 int64     `json:"applyid" xorm:"APPLYID"`                                      // 申请ID(185+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+	OUTUSERID               int64     `json:"outuserid" xorm:"OUTUSERID" form:"userid" binding:"required"` // 转出方用户ID(申请方)
+	OUTLOGINID              int64     `json:"outloginid" xorm:"OUTLOGINID"`                                // 转出方登录账号
+	OUTACCOUNTID            int64     `json:"outaccountid" xorm:"OUTACCOUNTID"`                            // 转出方资金ID(申请方)
+	INUSERID                int64     `json:"inuserid" xorm:"INUSERID"`                                    // 转入方用户ID(确认方)
+	INACCOUNTID             int64     `json:"inaccountid" xorm:"INACCOUNTID"`                              // 转入方资金ID(确认方)
+	INLOGINID               int64     `json:"inloginid" xorm:"INLOGINID"`                                  // 转入方登录账号
+	GOODSID                 int32     `json:"goodsid" xorm:"GOODSID"`                                      // 商品ID
+	MARKETID                int32     `json:"marketid" xorm:"MARKETID"`                                    // 市场ID
+	BUYORSELL               int32     `json:"buyorsell" xorm:"BUYORSELL"`                                  // 买卖 - 0:买 1:卖
+	QTY                     int64     `json:"qty" xorm:"QTY"`                                              // 转让数量
+	TRANSFERPRICE           float64   `json:"transferprice" xorm:"TRANSFERPRICE"`                          // 转让价格
+	TRANSFERAPPLYSTATUS     int32     `json:"transferapplystatus" xorm:"TRANSFERAPPLYSTATUS"`              // 过户申请状态 - 1: 待审核 2:待确认 3:确认处理中 4:已确认 5:申请失败 6:系统撤销 7:审核拒绝- 枚举"transferapplystatus"
+	FREEZEDAYS              int64     `json:"freezedays" xorm:"FREEZEDAYS"`                                // 冻结天数(T+N)
+	APPLYREMARK             string    `json:"applyremark" xorm:"APPLYREMARK"`                              // 申请备注
+	RETREMARK               string    `json:"retremark" xorm:"RETREMARK"`                                  // 返回信息
+	RETCODE                 int32     `json:"retcode" xorm:"RETCODE"`                                      // 错误代码
+	TRADEDATE               string    `json:"tradedate" xorm:"TRADEDATE"`                                  // 交易日
+	APPLICANTID             int64     `json:"applicantid" xorm:"APPLICANTID"`                              // 申请人ID
+	APPLYTIME               string    `json:"applytime" xorm:"APPLYTIME"`                                  // 申请时间
+	TRANSFERTYPE            int32     `json:"transfertype" xorm:"TRANSFERTYPE"`                            // 转让类型 - 1.协议转让
+	TRANSFERAMOUNT          float64   `json:"transferamount" xorm:"TRANSFERAMOUNT"`                        // 转让总金额
+	GOODSCURPRICE           float64   `json:"goodscurprice" xorm:"GOODSCURPRICE"`                          // 商品实时价格
+	GOODSCURAMOUNT          float64   `json:"goodscuramount" xorm:"GOODSCURAMOUNT"`                        // 商品实时价金额
+	OPENFEEALGORITHM        int32     `json:"openfeealgorithm" xorm:"OPENFEEALGORITHM"`                    // 建仓手续费收取方式  1:比率  2:固定
+	OPENMEMBERCHARGEVALUE   float64   `json:"openmemberchargevalue" xorm:"OPENMEMBERCHARGEVALUE"`          // 建仓会员手续费设置值
+	OPENEXCHAGECHARGEVALUE  float64   `json:"openexchagechargevalue" xorm:"OPENEXCHAGECHARGEVALUE"`        // 建仓交易所手续费设置值
+	CLOSEFEEALGORITHM       int32     `json:"closefeealgorithm" xorm:"CLOSEFEEALGORITHM"`                  // 平仓手续费收取方式(转出方) 1:比率  2:固定
+	CLOSEMEMBERCHARGEVALUE  float64   `json:"closememberchargevalue" xorm:"CLOSEMEMBERCHARGEVALUE"`        // 平仓会员手续费设置值(转出方)
+	CLOSEEXCHAGECHARGEVALUE float64   `json:"closeexchagechargevalue" xorm:"CLOSEEXCHAGECHARGEVALUE"`      // 平仓交易所手续费设置值(转出方)
+	OUTCHARGE               float64   `json:"outcharge" xorm:"OUTCHARGE"`                                  // 转出方手续费
+	INCHARGE                float64   `json:"incharge" xorm:"INCHARGE"`                                    // 转入方手续费
+	CONFIRMDATE             time.Time `json:"confirmdate" xorm:"CONFIRMDATE"`                              // 确认时间
+	AUDITORID               int64     `json:"auditorid" xorm:"AUDITORID"`                                  // 审核人
+	AUDITTIME               time.Time `json:"audittime" xorm:"AUDITTIME"`                                  // 审核时间
+	AUDITREMARK             string    `json:"auditremark" xorm:"AUDITREMARK"`                              // 审核备注
+	CLIENTTICKET            string    `json:"clientticket" xorm:"CLIENTTICKET"`                            // 客户端流水号
+
+	GOODSDISPLAY string `json:"goodsdisplay" xorm:"GOODSDISPLAY"` // 商品名称
+	INUSERNAME   string `json:"inusername" xorm:"INUSERNAME"`     // 转入方
+	APPLYSTATUS  string `json:"applystatus" xorm:"APPLYSTATUS"`   // 状态
+
+	PageEx `xorm:"extends"` // 页码信息
+}
+
+func (r *OutTradepositiontransfer) calc() {
+
+}
+
+func (r *OutTradepositiontransfer) buildSql() string {
+	var sqlId utils.SQLVal = `
+	select 
+		g.goodscode || '/' || g.goodsname as GOODSDISPLAY,
+		vlogin.LOGINIDS || '/' || ui.customername as INUSERNAME,
+		en.enumdicname as APPLYSTATUS,
+		t.applyid,
+		t.outuserid,
+		t.outloginid,
+		t.outaccountid,
+		t.inuserid,
+		t.inaccountid,
+		t.inloginid,
+		t.goodsid,
+		t.marketid,
+		t.buyorsell,
+		t.qty,
+		t.transferprice,
+		t.transferapplystatus,
+		t.freezedays,
+		t.applyremark,
+		t.retremark,
+		t.retcode,
+		t.tradedate,
+		t.applicantid,
+		to_char(t.applytime, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME,
+		t.transfertype,
+		t.transferamount,
+		t.goodscurprice,
+		t.goodscuramount,
+		t.openfeealgorithm,
+		t.openmemberchargevalue,
+		t.openexchagechargevalue,
+		t.closefeealgorithm,
+		t.closememberchargevalue,
+		t.closeexchagechargevalue,
+		t.outcharge,
+		t.incharge,
+		t.confirmdate,
+		t.auditorid,
+		t.audittime,
+		t.auditremark,
+		t.clientticket
+	from Trade_PositionTransfer t
+	left join goods g
+	on t.goodsid = g.goodsid
+	left join userinfo ui
+	on t.inuserid = ui.userid
+	left join VIEW_USER_LOGINIDS vlogin
+	on t.inuserid = vlogin.USERID
+	left join enumdicitem en
+	on en.enumdiccode = 'transferapplystatus'
+	and en.enumitemname = t.transferapplystatus
+	where t.outuserid = %v 
+	order by t.applytime desc
+`
+
+	sqlId.FormatParam(r.OUTUSERID)
+
+	sqlId.Page(r.Page, r.PageSize)
+	return sqlId.String()
+}
+
+func (r *OutTradepositiontransfer) GetDataByPage() (interface{}, error, int, int, int) {
+	sData := make([]OutTradepositiontransfer, 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
+}
+
+func GetUserInfoByUserIDorMobile(param string) (userinfo *Userinfo, err error) {
+	// 先尝试加密手机号码,手机号码需要AES加密
+	mobile := ""
+	key, _ := hex.DecodeString(utils.AESSecretKey)
+	if mobileEncrypted, err := utils.AESEncrypt([]byte(param), key); err == nil {
+		mobile = hex.EncodeToString(mobileEncrypted)
+	}
+
+	userinfos := make([]Userinfo, 0)
+	sql := fmt.Sprintf(`
+	SELECT
+		t.* 
+	FROM userinfo t 
+	INNER JOIN loginaccount l
+		ON l.userid = t.userid
+	WHERE l.loginid = %v 
+	`, param)
+	if mobile != "" {
+		sql = fmt.Sprintf("%v OR t.mobile = '%v'", sql, mobile)
+	}
+	err = db.GetEngine().SQL(sql).Find(&userinfos)
+	if len(userinfos) > 0 {
+		userinfo = &userinfos[0]
+	}
+
+	return
+}

+ 10 - 0
routers/router.go

@@ -35,6 +35,7 @@ import (
 	"mtp2_if/controllers/user"
 	"mtp2_if/controllers/wrTrade2"
 	"mtp2_if/controllers/wrtrade"
+	"mtp2_if/controllers/zhongrong"
 	"mtp2_if/controllers/zj"
 	"mtp2_if/logger"
 	"mtp2_if/token"
@@ -814,6 +815,15 @@ func InitRouter() *gin.Engine {
 		reportR.GET("QueryReportMonthTaaccount", report.QueryReportMonthTaaccount)
 	}
 
+	// ************************* 中融 *************************
+	zhongrongR := apiR.Group("Zhongrong")
+	zhongrongR.Use(token.Auth())
+	{
+		zhongrongR.GET("QueryInTradePositionTransfer", zhongrong.QueryInTradePositionTransfer)
+		zhongrongR.GET("QueryOutTradepositiontransfer", zhongrong.QueryOutTradepositiontransfer)
+		zhongrongR.GET("GetUserInfo", zhongrong.GetUserInfo)
+	}
+
 	// ************************* 腾讯 *************************
 	tencentR := apiR.Group("Tencent")
 	tencentR.Use()