Przeglądaj źródła

feat:企业订阅权益修改&手动分发人员获取

duxin 2 lat temu
rodzic
commit
c1d2aa6fe1

+ 9 - 0
jyBXSubscribe/api/bxsubscribe.api

@@ -86,6 +86,13 @@ type (
 		PowerSource int64  `form:"powerSource,optional"`
 		PowerSource int64  `form:"powerSource,optional"`
 		UserPower   int64  `form:"userPower,optional"`
 		UserPower   int64  `form:"userPower,optional"`
 	}
 	}
+	DistributorReq {
+		AppId     string `header:"appId"`
+		EntId     string `header:"entId,optional"`
+		EntUserId string `header:"entUserId,optional"`
+		Region    string `path:"region,optional"`
+		SelectIds string `json:"selectIds,optional"`
+	}
 )
 )
 service bxsubscribe-api {
 service bxsubscribe-api {
 	@handler subscribeList
 	@handler subscribeList
@@ -100,4 +107,6 @@ service bxsubscribe-api {
 	post /jybx/subscribe/:userType/setRead(SetReadReq) returns (commonResp)
 	post /jybx/subscribe/:userType/setRead(SetReadReq) returns (commonResp)
 	@handler getKey
 	@handler getKey
 	post /jybx/subscribe/:userType/getKey(GetKeyReq) returns (commonResp)
 	post /jybx/subscribe/:userType/getKey(GetKeyReq) returns (commonResp)
+	@handler distributor
+	post /jybx/subscribe/:userType/distributor(DistributorReq) returns (commonResp)
 }
 }

+ 28 - 0
jyBXSubscribe/api/internal/handler/distributorhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"jyBXSubscribe/api/internal/logic"
+	"jyBXSubscribe/api/internal/svc"
+	"jyBXSubscribe/api/internal/types"
+)
+
+func distributorHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.DistributorReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewDistributorLogic(r.Context(), svcCtx)
+		resp, err := l.Distributor(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 5 - 0
jyBXSubscribe/api/internal/handler/routes.go

@@ -42,6 +42,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/subscribe/:userType/getKey",
 				Path:    "/jybx/subscribe/:userType/getKey",
 				Handler: getKeyHandler(serverCtx),
 				Handler: getKeyHandler(serverCtx),
 			},
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/subscribe/:userType/distributor",
+				Handler: distributorHandler(serverCtx),
+			},
 		},
 		},
 	)
 	)
 }
 }

+ 49 - 0
jyBXSubscribe/api/internal/logic/distributorlogic.go

@@ -0,0 +1,49 @@
+package logic
+
+import (
+	"context"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"jyBXSubscribe/api/internal/svc"
+	"jyBXSubscribe/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type DistributorLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewDistributorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DistributorLogic {
+	return &DistributorLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *DistributorLogic) Distributor(req *types.DistributorReq) (resp *types.CommonResp, err error) {
+	// todo: add your logic here and delete this line
+	res, err := l.svcCtx.Suscribe.GetDistributor(l.ctx, &bxsubscribe.GetDistributorReq{
+		AppId:     req.AppId,
+		EntId:     req.EntId,
+		EntUserId: req.EntUserId,
+		Region:    req.Region,
+		SelectIds: req.SelectIds,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: res.ErrCode,
+			Err_msg:  res.ErrMsg,
+			Data:     nil,
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res,
+	}, nil
+	return
+}

+ 8 - 0
jyBXSubscribe/api/internal/types/types.go

@@ -80,3 +80,11 @@ type GetKeyReq struct {
 	PowerSource int64  `form:"powerSource,optional"`
 	PowerSource int64  `form:"powerSource,optional"`
 	UserPower   int64  `form:"userPower,optional"`
 	UserPower   int64  `form:"userPower,optional"`
 }
 }
+
+type DistributorReq struct {
+	AppId     string `header:"appId"`
+	EntId     string `header:"entId,optional"`
+	EntUserId string `header:"entUserId,optional"`
+	Region    string `path:"region,optional"`
+	SelectIds string `json:"selectIds,optional"`
+}

+ 21 - 0
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -175,13 +175,32 @@ message GetKeyReq{
   int64   userPower = 12;
   int64   userPower = 12;
   string  deptId = 13;
   string  deptId = 13;
 }
 }
+
+message GetDistributorReq{
+  string  appId = 1;
+  string  entId = 2;
+  string  entUserId = 3;
+  string  region = 4;
+  string  selectIds = 5;
+}
+
 message KeyResp {
 message KeyResp {
   int64 err_code = 1;
   int64 err_code = 1;
   string err_msg = 2;
   string err_msg = 2;
   repeated KeyItems items = 3;//关键词
   repeated KeyItems items = 3;//关键词
 }
 }
 
 
