Переглянути джерело

Merge branch 'master' into feature/v1.1.18

lianbingjie 2 роки тому
батько
коміт
71ec3c8a77

+ 25 - 0
jyBXSubscribe/api/bxsubscribe.api

@@ -154,6 +154,27 @@ type (
 		PushValue    int64    `json:"pushValue,optional"`
 		Interested   int64    `json:"interested,optional"`
 	}
+	GetStaffSubscribeListReq {
+		AppId     string `header:"appId"`
+		EntId     int64  `header:"entId,optional"`
+		EntUserId int64  `header:"entUserId,optional"`
+		EStatus   int64  `json:"e_status,optional"`
+		PStatus   int64  `json:"p_status,optional"`
+		Search    string `json:"search,optional"`
+		PageNum   int64  `json:"pageNum,optional"`
+		PageSize  int64  `json:"pageSize,optional"`
+	}
+	GetStaffSubscribeDetailReq {
+		AppId     string `header:"appId"`
+		EntId     int64  `header:"entId,optional"`
+		EntUserId int64  `header:"entUserId,optional"`
+		Token     string `json:"token,optional"`
+	}
+	StaffSubscribeCommonResp {
+		Err_code int64       `json:"error_code"`
+		Err_msg  string      `json:"error_msg"`
+		Data     interface{} `json:"data"`
+	}
 )
 service bxsubscribe-api {
 	@handler subscribeList
@@ -182,4 +203,8 @@ service bxsubscribe-api {
 	post /jybx/subscribe/getPushSet (GetUserReq) returns (commonResp)
 	@handler setPushSet  //推送设置修改
 	post /jybx/subscribe/setPushSet (SetPushSetReq) returns (commonResp)
+	@handler getStaffSubscribeList //查询企业员工订阅状态
+	post /jybx/subscribe/getStaffSubscribe (GetStaffSubscribeListReq) returns (StaffSubscribeCommonResp)
+	@handler getStaffSubscribeDetail //查询企业员工订阅详情
+	post /jybx/subscribe/getStaffSubscribeDetail (GetStaffSubscribeDetailReq) returns (StaffSubscribeCommonResp)
 }

+ 28 - 0
jyBXSubscribe/api/internal/handler/getstaffsubscribedetailhandler.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 getStaffSubscribeDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GetStaffSubscribeDetailReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewGetStaffSubscribeDetailLogic(r.Context(), svcCtx)
+		resp, err := l.GetStaffSubscribeDetail(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 28 - 0
jyBXSubscribe/api/internal/handler/getstaffsubscribelisthandler.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 getStaffSubscribeListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GetStaffSubscribeListReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewGetStaffSubscribeListLogic(r.Context(), svcCtx)
+		resp, err := l.GetStaffSubscribeList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

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

@@ -77,6 +77,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/subscribe/setPushSet",
 				Handler: setPushSetHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/subscribe/getStaffSubscribe",
+				Handler: getStaffSubscribeListHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/subscribe/getStaffSubscribeDetail",
+				Handler: getStaffSubscribeDetailHandler(serverCtx),
+			},
 		},
 	)
 }

+ 57 - 0
jyBXSubscribe/api/internal/logic/getstaffsubscribedetaillogic.go

@@ -0,0 +1,57 @@
+package logic
+
+import (
+	"context"
+	"encoding/json"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"jyBXSubscribe/api/internal/svc"
+	"jyBXSubscribe/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetStaffSubscribeDetailLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetStaffSubscribeDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaffSubscribeDetailLogic {
+	return &GetStaffSubscribeDetailLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetStaffSubscribeDetailLogic) GetStaffSubscribeDetail(req *types.GetStaffSubscribeDetailReq) (resp *types.StaffSubscribeCommonResp, err error) {
+	res, err := l.svcCtx.Suscribe.GetStaffSubscribeDetail(l.ctx, &bxsubscribe.StaffSubscribeDetailReq{
+		EntId:     req.EntId,
+		EntUserId: req.EntUserId,
+		Token:     req.Token,
+	})
+	if err != nil {
+		return nil, err
+	}
+	if res.ErrCode != 0 {
+		return &types.StaffSubscribeCommonResp{
+			Err_code: res.ErrCode,
+			Err_msg:  res.ErrMsg,
+			Data:     nil,
+		}, nil
+	}
+	subscribeDetail := map[string]interface{}{}
+	if err := json.Unmarshal(res.Data, &subscribeDetail); err != nil {
+		return &types.StaffSubscribeCommonResp{
+			Err_code: res.ErrCode,
+			Err_msg:  "返回异常",
+			Data:     nil,
+		}, nil
+	}
+	return &types.StaffSubscribeCommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     subscribeDetail,
+	}, nil
+}

+ 56 - 0
jyBXSubscribe/api/internal/logic/getstaffsubscribelistlogic.go

@@ -0,0 +1,56 @@
+package logic
+
+import (
+	"context"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"jyBXSubscribe/api/internal/svc"
+	"jyBXSubscribe/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetStaffSubscribeListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetStaffSubscribeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaffSubscribeListLogic {
+	return &GetStaffSubscribeListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetStaffSubscribeListLogic) GetStaffSubscribeList(req *types.GetStaffSubscribeListReq) (resp *types.StaffSubscribeCommonResp, err error) {
+	res, err := l.svcCtx.Suscribe.GetStaffSubscribeList(l.ctx, &bxsubscribe.StaffSubscribeReq{
+		AppId:     req.AppId,
+		EntId:     req.EntId,
+		EntUserId: req.EntUserId,
+		Query:     req.Search,
+		EStatus:   req.EStatus,
+		PStatus:   req.PStatus,
+		PageNum:   req.PageNum,
+		PageSize:  req.PageSize,
+	})
+	if err != nil {
+		return nil, err
+	}
+	if res.ErrCode != 0 {
+		return &types.StaffSubscribeCommonResp{
+			Err_code: res.ErrCode,
+			Err_msg:  res.ErrMsg,
+			Data:     nil,
+		}, nil
+	}
+	return &types.StaffSubscribeCommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data: map[string]interface{}{
+			"total": res.Total,
+			"list":  res.Items,
+		},
+	}, nil
+}

+ 2 - 0
jyBXSubscribe/api/internal/logic/viewStatusLogic.go

