فهرست منبع

1.子级门店菜单按rootuser查找
2.敞口参数调整明细接口swag更新
3.增加查询我的团队接口
4.更新查询协议状态字段的枚举描述

zou.yingbin 4 سال پیش
والد
کامیت
c1a270895d

+ 1 - 1
controllers/ermcp/qryAccMgr.go

@@ -120,7 +120,7 @@ func QueryAccMgrRoleMenu(c *gin.Context) {
 	a := app.GinUtils{Gin: app.Gin{C: c}}
 	req := QryRoleMenuReq{}
 	a.DoBindReq(&req)
-	m := models.ErmcpRoleMenu{USERID: req.UserId, FilterRoleId: req.RoleId}
+	m := models.ErmcpRoleMenu{USERID: mtpcache.GetAreaUserId(req.UserId, 0), FilterRoleId: req.RoleId}
 	a.DoGetDataI(&m)
 }
 

+ 1 - 1
controllers/ermcp3/qryErmcp3Report.go

@@ -340,7 +340,7 @@ func QryAreaExpourseFutuDetail(c *gin.Context) {
 // @Param middlegoodsid query int true "套保商品id"
 // @Param cycletype query int true "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】"
 // @Param cycletime query string true "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】"
-// @Success 200 {array} models.Ermcp3ExposureFutuDetail
+// @Success 200 {array} models.Ermcp3ExposureParamChLog
 // @Failure 500 {object} app.Response
 // @Router /Ermcp3/QryAreaExpourseParamChLogDetail [get]
 // @Tags 企业风险管理v3(app)

+ 19 - 0
controllers/qhj/qryQhj.go

@@ -444,3 +444,22 @@ func QueryAreaFinanceConfig(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryMyTeam
+// @Summary 查询我的团队
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户ID"
+// @Success 200 {array} models.QhjMyTeam
+// @Failure 500 {object} app.Response
+// @Router /Qhj/QueryMyTeam [get]
+// @Tags 大连千海金
+func QueryMyTeam(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	req := struct {
+		USERID int64 `form:"userid" binding:"required"` // 用户id
+	}{}
+	a.DoBindReq(&req)
+	m := models.QhjMyTeam{USERID: req.USERID}
+	a.DoGetDataI(&m)
+}

+ 1 - 1
controllers/qhj/qryQhjAgreement.go

@@ -19,7 +19,7 @@ import (
 // @Param agreementid query int false "协议ID"
 // @Param agreementversion query int false "协议版本号"
 // @Param agreementtype query int false "协议类型 - 1:注册 2:登录 3:交易"
-// @Param isvalid query int false "是否有效 - 0:无效 1:有效"
+// @Param isvalid query int false "是否有效 - 是否有效 - 1:正常 2:停用 3:注销"
 // @Param agreementno query string false "协议编号(模糊匹配)"
 // @Param agreementname query string false "协议名称(模糊匹配)"
 // @Success 200 {array} models.QhjAgreementConfig

+ 20 - 0
controllers/qhjPCWeb/qryQhjPCWeb.go

@@ -326,3 +326,23 @@ func QueryBrokerApply(c *gin.Context) {
 	a.DoBindReq(&m)
 	a.DoGetDataI(&m)
 }
+
+// QueryBrokerRewardReport
+// @Summary 查询经纪人奖励报表(废弃)
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "所属机构ID"
+// @Param cycletype query int true "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】"
+// @Param cycletime query string true "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】"
+// @Param filtername query string false "名称(模糊匹配)"
+// @Param includesub query int false "是否包含子级 1-包含"
+// @Success 200 {array} models.QhjMgrBrokerRewardReport
+// @Failure 500 {object} app.Response
+// @Router /QhjMgr/QueryBrokerRewardReport [get]
+// @Tags 大连千海金(PCWeb)
+func QueryBrokerRewardReport(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.QhjMgrBrokerRewardReport{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 288 - 3
docs/docs.go

@@ -3174,7 +3174,7 @@ var doc = `{
                         "schema": {
                             "type": "array",
                             "items": {
-                                "$ref": "#/definitions/models.Ermcp3ExposureFutuDetail"
+                                "$ref": "#/definitions/models.Ermcp3ExposureParamChLog"
                             }
                         }
                     },
@@ -7472,6 +7472,48 @@ var doc = `{
                 }
             }
         },
+        "/Qhj/QueryMyTeam": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询我的团队",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjMyTeam"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryParentAreaList": {
             "get": {
                 "security": [
@@ -8133,6 +8175,74 @@ var doc = `{
                 }
             }
         },
+        "/QhjMgr/QueryBrokerRewardReport": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(PCWeb)"
+                ],
+                "summary": "查询经纪人奖励报表(废弃)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】",
+                        "name": "cycletype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】",
+                        "name": "cycletime",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "名称(模糊匹配)",
+                        "name": "filtername",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否包含子级 1-包含",
+                        "name": "includesub",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjMgrBrokerRewardReport"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/QhjMgr/QueryContract": {
             "get": {
                 "security": [
@@ -8790,7 +8900,7 @@ var doc = `{
                     },
                     {
                         "type": "integer",
-                        "description": "是否有效 - 0:无效 1:有效",
+                        "description": "是否有效 - 是否有效 - 1:正常 2:停用 3:注销",
                         "name": "isvalid",
                         "in": "query"
                     },
@@ -16160,6 +16270,79 @@ var doc = `{
                 }
             }
         },
+        "models.Ermcp3ExposureParamChLog": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "期货账户ID (作废, 默认为0)",
+                    "type": "integer"
+                },
+                "aftervalue": {
+                    "description": "应套保\\套利量变更后(调整后应套保总量)",
+                    "type": "number"
+                },
+                "areauserid": {
+                    "description": "所属机构\\交易用户ID",
+                    "type": "integer"
+                },
+                "beforevalue": {
+                    "description": "应套保\\套利量变更前(调整前应套保总量)",
+                    "type": "number"
+                },
+                "begindate": {
+                    "description": "开始交易日",
+                    "type": "string"
+                },
+                "changelogtype": {
+                    "description": "变更流水类型 - 1:套保比率变更 2:套利比率变更",
+                    "type": "integer"
+                },
+                "curvalue": {
+                    "description": "当前套保\\套利量(套保总量|套利总量)",
+                    "type": "number"
+                },
+                "diffvalue": {
+                    "description": "应套保总量变化量",
+                    "type": "number"
+                },
+                "enddate": {
+                    "description": "结束交易日",
+                    "type": "string"
+                },
+                "logdatetime": {
+                    "description": "流水日期",
+                    "type": "string"
+                },
+                "logid": {
+                    "description": "流水ID(609+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "middlegoodscode": {
+                    "description": "套保品种代码",
+                    "type": "string"
+                },
+                "middlegoodsid": {
+                    "description": "套保品种",
+                    "type": "integer"
+                },
+                "middlegoodsname": {
+                    "description": "套保品种名称",
+                    "type": "string"
+                },
+                "paramaftervalue": {
+                    "description": "参数变更后(调整后参数值)",
+                    "type": "number"
+                },
+                "parambeforevalue": {
+                    "description": "参数变更前(调整前参数值)",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                }
+            }
+        },
         "models.Ermcp3ExpourseReport": {
             "type": "object",
             "properties": {
@@ -23183,7 +23366,7 @@ var doc = `{
                     "type": "integer"
                 },
                 "isvalid": {
-                    "description": "是否有效 - 0:无效 1:有效",
+                    "description": "是否有效 - 是否有效 - 1:正常 2:停用 3:注销",
                     "type": "integer"
                 },
                 "reviserid": {
@@ -24278,6 +24461,71 @@ var doc = `{
                 }
             }
         },
+        "models.QhjMgrBrokerRewardReport": {
+            "type": "object",
+            "properties": {
+                "createtime": {
+                    "description": "创建时间(注册时间)",
+                    "type": "string"
+                },
+                "cycletime": {
+                    "description": "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】",
+                    "type": "string"
+                },
+                "cycletype": {
+                    "description": "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】",
+                    "type": "integer"
+                },
+                "directtotalnum": {
+                    "description": "直推总人数【期末】",
+                    "type": "integer"
+                },
+                "indirecttotalnum": {
+                    "description": "间推总人数【期末】",
+                    "type": "integer"
+                },
+                "mobile": {
+                    "description": "电话号码",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id(经纪人id)",
+                    "type": "integer"
+                },
+                "refereeusername": {
+                    "description": "推荐人名称(经纪人) 上级经纪人名称",
+                    "type": "string"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "用户层级路径",
+                    "type": "string"
+                },
+                "todayrewardamount": {
+                    "description": "奖励总金额【汇总】",
+                    "type": "number"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "经纪人用户ID",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjMgrContract": {
             "type": "object",
             "properties": {
@@ -25009,6 +25257,43 @@ var doc = `{
                 }
             }
         },
+        "models.QhjMyTeam": {
+            "type": "object",
+            "properties": {
+                "accountname": {
+                    "description": "用户名称",
+                    "type": "string"
+                },
+                "accountstatus": {
+                    "description": "账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "mobile": {
+                    "description": "手机号码",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型 1-个人 2-企业",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QhjNodeAgreementConfig": {
             "type": "object",
             "properties": {

+ 288 - 3
docs/swagger.json

@@ -3158,7 +3158,7 @@
                         "schema": {
                             "type": "array",
                             "items": {
-                                "$ref": "#/definitions/models.Ermcp3ExposureFutuDetail"
+                                "$ref": "#/definitions/models.Ermcp3ExposureParamChLog"
                             }
                         }
                     },
@@ -7456,6 +7456,48 @@
                 }
             }
         },
+        "/Qhj/QueryMyTeam": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金"
+                ],
+                "summary": "查询我的团队",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjMyTeam"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Qhj/QueryParentAreaList": {
             "get": {
                 "security": [
@@ -8117,6 +8159,74 @@
                 }
             }
         },
+        "/QhjMgr/QueryBrokerRewardReport": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "大连千海金(PCWeb)"
+                ],
+                "summary": "查询经纪人奖励报表(废弃)",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "所属机构ID",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】",
+                        "name": "cycletype",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】",
+                        "name": "cycletime",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "名称(模糊匹配)",
+                        "name": "filtername",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "是否包含子级 1-包含",
+                        "name": "includesub",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.QhjMgrBrokerRewardReport"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/QhjMgr/QueryContract": {
             "get": {
                 "security": [
@@ -8774,7 +8884,7 @@
                     },
                     {
                         "type": "integer",
-                        "description": "是否有效 - 0:无效 1:有效",
+                        "description": "是否有效 - 是否有效 - 1:正常 2:停用 3:注销",
                         "name": "isvalid",
                         "in": "query"
                     },
@@ -16144,6 +16254,79 @@
                 }
             }
         },
+        "models.Ermcp3ExposureParamChLog": {
+            "type": "object",
+            "properties": {
+                "accountid": {
+                    "description": "期货账户ID (作废, 默认为0)",
+                    "type": "integer"
+                },
+                "aftervalue": {
+                    "description": "应套保\\套利量变更后(调整后应套保总量)",
+                    "type": "number"
+                },
+                "areauserid": {
+                    "description": "所属机构\\交易用户ID",
+                    "type": "integer"
+                },
+                "beforevalue": {
+                    "description": "应套保\\套利量变更前(调整前应套保总量)",
+                    "type": "number"
+                },
+                "begindate": {
+                    "description": "开始交易日",
+                    "type": "string"
+                },
+                "changelogtype": {
+                    "description": "变更流水类型 - 1:套保比率变更 2:套利比率变更",
+                    "type": "integer"
+                },
+                "curvalue": {
+                    "description": "当前套保\\套利量(套保总量|套利总量)",
+                    "type": "number"
+                },
+                "diffvalue": {
+                    "description": "应套保总量变化量",
+                    "type": "number"
+                },
+                "enddate": {
+                    "description": "结束交易日",
+                    "type": "string"
+                },
+                "logdatetime": {
+                    "description": "流水日期",
+                    "type": "string"
+                },
+                "logid": {
+                    "description": "流水ID(609+Unix秒时间戳(10位)+xxxxxx)",
+                    "type": "string"
+                },
+                "middlegoodscode": {
+                    "description": "套保品种代码",
+                    "type": "string"
+                },
+                "middlegoodsid": {
+                    "description": "套保品种",
+                    "type": "integer"
+                },
+                "middlegoodsname": {
+                    "description": "套保品种名称",
+                    "type": "string"
+                },
+                "paramaftervalue": {
+                    "description": "参数变更后(调整后参数值)",
+                    "type": "number"
+                },
+                "parambeforevalue": {
+                    "description": "参数变更前(调整前参数值)",
+                    "type": "number"
+                },
+                "tradedate": {
+                    "description": "交易日(yyyyMMdd)",
+                    "type": "string"
+                }
+            }
+        },
         "models.Ermcp3ExpourseReport": {
             "type": "object",
             "properties": {
@@ -23167,7 +23350,7 @@
                     "type": "integer"
                 },
                 "isvalid": {
-                    "description": "是否有效 - 0:无效 1:有效",
+                    "description": "是否有效 - 是否有效 - 1:正常 2:停用 3:注销",
                     "type": "integer"
                 },
                 "reviserid": {
@@ -24262,6 +24445,71 @@
                 }
             }
         },
+        "models.QhjMgrBrokerRewardReport": {
+            "type": "object",
+            "properties": {
+                "createtime": {
+                    "description": "创建时间(注册时间)",
+                    "type": "string"
+                },
+                "cycletime": {
+                    "description": "周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】",
+                    "type": "string"
+                },
+                "cycletype": {
+                    "description": "周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】",
+                    "type": "integer"
+                },
+                "directtotalnum": {
+                    "description": "直推总人数【期末】",
+                    "type": "integer"
+                },
+                "indirecttotalnum": {
+                    "description": "间推总人数【期末】",
+                    "type": "integer"
+                },
+                "mobile": {
+                    "description": "电话号码",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id(经纪人id)",
+                    "type": "integer"
+                },
+                "refereeusername": {
+                    "description": "推荐人名称(经纪人) 上级经纪人名称",
+                    "type": "string"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "subarealevelpath": {
+                    "description": "用户层级路径",
+                    "type": "string"
+                },
+                "todayrewardamount": {
+                    "description": "奖励总金额【汇总】",
+                    "type": "number"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "经纪人用户ID",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型  1-个人 2-企业",
+                    "type": "integer"
+                },
+                "username": {
+                    "description": "用户名称",
+                    "type": "string"
+                }
+            }
+        },
         "models.QhjMgrContract": {
             "type": "object",
             "properties": {
@@ -24993,6 +25241,43 @@
                 }
             }
         },
+        "models.QhjMyTeam": {
+            "type": "object",
+            "properties": {
+                "accountname": {
+                    "description": "用户名称",
+                    "type": "string"
+                },
+                "accountstatus": {
+                    "description": "账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "mobile": {
+                    "description": "手机号码",
+                    "type": "string"
+                },
+                "refereeuserid": {
+                    "description": "推荐人id",
+                    "type": "integer"
+                },
+                "refernum": {
+                    "description": "推荐码",
+                    "type": "string"
+                },
+                "userid": {
+                    "description": "用户id",
+                    "type": "integer"
+                },
+                "userinfotype": {
+                    "description": "用户类型 1-个人 2-企业",
+                    "type": "integer"
+                }
+            }
+        },
         "models.QhjNodeAgreementConfig": {
             "type": "object",
             "properties": {

+ 202 - 3
docs/swagger.yaml

@@ -4231,6 +4231,60 @@ definitions:
         description: 品类名称
         type: string
     type: object
+  models.Ermcp3ExposureParamChLog:
+    properties:
+      accountid:
+        description: 期货账户ID (作废, 默认为0)
+        type: integer
+      aftervalue:
+        description: 应套保\套利量变更后(调整后应套保总量)
+        type: number
+      areauserid:
+        description: 所属机构\交易用户ID
+        type: integer
+      beforevalue:
+        description: 应套保\套利量变更前(调整前应套保总量)
+        type: number
+      begindate:
+        description: 开始交易日
+        type: string
+      changelogtype:
+        description: 变更流水类型 - 1:套保比率变更 2:套利比率变更
+        type: integer
+      curvalue:
+        description: 当前套保\套利量(套保总量|套利总量)
+        type: number
+      diffvalue:
+        description: 应套保总量变化量
+        type: number
+      enddate:
+        description: 结束交易日
+        type: string
+      logdatetime:
+        description: 流水日期
+        type: string
+      logid:
+        description: 流水ID(609+Unix秒时间戳(10位)+xxxxxx)
+        type: string
+      middlegoodscode:
+        description: 套保品种代码
+        type: string
+      middlegoodsid:
+        description: 套保品种
+        type: integer
+      middlegoodsname:
+        description: 套保品种名称
+        type: string
+      paramaftervalue:
+        description: 参数变更后(调整后参数值)
+        type: number
+      parambeforevalue:
+        description: 参数变更前(调整前参数值)
+        type: number
+      tradedate:
+        description: 交易日(yyyyMMdd)
+        type: string
+    type: object
   models.Ermcp3ExpourseReport:
     properties:
       accountid:
@@ -9480,7 +9534,7 @@ definitions:
         description: 创建来源 - 1:管理端 2:终端
         type: integer
       isvalid:
-        description: 是否有效 - 0:无效 1:有效
+        description: 是否有效 - 是否有效 - 1:正常 2:停用 3:注销
         type: integer
       reviserid:
         description: 修改人
@@ -10298,6 +10352,54 @@ definitions:
         description: 用户名称
         type: string
     type: object
+  models.QhjMgrBrokerRewardReport:
+    properties:
+      createtime:
+        description: 创建时间(注册时间)
+        type: string
+      cycletime:
+        description: 周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】
+        type: string
+      cycletype:
+        description: 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+        type: integer
+      directtotalnum:
+        description: 直推总人数【期末】
+        type: integer
+      indirecttotalnum:
+        description: 间推总人数【期末】
+        type: integer
+      mobile:
+        description: 电话号码
+        type: string
+      refereeuserid:
+        description: 推荐人id(经纪人id)
+        type: integer
+      refereeusername:
+        description: 推荐人名称(经纪人) 上级经纪人名称
+        type: string
+      refernum:
+        description: 推荐码
+        type: string
+      subarealevelpath:
+        description: 用户层级路径
+        type: string
+      todayrewardamount:
+        description: 奖励总金额【汇总】
+        type: number
+      updatetime:
+        description: 更新时间
+        type: string
+      userid:
+        description: 经纪人用户ID
+        type: integer
+      userinfotype:
+        description: 用户类型  1-个人 2-企业
+        type: integer
+      username:
+        description: 用户名称
+        type: string
+    type: object
   models.QhjMgrContract:
     properties:
       contractconfirmtime:
@@ -10845,6 +10947,33 @@ definitions:
         description: 账户类型 1-个人 2-企业
         type: integer
     type: object
+  models.QhjMyTeam:
+    properties:
+      accountname:
+        description: 用户名称
+        type: string
+      accountstatus:
+        description: 账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      mobile:
+        description: 手机号码
+        type: string
+      refereeuserid:
+        description: 推荐人id
+        type: integer
+      refernum:
+        description: 推荐码
+        type: string
+      userid:
+        description: 用户id
+        type: integer
+      userinfotype:
+        description: 用户类型 1-个人 2-企业
+        type: integer
+    type: object
   models.QhjNodeAgreementConfig:
     properties:
       agreementcontent:
@@ -16662,7 +16791,7 @@ paths:
           description: OK
           schema:
             items:
-              $ref: '#/definitions/models.Ermcp3ExposureFutuDetail'
+              $ref: '#/definitions/models.Ermcp3ExposureParamChLog'
             type: array
         "500":
           description: Internal Server Error
@@ -19384,6 +19513,32 @@ paths:
       summary: 交易商品扩展表
       tags:
       - 大连千海金
+  /Qhj/QueryMyTeam:
+    get:
+      parameters:
+      - description: 用户ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjMyTeam'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询我的团队
+      tags:
+      - 大连千海金
   /Qhj/QueryParentAreaList:
     get:
       parameters:
@@ -19798,6 +19953,50 @@ paths:
       summary: 查询经纪人申请
       tags:
       - 大连千海金(PCWeb)
+  /QhjMgr/QueryBrokerRewardReport:
+    get:
+      parameters:
+      - description: 所属机构ID
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+        in: query
+        name: cycletype
+        required: true
+        type: integer
+      - description: 周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】
+        in: query
+        name: cycletime
+        required: true
+        type: string
+      - description: 名称(模糊匹配)
+        in: query
+        name: filtername
+        type: string
+      - description: 是否包含子级 1-包含
+        in: query
+        name: includesub
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.QhjMgrBrokerRewardReport'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询经纪人奖励报表(废弃)
+      tags:
+      - 大连千海金(PCWeb)
   /QhjMgr/QueryContract:
     get:
       parameters:
@@ -20209,7 +20408,7 @@ paths:
         in: query
         name: agreementtype
         type: integer
-      - description: 是否有效 - 0:无效 1:有效
+      - description: 是否有效 - 是否有效 - 1:正常 2:停用 3:注销
         in: query
         name: isvalid
         type: integer

+ 78 - 0
models/qhj.go

@@ -1875,3 +1875,81 @@ func (r *QhjAreaFinanceConfig) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// QhjMyTeamEx 我的团队(含层次结构)
+type QhjMyTeamEx struct {
+	QhjMyTeam
+	SubList []QhjMyTeamEx
+}
+
+func (r *QhjMyTeamEx) addSub(lst []QhjMyTeam) {
+	for i := range lst {
+		if r.USERID == lst[i].REFEREEUSERID {
+			v := QhjMyTeamEx{QhjMyTeam: lst[i], SubList: make([]QhjMyTeamEx, 0)}
+			v.addSub(lst)
+			r.SubList = append(r.SubList, v)
+		}
+	}
+}
+
+// QhjMyTeam 我的团队
+type QhjMyTeam struct {
+	LEVEL         int32  `json:"-"  xorm:"'LEVEL'"`                     // 层级
+	USERID        int64  `json:"userid"  xorm:"'USERID'"`               // 用户id
+	ACCOUNTNAME   string `json:"accountname"  xorm:"'ACCOUNTNAME'"`     // 用户名称
+	REFEREEUSERID int64  `json:"refereeuserid"  xorm:"'REFEREEUSERID'"` // 推荐人id
+	REFERNUM      string `json:"refernum"  xorm:"'REFERNUM'"`           // 推荐码
+	CREATETIME    string `json:"createtime"  xorm:"'CREATETIME'"`       // 创建时间
+	ACCOUNTSTATUS int32  `json:"accountstatus"  xorm:"'ACCOUNTSTATUS'"` // 账户状态 -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)
+	MOBILE        string `json:"mobile"  xorm:"'MOBILE'"`               // 手机号码
+	USERINFOTYPE  int32  `json:"userinfotype"  xorm:"'USERINFOTYPE'"`   // 用户类型 1-个人 2-企业
+}
+
+func (r *QhjMyTeam) calc() {
+	r.MOBILE = DecryptField(r.MOBILE)
+}
+
+func (r *QhjMyTeam) buildSql() string {
+	var sqlId utils.SQLVal = "select level," +
+		"       t.userid," +
+		"       t.accountname," +
+		"       t.refereeuserid," +
+		"       t.refernum," +
+		"       to_char(t.createtime, 'yyyy-dd-mm hh24:mi:ss') createtime," +
+		"       t.accountstatus," +
+		"       ui.mobile," +
+		"       ui.userinfotype" +
+		"  from useraccount t" +
+		"  left join userinfo ui" +
+		"    on t.userid = ui.userid" +
+		" start with t.userid = %v" +
+		"connect by prior t.userid = t.refereeuserid" +
+		"       and level <= 3" +
+		" order by level"
+	sqlId.FormatParam(r.USERID)
+	return sqlId.String()
+}
+
+// GetDataEx 获取我的团队
+func (r *QhjMyTeam) GetDataEx() (interface{}, error) {
+	sData := make([]QhjMyTeam, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	sDataEx := make([]QhjMyTeamEx, 0)
+	// 构建顶层
+	for i := range sData {
+		if sData[i].LEVEL == 1 {
+			v := QhjMyTeamEx{QhjMyTeam: sData[i], SubList: make([]QhjMyTeamEx, 0)}
+			sDataEx = append(sDataEx, v)
+		}
+	}
+
+	// 递归构建层级
+	for i := range sDataEx {
+		sDataEx[i].addSub(sData)
+	}
+
+	return sDataEx, err
+}

+ 1 - 1
models/qhjAgreement.go

@@ -21,7 +21,7 @@ type QhjAgreementConfig struct {
 	AGREEMENTTYPE      int32  `json:"agreementtype"  xorm:"AGREEMENTTYPE" form:"agreementtype"`                // 协议类型 - 1:注册 2:登录 3:交易
 	AGREEMENTFREQUENCY int32  `json:"agreementfrequency"  xorm:"AGREEMENTFREQUENCY" form:"agreementfrequency"` // 协议频率 - 1:首次 2:每次 [登录为2, 其它为1]
 	AGREEMENTCONTENT   string `json:"agreementcontent"  xorm:"AGREEMENTCONTENT" form:"agreementcontent"`       // 协议内容
-	ISVALID            int32  `json:"isvalid"  xorm:"ISVALID" form:"isvalid"`                                  // 是否有效 - 0:无效 1:有效
+	ISVALID            int32  `json:"isvalid"  xorm:"ISVALID" form:"isvalid"`                                  // 是否有效 - 是否有效 - 1:正常 2:停用 3:注销
 	CREATORSRC         int32  `json:"creatorsrc"  xorm:"CREATORSRC" form:"creatorsrc"`                         // 创建来源 - 1:管理端 2:终端
 	CREATORID          int64  `json:"creatorid"  xorm:"CREATORID" form:"creatorid"`                            // 创建人
 	CREATETIME         string `json:"createtime"  xorm:"CREATETIME" form:"createtime"`                         // 创建时间

+ 116 - 0
models/qhjPCWeb.go

@@ -1328,3 +1328,119 @@ func (r *QhjMgrBrokerApply) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// QhjMgrBrokerRewardReport 经纪人奖励报表
+type QhjMgrBrokerRewardReport struct {
+	CYCLETIME         string  `json:"cycletime"  xorm:"CYCLETIME" form:"cycletime"`                         // 周期时间 日(YYYYMMDD) 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYMMDD) 全(0)【原值】
+	CYCLETYPE         int32   `json:"cycletype"  xorm:"CYCLETYPE" form:"cycletype"`                         // 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+	USERID            int64   `json:"userid"  xorm:"USERID" form:"userid"`                                  // 经纪人用户ID
+	DIRECTTOTALNUM    int32   `json:"directtotalnum"  xorm:"DIRECTTOTALNUM" form:"directtotalnum"`          // 直推总人数【期末】
+	INDIRECTTOTALNUM  int32   `json:"indirecttotalnum"  xorm:"INDIRECTTOTALNUM" form:"indirecttotalnum"`    // 间推总人数【期末】
+	TODAYREWARDAMOUNT float64 `json:"todayrewardamount"  xorm:"TODAYREWARDAMOUNT" form:"todayrewardamount"` // 奖励总金额【汇总】
+	UPDATETIME        string  `json:"updatetime"  xorm:"UPDATETIME" form:"updatetime"`                      // 更新时间
+	USERNAME          string  `json:"username"  xorm:"'USERNAME'"`                                          // 用户名称
+	REFEREEUSERID     int64   `json:"refereeuserid"  xorm:"'REFEREEUSERID'"`                                // 推荐人id(经纪人id)
+	REFERNUM          string  `json:"refernum"  xorm:"'REFERNUM'"`                                          // 推荐码
+	SUBAREALEVELPATH  string  `json:"subarealevelpath"  xorm:"'SUBAREALEVELPATH'"`                          // 用户层级路径
+	CREATETIME        string  `json:"createtime"  xorm:"'CREATETIME'"`                                      // 创建时间(注册时间)
+	USERINFOTYPE      int32   `json:"userinfotype"  xorm:"'USERINFOTYPE'"`                                  // 用户类型  1-个人 2-企业
+	MOBILE            string  `json:"mobile"  xorm:"'MOBILE'"`                                              // 电话号码
+	REFEREEUSERNAME   string  `json:"refereeusername"  xorm:"'REFEREEUSERNAME'"`                            // 推荐人名称(经纪人) 上级经纪人名称
+
+	IncludeSub int32  `json:"-" form:"includesub"` // 是否包含子级 1-包含
+	FilterName string `json:"-" form:"filtername"` // 模糊搜索名称
+}
+
+func (r *QhjMgrBrokerRewardReport) calc() {
+	r.MOBILE = DecryptField(r.MOBILE)
+}
+
+func (r *QhjMgrBrokerRewardReport) sqlDay() string {
+	var sqlId utils.SQLVal = "SELECT t.reckondate as CYCLETIME," +
+		"       0 as CYCLETYPE," +
+		"       t.USERID," +
+		"       t.DIRECTTOTALNUM," +
+		"       t.INDIRECTTOTALNUM," +
+		"       t.TODAYREWARDAMOUNT," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       u.accountname USERNAME," +
+		"       u.refereeuserid," +
+		"       u.refernum," +
+		"       u.subarealevelpath," +
+		"       to_char(u.createtime, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       ui.userinfotype," +
+		"       ui.mobile," +
+		"       u2.accountname REFEREEUSERNAME" +
+		"  FROM RECKON_BROKERREWARD t" +
+		"  INNER JOIN USERACCOUNT u on t.userid=u.userid" +
+		"  INNER JOIN USERINFO ui on t.userid=ui.userid" +
+		"  LEFT JOIN USERACCOUNT u2 on u.refereeuserid=u2.userid" +
+		" WHERE 1 = 1"
+
+	return sqlId.String()
+}
+
+func (r *QhjMgrBrokerRewardReport) sqlCycle() string {
+	var sqlId utils.SQLVal = "SELECT t.CYCLETIME," +
+		"       t.CYCLETYPE," +
+		"       t.USERID," +
+		"       t.DIRECTTOTALNUM," +
+		"       t.INDIRECTTOTALNUM," +
+		"       t.TODAYREWARDAMOUNT," +
+		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
+		"       u.accountname USERNAME," +
+		"       u.refereeuserid," +
+		"       u.refernum," +
+		"       u.subarealevelpath," +
+		"       to_char(u.createtime, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
+		"       ui.userinfotype," +
+		"       ui.mobile," +
+		"       u2.accountname REFEREEUSERNAME" +
+		"  FROM REPORT_BROKERREWARD t" +
+		"  INNER JOIN USERACCOUNT u on t.userid=u.userid" +
+		"  INNER JOIN USERINFO ui on t.userid=ui.userid" +
+		"  LEFT JOIN USERACCOUNT u2 on u.refereeuserid=u2.userid" +
+		" WHERE 1 = 1"
+
+	return sqlId.String()
+}
+
+func (r *QhjMgrBrokerRewardReport) buildSql() string {
+	var sqlId utils.SQLVal
+	if r.CYCLETYPE == 0 {
+		sqlId = utils.SQLVal(r.sqlDay())
+		sqlId.AndEx("t.reckondate", r.CYCLETIME, r.CYCLETIME != "")
+	} else {
+		sqlId = utils.SQLVal(r.sqlCycle())
+		sqlId.And("t.CYCLETYPE", r.CYCLETYPE)
+		// 转换时间
+		// 兼容性处理, 月报表日期如果是yyyymmdd, 只取yyyymm
+		if r.CYCLETYPE == 1 && len(r.CYCLETIME) > 6 {
+			r.CYCLETIME = r.CYCLETIME[:6]
+		} else if r.CYCLETYPE == 4 {
+			r.CYCLETIME = mtpcache.GetWeekIW(r.CYCLETIME)
+		}
+		sqlId.And("t.CYCLETIME", r.CYCLETIME)
+	}
+	if r.IncludeSub == 1 {
+		//sqlId.JoinFormat(" and u.subarealevelpath like '%%,%v,%%,%%'", r.USERID)
+		// 要用 refereeuserid 递归查询, 不能用subarealevelpath
+	} else {
+		sqlId.And("u.refereeuserid", r.USERID)
+	}
+	if len(r.FilterName) > 0 {
+		sqlId.JoinFormat(" and u.accountname like '%%%v%%'", r.FilterName, r.FilterName)
+	}
+
+	return sqlId.String()
+}
+
+// GetDataEx 获取经纪人奖励报表
+func (r *QhjMgrBrokerRewardReport) GetDataEx() (interface{}, error) {
+	sData := make([]QhjMgrBrokerRewardReport, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 2 - 0
routers/router.go

@@ -474,6 +474,7 @@ func InitRouter() *gin.Engine {
 		qhjR.GET("QueryGoodsEx", qhj.QueryGoodsEx)
 		qhjR.GET("QueryParentAreaList", qhj.QueryParentAreaList)
 		qhjR.GET("QueryAreaFinanceConfig", qhj.QueryAreaFinanceConfig)
+		qhjR.GET("QueryMyTeam", qhj.QueryMyTeam)
 	}
 
 	// *************************千海金(PCWeb)*****************************
@@ -490,6 +491,7 @@ func InitRouter() *gin.Engine {
 		qhjPCWebR.GET("QueryContract", qhjPCWeb.QueryContract)
 		qhjPCWebR.GET("QueryPickGoods", qhjPCWeb.QueryPickGoods)
 		qhjPCWebR.GET("QueryBrokerApply", qhjPCWeb.QueryBrokerApply)
+		qhjPCWebR.GET("QueryBrokerRewardReport", qhjPCWeb.QueryBrokerRewardReport)
 	}
 
 	// **********************千海金(协议和签约)**************************