+message DistributorResp {
+  int64 err_code = 1;
+  string err_msg = 2;
+  repeated userResp items = 3;//分发人员
+}
 
 
+message userResp {
+  string name = 1;
+  int64 id = 2;
+  string phone = 3;
+}
 
 
 service Bxsubscribe {
 service Bxsubscribe {
   //获取订阅推送列表
   //获取订阅推送列表
@@ -196,4 +215,6 @@ service Bxsubscribe {
   rpc SetRead(SetReadReq)returns(StatusResp);
   rpc SetRead(SetReadReq)returns(StatusResp);
   //关键词获取
   //关键词获取
   rpc GetKey(GetKeyReq)returns(KeyResp);
   rpc GetKey(GetKeyReq)returns(KeyResp);
+  //手动分发人员
+  rpc GetDistributor(GetDistributorReq)returns(DistributorResp);
 }
 }

+ 11 - 0
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -15,6 +15,8 @@ import (
 type (
 type (
 	ByPushHistoryResp      = bxsubscribe.ByPushHistoryResp
 	ByPushHistoryResp      = bxsubscribe.ByPushHistoryResp
 	CityList               = bxsubscribe.CityList
 	CityList               = bxsubscribe.CityList
+	DistributorResp        = bxsubscribe.DistributorResp
+	GetDistributorReq      = bxsubscribe.GetDistributorReq
 	GetKeyReq              = bxsubscribe.GetKeyReq
 	GetKeyReq              = bxsubscribe.GetKeyReq
 	Items                  = bxsubscribe.Items
 	Items                  = bxsubscribe.Items
 	Key                    = bxsubscribe.Key
 	Key                    = bxsubscribe.Key
@@ -31,6 +33,7 @@ type (
 	SubscribeInfosReq      = bxsubscribe.SubscribeInfosReq
 	SubscribeInfosReq      = bxsubscribe.SubscribeInfosReq
 	SubscribeInfosResp     = bxsubscribe.SubscribeInfosResp
 	SubscribeInfosResp     = bxsubscribe.SubscribeInfosResp
 	UpdateSubScribeInfoReq = bxsubscribe.UpdateSubScribeInfoReq
 	UpdateSubScribeInfoReq = bxsubscribe.UpdateSubScribeInfoReq
+	UserResp               = bxsubscribe.UserResp
 
 
 	Bxsubscribe interface {
 	Bxsubscribe interface {
 		// 获取订阅推送列表
 		// 获取订阅推送列表
@@ -45,6 +48,8 @@ type (
 		SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 		SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 		// 关键词获取
 		// 关键词获取
 		GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
 		GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
+		// 手动分发人员
+		GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
 	}
 	}
 
 
 	defaultBxsubscribe struct {
 	defaultBxsubscribe struct {
@@ -93,3 +98,9 @@ func (m *defaultBxsubscribe) GetKey(ctx context.Context, in *GetKeyReq, opts ...
 	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
 	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
 	return client.GetKey(ctx, in, opts...)
 	return client.GetKey(ctx, in, opts...)
 }
 }
+
+// 手动分发人员
+func (m *defaultBxsubscribe) GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetDistributor(ctx, in, opts...)
+}

+ 44 - 0
jyBXSubscribe/rpc/internal/logic/getdistributorlogic.go

@@ -0,0 +1,44 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	"jyBXSubscribe/rpc/model"
+	"strings"
+
+	"jyBXSubscribe/rpc/internal/svc"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetDistributorLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetDistributorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDistributorLogic {
+	return &GetDistributorLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 手动分发人员
+func (l *GetDistributorLogic) GetDistributor(in *bxsubscribe.GetDistributorReq) (*bxsubscribe.DistributorResp, error) {
+	// todo: add your logic here and delete this line
+	da := new(bxsubscribe.DistributorResp)
+	users := model.Distributor(strings.Split(in.Region, ","), common.IntAll(in.EntId), common.IntAll(in.EntUserId))
+	if len(users) > 0 {
+		for _, v := range users {
+			var data bxsubscribe.UserResp
+			data.Id = common.Int64All(v.Id)
+			data.Name = v.Name
+			data.Phone = v.Phone
+			da.Items = append(da.Items, &data)
+		}
+	}
+	return da, nil
+}

+ 6 - 0
jyBXSubscribe/rpc/internal/server/bxsubscribeserver.go

@@ -57,3 +57,9 @@ func (s *BxsubscribeServer) GetKey(ctx context.Context, in *bxsubscribe.GetKeyRe
 	l := logic.NewGetKeyLogic(ctx, s.svcCtx)
 	l := logic.NewGetKeyLogic(ctx, s.svcCtx)
 	return l.GetKey(in)
 	return l.GetKey(in)
 }
 }
+
+// 手动分发人员
+func (s *BxsubscribeServer) GetDistributor(ctx context.Context, in *bxsubscribe.GetDistributorReq) (*bxsubscribe.DistributorResp, error) {
+	l := logic.NewGetDistributorLogic(ctx, s.svcCtx)
+	return l.GetDistributor(in)
+}

+ 110 - 0
jyBXSubscribe/rpc/model/distributor.go

@@ -0,0 +1,110 @@
+package model
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	IC "jyBXSubscribe/rpc/init"
+	"strings"
+)
+
+func Distributor(region []string, entId, entUserId int) []*User {
+	var (
+		ss, users []*User
+	)
+	entInfo := EntInfo(entId, entUserId)
+	if entInfo.Role_admin_department {
+		users = *GetDisUsers(entId, entInfo.Dept.Id)
+	} else if entInfo.Role_admin_system {
+		users = *GetEntUsers(entId)
+	}
+	//获取所有分配权益的用户
+	powerUser := GetEntPowerUsers(entId)
+	//判断企业是否为商机管理企业
+	isEnt := GetIsEnt(entId)
+	regions := []string{}
+
+	for _, v := range region {
+		//剔除空与全国
+		if v == "" || strings.Contains(v, "全国") {
+			continue
+		}
+		regions = append(regions, v)
+	}
+	if len(regions) > 0 { //判断区域
+		for _, v := range users {
+			if isEnt && v.Power == 1 { //商机管理用户 同时有商机管理权益
+				rules := IC.MainMysql.FindOne("entniche_user_rule", map[string]interface{}{"user_id": v.Id, "dept_id": v.Dept_id}, "rule_id", "")
+				if rules != nil && len(*rules) > 0 {
+					data, ok := IC.Mgo.FindById("entniche_distribute", common.InterfaceToStr((*rules)["rule_id"]), "")
+					if ok && data != nil && len(*data) > 0 {
+						o_area, _ := (*data)["o_area"].(map[string]interface{})
+						if regionCheck(o_area, regions) {
+							ss = append(ss, v)
+						}
+					}
+				} else { // 企业未分配规则 查询个人
+					data, ok := IC.Mgo.FindOne("entniche_rule", map[string]interface{}{
+						"i_userid": v.Id,
+						"i_entid":  entId,
+					})
+					if ok && data != nil && len(*data) > 0 {
+						o_entniche, _ := (*data)["o_entniche"].(map[string]interface{})
+						o_area, _ := o_entniche["o_area"].(map[string]interface{})
+						if regionCheck(o_area, regions) {
+							ss = append(ss, v)
+						}
+					}
+				}
+			} else {
+				//非商机管理企业 是否分配大会员或超级订阅
+				//user表 判断区域是否符合
+				if status := powerUser[common.InterfaceToStr(v.Id)]; status != 0 {
+					//查询user表区域
+					data, ok := IC.Mgo.FindOne("user", map[string]interface{}{
+						"$or": []map[string]interface{}{{"s_phone": v.Phone}, {"s_m_phone": v.Phone}},
+					})
+					if ok && data != nil && len(*data) > 0 {
+						o_area := make(map[string]interface{})
+						i_member_status, _ := (*data)["i_member_status"].(int)
+						i_vip_status, _ := (*data)["i_vip_status"].(int)
+						o_member_jy, _ := (*data)["o_member_jy"].(map[string]interface{})
+						o_vipjy, _ := (*data)["o_vipjy"].(map[string]interface{})
+						if status == 1 && i_vip_status > 0 {
+							o_area, _ = o_vipjy["o_area"].(map[string]interface{})
+						} else if status == 2 && i_member_status > 0 {
+							o_area, _ = o_member_jy["o_area"].(map[string]interface{})
+						} else {
+							continue
+						}
+
+						if regionCheck(o_area, regions) {
+							ss = append(ss, v)
+						}
+					}
+				}
+			}
+		}
+	} else {
+		for _, v := range users {
+			if (isEnt && v.Power == 1) || powerUser[common.InterfaceToStr(v.Id)] != 0 {
+				ss = append(ss, v)
+			}
+		}
+	}
+	return ss
+}
+
+func regionCheck(o_area map[string]interface{}, regions []string) bool {
+	if o_area == nil {
+		return true
+	} else {
+		regionBool := true
+		for _, v1 := range regions {
+			if _, ok1 := o_area[v1]; ok1 {
+				continue
+			} else {
+				regionBool = false
+			}
+		}
+		return regionBool
+	}
+}

+ 154 - 0
jyBXSubscribe/rpc/model/entity.go

@@ -0,0 +1,154 @@
+package model
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"encoding/json"
+	IC "jyBXSubscribe/rpc/init"
+	"strings"
+)
+
+type User struct {
+	Id        int
+	Name      string //员工姓名
+	Mail      string //邮箱
+	Phone     string //手机号
+	Dept_id   int    //部门id
+	Dept_name string //部门名称
+	//Role      string //角色
+	Power int //权限
+}
+
+type CurrentUser struct {
+	Role_admin_department bool        //是否是部门管理员
+	Role_admin_system     bool        //是否是系统管理员
+	Dept                  *Department //部门信息
+	BondPhone             string      //手机号
+	NickName              string      //昵称
+	HeadImageUrl          string      //头像
+	PersonalAuth          int         //个人认证
+	PersonalAuthReason    string      //个人认证不通过原因
+	User_power            int         //是否分配权限
+	User_name             string      //用户姓名
+}
+
+type Department struct {
+	Id         int
+	Name       string //部门名
+	Pid        int    //上级部门id
+	Pname      string //上级部门名称
+	Nodiff     int    //全员无差别接收 0:关闭 1:打开
+	Subdis     int    //订阅分发 0:关闭 1:打开
+	Aid        int    //管理员id
+	Aname      string //管理员姓名
+	Rname      string //角色名
+	User_count int    //该部门下员工的总数
+	Dept_count int    //该部门下子部门总数
+	Ent_id     int    //公司id
+}
+
+const (
+	//角色
+	Role_admin_system     = 1 //系统管理员
+	Role_admin_department = 2 //部门管理员
+)
+
+// 当前登录用户的信息
+func EntInfo(entId, entUserId int) *CurrentUser {
+	currentUser := &CurrentUser{
+		Dept: &Department{},
+	}
+	user := IC.MainMysql.SelectBySql(`SELECT a.name as user_name from entniche_user a INNER JOIN entniche_user_role b on (a.id=b.user_id) where a.id=? and b.role_id=? limit 1`, entUserId, Role_admin_system)
+	if user != nil && len(*user) > 0 {
+		currentUser.Role_admin_system = true
+		currentUser.User_name, _ = (*user)[0]["user_name"].(string)
+		currentUser.User_power = 1
+		r := IC.MainMysql.SelectBySql(`SELECT id,name,subdis,nodiff from entniche_department where ent_id=? and pid=0 limit 1`, entId)
+		if r != nil && len(*r) == 1 {
+			department := JsonUnmarshal((*r)[0], &Department{}).(*Department)
+			if department != nil {
+				department.Pid = department.Id
+				currentUser.Dept = department
+			}
+		}
+	} else {
+		//角色、权限
+		r := IC.MainMysql.SelectBySql(`SELECT a.name as user_name,a.power as user_power,b.role_id,d.id as dept_id,d.name as dept_name,d.subdis as dept_subdis,d.nodiff as dept_nodiff,e.id as dept_pid from entniche_user a 
+			LEFT JOIN entniche_user_role b on (b.user_id=?) 
+			INNER JOIN entniche_department_user c on (a.id=? and a.id=c.user_id) 
+			INNER JOIN entniche_department d on (c.dept_id=d.id) 
+			INNER JOIN entniche_department e on (e.ent_id=? and e.pid=0) 
+			order by a.id desc limit 1`, entUserId, entUserId, entId)
+		if r != nil && len(*r) == 1 {
+			currentUser.User_name, _ = (*r)[0]["user_name"].(string)
+			currentUser.User_power = common.IntAll((*r)[0]["user_power"])
+			if common.IntAll((*r)[0]["role_id"]) == Role_admin_department {
+				currentUser.Role_admin_department = true
+			}
+			currentUser.Dept.Id = common.IntAll((*r)[0]["dept_id"])
+			currentUser.Dept.Pid = common.IntAll((*r)[0]["dept_pid"])
+			currentUser.Dept.Name = common.ObjToString((*r)[0]["dept_name"])
+			currentUser.Dept.Subdis = common.IntAll((*r)[0]["dept_subdis"])
+			currentUser.Dept.Nodiff = common.IntAll((*r)[0]["dept_nodiff"])
+		}
+	}
+	return currentUser
+}
+
+// map转结构体
+func JsonUnmarshal(m interface{}, s interface{}) interface{} {
+	var b []byte
+	if v, ok := m.(string); ok {
+		b = []byte(v)
+	} else if v, ok := m.([]byte); ok {
+		b = v
+	} else {
+		b, _ = json.Marshal(m)
+	}
+	json.Unmarshal(b, &s)
+	return s
+}
+
+// 获取部门下可以进行分发的人员(不包含部门名称和部门id)
+func GetDisUsers(entId, deptId int) *[]*User {
+	r := IC.MainMysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone from entniche_department_parent a 
+		INNER JOIN entniche_department_user b on (b.dept_id=? or (a.pid=? and a.id=b.dept_id)) 
+		INNER JOIN entniche_user c on (c.ent_id=? and b.user_id=c.id) 
+		order by convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, deptId, deptId, entId)
+	users, _ := JsonUnmarshal(r, &[]*User{}).(*[]*User)
+	if users == nil {
+		return &[]*User{}
+	}
+	return users
+}
+
+// 获取企业下所有的员工(不包含部门名称和部门id)
+func GetEntUsers(entId int) *[]*User {
+	r := IC.MainMysql.SelectBySql(`select * from entniche_user where ent_id=?
+		order by convert(name using gbk) COLLATE gbk_chinese_ci asc`, entId)
+	users, _ := JsonUnmarshal(*r, &[]*User{}).(*[]*User)
+	if users == nil {
+		return &[]*User{}
+	}
+	return users
+}
+
+// 获取企业下分配权益的用户
+func GetEntPowerUsers(entId int) map[string]int {
+	r := IC.MainMysql.SelectBySql(`select a.ent_user_id,b.product_type from entniche_power a  LEFT JOIN entniche_wait_empower b ON (a.wait_empower_id = b.id) where a.ent_id=? and a.status != -1`, entId)
+	if r == nil {
+		return nil
+	}
+	data := make(map[string]int)
+	for _, v := range *r {
+		if strings.Contains(common.InterfaceToStr(v["product_type"]), "VIP") {
+			data[common.InterfaceToStr(v["ent_user_id"])] = 1
+		} else if strings.Contains(common.InterfaceToStr(v["product_type"]), "大会员") {
+			data[common.InterfaceToStr(v["ent_user_id"])] = 2
+		}
+	}
+	return data
+}
+
+func GetIsEnt(entId int) bool {
+	return IC.MainMysql.CountBySql(`select * from entniche_info where ent_id=? and status == 1`, entId) > 0
+}

+ 14 - 1
jyBXSubscribe/rpc/model/push.go

@@ -376,6 +376,19 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			} else {
 			} else {
 				userStr = fmt.Sprintf("   a.entid='%s' ", spqp.EntId)
 				userStr = fmt.Sprintf("   a.entid='%s' ", spqp.EntId)
 			}
 			}
+			//判断是企业管理员还是部门管理员 部门管理员获取所有子部门
+			userEnt := EntInfo(common.IntAll(spqp.EntId), common.IntAll(spqp.EntUserId))
+			if userEnt.Role_admin_department { //部门管理员 获取所有子部门
+				var deptIds []string
+				r := IC.MainMysql.SelectBySql(`select DISTINCT b.* from entniche_department_parent a 
+	INNER JOIN entniche_department b on (b.ent_id=? and (b.id=? or (a.pid=? and a.id=b.id)))`, spqp.EntId, userEnt.Dept.Id, userEnt.Dept.Id)
+				if r != nil && len(*r) > 0 {
+					for _, v := range *r {
+						deptIds = append(deptIds, common.InterfaceToStr(v["id"]))
+					}
+					userStr += fmt.Sprintf(" a.deptid in (%s)  ", strings.Join(deptIds, ","))
+				}
+			}
 		} else {
 		} else {
 			if spqp.BuySubject == 1 {
 			if spqp.BuySubject == 1 {
 				//企业主体是企业的个人查询
 				//企业主体是企业的个人查询
@@ -1550,7 +1563,7 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
 
 
 }
 }
 
 
-//关键词处理
+// 关键词处理
 func KeyHandle(a_items map[string]interface{}) []interface{} {
 func KeyHandle(a_items map[string]interface{}) []interface{} {
 	keyArr := []interface{}{}
 	keyArr := []interface{}{}
 	if a_items["a_key"] != nil {
 	if a_items["a_key"] != nil {

+ 314 - 43
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.20.0--rc2
+// 	protoc-gen-go v1.28.1
+// 	protoc        v3.19.4
 // source: bxsubscribe.proto
 // source: bxsubscribe.proto
 
 
 package bxsubscribe
 package bxsubscribe
@@ -568,7 +568,6 @@ func (x *SubscribeInfo) GetSite() string {
 	return ""
 	return ""
 }
 }
 
 
-//
 type SomeInfoReq struct {
 type SomeInfoReq struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -822,7 +821,6 @@ func (x *SomeInfo) GetUserId() string {
 	return ""
 	return ""
 }
 }
 
 
-//
 type StatusResp struct {
 type StatusResp struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1084,7 +1082,7 @@ func (x *UpdateSubScribeInfoReq) GetUserId() string {
 	return ""
 	return ""
 }
 }
 
 
-//城市
+// 城市
 type CityList struct {
 type CityList struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1132,7 +1130,7 @@ func (x *CityList) GetCity() []string {
 	return nil
 	return nil
 }
 }
 
 
-//分类
+// 分类
 type Items struct {
 type Items struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1196,7 +1194,7 @@ func (x *Items) GetAKey() []*Keys {
 	return nil
 	return nil
 }
 }
 
 
-//关键词
+// 关键词
 type Keys struct {
 type Keys struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1339,7 +1337,7 @@ func (x *KeyItems) GetAKey() []*Key {
 	return nil
 	return nil
 }
 }
 
 
-//关键词
+// 关键词
 type Key struct {
 type Key struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1657,6 +1655,85 @@ func (x *GetKeyReq) GetDeptId() string {
 	return ""
 	return ""
 }
 }
 
 
+type GetDistributorReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AppId     string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
+	EntId     string `protobuf:"bytes,2,opt,name=entId,proto3" json:"entId,omitempty"`
+	EntUserId string `protobuf:"bytes,3,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+	Region    string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"`
+	SelectIds string `protobuf:"bytes,5,opt,name=selectIds,proto3" json:"selectIds,omitempty"`
+}
+
+func (x *GetDistributorReq) Reset() {
+	*x = GetDistributorReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[17]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *GetDistributorReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetDistributorReq) ProtoMessage() {}
+
+func (x *GetDistributorReq) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[17]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use GetDistributorReq.ProtoReflect.Descriptor instead.
+func (*GetDistributorReq) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{17}
+}
+
+func (x *GetDistributorReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *GetDistributorReq) GetEntId() string {
+	if x != nil {
+		return x.EntId
+	}
+	return ""
+}
+
+func (x *GetDistributorReq) GetEntUserId() string {
+	if x != nil {
+		return x.EntUserId
+	}
+	return ""
+}
+
+func (x *GetDistributorReq) GetRegion() string {
+	if x != nil {
+		return x.Region
+	}
+	return ""
+}
+
+func (x *GetDistributorReq) GetSelectIds() string {
+	if x != nil {
+		return x.SelectIds
+	}
+	return ""
+}
+
 type KeyResp struct {
 type KeyResp struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1670,7 +1747,7 @@ type KeyResp struct {
 func (x *KeyResp) Reset() {
 func (x *KeyResp) Reset() {
 	*x = KeyResp{}
 	*x = KeyResp{}
 	if protoimpl.UnsafeEnabled {
 	if protoimpl.UnsafeEnabled {
-		mi := &file_bxsubscribe_proto_msgTypes[17]
+		mi := &file_bxsubscribe_proto_msgTypes[18]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 		ms.StoreMessageInfo(mi)
 	}
 	}
@@ -1683,7 +1760,7 @@ func (x *KeyResp) String() string {
 func (*KeyResp) ProtoMessage() {}
 func (*KeyResp) ProtoMessage() {}
 
 
 func (x *KeyResp) ProtoReflect() protoreflect.Message {
 func (x *KeyResp) ProtoReflect() protoreflect.Message {
-	mi := &file_bxsubscribe_proto_msgTypes[17]
+	mi := &file_bxsubscribe_proto_msgTypes[18]
 	if protoimpl.UnsafeEnabled && x != nil {
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
 		if ms.LoadMessageInfo() == nil {
@@ -1696,7 +1773,7 @@ func (x *KeyResp) ProtoReflect() protoreflect.Message {
 
 
 // Deprecated: Use KeyResp.ProtoReflect.Descriptor instead.
 // Deprecated: Use KeyResp.ProtoReflect.Descriptor instead.
 func (*KeyResp) Descriptor() ([]byte, []int) {
 func (*KeyResp) Descriptor() ([]byte, []int) {
-	return file_bxsubscribe_proto_rawDescGZIP(), []int{17}
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{18}
 }
 }
 
 
 func (x *KeyResp) GetErrCode() int64 {
 func (x *KeyResp) GetErrCode() int64 {
@@ -1720,6 +1797,132 @@ func (x *KeyResp) GetItems() []*KeyItems {
 	return nil
 	return nil
 }
 }
 
 
+type DistributorResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ErrCode int64       `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3" json:"err_code,omitempty"`
+	ErrMsg  string      `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
+	Items   []*UserResp `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` //分发人员
+}
+
+func (x *DistributorResp) Reset() {
+	*x = DistributorResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[19]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *DistributorResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DistributorResp) ProtoMessage() {}
+
+func (x *DistributorResp) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[19]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use DistributorResp.ProtoReflect.Descriptor instead.
+func (*DistributorResp) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *DistributorResp) GetErrCode() int64 {
+	if x != nil {
+		return x.ErrCode
+	}
+	return 0
+}
+
+func (x *DistributorResp) GetErrMsg() string {
+	if x != nil {
+		return x.ErrMsg
+	}
+	return ""
+}
+
+func (x *DistributorResp) GetItems() []*UserResp {
+	if x != nil {
+		return x.Items
+	}
+	return nil
+}
+
+type UserResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+	Id    int64  `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+	Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"`
+}
+
+func (x *UserResp) Reset() {
+	*x = UserResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[20]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserResp) ProtoMessage() {}
+
+func (x *UserResp) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[20]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use UserResp.ProtoReflect.Descriptor instead.
+func (*UserResp) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{20}
+}
+
+func (x *UserResp) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *UserResp) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
+func (x *UserResp) GetPhone() string {
+	if x != nil {
+		return x.Phone
+	}
+	return ""
+}
+
 var File_bxsubscribe_proto protoreflect.FileDescriptor
 var File_bxsubscribe_proto protoreflect.FileDescriptor
 
 
 var file_bxsubscribe_proto_rawDesc = []byte{
 var file_bxsubscribe_proto_rawDesc = []byte{
@@ -1958,14 +2161,35 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6f, 0x77,
 	0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6f, 0x77,
 	0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6f,
 	0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6f,
 	0x77, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x18, 0x0d, 0x20,
 	0x77, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x18, 0x0d, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x22, 0x6a, 0x0a, 0x07, 0x4b,
-	0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f,
-	0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64,
-	0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74,
-	0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x78, 0x73, 0x75,
-	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x73,
-	0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x32, 0xbe, 0x03, 0x0a, 0x0b, 0x42, 0x78, 0x73, 0x75,
+	0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x70, 0x74, 0x49, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x11,
+	0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65,
+	0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a,
+	0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72,
+	0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67,
+	0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x49, 0x64, 0x73,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x49, 0x64,
+	0x73, 0x22, 0x6a, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08,
+	0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
+	0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d,
+	0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67,
+	0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x15, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x4b, 0x65,
+	0x79, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x72, 0x0a,
+	0x0f, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65,
+	0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72,
+	0x72, 0x4d, 0x73, 0x67, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20,
+	0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
+	0x65, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d,
+	0x73, 0x22, 0x44, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+	0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
+	0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x8e, 0x04, 0x0a, 0x0b, 0x42, 0x78, 0x73, 0x75,
 	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x75,
 	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x75,
 	0x62, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
 	0x62, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
 	0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66,
 	0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66,
@@ -1993,7 +2217,12 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x73,
 	0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x73,
 	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52,
 	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52,
 	0x65, 0x71, 0x1a, 0x14, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
 	0x65, 0x71, 0x1a, 0x14, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
-	0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x62, 0x78,
+	0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44,
+	0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x73,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74,
+	0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x62, 0x78, 0x73,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62,
+	0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x62, 0x78,
 	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x33,
 	0x33,
 }
 }
@@ -2010,7 +2239,7 @@ func file_bxsubscribe_proto_rawDescGZIP() []byte {
 	return file_bxsubscribe_proto_rawDescData
 	return file_bxsubscribe_proto_rawDescData
 }
 }
 
 
-var file_bxsubscribe_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
+var file_bxsubscribe_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
 var file_bxsubscribe_proto_goTypes = []interface{}{
 var file_bxsubscribe_proto_goTypes = []interface{}{
 	(*SubscribeInfosReq)(nil),      // 0: bxsubscribe.SubscribeInfosReq
 	(*SubscribeInfosReq)(nil),      // 0: bxsubscribe.SubscribeInfosReq
 	(*SubscribeInfosResp)(nil),     // 1: bxsubscribe.SubscribeInfosResp
 	(*SubscribeInfosResp)(nil),     // 1: bxsubscribe.SubscribeInfosResp
@@ -2029,36 +2258,42 @@ var file_bxsubscribe_proto_goTypes = []interface{}{
 	(*Key)(nil),                    // 14: bxsubscribe.Key
 	(*Key)(nil),                    // 14: bxsubscribe.Key
 	(*SetReadReq)(nil),             // 15: bxsubscribe.SetReadReq
 	(*SetReadReq)(nil),             // 15: bxsubscribe.SetReadReq
 	(*GetKeyReq)(nil),              // 16: bxsubscribe.GetKeyReq
 	(*GetKeyReq)(nil),              // 16: bxsubscribe.GetKeyReq
-	(*KeyResp)(nil),                // 17: bxsubscribe.KeyResp
-	nil,                            // 18: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
+	(*GetDistributorReq)(nil),      // 17: bxsubscribe.GetDistributorReq
+	(*KeyResp)(nil),                // 18: bxsubscribe.KeyResp
+	(*DistributorResp)(nil),        // 19: bxsubscribe.DistributorResp
+	(*UserResp)(nil),               // 20: bxsubscribe.userResp
+	nil,                            // 21: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
 }
 }
 var file_bxsubscribe_proto_depIdxs = []int32{
 var file_bxsubscribe_proto_depIdxs = []int32{
 	2,  // 0: bxsubscribe.SubscribeInfosResp.data:type_name -> bxsubscribe.subscribeData
 	2,  // 0: bxsubscribe.SubscribeInfosResp.data:type_name -> bxsubscribe.subscribeData
 	3,  // 1: bxsubscribe.subscribeData.list:type_name -> bxsubscribe.subscribeInfo
 	3,  // 1: bxsubscribe.subscribeData.list:type_name -> bxsubscribe.subscribeInfo
 	6,  // 2: bxsubscribe.SomeInfoResp.data:type_name -> bxsubscribe.SomeInfo
 	6,  // 2: bxsubscribe.SomeInfoResp.data:type_name -> bxsubscribe.SomeInfo
-	18, // 3: bxsubscribe.UpdateSubScribeInfoReq.area:type_name -> bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
+	21, // 3: bxsubscribe.UpdateSubScribeInfoReq.area:type_name -> bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
 	11, // 4: bxsubscribe.UpdateSubScribeInfoReq.items:type_name -> bxsubscribe.Items
 	11, // 4: bxsubscribe.UpdateSubScribeInfoReq.items:type_name -> bxsubscribe.Items
 	12, // 5: bxsubscribe.Items.a_key:type_name -> bxsubscribe.Keys
 	12, // 5: bxsubscribe.Items.a_key:type_name -> bxsubscribe.Keys
 	14, // 6: bxsubscribe.KeyItems.a_key:type_name -> bxsubscribe.Key
 	14, // 6: bxsubscribe.KeyItems.a_key:type_name -> bxsubscribe.Key
 	13, // 7: bxsubscribe.KeyResp.items:type_name -> bxsubscribe.KeyItems
 	13, // 7: bxsubscribe.KeyResp.items:type_name -> bxsubscribe.KeyItems
-	10, // 8: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry.value:type_name -> bxsubscribe.CityList
-	0,  // 9: bxsubscribe.Bxsubscribe.GetSubList:input_type -> bxsubscribe.SubscribeInfosReq
-	4,  // 10: bxsubscribe.Bxsubscribe.GetSubSomeInfo:input_type -> bxsubscribe.SomeInfoReq
-	9,  // 11: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:input_type -> bxsubscribe.UpdateSubScribeInfoReq
-	0,  // 12: bxsubscribe.Bxsubscribe.ByPushHistory:input_type -> bxsubscribe.SubscribeInfosReq
-	15, // 13: bxsubscribe.Bxsubscribe.SetRead:input_type -> bxsubscribe.SetReadReq
-	16, // 14: bxsubscribe.Bxsubscribe.GetKey:input_type -> bxsubscribe.GetKeyReq
-	1,  // 15: bxsubscribe.Bxsubscribe.GetSubList:output_type -> bxsubscribe.SubscribeInfosResp
-	5,  // 16: bxsubscribe.Bxsubscribe.GetSubSomeInfo:output_type -> bxsubscribe.SomeInfoResp
-	7,  // 17: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:output_type -> bxsubscribe.StatusResp
-	8,  // 18: bxsubscribe.Bxsubscribe.ByPushHistory:output_type -> bxsubscribe.ByPushHistoryResp
-	7,  // 19: bxsubscribe.Bxsubscribe.SetRead:output_type -> bxsubscribe.StatusResp
-	17, // 20: bxsubscribe.Bxsubscribe.GetKey:output_type -> bxsubscribe.KeyResp
-	15, // [15:21] is the sub-list for method output_type
-	9,  // [9:15] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
+	20, // 8: bxsubscribe.DistributorResp.items:type_name -> bxsubscribe.userResp
+	10, // 9: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry.value:type_name -> bxsubscribe.CityList
+	0,  // 10: bxsubscribe.Bxsubscribe.GetSubList:input_type -> bxsubscribe.SubscribeInfosReq
+	4,  // 11: bxsubscribe.Bxsubscribe.GetSubSomeInfo:input_type -> bxsubscribe.SomeInfoReq
+	9,  // 12: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:input_type -> bxsubscribe.UpdateSubScribeInfoReq
+	0,  // 13: bxsubscribe.Bxsubscribe.ByPushHistory:input_type -> bxsubscribe.SubscribeInfosReq
+	15, // 14: bxsubscribe.Bxsubscribe.SetRead:input_type -> bxsubscribe.SetReadReq
+	16, // 15: bxsubscribe.Bxsubscribe.GetKey:input_type -> bxsubscribe.GetKeyReq
+	17, // 16: bxsubscribe.Bxsubscribe.GetDistributor:input_type -> bxsubscribe.GetDistributorReq
+	1,  // 17: bxsubscribe.Bxsubscribe.GetSubList:output_type -> bxsubscribe.SubscribeInfosResp
+	5,  // 18: bxsubscribe.Bxsubscribe.GetSubSomeInfo:output_type -> bxsubscribe.SomeInfoResp
+	7,  // 19: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:output_type -> bxsubscribe.StatusResp
+	8,  // 20: bxsubscribe.Bxsubscribe.ByPushHistory:output_type -> bxsubscribe.ByPushHistoryResp
+	7,  // 21: bxsubscribe.Bxsubscribe.SetRead:output_type -> bxsubscribe.StatusResp
+	18, // 22: bxsubscribe.Bxsubscribe.GetKey:output_type -> bxsubscribe.KeyResp
+	19, // 23: bxsubscribe.Bxsubscribe.GetDistributor:output_type -> bxsubscribe.DistributorResp
+	17, // [17:24] is the sub-list for method output_type
+	10, // [10:17] is the sub-list for method input_type
+	10, // [10:10] is the sub-list for extension type_name
+	10, // [10:10] is the sub-list for extension extendee
+	0,  // [0:10] is the sub-list for field type_name
 }
 }
 
 
 func init() { file_bxsubscribe_proto_init() }
 func init() { file_bxsubscribe_proto_init() }
@@ -2272,6 +2507,18 @@ func file_bxsubscribe_proto_init() {
 			}
 			}
 		}
 		}
 		file_bxsubscribe_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
 		file_bxsubscribe_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GetDistributorReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxsubscribe_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*KeyResp); i {
 			switch v := v.(*KeyResp); i {
 			case 0:
 			case 0:
 				return &v.state
 				return &v.state
@@ -2283,6 +2530,30 @@ func file_bxsubscribe_proto_init() {
 				return nil
 				return nil
 			}
 			}
 		}
 		}
+		file_bxsubscribe_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*DistributorResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxsubscribe_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	}
 	type x struct{}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
@@ -2290,7 +2561,7 @@ func file_bxsubscribe_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_bxsubscribe_proto_rawDesc,
 			RawDescriptor: file_bxsubscribe_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
-			NumMessages:   19,
+			NumMessages:   22,
 			NumExtensions: 0,
 			NumExtensions: 0,
 			NumServices:   1,
 			NumServices:   1,
 		},
 		},

+ 51 - 13
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // versions:
 // - protoc-gen-go-grpc v1.2.0
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.20.0--rc2
+// - protoc             v3.19.4
 // source: bxsubscribe.proto
 // source: bxsubscribe.proto
 
 
 package bxsubscribe
 package bxsubscribe
@@ -22,18 +22,20 @@ const _ = grpc.SupportPackageIsVersion7
 //
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
 type BxsubscribeClient interface {
 type BxsubscribeClient interface {
-	//获取订阅推送列表
+	// 获取订阅推送列表
 	GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error)
 	GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error)
-	//获取订阅推送相关信息
+	// 获取订阅推送相关信息
 	GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error)
 	GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error)