@@ -46,6 +46,8 @@ func (l *ViewStatusLogic) ViewStatus(req *types.ViewStatusReq) (resp *types.Comm
 		_d["visittime"] = v.Visittime
 		_d["isvisit"] = v.Isvisit
 		_d["date"] = v.Date
+		_d["source"] = v.Source
+		_d["phone"] = v.Phone
 		data = append(data, _d)
 	}
 	return &types.CommonResp{

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

@@ -154,3 +154,27 @@ type SetPushSetReq struct {
 	PushValue    int64    `json:"pushValue,optional"`
 	Interested   int64    `json:"interested,optional"`
 }
+
+type GetStaffSubscribeListReq struct {
+	AppId     string `header:"appId"`
+	EntId     int64  `header:"entId,optional"`
+	EntUserId int64  `header:"entUserId,optional"`
+	EStatus   int64  `json:"e_status,optional"`
+	PStatus   int64  `json:"p_status,optional"`
+	Search    string `json:"search,optional"`
+	PageNum   int64  `json:"pageNum,optional"`
+	PageSize  int64  `json:"pageSize,optional"`
+}
+
+type GetStaffSubscribeDetailReq struct {
+	AppId     string `header:"appId"`
+	EntId     int64  `header:"entId,optional"`
+	EntUserId int64  `header:"entUserId,optional"`
+	Token     string `json:"token,optional"`
+}
+
+type StaffSubscribeCommonResp struct {
+	Err_code int64       `json:"error_code"`
+	Err_msg  string      `json:"error_msg"`
+	Data     interface{} `json:"data"`
+}

+ 2 - 1
jyBXSubscribe/rpc/bxsubscribe.go

@@ -27,6 +27,7 @@ var dbFile = flag.String("df", "etc/db.yaml", "the db file")
 var logFile = flag.String("lf", "etc/logs.yaml", "the log file")
 
 func main() {
+
 	//初始化基本配置
 	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("etc/config.yaml")
 	conf.MustLoad(*configF, &IC.C)
@@ -35,7 +36,7 @@ func main() {
 	//初始化日志信息
 	conf.MustLoad(*logFile, &IC.Logc)
 	IC.InitC()
-	//
+
 	go func() {
 		err := endless.ListenAndServe(":"+MC.InterfaceToStr(IC.C.Webrpcport), nil, func() {})
 		if err != nil {

+ 47 - 2
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -1,5 +1,5 @@
 syntax = "proto3";
-
+import "google/protobuf/struct.proto";
 package bxsubscribe;
 option go_package = "./bxsubscribe";
 
@@ -273,6 +273,8 @@ message UserStatus {
   int64 isvisit = 3;
   string visittime = 4;
   string date = 5;
+  string phone =6;
+  int64 source =7;
 }
 message GetUserInfoReq{
   string  appId = 1;
@@ -334,7 +336,7 @@ message PushSet{
   int64 isMailShow=8;
 }
 message SetPushSetReq{
-  string  appId = 1;
+  string appId = 1;
   int64  entId = 2;
   int64  entUserId = 3;
   string  userId = 4;
@@ -348,6 +350,45 @@ message SetPushSetReq{
   int64 interested = 12;
 }
 
+message StaffSubscribeReq {
+  string appId = 1;
+  int64  entId = 2;
+  int64  entUserId = 3;
+  string query = 4;
+  int64 eStatus = 6;
+  int64 pStatus = 7;
+  int64 pageNum = 8;
+  int64 pageSize =9;
+}
+
+
+message StaffSubscribeListResp {
+  int64 err_code = 1;
+  string err_msg = 2;
+  int64 total =3;
+  repeated StaffSubscribe items = 4;
+}
+message StaffSubscribe {
+  string token = 1;
+  string name = 2;
+  string phone = 3;
+  int64 eStatus = 4;
+  int64 pStatus = 5;
+}
+
+message StaffSubscribeDetailReq{
+  int64  entId = 1;
+  int64  entUserId = 2;
+  string  token =3;
+}
+
+message StaffSubscribeDetail{
+  int64 err_code = 1;
+  string err_msg = 2;
+  bytes  data =3;
+}
+
+
 
 service Bxsubscribe {
   //获取订阅推送列表
@@ -378,4 +419,8 @@ service Bxsubscribe {
   rpc getPushSet(GetPushSetReq)returns(GetPushSetResp);
   //用户推送设置修改
   rpc setPushSet(SetPushSetReq)returns(StatusResp);
+  //查看企业员工用户订阅
+  rpc getStaffSubscribeList(StaffSubscribeReq)returns(StaffSubscribeListResp);
+  //查看企业员工用户订阅详情
+  rpc getStaffSubscribeDetail(StaffSubscribeDetailReq)returns(StaffSubscribeDetail);
 }

+ 60 - 39
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -13,45 +13,50 @@ import (
 )
 
 type (
-	ByPushHistoryResp      = bxsubscribe.ByPushHistoryResp
-	CityList               = bxsubscribe.CityList
-	DistributorResp        = bxsubscribe.DistributorResp
-	GetDistributorReq      = bxsubscribe.GetDistributorReq
-	GetKeyReq              = bxsubscribe.GetKeyReq
-	GetPushSetReq          = bxsubscribe.GetPushSetReq
-	GetPushSetResp         = bxsubscribe.GetPushSetResp
-	GetUserInfo            = bxsubscribe.GetUserInfo
-	GetUserInfoReq         = bxsubscribe.GetUserInfoReq
-	GetUserInfoResq        = bxsubscribe.GetUserInfoResq
-	GetViewStatusReq       = bxsubscribe.GetViewStatusReq
-	Items                  = bxsubscribe.Items
-	Key                    = bxsubscribe.Key
-	KeyItems               = bxsubscribe.KeyItems
-	KeyResp                = bxsubscribe.KeyResp
-	Keys                   = bxsubscribe.Keys
-	List                   = bxsubscribe.List
-	MsgDistributorReq      = bxsubscribe.MsgDistributorReq
-	PushSet                = bxsubscribe.PushSet
-	SetPushSetReq          = bxsubscribe.SetPushSetReq
-	SetReadReq             = bxsubscribe.SetReadReq
-	SetUserInfoReq         = bxsubscribe.SetUserInfoReq
-	SomeInfo               = bxsubscribe.SomeInfo
-	SomeInfoReq            = bxsubscribe.SomeInfoReq
-	SomeInfoResp           = bxsubscribe.SomeInfoResp
-	StatusResp             = bxsubscribe.StatusResp
-	Subscribe              = bxsubscribe.Subscribe
-	SubscribeData          = bxsubscribe.SubscribeData
-	SubscribeInfo          = bxsubscribe.SubscribeInfo
-	SubscribeInfosReq      = bxsubscribe.SubscribeInfosReq
-	SubscribeInfosResp     = bxsubscribe.SubscribeInfosResp
-	TimeJson               = bxsubscribe.TimeJson
-	UpdateSubScribeInfoReq = bxsubscribe.UpdateSubScribeInfoReq
-	UserReq                = bxsubscribe.UserReq
-	UserResp               = bxsubscribe.UserResp
-	UserResq               = bxsubscribe.UserResq
-	UserStatus             = bxsubscribe.UserStatus
-	ViewStatusResp         = bxsubscribe.ViewStatusResp
-	WinnerInfo             = bxsubscribe.WinnerInfo
+	ByPushHistoryResp       = bxsubscribe.ByPushHistoryResp
+	CityList                = bxsubscribe.CityList
+	DistributorResp         = bxsubscribe.DistributorResp
+	GetDistributorReq       = bxsubscribe.GetDistributorReq
+	GetKeyReq               = bxsubscribe.GetKeyReq
+	GetPushSetReq           = bxsubscribe.GetPushSetReq
+	GetPushSetResp          = bxsubscribe.GetPushSetResp
+	GetUserInfo             = bxsubscribe.GetUserInfo
+	GetUserInfoReq          = bxsubscribe.GetUserInfoReq
+	GetUserInfoResq         = bxsubscribe.GetUserInfoResq
+	GetViewStatusReq        = bxsubscribe.GetViewStatusReq
+	Items                   = bxsubscribe.Items
+	Key                     = bxsubscribe.Key
+	KeyItems                = bxsubscribe.KeyItems
+	KeyResp                 = bxsubscribe.KeyResp
+	Keys                    = bxsubscribe.Keys
+	List                    = bxsubscribe.List
+	MsgDistributorReq       = bxsubscribe.MsgDistributorReq
+	PushSet                 = bxsubscribe.PushSet
+	SetPushSetReq           = bxsubscribe.SetPushSetReq
+	SetReadReq              = bxsubscribe.SetReadReq
+	SetUserInfoReq          = bxsubscribe.SetUserInfoReq
+	SomeInfo                = bxsubscribe.SomeInfo
+	SomeInfoReq             = bxsubscribe.SomeInfoReq
+	SomeInfoResp            = bxsubscribe.SomeInfoResp
+	StaffSubscribe          = bxsubscribe.StaffSubscribe
+	StaffSubscribeDetail    = bxsubscribe.StaffSubscribeDetail
+	StaffSubscribeDetailReq = bxsubscribe.StaffSubscribeDetailReq
+	StaffSubscribeListResp  = bxsubscribe.StaffSubscribeListResp
+	StaffSubscribeReq       = bxsubscribe.StaffSubscribeReq
+	StatusResp              = bxsubscribe.StatusResp
+	Subscribe               = bxsubscribe.Subscribe
+	SubscribeData           = bxsubscribe.SubscribeData
+	SubscribeInfo           = bxsubscribe.SubscribeInfo
+	SubscribeInfosReq       = bxsubscribe.SubscribeInfosReq
+	SubscribeInfosResp      = bxsubscribe.SubscribeInfosResp
+	TimeJson                = bxsubscribe.TimeJson
+	UpdateSubScribeInfoReq  = bxsubscribe.UpdateSubScribeInfoReq
+	UserReq                 = bxsubscribe.UserReq
+	UserResp                = bxsubscribe.UserResp
+	UserResq                = bxsubscribe.UserResq
+	UserStatus              = bxsubscribe.UserStatus
+	ViewStatusResp          = bxsubscribe.ViewStatusResp
+	WinnerInfo              = bxsubscribe.WinnerInfo
 
 	Bxsubscribe interface {
 		// 获取订阅推送列表
@@ -82,6 +87,10 @@ type (
 		GetPushSet(ctx context.Context, in *GetPushSetReq, opts ...grpc.CallOption) (*GetPushSetResp, error)
 		// 用户推送设置修改
 		SetPushSet(ctx context.Context, in *SetPushSetReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 查看企业员工用户订阅
+		GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error)
+		// 查看企业员工用户订阅详情
+		GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error)
 	}
 
 	defaultBxsubscribe struct {
@@ -178,3 +187,15 @@ func (m *defaultBxsubscribe) SetPushSet(ctx context.Context, in *SetPushSetReq,
 	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
 	return client.SetPushSet(ctx, in, opts...)
 }
+
+// 查看企业员工用户订阅
+func (m *defaultBxsubscribe) GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetStaffSubscribeList(ctx, in, opts...)
+}
+
+// 查看企业员工用户订阅详情
+func (m *defaultBxsubscribe) GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetStaffSubscribeDetail(ctx, in, opts...)
+}

+ 201 - 0
jyBXSubscribe/rpc/bxsubscribeclient/bxsubscribe.go

@@ -0,0 +1,201 @@
+// Code generated by goctl. DO NOT EDIT.
+// Source: bxsubscribe.proto
+
+package bxsubscribeclient
+
+import (
+	"context"
+
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
+)
+
+type (
+	ByPushHistoryResp       = bxsubscribe.ByPushHistoryResp
+	CityList                = bxsubscribe.CityList
+	DistributorResp         = bxsubscribe.DistributorResp
+	GetDistributorReq       = bxsubscribe.GetDistributorReq
+	GetKeyReq               = bxsubscribe.GetKeyReq
+	GetPushSetReq           = bxsubscribe.GetPushSetReq
+	GetPushSetResp          = bxsubscribe.GetPushSetResp
+	GetUserInfo             = bxsubscribe.GetUserInfo
+	GetUserInfoReq          = bxsubscribe.GetUserInfoReq
+	GetUserInfoResq         = bxsubscribe.GetUserInfoResq
+	GetViewStatusReq        = bxsubscribe.GetViewStatusReq
+	Items                   = bxsubscribe.Items
+	Key                     = bxsubscribe.Key
+	KeyItems                = bxsubscribe.KeyItems
+	KeyResp                 = bxsubscribe.KeyResp
+	Keys                    = bxsubscribe.Keys
+	List                    = bxsubscribe.List
+	MsgDistributorReq       = bxsubscribe.MsgDistributorReq
+	PushSet                 = bxsubscribe.PushSet
+	SetPushSetReq           = bxsubscribe.SetPushSetReq
+	SetReadReq              = bxsubscribe.SetReadReq
+	SetUserInfoReq          = bxsubscribe.SetUserInfoReq
+	SomeInfo                = bxsubscribe.SomeInfo
+	SomeInfoReq             = bxsubscribe.SomeInfoReq
+	SomeInfoResp            = bxsubscribe.SomeInfoResp
+	StaffSubscribe          = bxsubscribe.StaffSubscribe
+	StaffSubscribeDetail    = bxsubscribe.StaffSubscribeDetail
+	StaffSubscribeDetailReq = bxsubscribe.StaffSubscribeDetailReq
+	StaffSubscribeListResp  = bxsubscribe.StaffSubscribeListResp
+	StaffSubscribeReq       = bxsubscribe.StaffSubscribeReq
+	StatusResp              = bxsubscribe.StatusResp
+	Subscribe               = bxsubscribe.Subscribe
+	SubscribeData           = bxsubscribe.SubscribeData
+	SubscribeInfo           = bxsubscribe.SubscribeInfo
+	SubscribeInfosReq       = bxsubscribe.SubscribeInfosReq
+	SubscribeInfosResp      = bxsubscribe.SubscribeInfosResp
+	TimeJson                = bxsubscribe.TimeJson
+	UpdateSubScribeInfoReq  = bxsubscribe.UpdateSubScribeInfoReq
+	UserReq                 = bxsubscribe.UserReq
+	UserResp                = bxsubscribe.UserResp
+	UserResq                = bxsubscribe.UserResq
+	UserStatus              = bxsubscribe.UserStatus
+	ViewStatusResp          = bxsubscribe.ViewStatusResp
+	WinnerInfo              = bxsubscribe.WinnerInfo
+
+	Bxsubscribe interface {
+		// 获取订阅推送列表
+		GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error)
+		// 获取订阅推送相关信息
+		GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error)
+		// 修改订阅信息接口
+		UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 推送页面筛选导出
+		ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error)
+		// 推送数据浏览状态修改
+		SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 关键词获取
+		GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
+		// 订阅设置获取
+		GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error)
+		// 信息分发
+		MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 手动分发人员查询
+		GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
+		// 查看状态
+		GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error)
+		// 用户推送信息查看
+		UserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResq, error)
+		// 用户邮箱保存
+		SetUser(ctx context.Context, in *SetUserInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 用户推送设置查看
+		GetPushSet(ctx context.Context, in *GetPushSetReq, opts ...grpc.CallOption) (*GetPushSetResp, error)
+		// 用户推送设置修改
+		SetPushSet(ctx context.Context, in *SetPushSetReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 查看企业员工用户订阅
+		GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error)
+		// 查看企业员工用户订阅详情
+		GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error)
+	}
+
+	defaultBxsubscribe struct {
+		cli zrpc.Client
+	}
+)
+
+func NewBxsubscribe(cli zrpc.Client) Bxsubscribe {
+	return &defaultBxsubscribe{
+		cli: cli,
+	}
+}
+
+// 获取订阅推送列表
+func (m *defaultBxsubscribe) GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetSubList(ctx, in, opts...)
+}
+
+// 获取订阅推送相关信息
+func (m *defaultBxsubscribe) GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetSubSomeInfo(ctx, in, opts...)
+}
+
+// 修改订阅信息接口
+func (m *defaultBxsubscribe) UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.UpdateSubScribeInfo(ctx, in, opts...)
+}
+
+// 推送页面筛选导出
+func (m *defaultBxsubscribe) ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.ByPushHistory(ctx, in, opts...)
+}
+
+// 推送数据浏览状态修改
+func (m *defaultBxsubscribe) SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.SetRead(ctx, in, opts...)
+}
+
+// 关键词获取
+func (m *defaultBxsubscribe) GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetKey(ctx, in, opts...)
+}
+
+// 订阅设置获取
+func (m *defaultBxsubscribe) GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetSubScribeInfo(ctx, in, opts...)
+}
+
+// 信息分发
+func (m *defaultBxsubscribe) MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.MsgDistributor(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...)
+}
+
+// 查看状态
+func (m *defaultBxsubscribe) GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetViewStatus(ctx, in, opts...)
+}
+
+// 用户推送信息查看
+func (m *defaultBxsubscribe) UserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResq, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.UserInfo(ctx, in, opts...)
+}
+
+// 用户邮箱保存
+func (m *defaultBxsubscribe) SetUser(ctx context.Context, in *SetUserInfoReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.SetUser(ctx, in, opts...)
+}
+
+// 用户推送设置查看
+func (m *defaultBxsubscribe) GetPushSet(ctx context.Context, in *GetPushSetReq, opts ...grpc.CallOption) (*GetPushSetResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetPushSet(ctx, in, opts...)
+}
+
+// 用户推送设置修改
+func (m *defaultBxsubscribe) SetPushSet(ctx context.Context, in *SetPushSetReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.SetPushSet(ctx, in, opts...)
+}
+
+// 查看企业员工用户订阅
+func (m *defaultBxsubscribe) GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetStaffSubscribeList(ctx, in, opts...)
+}
+
+// 查看企业员工用户订阅详情
+func (m *defaultBxsubscribe) GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetStaffSubscribeDetail(ctx, in, opts...)
+}

