Pārlūkot izejas kodu

1.增加 查经纪人和申请记录接口

zou.yingbin 4 gadi atpakaļ
vecāks
revīzija
d8490fc9f0
6 mainītis faili ar 278 papildinājumiem un 0 dzēšanām
  1. 16 0
      controllers/qhj/qryQhj.go
  2. 77 0
      docs/docs.go
  3. 77 0
      docs/swagger.json
  4. 51 0
      docs/swagger.yaml
  5. 56 0
      models/qhj.go
  6. 1 0
      routers/router.go

+ 16 - 0
controllers/qhj/qryQhj.go

@@ -537,3 +537,19 @@ func QueryBrokerApply(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryBrokerApplyEx
+// @Summary 查询经纪人信息和申请记录
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int false "所属机构ID"
+// @Success 200 {array} models.QhjBrokerApplyEx
+// @Failure 500 {object} app.Response
+// @Router /Qhj/QueryBrokerApplyEx [get]
+// @Tags 大连千海金
+func QueryBrokerApplyEx(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjBrokerApplyEx{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 77 - 0
docs/docs.go

@@ -7277,6 +7277,47 @@ var doc = `{
                 }
             }
         },
+        "/Qhj/QueryBrokerApplyEx": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询经纪人信息和申请记录",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjBrokerApplyEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryBrokerRewardLog": {
             "get": {
                 "security": [
@@ -10853,6 +10894,10 @@ var doc = `{
                     "description": "是否显示",
                     "type": "boolean"
                 },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
                 "rulekey": {
                     "description": "对应权限主键,对应FUNCMENULIST表RESOURCECODE",
                     "type": "string"
@@ -10868,6 +10913,10 @@ var doc = `{
                 "type": {
                     "description": "类型,1:菜单 2:按钮",
                     "type": "integer"
+                },
+                "url": {
+                    "description": "URL",
+                    "type": "string"
                 }
             }
         },
@@ -23966,6 +24015,34 @@ var doc = `{
                 }
             }
         },
+        "models.QhjBrokerApplyEx": {
+            "type": "object",
+            "properties": {
+                "applylist": {
+                    "description": "经纪人申请记录(只返回最新一条)",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.QhjBrokerApply"
+                    }
+                },
+                "canrecommend": {
+                    "description": "是否经纪人 0-不是 1-是",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QhjBrokerRewardLog": {
             "type": "object",
             "properties": {

+ 77 - 0
docs/swagger.json

@@ -7261,6 +7261,47 @@
                 }
             }
         },
+        "/Qhj/QueryBrokerApplyEx": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询经纪人信息和申请记录",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjBrokerApplyEx"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryBrokerRewardLog": {
             "get": {
                 "security": [
@@ -10837,6 +10878,10 @@
                     "description": "是否显示",
                     "type": "boolean"
                 },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
                 "rulekey": {
                     "description": "对应权限主键,对应FUNCMENULIST表RESOURCECODE",
                     "type": "string"
@@ -10852,6 +10897,10 @@
                 "type": {
                     "description": "类型,1:菜单 2:按钮",
                     "type": "integer"
+                },
+                "url": {
+                    "description": "URL",
+                    "type": "string"
                 }
             }
         },
@@ -23950,6 +23999,34 @@
                 }
             }
         },