-	//修改订阅信息接口
+	// 修改订阅信息接口
 	UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
 	UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//推送页面筛选导出
+	// 推送页面筛选导出
 	ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error)
 	ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error)
-	//推送数据浏览状态修改
+	// 推送数据浏览状态修改
 	SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 	SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//关键词获取
+	// 关键词获取
 	GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
 	GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
+	// 手动分发人员
+	GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
 }
 }
 
 
 type bxsubscribeClient struct {
 type bxsubscribeClient struct {
@@ -98,22 +100,33 @@ func (c *bxsubscribeClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...g
 	return out, nil
 	return out, nil
 }
 }
 
 
+func (c *bxsubscribeClient) GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error) {
+	out := new(DistributorResp)
+	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetDistributor", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // BxsubscribeServer is the server API for Bxsubscribe service.
 // BxsubscribeServer is the server API for Bxsubscribe service.
 // All implementations must embed UnimplementedBxsubscribeServer
 // All implementations must embed UnimplementedBxsubscribeServer
 // for forward compatibility
 // for forward compatibility
 type BxsubscribeServer interface {
 type BxsubscribeServer interface {
-	//获取订阅推送列表
+	// 获取订阅推送列表
 	GetSubList(context.Context, *SubscribeInfosReq) (*SubscribeInfosResp, error)
 	GetSubList(context.Context, *SubscribeInfosReq) (*SubscribeInfosResp, error)
-	//获取订阅推送相关信息
+	// 获取订阅推送相关信息
 	GetSubSomeInfo(context.Context, *SomeInfoReq) (*SomeInfoResp, error)
 	GetSubSomeInfo(context.Context, *SomeInfoReq) (*SomeInfoResp, error)
-	//修改订阅信息接口
+	// 修改订阅信息接口
 	UpdateSubScribeInfo(context.Context, *UpdateSubScribeInfoReq) (*StatusResp, error)
 	UpdateSubScribeInfo(context.Context, *UpdateSubScribeInfoReq) (*StatusResp, error)
-	//推送页面筛选导出
+	// 推送页面筛选导出
 	ByPushHistory(context.Context, *SubscribeInfosReq) (*ByPushHistoryResp, error)
 	ByPushHistory(context.Context, *SubscribeInfosReq) (*ByPushHistoryResp, error)
-	//推送数据浏览状态修改
+	// 推送数据浏览状态修改
 	SetRead(context.Context, *SetReadReq) (*StatusResp, error)
 	SetRead(context.Context, *SetReadReq) (*StatusResp, error)
-	//关键词获取
+	// 关键词获取
 	GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
 	GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
+	// 手动分发人员
+	GetDistributor(context.Context, *GetDistributorReq) (*DistributorResp, error)
 	mustEmbedUnimplementedBxsubscribeServer()
 	mustEmbedUnimplementedBxsubscribeServer()
 }
 }
 
 
@@ -139,6 +152,9 @@ func (UnimplementedBxsubscribeServer) SetRead(context.Context, *SetReadReq) (*St
 func (UnimplementedBxsubscribeServer) GetKey(context.Context, *GetKeyReq) (*KeyResp, error) {
 func (UnimplementedBxsubscribeServer) GetKey(context.Context, *GetKeyReq) (*KeyResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
 	return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
 }
 }
+func (UnimplementedBxsubscribeServer) GetDistributor(context.Context, *GetDistributorReq) (*DistributorResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetDistributor not implemented")
+}
 func (UnimplementedBxsubscribeServer) mustEmbedUnimplementedBxsubscribeServer() {}
 func (UnimplementedBxsubscribeServer) mustEmbedUnimplementedBxsubscribeServer() {}
 
 
 // UnsafeBxsubscribeServer may be embedded to opt out of forward compatibility for this service.
 // UnsafeBxsubscribeServer may be embedded to opt out of forward compatibility for this service.
@@ -260,6 +276,24 @@ func _Bxsubscribe_GetKey_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 	return interceptor(ctx, in, info, handler)
 }
 }
 
 
+func _Bxsubscribe_GetDistributor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(GetDistributorReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxsubscribeServer).GetDistributor(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxsubscribe.Bxsubscribe/GetDistributor",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxsubscribeServer).GetDistributor(ctx, req.(*GetDistributorReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Bxsubscribe_ServiceDesc is the grpc.ServiceDesc for Bxsubscribe service.
 // Bxsubscribe_ServiceDesc is the grpc.ServiceDesc for Bxsubscribe service.
 // It's only intended for direct use with grpc.RegisterService,
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
 // and not to be introspected or modified (even as a copy)
@@ -291,6 +325,10 @@ var Bxsubscribe_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetKey",
 			MethodName: "GetKey",
 			Handler:    _Bxsubscribe_GetKey_Handler,
 			Handler:    _Bxsubscribe_GetKey_Handler,
 		},
 		},
+		{
+			MethodName: "GetDistributor",
+			Handler:    _Bxsubscribe_GetDistributor_Handler,
+		},
 	},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "bxsubscribe.proto",
 	Metadata: "bxsubscribe.proto",