فهرست منبع

1.查定投设置按更新时间倒序
2.查充值提现按更新时间倒序
3.增加查经纪人信息接口(app)

zou.yingbin 4 سال پیش
والد
کامیت
81a4529a49
7فایلهای تغییر یافته به همراه528 افزوده شده و 3 حذف شده
  1. 17 0
      controllers/qhj/qryQhj.go
  2. 157 1
      docs/docs.go
  3. 157 1
      docs/swagger.json
  4. 111 1
      docs/swagger.yaml
  5. 84 0
      models/qhj.go
  6. 1 0
      models/qhjPCWeb.go
  7. 1 0
      routers/router.go

+ 17 - 0
controllers/qhj/qryQhj.go

@@ -520,3 +520,20 @@ func QueryScoreLog(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryBrokerApply
+// @Summary 查询经纪人申请
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int false "所属机构ID"
+// @Param filterstatus query string false "状态 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回"
+// @Success 200 {array} models.QhjBrokerApply
+// @Failure 500 {object} app.Response
+// @Router /Qhj/QueryBrokerApply [get]
+// @Tags 大连千海金
+func QueryBrokerApply(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjBrokerApply{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 157 - 1
docs/docs.go

@@ -7230,6 +7230,53 @@ var doc = `{
                 }
             }
         },
+        "/Qhj/QueryBrokerApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询经纪人申请",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "状态 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "filterstatus",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjBrokerApply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryBrokerRewardLog": {
             "get": {
                 "security": [
@@ -23810,6 +23857,115 @@ var doc = `{
                 }
             }
         },
+        "models.QhjBrokerApply": {
+            "type": "object",
+            "properties": {
+                "applicantid": {
+                    "description": "申请人",
+                    "type": "integer"
+                },
+                "applysrc": {
+                    "description": "申请来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "auditsrc": {
+                    "description": "审核来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "audittradedate": {
+                    "description": "审核交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "brokerapplyid": {
+                    "description": "申请ID(SEQ_BROKERAPPLY)",
+                    "type": "integer"
+                },
+                "cardbackphotourl": {
+                    "description": "证件背面图片地址",
+                    "type": "string"
+                },
+                "cardfrontphotourl": {
+                    "description": "证件正面图片地址",
+                    "type": "string"
+                },
+                "cardnum": {
+                    "description": "证件号码(加密存储) 注:数据库没存证件类型字段,产品说类型固定为身份证",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "姓名",
+                    "type": "string"
+                },
+                "logincode": {
+                    "description": "登录代码",
+                    "type": "string"
+                },
+                "mobile": {
+                    "description": "手机号码",
+                    "type": "string"
+                },
+                "parentuserid": {
+                    "description": "所属机构id",
+                    "type": "integer"
+                },
+                "parentusername": {
+                    "description": "所属机构名称",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id(经纪人)",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "层级路径",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "申请人用户ID",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjBrokerRewardLog": {
             "type": "object",
             "properties": {
@@ -27442,7 +27598,7 @@ var doc = `{
                     "description": "关联用户",
                     "type": "integer"
                 },
-                "remainacount": {
+                "remainamount": {
                     "description": "融资额(从融资合同中统计)",
                     "type": "number"
                 },

+ 157 - 1
docs/swagger.json

@@ -7214,6 +7214,53 @@
                 }
             }
         },
+        "/Qhj/QueryBrokerApply": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询经纪人申请",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "string",
+                        "description": "状态 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                        "name": "filterstatus",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjBrokerApply"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryBrokerRewardLog": {
             "get": {
                 "security": [
@@ -23794,6 +23841,115 @@
                 }
             }
         },
+        "models.QhjBrokerApply": {
+            "type": "object",
+            "properties": {
+                "applicantid": {
+                    "description": "申请人",
+                    "type": "integer"
+                },
+                "applysrc": {
+                    "description": "申请来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "applystatus": {
+                    "description": "申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回",
+                    "type": "integer"
+                },
+                "applytime": {
+                    "description": "申请时间",
+                    "type": "string"
+                },
+                "auditorid": {
+                    "description": "审核人",
+                    "type": "integer"
+                },
+                "auditremark": {
+                    "description": "审核备注",
+                    "type": "string"
+                },
+                "auditsrc": {
+                    "description": "审核来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "audittime": {
+                    "description": "审核时间",
+                    "type": "string"
+                },
+                "audittradedate": {
+                    "description": "审核交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "brokerapplyid": {
+                    "description": "申请ID(SEQ_BROKERAPPLY)",
+                    "type": "integer"
+                },
+                "cardbackphotourl": {
+                    "description": "证件背面图片地址",
+                    "type": "string"
+                },
+                "cardfrontphotourl": {
+                    "description": "证件正面图片地址",
+                    "type": "string"
+                },
+                "cardnum": {
+                    "description": "证件号码(加密存储) 注:数据库没存证件类型字段,产品说类型固定为身份证",
+                    "type": "string"
+                },
+                "customername": {
+                    "description": "姓名",
+                    "type": "string"
+                },
+                "logincode": {
+                    "description": "登录代码",
+                    "type": "string"
+                },
+                "mobile": {
+                    "description": "手机号码",
+                    "type": "string"
+                },
+                "parentuserid": {
+                    "description": "所属机构id",
+                    "type": "integer"
+                },
+                "parentusername": {
+                    "description": "所属机构名称",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id(经纪人)",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "层级路径",
+                    "type": "string"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "申请人用户ID",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjBrokerRewardLog": {
             "type": "object",
             "properties": {
@@ -27426,7 +27582,7 @@
                     "description": "关联用户",
                     "type": "integer"
                 },
-                "remainacount": {
+                "remainamount": {
                     "description": "融资额(从融资合同中统计)",
                     "type": "number"
                 },

+ 111 - 1
docs/swagger.yaml

@@ -9730,6 +9730,87 @@ definitions:
         description: 状态 - 0:正常 1:注销
         type: integer
     type: object
+  models.QhjBrokerApply:
+    properties:
+      applicantid:
+        description: 申请人
+        type: integer
+      applysrc:
+        description: 申请来源 - 1:管理端 2:终端
+        type: integer
+      applystatus:
+        description: 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        type: integer
+      applytime:
+        description: 申请时间
+        type: string
+      auditorid:
+        description: 审核人
+        type: integer
+      auditremark:
+        description: 审核备注
+        type: string
+      auditsrc:
+        description: 审核来源 - 1:管理端 2:终端
+        type: integer
+      audittime:
+        description: 审核时间
+        type: string
+      audittradedate:
+        description: 审核交易日(yyyyMMdd)
+        type: string
+      brokerapplyid:
+        description: 申请ID(SEQ_BROKERAPPLY)
+        type: integer
+      cardbackphotourl:
+        description: 证件背面图片地址
+        type: string
+      cardfrontphotourl:
+        description: 证件正面图片地址
+        type: string
+      cardnum:
+        description: 证件号码(加密存储) 注:数据库没存证件类型字段,产品说类型固定为身份证
+        type: string
+      customername:
+        description: 姓名
+        type: string
+      logincode:
+        description: 登录代码
+        type: string
+      mobile:
+        description: 手机号码
+        type: string
+      parentuserid:
+        description: 所属机构id
+        type: integer
+      parentusername:
+        description: 所属机构名称
+        type: string
+      refereeuserid:
+        description: 推荐人id(经纪人)
+        type: integer
+      refernum:
+        description: 推荐码
+        type: string
+      remark:
+        description: 备注
+        type: string
+      subarealevelpath:
+        description: 层级路径
+        type: string
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+      userid:
+        description: 申请人用户ID
+        type: integer
+      userinfotype:
+        description: 用户类型  1-个人 2-企业
+        type: integer
+      username:
+        description: 用户名称
+        type: string
+    type: object
   models.QhjBrokerRewardLog:
     properties:
       accountid:
@@ -12433,7 +12514,7 @@ definitions:
       relateduserid:
         description: 关联用户
         type: integer
-      remainacount:
+      remainamount:
         description: 融资额(从融资合同中统计)
         type: number
       serivcegroup:
@@ -19560,6 +19641,35 @@ paths:
       summary: 查询开户行
       tags:
       - 大连千海金
+  /Qhj/QueryBrokerApply:
+    get:
+      parameters:
+      - description: 所属机构ID
+        in: query
+        name: userid
+        type: integer
+      - description: 状态 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+        in: query
+        name: filterstatus
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjBrokerApply'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询经纪人申请
+      tags:
+      - 大连千海金
   /Qhj/QueryBrokerRewardLog:
     get:
       parameters:

+ 84 - 0
models/qhj.go

@@ -287,6 +287,7 @@ func (r *QhjRStrategy) buildSql() string {
 		sqlId.JoinFormat(" and (k.logincode like '%%%v%%' or u.accountname like '%%%v%%')", r.FilterName, r.FilterName)
 	}
 	sqlId.JoinEx(len(r.FilterStatus) > 0, fmt.Sprintf(" and t.REGULARLYSTRATEGYSTATUS in(%v)", r.FilterStatus))
+	sqlId.Join(" order by t.UPDATETIME desc")
 	return sqlId.String()
 }
 
@@ -2243,3 +2244,86 @@ func (r *QhjContractRemainAmount) GetData() ([]QhjContractRemainAmount, error) {
 	}
 	return sData, err
 }
+
+// QhjBrokerApply 经济人申请表
+type QhjBrokerApply struct {
+	APPLYSRC          int32  `json:"applysrc"  xorm:"APPLYSRC" form:"applysrc"`                            // 申请来源 - 1:管理端 2:终端
+	APPLYSTATUS       int32  `json:"applystatus"  xorm:"APPLYSTATUS" form:"applystatus"`                   // 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+	AUDITSRC          int32  `json:"auditsrc"  xorm:"AUDITSRC" form:"auditsrc"`                            // 审核来源 - 1:管理端 2:终端
+	APPLICANTID       int64  `json:"applicantid"  xorm:"APPLICANTID" form:"applicantid"`                   // 申请人
+	AUDITORID         int64  `json:"auditorid"  xorm:"AUDITORID" form:"auditorid"`                         // 审核人
+	BROKERAPPLYID     int64  `json:"brokerapplyid"  xorm:"BROKERAPPLYID" form:"brokerapplyid"`             // 申请ID(SEQ_BROKERAPPLY)
+	USERID            int64  `json:"userid"  xorm:"USERID" form:"userid"`                                  // 申请人用户ID
+	APPLYTIME         string `json:"applytime"  xorm:"APPLYTIME" form:"applytime"`                         // 申请时间
+	AUDITREMARK       string `json:"auditremark"  xorm:"AUDITREMARK" form:"auditremark"`                   // 审核备注
+	AUDITTIME         string `json:"audittime"  xorm:"AUDITTIME" form:"audittime"`                         // 审核时间
+	AUDITTRADEDATE    string `json:"audittradedate"  xorm:"AUDITTRADEDATE" form:"audittradedate"`          // 审核交易日(yyyyMMdd)
+	CARDBACKPHOTOURL  string `json:"cardbackphotourl"  xorm:"CARDBACKPHOTOURL" form:"cardbackphotourl"`    // 证件背面图片地址
+	CARDFRONTPHOTOURL string `json:"cardfrontphotourl"  xorm:"CARDFRONTPHOTOURL" form:"cardfrontphotourl"` // 证件正面图片地址
+	CARDNUM           string `json:"cardnum"  xorm:"CARDNUM" form:"cardnum"`                               // 证件号码(加密存储) 注:数据库没存证件类型字段,产品说类型固定为身份证
+	CUSTOMERNAME      string `json:"customername"  xorm:"CUSTOMERNAME" form:"customername"`                // 姓名
+	REMARK            string `json:"remark"  xorm:"REMARK" form:"remark"`                                  // 备注
+	TRADEDATE         string `json:"tradedate"  xorm:"TRADEDATE" form:"tradedate"`                         // 交易日(yyyyMMdd)
+	BrokerExInfo      `xorm:"extends"`
+
+	FilterStatus string `json:"-" form:"filterstatus"` // 筛选条件
+}
+
+func (r *QhjBrokerApply) calc() {
+	r.MOBILE = DecryptField(r.MOBILE)
+	r.CARDNUM = DecryptField(r.CARDNUM)
+	if r.LOGINCODE == "" {
+		r.LOGINCODE = r.MOBILE
+	}
+}
+
+func (r *QhjBrokerApply) buildSql() string {
+	var sqlId utils.SQLVal = "with k as (select t.userid, wm_concat(t.logincode) logincode from loginaccount t group by t.userid)" +
+		"SELECT t.CUSTOMERNAME," +
+		"       t.CARDNUM," +
+		"       t.CARDFRONTPHOTOURL," +
+		"       t.CARDBACKPHOTOURL," +
+		"       t.BROKERAPPLYID," +
+		"       t.USERID," +
+		"       t.TRADEDATE," +
+		"       t.APPLYSRC," +
+		"       t.APPLICANTID," +
+		"       t.REMARK," +
+		"       to_char(t.APPLYTIME, 'yyyy-mm-dd hh24:mi:ss') APPLYTIME," +
+		"       t.APPLYSTATUS," +
+		"       t.AUDITTRADEDATE," +
+		"       t.AUDITORID," +
+		"       t.AUDITSRC," +
+		"       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
+		"       t.AUDITREMARK," +
+		"       u.accountname USERNAME," +
+		"       u.parentuserid," +
+		"       u.refereeuserid," +
+		"       u.refernum," +
+		"       ui.userinfotype," +
+		"       ui.mobile," +
+		"       u2.accountname PARENTUSERNAME," +
+		"       k.logincode," +
+		"       u.subarealevelpath" +
+		"  FROM BROKERAPPLY t" +
+		"  INNER JOIN USERACCOUNT u on t.userid=u.userid" +
+		"  INNER JOIN USERINFO ui on t.userid=ui.userid" +
+		"  LEFT JOIN k on t.userid=k.userid" +
+		"  LEFT JOIN USERACCOUNT u2 on u.parentuserid=u2.userid" +
+		" WHERE 1 = 1"
+	sqlId.And("u.USERID", r.USERID)
+	sqlId.JoinEx(r.FilterStatus != "", fmt.Sprintf(" and t.APPLYSTATUS in(%v)", r.FilterStatus))
+	sqlId.Join(" order by t.APPLYTIME desc")
+	sqlId.Page(1, 1) // 按申请时间倒序后取最近一条
+	return sqlId.String()
+}
+
+// GetDataEx 获取经济人申请表
+func (r *QhjBrokerApply) GetDataEx() (interface{}, error) {
+	sData := make([]QhjBrokerApply, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 1 - 0
models/qhjPCWeb.go

@@ -416,6 +416,7 @@ func (r *QhjMgrAccountOutInApply) buildSql() string {
 	if len(r.FilterName) > 0 {
 		sqlId.Join(fmt.Sprintf(" and (tmp.logincode like '%%%v%%' or u.accountname like '%%%v%%')", r.FilterName, r.FilterName))
 	}
+	sqlId.Join(" order by t.UPDATETIME desc")
 	return sqlId.String()
 }
 

+ 1 - 0
routers/router.go

@@ -478,6 +478,7 @@ func InitRouter() *gin.Engine {
 		qhjR.GET("QueryMyTeamOrder", qhj.QueryTeamOrder)
 		qhjR.GET("QueryBrokerRewardLog", qhj.QueryBrokerRewardLog)
 		qhjR.GET("QueryScoreLog", qhj.QueryScoreLog)
+		qhjR.GET("QueryBrokerApply", qhj.QueryBrokerApply)
 	}
 
 	// *************************千海金(PCWeb)*****************************