+ 43 - 0
jyBXSubscribe/rpc/internal/logic/getstaffsubscribedetaillogic.go

@@ -0,0 +1,43 @@
+package logic
+
+import (
+	"context"
+	"github.com/gogf/gf/v2/util/gconv"
+	"jyBXSubscribe/rpc/model"
+
+	"jyBXSubscribe/rpc/internal/svc"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetStaffSubscribeDetailLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetStaffSubscribeDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaffSubscribeDetailLogic {
+	return &GetStaffSubscribeDetailLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// GetStaffSubscribeDetail 查看企业员工用户订阅详情
+func (l *GetStaffSubscribeDetailLogic) GetStaffSubscribeDetail(in *bxsubscribe.StaffSubscribeDetailReq) (*bxsubscribe.StaffSubscribeDetail, error) {
+	rData, err := model.GetStaffSubscribeDetail(in.EntId, in.EntUserId, in.Token)
+	if err != nil {
+		return &bxsubscribe.StaffSubscribeDetail{
+			ErrCode: -1,
+			ErrMsg:  err.Error(),
+			Data:    nil,
+		}, nil
+	}
+	return &bxsubscribe.StaffSubscribeDetail{
+		ErrCode: 0,
+		ErrMsg:  "",
+		Data:    gconv.Bytes(rData),
+	}, nil
+}

+ 38 - 0
jyBXSubscribe/rpc/internal/logic/getstaffsubscribelistlogic.go

@@ -0,0 +1,38 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	"github.com/gogf/gf/v2/util/gconv"
+	"jyBXSubscribe/rpc/model"
+
+	"jyBXSubscribe/rpc/internal/svc"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetStaffSubscribeListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetStaffSubscribeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaffSubscribeListLogic {
+	return &GetStaffSubscribeListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// GetStaffSubscribeList 查看企业员工用户订阅
+func (l *GetStaffSubscribeListLogic) GetStaffSubscribeList(in *bxsubscribe.StaffSubscribeReq) (*bxsubscribe.StaffSubscribeListResp, error) {
+	pNum := common.Int64All(common.If(in.PageNum < 0, 0, in.PageNum))
+	pSize := common.Int64All(common.If(in.PageSize != 0, in.PageSize, 5))
+	total, list := model.GetStaffSubscribeList(gconv.Int(in.EntId), gconv.Int(in.EntUserId), in.Query, in.EStatus, in.PStatus, pNum, pSize)
+	return &bxsubscribe.StaffSubscribeListResp{
+		Total: total,
+		Items: list,
+	}, nil
+}

+ 11 - 6
jyBXSubscribe/rpc/internal/logic/getviewstatuslogic.go

@@ -43,7 +43,7 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 	in.InfoId = util.DecodeId(in.InfoId)
 	log.Println("查看状态参数", in)
 	res := new(bxsubscribe.ViewStatusResp)
-	finsql = `SELECT userid,isvisit,visittime,date FROM pushentniche where  infoid =? and source in (2,3) order By date asc`
+	finsql = `SELECT userid,isvisit,visittime,date,source FROM pushentniche where  infoid =?  order By date asc`
 	if user.Role_admin_department {
 		users = model.GetDisUsers(common.IntAll(in.EntId), user.Dept.Id)
 		if users != nil && len(*users) > 0 {
@@ -60,20 +60,22 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 		users = model.GetEntUsers(common.IntAll(in.EntId))
 	}
 	if len(ss) > 0 {
-		finsql = fmt.Sprintf(`SELECT userid,isvisit,visittime,date FROM pushentniche where  infoid =? and source in (2,3) %s order By date asc`, fmt.Sprintf(`and userid in (%s)`, strings.Join(ss, ",")))
+		finsql = fmt.Sprintf(`SELECT userid,isvisit,visittime,date,source FROM pushentniche where  infoid =?  %s order By date asc`, fmt.Sprintf(`and userid in (%s)`, strings.Join(ss, ",")))
 	}
 	data := IC.BaseServiceMysql.SelectBySql(finsql, in.InfoId)
-	userMap := make(map[int]string)
+	userMap := make(map[int]*model.User)
 	for _, u := range *users {
-		userMap[u.Id] = u.Name
+		if u != nil {
+			userMap[u.Id] = u
+		}
 	}
 	if data != nil && len(*data) > 0 {
 		//d := make(map[string]int)
 		for _, v := range *data {
 			userid := common.IntAll(v["userid"])
-			if name, ok := userMap[userid]; ok && name != "" {
+			if u, ok := userMap[userid]; ok && u != nil {
 				var da bxsubscribe.UserStatus
-				da.Name = name
+				da.Name = u.Name
 				da.Isvisit = common.Int64All(v["isvisit"])
 				visittime := common.InterfaceToStr(v["visittime"])
 				date := common.Int64All(v["date"])
@@ -82,6 +84,8 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 				}
 				da.Visittime = visittime
 				da.Id = common.Int64All(userid)
+				da.Phone = u.Phone
+				da.Source = common.Int64All(v["source"])
 				res.Items = append(res.Items, &da)
 				//if _, ok1 := d[common.InterfaceToStr(userid)]; !ok1 {
 				//	res.Items = append(res.Items, &da)
@@ -90,6 +94,7 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 			}
 		}
 	}
+	log.Println("查看输出结果参数", res)
 	//Reverse(&res.Items)
 	return res, nil
 }

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

@@ -105,3 +105,15 @@ func (s *BxsubscribeServer) SetPushSet(ctx context.Context, in *bxsubscribe.SetP
 	l := logic.NewSetPushSetLogic(ctx, s.svcCtx)
 	return l.SetPushSet(in)
 }
+
+// 查看企业员工用户订阅
+func (s *BxsubscribeServer) GetStaffSubscribeList(ctx context.Context, in *bxsubscribe.StaffSubscribeReq) (*bxsubscribe.StaffSubscribeListResp, error) {
+	l := logic.NewGetStaffSubscribeListLogic(ctx, s.svcCtx)
+	return l.GetStaffSubscribeList(in)
+}
+
+// 查看企业员工用户订阅详情
+func (s *BxsubscribeServer) GetStaffSubscribeDetail(ctx context.Context, in *bxsubscribe.StaffSubscribeDetailReq) (*bxsubscribe.StaffSubscribeDetail, error) {
+	l := logic.NewGetStaffSubscribeDetailLogic(ctx, s.svcCtx)
+	return l.GetStaffSubscribeDetail(in)
+}

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

@@ -91,6 +91,7 @@ func Distributor(region []string, entId, entUserId int) []*User {
 				data, _ := IC.Mgo.Find("entniche_rule", map[string]interface{}{
 					"i_userid": v.Id,
 					"i_entid":  entId,
+					"i_type":   1,
 				}, "", nil, false, -1, 1)
 				for _, value := range *data {
 					o_entniche := common.ObjToMap(value["o_entniche"])

+ 17 - 25
jyBXSubscribe/rpc/model/push.go

@@ -536,7 +536,18 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				querys = append(querys, fmt.Sprintf("b.isvalidfile =0 "))
 			}
 		}
-
+		// 是否已读
+		if spqp.IsRead != "" {
+			if spqp.IsRead == "0" {
+				userStr += " and a.isvisit IS NULL"
+			} else if spqp.IsRead == "1" {
+				userStr += " and a.isvisit=1"
+			}
+		}
+		// 信息来源
+		if spqp.Source == "1" || spqp.Source == "2" || spqp.Source == "3" {
+			userStr += " and a.source=" + spqp.Source
+		}
 		if spqp.IsEnt {
 			var staffs []string
 			userStr += fmt.Sprintf(" and  a.entid='%s' ", spqp.EntId)
@@ -568,20 +579,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			} else if len(spqp.Staffs) > 0 {
 				staffs = spqp.Staffs
 			}
-			//老板商机管理需要查询全部来源
-			isNew := true
-			//商机管理判断
-			newCount := IC.MainMysql.CountBySql("select  count(id) from  entniche_info where  id =? and  isNew != 1 and  status=1", spqp.EntId)
-			if newCount > 0 {
-				isNew = false
-			}
 			// 无查询分配人员、是否已读
 			if spqp.IsRead == "" && len(staffs) == 0 {
 				//查询数量(需要去重)
-				countSql = fmt.Sprintf("select count(1) from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))
+				countSql = fmt.Sprintf("select count(1) from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr)
 				//列表查询
-				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count from %s a STRAIGHT_JOIN %s b ON a.infoid = b.infoid  %s where  %s %s %s order by a.date desc,a.id desc",
-					aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))
+				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count, IF(a.source is NULL,1,a.source) as  source  from %s a STRAIGHT_JOIN %s b ON a.infoid = b.infoid  %s where  %s %s order by a.date desc,a.id desc",
+					aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr)
 			} else {
 				//查询分配人员或是否已读
 				staffQuery := " 1=1 "
@@ -595,23 +599,11 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 						staffQuery += " and a.isvisit=1"
 					}
 				}
-				countSql = fmt.Sprintf("select count(1) from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s %s and ((%s) or EXISTS (SELECT 1 from %s c STRAIGHT_JOIN %s b ON c.infoid = b.infoid  %s WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) ", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""), staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
+				countSql = fmt.Sprintf("select count(1) from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s and %s ", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, staffQuery)
 				//列表查询
-				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s %s and ((%s) or EXISTS (SELECT 1 from %s c STRAIGHT_JOIN %s b ON c.infoid = b.infoid  %s WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""), staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
+				findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count,IF(a.source is NULL,1,a.source) as  source from %s a STRAIGHT_JOIN %s b ON  a.infoid = b.infoid  %s where %s %s and %s order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, leftJoinStr, strings.Join(querys, " and "), userStr, staffQuery)
 			}
 		} else {
-			// 是否已读
-			if spqp.IsRead != "" {
-				if spqp.IsRead == "0" {
-					userStr += " and a.isvisit IS NULL"
-				} else if spqp.IsRead == "1" {
-					userStr += " and a.isvisit=1"
-				}
-			}
-			// 信息来源
-			if spqp.Source == "1" || spqp.Source == "2" || spqp.Source == "3" {
-				userStr += " and a.source=" + spqp.Source
-			}
 			if spqp.PositionType == 1 {
 				//企业主体是企业的个人查询
 				if spqp.UserType == SubVipFlag {

+ 409 - 0
jyBXSubscribe/rpc/model/staffSubscribe.go

@@ -0,0 +1,409 @@
+package model
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	IC "jyBXSubscribe/rpc/init"
+	"jyBXSubscribe/rpc/type/bxsubscribe"
+	"strings"
+	"time"
+)
+
+// PersonSubscribe 个人订阅结构体
+type PersonSubscribe struct {
+	AInfotype     []string            `json:"a_infotype"`
+	ABuyerclass   []string            `json:"a_buyerclass"`
+	IProjectmatch int                 `json:"i_projectmatch"`
+	OArea         map[string][]string `json:"o_area"`
+	AItems        []struct {
+		SItem string `json:"s_item"`
+		AKey  []struct {
+			Key      []string `json:"key"`
+			Notkey   []string `json:"notkey"`
+			Matchway float64  `json:"matchway"`
+		} `json:"a_key"`
+	} `json:"a_items"`
+	IEntFastimport int `json:"i_ent_fastimport"`
+	IApppush       int `json:"i_apppush"`
+	IMailpush      int `json:"i_mailpush"`
+	IMatchway      int `json:"i_matchway"`
+	IRatemode      int `json:"i_ratemode"`
+}
+
+// IsEmpty 判断订阅内容是否为空
+func (p *PersonSubscribe) IsEmpty() bool {
+	if len(p.AInfotype) > 0 || len(p.ABuyerclass) > 0 || len(p.OArea) > 0 {
+		return false
+	}
+	// 遍历订阅词
+	for _, item := range p.AItems {
+		for _, key := range item.AKey {
+			if len(key.Key) > 0 || len(key.Notkey) > 0 {
+				return false
+			}
+		}
+	}
+	return true
+}
+
+// GetStaffSubscribeList 员工订阅总览列表
+// query 检索名字/手机号
+// eStatus 是否有企业订阅 -1 无企业订阅 1 有企业订阅
+// pStatus 是否有个人订阅 -1 无个人订阅 1 有个人订阅
+func GetStaffSubscribeList(entId, entUserId int, query string, eStatus, pStatus, pageNum, pageSize int64) (total int64, list []*bxsubscribe.StaffSubscribe) {
+	userEnt := EntInfo(entId, entUserId)
+	// 非管理员无权限查询
+	if !(userEnt.Role_admin_system || userEnt.Role_admin_department) {
+		return
+	}
+	// 当检索是否有个人订阅时,因为无法关联查询,需要提前加载员工是否有个人订阅
+	pSubscribeList := getEntPersonOrderList(entId)
+	// 加载当前企业所有企业分发数据
+	ruleIds := getEntSubscirbeList(entId, userEnt.Dept.Id, userEnt.Role_admin_system)
+
+	allRule := ""
+	if len(ruleIds) > 0 {
+		allRule = " AND b.rule_id in ('" + strings.Join(ruleIds, "','") + "')"
+	} else {
+		allRule = " AND b.rule_id is NULL "
+	}
+
+	var sql string = ` FROM (
+	SELECT
+		a.id,
+		a.name,
+		a.phone,
+		b.rule_id,
+		a.createtime,
+		GROUP_CONCAT( a.product_type ) AS product_type 
+	FROM
+		(
+		SELECT
+			u.id,
+			u.NAME,
+			u.phone,
+			'e' AS product_type,
+			u.createtime
+		FROM
+			entniche_info a
+			INNER JOIN entniche_user u ON ( a.id = ? AND a.STATUS = 1 AND u.power = 1 AND a.id = u.ent_id ) 
+			%s
+			UNION
+		SELECT
+			u.id,
+			u.NAME,
+			u.phone,
+			IF ( instr( a.product_type, 'v' )> 0, 'v', 'm' ) AS product_type ,
+			u.createtime
+		FROM
+			entniche_wait_empower a
+			INNER JOIN entniche_power b ON ( a.ent_id = ? AND a.end_time > ? AND b.STATUS = 1 AND a.id = b.wait_empower_id )
+			INNER JOIN entniche_user u ON ( b.ent_user_id = u.id ) 
+			%s
+		) a
+		LEFT JOIN entniche_user_rule b ON ( a.id = b.user_id %s)
+	GROUP BY
+		a.id,
+		a.NAME,
+		a.phone,
+		b.rule_id,
+		a.createtime
+) as AllData 
+WHERE`
+
+	queryArr, valueArr := []string{" 1=1 "}, []interface{}{}
+	nowStr := time.Now().Format(date.Date_Full_Layout)
+	if userEnt.Role_admin_system { //企业管理员
+		sql = fmt.Sprintf(sql, "", "", allRule)
+		valueArr = append(valueArr, entId, entId, nowStr)
+	} else { //部门管理员
+		limit := fmt.Sprintf(" INNER JOIN entniche_department_user d ON ( d.user_id = u.id) WHERE d.dept_id =? ")
+		sql = fmt.Sprintf(sql, limit, limit, allRule)
+		valueArr = append(valueArr, entId, userEnt.Dept.Id, entId, nowStr, userEnt.Dept.Id)
+	}
+
+	// 查询条件过滤
+	if query = strings.TrimSpace(query); query != "" {
+		queryArr = append(queryArr, ` ( name LIKE ? or phone like ? ) `)
+		valueArr = append(valueArr, "%"+query+"%", "%"+query+"%")
+	}
+	// 企业分发过滤
+	if eStatus == 1 && len(ruleIds) == 0 {
+		return 0, nil
+	} else if eStatus != 0 && len(ruleIds) > 0 {
+		if eStatus == 1 { //有个人订阅
+			tStr := ``
+			for i, v := range ruleIds {
+				if i != 0 {
+					tStr += `,`
+				}
+				tStr += fmt.Sprintf(`"%s"`, v)
+			}
+			queryArr = append(queryArr, fmt.Sprintf(` rule_id in ( %s ) `, tStr))
+		} else if eStatus == -1 { //无个人订阅
+			queryArr = append(queryArr, ` rule_id is NULL `)
+		}
+	}
+	// 个人订阅过滤
+	if pStatus == 1 && len(pSubscribeList) == 0 {
+		return 0, nil
+	} else if pStatus != 0 && len(pSubscribeList) > 0 {
+		tStr := ``
+		for i, v := range pSubscribeList {
+			if i != 0 {
+				tStr += `,`
+			}
+			tStr += fmt.Sprintf("%d", v)
+		}
+
+		if pStatus == 1 { //有个人订阅
+			queryArr = append(queryArr, fmt.Sprintf(` id in ( %s ) `, tStr))
+		} else if pStatus == -1 { //无个人订阅
+			queryArr = append(queryArr, fmt.Sprintf(` id not in ( %s ) `, tStr))
+		}
+	}
+
+	countSql := fmt.Sprintf("SELECT count(id) %s  %s", sql, strings.Join(queryArr, " AND "))
+	total = IC.MainMysql.CountBySql(countSql, valueArr...)
+	if total > 0 {
+		finalSql := fmt.Sprintf("SELECT * %s  %s ORDER BY createtime DESC  LIMIT %d,%d", sql, strings.Join(queryArr, " AND "), common.If(pageNum >= 0, pageNum, 0).(int64)*pageSize, pageSize)
+		finalRes := IC.MainMysql.SelectBySql(finalSql, valueArr...)
+		if finalRes != nil && len(*finalRes) > 0 {
+			for _, m := range *finalRes {
+				eUser := common.Int64All(m["id"])
+				hasPersonSubscribe := false
+				for _, pid := range pSubscribeList {
+					if pid == eUser {
+						hasPersonSubscribe = true
+						break
+					}
+				}
+				list = append(list, &bxsubscribe.StaffSubscribe{
+					Token:   encodeSubscribeMsg(gconv.Int64(entId), gconv.Int64(entUserId), gconv.Int64(m["id"]), common.ObjToString(m["rule_id"]), gconv.String(m["product_type"])),
+					Name:    common.ObjToString(m["name"]),
+					Phone:   common.ObjToString(m["phone"]),
+					EStatus: gconv.Int64(common.If(common.ObjToString(m["rule_id"]) == "", -1, 1)),
+					PStatus: gconv.Int64(common.If(hasPersonSubscribe, 1, -1)),
+				})
+			}
+		}
+	}
+	return
+}
+
+// getEntPersonOrderList 查询企业订阅所有设置个人订阅的列表
+func getEntPersonOrderList(entId int) (uIds []int64) {
+	res, _ := IC.Mgo.Find("entniche_rule", map[string]interface{}{"i_entid": entId, "i_userid": map[string]interface{}{"$exists": 1}, "i_type": map[string]interface{}{"$exists": 1}}, nil, `{"o_entniche":1,"i_userid":1}`, false, -1, -1)
+	if res == nil || len(*res) == 0 {
+		return
+	}
+	for _, mData := range *res {
+		uId := common.Int64All(mData["i_userid"])
+		if uId <= 0 {
+			continue
+		}
+		thisSub := &PersonSubscribe{}
+		if gconv.Struct(mData["o_entniche"], thisSub) == nil {
+			if !thisSub.IsEmpty() {
+				uIds = append(uIds, uId)
+			}
+		}
+	}
+	return
+}
+
+// getEntSubscirbeList 查询企业分发列表
+func getEntSubscirbeList(entId, depId int, isAdmin bool) (rId []string) {
+	//查询是否有企业分发
+	dept_subscribe := IC.MainMysql.Count("entniche_info", map[string]interface{}{"dept_subscribe": 1, "id": entId}) > 0
+	queryMap := map[string]interface{}{
+		"1": "1",
+	}
+	if dept_subscribe && !isAdmin {
+		queryMap = map[string]interface{}{
+			"i_entid":  entId,
+			"i_status": 0, //0未删除 1已删除
+			"i_deptid": depId,
+		}
+	} else if isAdmin {
+		queryMap = map[string]interface{}{
+			"i_entid":  entId,
+			"i_status": 0, //0未删除 1已删除
+			"i_deptid": map[string]interface{}{
+				"$exists": false,
+			},
+		}
+	}
+	res, _ := IC.Mgo.Find("entniche_distribute", queryMap, nil, `{"_id":1,"o_area":1,"a_buyerclass":1,"a_items":1}`, false, -1, -1)
+	if len(*res) > 0 {
+		for _, v := range *res {
+			rId = append(rId, mongodb.BsonIdToSId(v["_id"]))
+		}
+	}
+	return
+}
+
+// GetStaffSubscribeDetail 获取企业个人订阅
+func GetStaffSubscribeDetail(entId, uid int64, token string) (rData map[string]interface{}, err error) {
+	entIdCheck, uidCheck, staffId, ruleId, power, err := decodeSubscribeMsg(token)
+	if err != nil {
+		return
+	}
+	if entId != entIdCheck || uid != uidCheck {
+		err = fmt.Errorf("权限异常")
+		return
+	}
+	if power == "" {
+		err = fmt.Errorf("无订阅内容")
+		return
+	}
+	rData = map[string]interface{}{}
+	nameEntNiche, nameVipMember := "", "" //当只存在大会员或商机管理时 展示个人订阅;当都存在时展示产品信息
+	valueEntNiche, valueVipMember := map[string]interface{}{}, map[string]interface{}{}
+
+	if strings.Index(power, "e") > -1 {
+		//个人订阅商机管理
+		if data := getPersonSubscribe(map[string]interface{}{"i_entid": entId, "i_userid": staffId, "i_type": 0}); data != nil && len(data) > 0 {
+			nameEntNiche = "个人订阅<br>商机管理"
+			valueEntNiche = data
+		}
+	}
+	if strings.Index(power, "m") > -1 || strings.Index(power, "v") > -1 {
+		//大会员或超级订阅企业版
+		if data := getPersonSubscribe(map[string]interface{}{"i_entid": entId, "i_userid": staffId, "i_type": 1}); data != nil && len(data) > 0 {
+			nameVipMember = fmt.Sprintf("个人订阅<br>%s", common.If(strings.Index(power, "v") > -1, "超级订阅", "大会员"))
+			valueVipMember = data
+		}
+	}
+
+	if len(valueEntNiche) > 0 && len(valueVipMember) > 0 {
+		rData[nameEntNiche] = valueEntNiche
+		rData[nameVipMember] = valueVipMember
+	} else if len(valueEntNiche) > 0 {
+		rData["个人订阅"] = valueEntNiche
+	} else if len(valueVipMember) > 0 {
+		rData["个人订阅"] = valueVipMember
+	}
+
+	// 企业自动分发
+	if ruleId != "" {
+		if data := getEntDistribute(ruleId, entId, staffId); data != nil && len(data) > 0 {
+			rData["企业自动分发"] = data
+		}
+	}
+	return
+}
+
+// getPersonSubscribe 个人订阅
+func getPersonSubscribe(query map[string]interface{}) (rData map[string]interface{}) {
+	res, _ := IC.Mgo.FindOneByField("entniche_rule", query, `{"o_entniche":1,"i_userid":1}`)
+	if res == nil || len(*res) == 0 {
+		return
+	}
+	subDetail, rData := &PersonSubscribe{}, map[string]interface{}{}
+	if err := gconv.Struct((*res)["o_entniche"], subDetail); err == nil {
+		if subDetail.IsEmpty() {
+			return
+		}
+		wordsList := []map[string]interface{}{}
+		for _, set := range subDetail.AItems {
+			for _, t := range set.AKey {
+				wordsList = append(wordsList, map[string]interface{}{
+					"key":    t.Key,
+					"match":  t.Matchway,
+					"notkey": t.Notkey,
+				})
+			}
+		}
+
+		rData["area"] = subDetail.OArea
+		rData["infotype"] = subDetail.AInfotype
+		rData["projectmatch"] = subDetail.IProjectmatch
+		rData["matchway"] = common.If(subDetail.IMatchway == 0, 1, subDetail.IMatchway) //匹配方式 默认标题匹配 1
+		rData["wordsList"] = wordsList
+		rData["buyerClass"] = subDetail.ABuyerclass
+	}
+	return
+}
+
+// getEntDistribute 获取企业分发订阅
+func getEntDistribute(ruleId string, entId, uid int64) (rData map[string]interface{}) {
+	//查询分发内容
+	ruleRes, _ := IC.Mgo.FindById("entniche_distribute", ruleId, `{"i_deptid":1,"o_area":1,"a_buyerclass":1,"a_items":1}`)
+	if ruleRes == nil || len(*ruleRes) == 0 {
+		return
+	}
+	rData = map[string]interface{}{}
+	deptId := common.IntAll((*ruleRes)["i_deptid"])  //部门id
+	itemArr := gconv.SliceStr((*ruleRes)["a_items"]) //关键词分类名称
+
+	var area map[string][]string
+	_ = gconv.Struct((*ruleRes)["o_area"], &area) //订阅地区
+
+	//查询分发订阅关键词及信息类型
+	var wordsRes *map[string]interface{}
+	if deptId != 0 {
+		wordsRes, _ = IC.Mgo.FindOne("entniche_rule", map[string]interface{}{"i_entid": entId, "i_deptid": deptId, "i_userid": map[string]interface{}{"$exists": 0}})
+	} else {
+		wordsRes, _ = IC.Mgo.FindOne("entniche_rule", map[string]interface{}{"i_entid": entId, "i_deptid": map[string]interface{}{"$exists": 0}, "i_userid": map[string]interface{}{"$exists": 0}})
+	}
+	wordsList := []map[string]interface{}{}
+	infotype, i_projectmatch, i_matchway := []string{}, 0, 0
+	if wordsRes != nil && len(*wordsRes) > 0 {
+		thisSub := &PersonSubscribe{}
+		if gconv.Struct((*wordsRes)["o_entniche"], thisSub) == nil {
+			for _, set := range thisSub.AItems {
+				for _, name := range itemArr {
+					if set.SItem == name {
+						for _, t := range set.AKey {
+							wordsList = append(wordsList, map[string]interface{}{
+								"key":    t.Key,
+								"match":  t.Matchway,
+								"notkey": t.Notkey,
+							})
+						}
+					}
+				}
+			}
+			i_matchway = thisSub.IMatchway
+			i_projectmatch = thisSub.IProjectmatch
+			infotype = thisSub.AInfotype
+		}
+	}
+	rData["buyerClass"] = (*ruleRes)["a_buyerclass"] //采购单位类型
+	rData["area"] = area
+	rData["infotype"] = infotype
+	rData["projectmatch"] = i_projectmatch
+	rData["matchway"] = i_matchway
+	rData["wordsList"] = wordsList
+	return
+}
+
+// decodeSubscribeMsg token解密
+func decodeSubscribeMsg(token string) (entId, uId, staffId int64, ruleId, power string, err error) {
+	values := encrypt.DecodeArticleId2ByCheck(token)
+	if len(values) != 5 {
+		err = fmt.Errorf("解析异常")
+		return
+	}
+	entId = gconv.Int64(values[0])
+	uId = gconv.Int64(values[1])
+	staffId = gconv.Int64(values[2])
+	ruleId = gconv.String(values[3])
+	power = gconv.String(values[4])
+
+	if entId == 0 || uId == 0 || staffId == 0 {
+		err = fmt.Errorf("参数异常")
+		return
+	}
+	return
+}
+
+// encodeSubscribeMsg token加密
+func encodeSubscribeMsg(entId, uId, staffId int64, ruleId, power string) string {
+	return encrypt.EncodeArticleId2ByCheck(fmt.Sprintf("%d,%d,%d,%s,%s", entId, uId, staffId, ruleId, strings.Replace(power, ",", "_", -1)))
+}

Різницю між файлами не показано, бо вона завелика
+ 995 - 540
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go


+ 153 - 58
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.15.1
+// - protoc-gen-go-grpc v1.3.0
+// - protoc             v3.21.12
 // source: bxsubscribe.proto
 
 package bxsubscribe
@@ -18,38 +18,61 @@ import (
 // Requires gRPC-Go v1.32.0 or later.
 const _ = grpc.SupportPackageIsVersion7
 
+const (
+	Bxsubscribe_GetSubList_FullMethodName              = "/bxsubscribe.Bxsubscribe/GetSubList"
+	Bxsubscribe_GetSubSomeInfo_FullMethodName          = "/bxsubscribe.Bxsubscribe/GetSubSomeInfo"
+	Bxsubscribe_UpdateSubScribeInfo_FullMethodName     = "/bxsubscribe.Bxsubscribe/UpdateSubScribeInfo"
+	Bxsubscribe_ByPushHistory_FullMethodName           = "/bxsubscribe.Bxsubscribe/ByPushHistory"
+	Bxsubscribe_SetRead_FullMethodName                 = "/bxsubscribe.Bxsubscribe/SetRead"
+	Bxsubscribe_GetKey_FullMethodName                  = "/bxsubscribe.Bxsubscribe/GetKey"
+	Bxsubscribe_GetSubScribeInfo_FullMethodName        = "/bxsubscribe.Bxsubscribe/GetSubScribeInfo"
+	Bxsubscribe_MsgDistributor_FullMethodName          = "/bxsubscribe.Bxsubscribe/MsgDistributor"
+	Bxsubscribe_GetDistributor_FullMethodName          = "/bxsubscribe.Bxsubscribe/GetDistributor"
+	Bxsubscribe_GetViewStatus_FullMethodName           = "/bxsubscribe.Bxsubscribe/GetViewStatus"
+	Bxsubscribe_UserInfo_FullMethodName                = "/bxsubscribe.Bxsubscribe/userInfo"
+	Bxsubscribe_SetUser_FullMethodName                 = "/bxsubscribe.Bxsubscribe/setUser"
+	Bxsubscribe_GetPushSet_FullMethodName              = "/bxsubscribe.Bxsubscribe/getPushSet"
+	Bxsubscribe_SetPushSet_FullMethodName              = "/bxsubscribe.Bxsubscribe/setPushSet"
+	Bxsubscribe_GetStaffSubscribeList_FullMethodName   = "/bxsubscribe.Bxsubscribe/getStaffSubscribeList"
+	Bxsubscribe_GetStaffSubscribeDetail_FullMethodName = "/bxsubscribe.Bxsubscribe/getStaffSubscribeDetail"
+)
+
 // BxsubscribeClient is the client API for Bxsubscribe service.
 //
 // 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 {
-	//获取订阅推送列表
+	// 获取订阅推送列表
 	GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error)
-	//获取订阅推送相关信息
+	// 获取订阅推送相关信息
 	GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error)
-	//修改订阅信息接口
+	// 修改订阅信息接口
 	UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//推送页面筛选导出
+	// 推送页面筛选导出
 	ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error)