+        "models.QhjBrokerApplyEx": {
+            "type": "object",
+            "properties": {
+                "applylist": {
+                    "description": "经纪人申请记录(只返回最新一条)",
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/models.QhjBrokerApply"
+                    }
+                },
+                "canrecommend": {
+                    "description": "是否经纪人 0-不是 1-是",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QhjBrokerRewardLog": {
             "type": "object",
             "properties": {

+ 51 - 0
docs/swagger.yaml

@@ -31,6 +31,9 @@ definitions:
       isshow:
         description: 是否显示
         type: boolean
+      remark:
+        description: 备注
+        type: string
       rulekey:
         description: 对应权限主键,对应FUNCMENULIST表RESOURCECODE
         type: string
@@ -43,6 +46,9 @@ definitions:
       type:
         description: 类型,1:菜单 2:按钮
         type: integer
+      url:
+        description: URL
+        type: string
     type: object
   common.QueryImageConfigsRsp:
     properties:
@@ -9811,6 +9817,26 @@ definitions:
         description: 用户名称
         type: string
     type: object
+  models.QhjBrokerApplyEx:
+    properties:
+      applylist:
+        description: 经纪人申请记录(只返回最新一条)
+        items:
+          $ref: '#/definitions/models.QhjBrokerApply'
+        type: array
+      canrecommend:
+        description: 是否经纪人 0-不是 1-是
+        type: integer
+      refernum:
+        description: 推荐码
+        type: string
+      userid:
+        description: 用户id
+        type: integer
+      userinfotype:
+        description: 用户类型  1-个人 2-企业
+        type: integer
+    type: object
   models.QhjBrokerRewardLog:
     properties:
       accountid:
@@ -19670,6 +19696,31 @@ paths:
       summary: 查询经纪人申请
       tags:
       - 大连千海金
+  /Qhj/QueryBrokerApplyEx:
+    get:
+      parameters:
+      - description: 所属机构ID
+        in: query
+        name: userid
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjBrokerApplyEx'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询经纪人信息和申请记录
+      tags:
+      - 大连千海金
   /Qhj/QueryBrokerRewardLog:
     get:
       parameters:

+ 56 - 0
models/qhj.go

@@ -2318,6 +2318,16 @@ func (r *QhjBrokerApply) buildSql() string {
 	return sqlId.String()
 }
 
+// GetData 获取经济人申请表
+func (r *QhjBrokerApply) GetData() ([]QhjBrokerApply, error) {
+	sData := make([]QhjBrokerApply, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
 // GetDataEx 获取经济人申请表
 func (r *QhjBrokerApply) GetDataEx() (interface{}, error) {
 	sData := make([]QhjBrokerApply, 0)
@@ -2327,3 +2337,49 @@ func (r *QhjBrokerApply) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// QhjBrokerInfo 经纪人信息
+type QhjBrokerInfo struct {
+	USERID       int64  `json:"userid"  xorm:"'USERID'" form:"userid"` // 用户id
+	REFERNUM     string `json:"refernum"  xorm:"'REFERNUM'"`           // 推荐码
+	CANRECOMMEND int32  `json:"canrecommend"  xorm:"'CANRECOMMEND'"`   // 是否经纪人 0-不是 1-是
+	USERINFOTYPE int32  `json:"userinfotype"  xorm:"'USERINFOTYPE'"`   // 用户类型  1-个人 2-企业
+}
+
+func (r *QhjBrokerInfo) buildSql() string {
+	var sqlId utils.SQLVal = "select t.userid, t.refernum, t.canrecommend, ui.userinfotype" +
+		"  from useraccount t" +
+		" inner join userinfo ui" +
+		"    on t.userid = ui.userid" +
+		" where 1 = 1"
+	sqlId.And("t.userid", r.USERID)
+	return sqlId.String()
+}
+
+// GetData 获取经济人信息
+func (r *QhjBrokerInfo) GetData() ([]QhjBrokerInfo, error) {
+	sData := make([]QhjBrokerInfo, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	return sData, err
+}
+
+// QhjBrokerApplyEx 经纪人信息和申请纪录
+type QhjBrokerApplyEx struct {
+	QhjBrokerInfo
+	APPLYLIST []QhjBrokerApply `json:"applylist"` // 经纪人申请记录(只返回最新一条)
+}
+
+// GetDataEx 获取经纪人信息和申请纪录
+func (r *QhjBrokerApplyEx) GetDataEx() (interface{}, error) {
+	sData := make([]QhjBrokerApplyEx, 0)
+	if sInfo, err := r.QhjBrokerInfo.GetData(); err == nil && len(sInfo) > 0 {
+		vInfo := sInfo[0]
+		val := QhjBrokerApplyEx{QhjBrokerInfo: vInfo, APPLYLIST: make([]QhjBrokerApply, 0)}
+		m := QhjBrokerApply{USERID: r.USERID}
+		if sApply, err := m.GetData(); err == nil {
+			val.APPLYLIST = append(val.APPLYLIST, sApply...)
+		}
+		sData = append(sData, val)
+	}
+	return sData, nil
+}

+ 1 - 0
routers/router.go

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