-	//推送数据浏览状态修改
+	// 推送数据浏览状态修改
 	SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//关键词获取
+	// 关键词获取
 	GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
-	//订阅设置获取
+	// 订阅设置获取
 	GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error)
-	//信息分发
+	// 信息分发
 	MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//手动分发人员查询
+	// 手动分发人员查询
 	GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error)
-	//查看状态
+	// 查看状态
 	GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error)
-	//用户推送信息查看
+	// 用户推送信息查看
 	UserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResq, error)
-	//用户邮箱保存
+	// 用户邮箱保存
 	SetUser(ctx context.Context, in *SetUserInfoReq, opts ...grpc.CallOption) (*StatusResp, error)
-	//用户推送设置查看
+	// 用户推送设置查看
 	GetPushSet(ctx context.Context, in *GetPushSetReq, opts ...grpc.CallOption) (*GetPushSetResp, error)
-	//用户推送设置修改
+	// 用户推送设置修改
 	SetPushSet(ctx context.Context, in *SetPushSetReq, opts ...grpc.CallOption) (*StatusResp, error)
+	// 查看企业员工用户订阅
+	GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error)
+	// 查看企业员工用户订阅详情
+	GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error)
 }
 
 type bxsubscribeClient struct {
@@ -62,7 +85,7 @@ func NewBxsubscribeClient(cc grpc.ClientConnInterface) BxsubscribeClient {
 
 func (c *bxsubscribeClient) GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error) {
 	out := new(SubscribeInfosResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetSubList", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetSubList_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -71,7 +94,7 @@ func (c *bxsubscribeClient) GetSubList(ctx context.Context, in *SubscribeInfosRe
 
 func (c *bxsubscribeClient) GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error) {
 	out := new(SomeInfoResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetSubSomeInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetSubSomeInfo_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -80,7 +103,7 @@ func (c *bxsubscribeClient) GetSubSomeInfo(ctx context.Context, in *SomeInfoReq,
 
 func (c *bxsubscribeClient) UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error) {
 	out := new(StatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/UpdateSubScribeInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_UpdateSubScribeInfo_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -89,7 +112,7 @@ func (c *bxsubscribeClient) UpdateSubScribeInfo(ctx context.Context, in *UpdateS
 
 func (c *bxsubscribeClient) ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error) {
 	out := new(ByPushHistoryResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/ByPushHistory", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_ByPushHistory_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -98,7 +121,7 @@ func (c *bxsubscribeClient) ByPushHistory(ctx context.Context, in *SubscribeInfo
 
 func (c *bxsubscribeClient) SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error) {
 	out := new(StatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/SetRead", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_SetRead_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -107,7 +130,7 @@ func (c *bxsubscribeClient) SetRead(ctx context.Context, in *SetReadReq, opts ..
 
 func (c *bxsubscribeClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error) {
 	out := new(KeyResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetKey", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetKey_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -116,7 +139,7 @@ func (c *bxsubscribeClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...g
 
 func (c *bxsubscribeClient) GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error) {
 	out := new(UserResq)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetSubScribeInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetSubScribeInfo_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -125,7 +148,7 @@ func (c *bxsubscribeClient) GetSubScribeInfo(ctx context.Context, in *UserReq, o
 
 func (c *bxsubscribeClient) MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error) {
 	out := new(StatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/MsgDistributor", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_MsgDistributor_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -134,7 +157,7 @@ func (c *bxsubscribeClient) MsgDistributor(ctx context.Context, in *MsgDistribut
 
 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...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetDistributor_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -143,7 +166,7 @@ func (c *bxsubscribeClient) GetDistributor(ctx context.Context, in *GetDistribut
 
 func (c *bxsubscribeClient) GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error) {
 	out := new(ViewStatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetViewStatus", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetViewStatus_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -152,7 +175,7 @@ func (c *bxsubscribeClient) GetViewStatus(ctx context.Context, in *GetViewStatus
 
 func (c *bxsubscribeClient) UserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResq, error) {
 	out := new(GetUserInfoResq)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/userInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_UserInfo_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -161,7 +184,7 @@ func (c *bxsubscribeClient) UserInfo(ctx context.Context, in *GetUserInfoReq, op
 
 func (c *bxsubscribeClient) SetUser(ctx context.Context, in *SetUserInfoReq, opts ...grpc.CallOption) (*StatusResp, error) {
 	out := new(StatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/setUser", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_SetUser_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -170,7 +193,7 @@ func (c *bxsubscribeClient) SetUser(ctx context.Context, in *SetUserInfoReq, opt
 
 func (c *bxsubscribeClient) GetPushSet(ctx context.Context, in *GetPushSetReq, opts ...grpc.CallOption) (*GetPushSetResp, error) {
 	out := new(GetPushSetResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/getPushSet", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetPushSet_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -179,7 +202,25 @@ func (c *bxsubscribeClient) GetPushSet(ctx context.Context, in *GetPushSetReq, o
 
 func (c *bxsubscribeClient) SetPushSet(ctx context.Context, in *SetPushSetReq, opts ...grpc.CallOption) (*StatusResp, error) {
 	out := new(StatusResp)
-	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/setPushSet", in, out, opts...)
+	err := c.cc.Invoke(ctx, Bxsubscribe_SetPushSet_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxsubscribeClient) GetStaffSubscribeList(ctx context.Context, in *StaffSubscribeReq, opts ...grpc.CallOption) (*StaffSubscribeListResp, error) {
+	out := new(StaffSubscribeListResp)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetStaffSubscribeList_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxsubscribeClient) GetStaffSubscribeDetail(ctx context.Context, in *StaffSubscribeDetailReq, opts ...grpc.CallOption) (*StaffSubscribeDetail, error) {
+	out := new(StaffSubscribeDetail)
+	err := c.cc.Invoke(ctx, Bxsubscribe_GetStaffSubscribeDetail_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -190,34 +231,38 @@ func (c *bxsubscribeClient) SetPushSet(ctx context.Context, in *SetPushSetReq, o
 // All implementations must embed UnimplementedBxsubscribeServer
 // for forward compatibility
 type BxsubscribeServer interface {
-	//获取订阅推送列表
+	// 获取订阅推送列表
 	GetSubList(context.Context, *SubscribeInfosReq) (*SubscribeInfosResp, error)
-	//获取订阅推送相关信息
+	// 获取订阅推送相关信息
 	GetSubSomeInfo(context.Context, *SomeInfoReq) (*SomeInfoResp, error)
-	//修改订阅信息接口
+	// 修改订阅信息接口
 	UpdateSubScribeInfo(context.Context, *UpdateSubScribeInfoReq) (*StatusResp, error)
-	//推送页面筛选导出
+	// 推送页面筛选导出
 	ByPushHistory(context.Context, *SubscribeInfosReq) (*ByPushHistoryResp, error)
-	//推送数据浏览状态修改
+	// 推送数据浏览状态修改
 	SetRead(context.Context, *SetReadReq) (*StatusResp, error)
-	//关键词获取
+	// 关键词获取
 	GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
-	//订阅设置获取
+	// 订阅设置获取
 	GetSubScribeInfo(context.Context, *UserReq) (*UserResq, error)
-	//信息分发
+	// 信息分发
 	MsgDistributor(context.Context, *MsgDistributorReq) (*StatusResp, error)
-	//手动分发人员查询
+	// 手动分发人员查询
 	GetDistributor(context.Context, *GetDistributorReq) (*DistributorResp, error)
-	//查看状态
+	// 查看状态
 	GetViewStatus(context.Context, *GetViewStatusReq) (*ViewStatusResp, error)
-	//用户推送信息查看
+	// 用户推送信息查看
 	UserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResq, error)
-	//用户邮箱保存
+	// 用户邮箱保存
 	SetUser(context.Context, *SetUserInfoReq) (*StatusResp, error)
-	//用户推送设置查看
+	// 用户推送设置查看
 	GetPushSet(context.Context, *GetPushSetReq) (*GetPushSetResp, error)
-	//用户推送设置修改
+	// 用户推送设置修改
 	SetPushSet(context.Context, *SetPushSetReq) (*StatusResp, error)
+	// 查看企业员工用户订阅
+	GetStaffSubscribeList(context.Context, *StaffSubscribeReq) (*StaffSubscribeListResp, error)
+	// 查看企业员工用户订阅详情
+	GetStaffSubscribeDetail(context.Context, *StaffSubscribeDetailReq) (*StaffSubscribeDetail, error)
 	mustEmbedUnimplementedBxsubscribeServer()
 }
 
@@ -267,6 +312,12 @@ func (UnimplementedBxsubscribeServer) GetPushSet(context.Context, *GetPushSetReq
 func (UnimplementedBxsubscribeServer) SetPushSet(context.Context, *SetPushSetReq) (*StatusResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SetPushSet not implemented")
 }
+func (UnimplementedBxsubscribeServer) GetStaffSubscribeList(context.Context, *StaffSubscribeReq) (*StaffSubscribeListResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetStaffSubscribeList not implemented")
+}
+func (UnimplementedBxsubscribeServer) GetStaffSubscribeDetail(context.Context, *StaffSubscribeDetailReq) (*StaffSubscribeDetail, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetStaffSubscribeDetail not implemented")
+}
 func (UnimplementedBxsubscribeServer) mustEmbedUnimplementedBxsubscribeServer() {}
 
 // UnsafeBxsubscribeServer may be embedded to opt out of forward compatibility for this service.
@@ -290,7 +341,7 @@ func _Bxsubscribe_GetSubList_Handler(srv interface{}, ctx context.Context, dec f
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetSubList",
+		FullMethod: Bxsubscribe_GetSubList_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetSubList(ctx, req.(*SubscribeInfosReq))
@@ -308,7 +359,7 @@ func _Bxsubscribe_GetSubSomeInfo_Handler(srv interface{}, ctx context.Context, d
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetSubSomeInfo",
+		FullMethod: Bxsubscribe_GetSubSomeInfo_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetSubSomeInfo(ctx, req.(*SomeInfoReq))
@@ -326,7 +377,7 @@ func _Bxsubscribe_UpdateSubScribeInfo_Handler(srv interface{}, ctx context.Conte
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/UpdateSubScribeInfo",
+		FullMethod: Bxsubscribe_UpdateSubScribeInfo_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).UpdateSubScribeInfo(ctx, req.(*UpdateSubScribeInfoReq))
@@ -344,7 +395,7 @@ func _Bxsubscribe_ByPushHistory_Handler(srv interface{}, ctx context.Context, de
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/ByPushHistory",
+		FullMethod: Bxsubscribe_ByPushHistory_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).ByPushHistory(ctx, req.(*SubscribeInfosReq))
@@ -362,7 +413,7 @@ func _Bxsubscribe_SetRead_Handler(srv interface{}, ctx context.Context, dec func
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/SetRead",
+		FullMethod: Bxsubscribe_SetRead_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).SetRead(ctx, req.(*SetReadReq))
@@ -380,7 +431,7 @@ func _Bxsubscribe_GetKey_Handler(srv interface{}, ctx context.Context, dec func(
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetKey",
+		FullMethod: Bxsubscribe_GetKey_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetKey(ctx, req.(*GetKeyReq))
@@ -398,7 +449,7 @@ func _Bxsubscribe_GetSubScribeInfo_Handler(srv interface{}, ctx context.Context,
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetSubScribeInfo",
+		FullMethod: Bxsubscribe_GetSubScribeInfo_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetSubScribeInfo(ctx, req.(*UserReq))
@@ -416,7 +467,7 @@ func _Bxsubscribe_MsgDistributor_Handler(srv interface{}, ctx context.Context, d
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/MsgDistributor",
+		FullMethod: Bxsubscribe_MsgDistributor_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).MsgDistributor(ctx, req.(*MsgDistributorReq))
@@ -434,7 +485,7 @@ func _Bxsubscribe_GetDistributor_Handler(srv interface{}, ctx context.Context, d
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetDistributor",
+		FullMethod: Bxsubscribe_GetDistributor_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetDistributor(ctx, req.(*GetDistributorReq))
@@ -452,7 +503,7 @@ func _Bxsubscribe_GetViewStatus_Handler(srv interface{}, ctx context.Context, de
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/GetViewStatus",
+		FullMethod: Bxsubscribe_GetViewStatus_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetViewStatus(ctx, req.(*GetViewStatusReq))
@@ -470,7 +521,7 @@ func _Bxsubscribe_UserInfo_Handler(srv interface{}, ctx context.Context, dec fun
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/userInfo",
+		FullMethod: Bxsubscribe_UserInfo_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).UserInfo(ctx, req.(*GetUserInfoReq))
@@ -488,7 +539,7 @@ func _Bxsubscribe_SetUser_Handler(srv interface{}, ctx context.Context, dec func
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/setUser",
+		FullMethod: Bxsubscribe_SetUser_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).SetUser(ctx, req.(*SetUserInfoReq))
@@ -506,7 +557,7 @@ func _Bxsubscribe_GetPushSet_Handler(srv interface{}, ctx context.Context, dec f
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/getPushSet",
+		FullMethod: Bxsubscribe_GetPushSet_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).GetPushSet(ctx, req.(*GetPushSetReq))
@@ -524,7 +575,7 @@ func _Bxsubscribe_SetPushSet_Handler(srv interface{}, ctx context.Context, dec f
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/bxsubscribe.Bxsubscribe/setPushSet",
+		FullMethod: Bxsubscribe_SetPushSet_FullMethodName,
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 		return srv.(BxsubscribeServer).SetPushSet(ctx, req.(*SetPushSetReq))
@@ -532,6 +583,42 @@ func _Bxsubscribe_SetPushSet_Handler(srv interface{}, ctx context.Context, dec f
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Bxsubscribe_GetStaffSubscribeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(StaffSubscribeReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxsubscribeServer).GetStaffSubscribeList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Bxsubscribe_GetStaffSubscribeList_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxsubscribeServer).GetStaffSubscribeList(ctx, req.(*StaffSubscribeReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Bxsubscribe_GetStaffSubscribeDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(StaffSubscribeDetailReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxsubscribeServer).GetStaffSubscribeDetail(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Bxsubscribe_GetStaffSubscribeDetail_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxsubscribeServer).GetStaffSubscribeDetail(ctx, req.(*StaffSubscribeDetailReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Bxsubscribe_ServiceDesc is the grpc.ServiceDesc for Bxsubscribe service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -595,6 +682,14 @@ var Bxsubscribe_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "setPushSet",
 			Handler:    _Bxsubscribe_SetPushSet_Handler,
 		},
+		{
+			MethodName: "getStaffSubscribeList",
+			Handler:    _Bxsubscribe_GetStaffSubscribeList_Handler,
+		},
+		{
+			MethodName: "getStaffSubscribeDetail",
+			Handler:    _Bxsubscribe_GetStaffSubscribeDetail_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "bxsubscribe.proto",

Деякі файли не було показано, через те що забагато файлів було змінено