fuwencai 2 years ago
parent
commit
c708dac28d

+ 3 - 2
jyBXCore/api/bxcore.api

@@ -63,10 +63,11 @@ type (
 		EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
 		EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
 		PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
 		PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
 		PositionId   int64  `header:"positionId"`
 		PositionId   int64  `header:"positionId"`
-		AccountId    string `header:"accountId,optional"` //账户id
+		AccountId    int64  `header:"accountId,optional"` //账户id
 		MgoUserId    string `header:"mgoUserId,optional"` //原userId
 		MgoUserId    string `header:"mgoUserId,optional"` //原userId
-		AppId        string `header:"appId"`
+		AppId        string `header:"appId,optional"`
 		UserId       string `header:"userId,optional"`
 		UserId       string `header:"userId,optional"`
+		NewUserId    int64  `header:"newUserId,optional"`
 	}
 	}
 	// 列表数据参标信息请求参数
 	// 列表数据参标信息请求参数
 	participateShowReq {
 	participateShowReq {

+ 5 - 0
jyBXCore/api/internal/logic/participateActionLogic.go

@@ -33,6 +33,11 @@ func (l *ParticipateActionLogic) ParticipateAction(req *types.ParticipateActionR
 		EntUserId:    req.EntUserId,
 		EntUserId:    req.EntUserId,
 		PositionId:   req.PositionId,
 		PositionId:   req.PositionId,
 		PositionType: req.PositionType,
 		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
 		BidId:        req.BidId,
 		BidId:        req.BidId,
 		ToEntUserId:  req.ToEntUserId,
 		ToEntUserId:  req.ToEntUserId,
 		IsRetain:     req.IsRetain,
 		IsRetain:     req.IsRetain,

+ 4 - 0
jyBXCore/api/internal/logic/participateSetUpInfoLogic.go

@@ -56,6 +56,10 @@ func (l *ParticipateSetUpInfoLogic) ParticipateSetUpInfo(req *types.ParticipateS
 		EntUserId:    req.EntUserId,
 		EntUserId:    req.EntUserId,
 		PositionId:   req.PositionId,
 		PositionId:   req.PositionId,
 		PositionType: req.PositionType,
 		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		AccountId:    req.AccountId,
 		SetAction:    req.SetAction,
 		SetAction:    req.SetAction,
 		IsAllow:      req.IsAllow,
 		IsAllow:      req.IsAllow,
 		BidType:      bidType,
 		BidType:      bidType,

+ 3 - 2
jyBXCore/api/internal/types/types.go

@@ -56,10 +56,11 @@ type BaseParam struct {
 	EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
 	EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
 	PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
 	PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
 	PositionId   int64  `header:"positionId"`
 	PositionId   int64  `header:"positionId"`
-	AccountId    string `header:"accountId,optional"` //账户id
+	AccountId    int64  `header:"accountId,optional"` //账户id
 	MgoUserId    string `header:"mgoUserId,optional"` //原userId
 	MgoUserId    string `header:"mgoUserId,optional"` //原userId
-	AppId        string `header:"appId"`
+	AppId        string `header:"appId,optional"`
 	UserId       string `header:"userId,optional"`
 	UserId       string `header:"userId,optional"`
+	NewUserId    int64  `header:"newUserId,optional"`
 }
 }
 
 
 type ParticipateShowReq struct {
 type ParticipateShowReq struct {

+ 0 - 81
jyBXCore/entity/rpc.go

@@ -1,81 +0,0 @@
-package entity
-
-import (
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
-	"context"
-	"strings"
-)
-
-var (
-	PowerCheck powercheck.PowerCheck
-)
-
-type UserInfoRpc struct {
-	AppId        string //appId 剑鱼 10000
-	UserId       string //用户id
-	BaseUserId   int64  //用户基本id
-	EntId        int64  //企业id
-	EntUserId    int64  //企业用户id
-	AccountId    int64  //账户id
-	PositionType int64  //职位类型 @个人 1企业
-	PositionId   int64  //职位id
-	MgoUserId    string //原userId
-}
-
-// GetUserPowers  获取用户权益信息
-func (ui *UserInfoRpc) GetUserPowers() *powercheck.CheckResp {
-	req := &powercheck.CheckReq{
-		Appid:        ui.AppId,
-		Userid:       ui.MgoUserId,
-		BaseUserId:   ui.BaseUserId,
-		AccountId:    ui.AccountId,
-		EntId:        ui.EntId,
-		PositionType: ui.PositionType,
-		PositionId:   ui.PositionId,
-	}
-	checkResp, err := PowerCheck.Check(context.Background(), req)
-	if err == nil {
-		return checkResp
-	}
-	return nil
-}
-
-// GetQueryItems 免费 标题(title)  正文(content) 老用户【中标企业(winner)】
-// 付费用户 全部(all)、标题(title)  正文(content)  会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
-// 项目名称projectname和标的物purchasing(ppa)
-func (ui *UserInfoRpc) GetQueryItems(selectType string, limitOldTime, registerData int64, isPay bool) (items []string) {
-	if isPay {
-		for _, t := range strings.Split(selectType, ",") {
-			if t == "content" {
-				items = append(items, "detail")
-			} else if t == "buyer" {
-				items = append(items, "mbuyer")
-			} else if t == "winner" {
-				items = append(items, "mwinner")
-			} else if t == "agency" {
-				items = append(items, "magency")
-			} else if t == "title" {
-				items = append(items, "title")
-			} else if t == "ppa" {
-				items = append(items, []string{"purchasing", "projectname.pname"}...)
-			} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
-				items = append(items, "filetext")
-			}
-		}
-		return
-	}
-	//老用户 使用付费功能
-	isOldUser := registerData != 0 && registerData < limitOldTime
-	for _, t := range strings.Split(selectType, ",") {
-		if t == "winner" && isOldUser {
-			items = append(items, "mwinner")
-		} else if t == "title" {
-			items = append(items, "title")
-		} else if t == "content" {
-			items = append(items, "detail")
-		} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
-			items = append(items, "filetext")
-		}
-	}
-	return
-}

+ 18 - 8
jyBXCore/rpc/bxcore.proto

@@ -300,10 +300,15 @@ message ParticipateSetUpInfoReq{
   int64  entUserId = 2; // 企业下用户id
   int64  entUserId = 2; // 企业下用户id
   int64  positionId = 3; // 职位id
   int64  positionId = 3; // 职位id
   int64  positionType =4;// 职位类型 0个人 1企业
   int64  positionType =4;// 职位类型 0个人 1企业
-  string  setAction = 5;//请求动作:U:更新,默认空
-  string  isAllow = 6;//是否允许多人参标
-  repeated BidTypeReq bidType = 7;
-  repeated RemindRuleReq remindRule = 8;
+  string mgoUserId = 5;  //原userId
+  string appId = 6;//剑鱼默认10000
+  string  userId = 7;//用户id
+  int64  newUserId = 8;//base_user_id 新用户id
+  int64 accountId = 9; //账户id
+  string  setAction = 10;//请求动作:U:更新,默认空
+  string  isAllow = 11;//是否允许多人参标
+  repeated BidTypeReq bidType = 12;
+  repeated RemindRuleReq remindRule = 13;
 }
 }
 
 
 message  BidTypeReq{
 message  BidTypeReq{
@@ -334,10 +339,15 @@ message ParticipateActionReq{
   int64  entUserId = 2; // 企业下用户id
   int64  entUserId = 2; // 企业下用户id
   int64  positionId = 3; // 职位id
   int64  positionId = 3; // 职位id
   int64  positionType =4;// 职位类型 0个人 1企业
   int64  positionType =4;// 职位类型 0个人 1企业
-  string  bidId = 5;//招标信息id
-  string  toEntUserId = 6;//划转对象的企业用户id
-  bool isRetain = 7;//是否保留原跟踪人
-  string actionType = 8;//in:参标;out:终止参标;transfer:划转
+  string mgoUserId = 5;  //原userId
+  string appId = 6;//剑鱼默认10000
+  string  userId = 7;//用户id
+  int64  newUserId = 8;//base_user_id 新用户id
+  int64 accountId = 9; //账户id
+  string  bidId = 10;//招标信息id
+  string  toEntUserId = 11;//划转对象的企业用户id
+  bool isRetain = 12;//是否保留原跟踪人
+  string actionType = 13;//in:参标;out:终止参标;transfer:划转
 }
 }
 //
 //
 message ParticipateActionRes{
 message ParticipateActionRes{

+ 2 - 14
jyBXCore/rpc/entity/search.go

@@ -6,7 +6,6 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"fmt"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
 	"github.com/zeromicro/go-zero/core/logx"
-	"jyBXCore/entity"
 	"jyBXCore/rpc/bxcore"
 	"jyBXCore/rpc/bxcore"
 	IC "jyBXCore/rpc/init"
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/service"
 	"jyBXCore/rpc/service"
@@ -162,26 +161,15 @@ func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
 	positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
 	positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
 	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
 	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
-	userInfoRpc := entity.UserInfoRpc{
-		AppId:        in.AppId,
-		UserId:       in.UserId,
-		BaseUserId:   baseUserId,
-		EntId:        in.EntId,
-		EntUserId:    in.EntUserId,
-		AccountId:    accountId,
-		PositionType: positionType,
-		PositionId:   positionId,
-		MgoUserId:    in.MgoUserId,
-	}
 	//判断用户身份
 	//判断用户身份
-	userInfo := userInfoRpc.GetUserPowers()
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, in.EntId, positionType, positionId)
 	//是否是付费用户
 	//是否是付费用户
 	in.IsPay = !userInfo.Free.IsFree
 	in.IsPay = !userInfo.Free.IsFree
 	//默认搜索范围
 	//默认搜索范围
 	if in.SelectType == "" {
 	if in.SelectType == "" {
 		in.SelectType = "title,content"
 		in.SelectType = "title,content"
 	}
 	}
-	queryItems := userInfoRpc.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit, userInfo.Free.Registedate, in.IsPay)
+	queryItems := util.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit, userInfo.Free.Registedate, in.IsPay)
 	in.SelectType = strings.Join(queryItems, ",")
 	in.SelectType = strings.Join(queryItems, ",")
 	// in.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
 	// in.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
 	//	详情页判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限
 	//	详情页判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限

+ 3 - 2
jyBXCore/rpc/etc/bxcore.yaml

@@ -42,8 +42,9 @@ DefaultTopTypes:
   - 拟建,采购意向
   - 拟建,采购意向
 JYKeyMark: " "
 JYKeyMark: " "
 ContextOldVipLimit: 1664553600
 ContextOldVipLimit: 1664553600
-PowersEtcdConf:
+Middleground:
   Etcd:
   Etcd:
     Hosts:
     Hosts:
       - 192.168.3.149:2379
       - 192.168.3.149:2379
-    Key: powercheck.rpc
+  PowerCheckCenterKey: powercheck.rpc #权益校验中台
+  UserCenterKey: usercenter.rpc #用户中台rpc

+ 15 - 24
jyBXCore/rpc/init/init.go

@@ -1,31 +1,26 @@
 package init
 package init
 
 
 import (
 import (
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"flag"
 	"flag"
 	"fmt"
 	"fmt"
 	_ "github.com/go-sql-driver/mysql"
 	_ "github.com/go-sql-driver/mysql"
 	"github.com/zeromicro/go-zero/core/conf"
 	"github.com/zeromicro/go-zero/core/conf"
-	"github.com/zeromicro/go-zero/core/discov"
 	"github.com/zeromicro/go-zero/core/logx"
 	"github.com/zeromicro/go-zero/core/logx"
-	"github.com/zeromicro/go-zero/zrpc"
 	"jyBXCore/entity"
 	"jyBXCore/entity"
 	"jyBXCore/rpc/internal/config"
 	"jyBXCore/rpc/internal/config"
 )
 )
 
 
-var configFile = flag.String("cf", "etc/bxcore.yaml", "the config file")
-var C config.Config
-var err error
-
-var dbFile = flag.String("df", "etc/db.yaml", "the db file")
-var DB config.Db
-
-var logFile = flag.String("lf", "etc/logs.yaml", "the logs file")
-var logc entity.Logc
-
-// 全文或附件搜索限制
-var SearchLimitKey = "jy_limitSearchText_new"
-var SearchLimitFlag = "jy_limitSearchText_%s"
+var (
+	configFile     = flag.String("cf", "etc/bxcore.yaml", "the config file")
+	C              config.Config
+	dbFile         = flag.String("df", "etc/db.yaml", "the db file")
+	DB             config.Db
+	logFile        = flag.String("lf", "etc/logs.yaml", "the logs file")
+	logc           entity.Logc
+	SearchLimitKey = "jy_limitSearchText_new" // 全文或附件搜索限制
+	Middleground   *middleground.Middleground
+)
 
 
 func init() {
 func init() {
 	//基本配置
 	//基本配置
@@ -57,12 +52,8 @@ func init() {
 	LabelInit()
 	LabelInit()
 	//
 	//
 	SearchLimitKey = fmt.Sprintf(C.LimitSearchText.LimitKey, "jy_limitSearchText")
 	SearchLimitKey = fmt.Sprintf(C.LimitSearchText.LimitKey, "jy_limitSearchText")
-	//初始化权益中台相关
-	powersClient := zrpc.MustNewClient(zrpc.RpcClientConf{
-		Etcd: discov.EtcdConf{
-			Hosts: C.PowersEtcdConf.Etcd.Hosts,
-			Key:   C.PowersEtcdConf.Etcd.Key,
-		},
-	})
-	entity.PowerCheck = powercheck.NewPowerCheck(powersClient)
+	//初始化中台相关
+	Middleground = middleground.NewMiddleground(C.Middleground.Etcd.Hosts).
+		RegUserCenter(C.Middleground.UserCenterKey).
+		RegPowerCheckCenter(C.Middleground.PowerCheckCenterKey)
 }
 }

+ 10 - 4
jyBXCore/rpc/internal/config/config.go

@@ -41,10 +41,16 @@ type Config struct {
 		Count    int
 		Count    int
 		PayCount int
 		PayCount int
 	} //招标信息初始化
 	} //招标信息初始化
-	DefaultTopTypes    []string           //信息类型初始值
-	JYKeyMark          string             //关键词分组标识
-	ContextOldVipLimit int64              //老版超级订阅 超前项目权限
-	PowersEtcdConf     zrpc.RpcClientConf //权益中台
+	DefaultTopTypes    []string //信息类型初始值
+	JYKeyMark          string   //关键词分组标识
+	ContextOldVipLimit int64    //老版超级订阅 超前项目权限
+	Middleground       struct { //中台
+		Etcd struct {
+			Hosts []string
+		}
+		PowerCheckCenterKey string
+		UserCenterKey       string
+	}
 }
 }
 
 
 type Db struct {
 type Db struct {

+ 6 - 14
jyBXCore/rpc/internal/logic/participateshowlogic.go

@@ -2,7 +2,8 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"jyBXCore/entity"
+	"fmt"
+	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/service"
 	"jyBXCore/rpc/service"
 	"jyBXCore/rpc/util"
 	"jyBXCore/rpc/util"
 	"strconv"
 	"strconv"
@@ -37,21 +38,12 @@ func (l *ParticipateShowLogic) ParticipateShow(in *bxcore.ParticipateShowReq) (*
 	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
 	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
 	baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
 	baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
-	userInfoRpc := entity.UserInfoRpc{
-		AppId:        in.AppId,
-		UserId:       in.UserId,
-		BaseUserId:   baseUserId,
-		EntId:        in.EntId,
-		EntUserId:    in.EntUserId,
-		AccountId:    accountId,
-		PositionType: in.PositionType,
-		PositionId:   in.PositionId,
-		MgoUserId:    in.MgoUserId,
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, in.EntId, in.PositionType, in.PositionId)
+	//不是超级订阅 也不是大会员
+	if userInfo.Vip.Status < 0 && userInfo.Member.Status < 0 {
+		return &result, fmt.Errorf("没权限")
 	}
 	}
 	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
 	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
-	if participateService.ParticipatePowerCheck(userInfoRpc) {
-		return &result, nil
-	}
 
 
 	// 2. 根据标讯id 查询项目信息 拿到有效的项目id (无项目信息或者已经过开标时间  则不展示按钮  在开标时间内或者没有开标时间字段需要展示)
 	// 2. 根据标讯id 查询项目信息 拿到有效的项目id (无项目信息或者已经过开标时间  则不展示按钮  在开标时间内或者没有开标时间字段需要展示)
 	// 信息id解密
 	// 信息id解密

+ 113 - 0
jyBXCore/rpc/model/tidb/tidb.go

@@ -2,6 +2,8 @@ package tidb
 
 
 import (
 import (
 	MC "app.yhyue.com/moapp/jybase/common"
 	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"database/sql"
 	"encoding/json"
 	"encoding/json"
 	"fmt"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
 	"github.com/zeromicro/go-zero/core/logx"
@@ -15,6 +17,111 @@ var (
 	PartTable = "participate"
 	PartTable = "participate"
 )
 )
 
 
+//划转参标信息
+func TransferParticipate(in *bxcore.ParticipateActionReq) error {
+	//保存或更新新跟踪人
+	if !IC.BaseMysql.ExecTx("划转参标信息", func(tx *sql.Tx) bool {
+		var (
+			b       = true
+			b2, b3  bool
+			now     = time.Now()
+			content = "%s划转给%s"
+		)
+		//是否保留原参标人
+		if !in.IsRetain {
+			content = fmt.Sprintf(content, "", "%s")
+			b = IC.BaseMysql.UpdateOrDeleteBySqlByTx(tx, fmt.Sprintf(`UPDATE participate_user SET state = -2 ,update_date = %s WHERE ent_id = ? AND project_id = ?`, date.FormatDate(&now, date.Date_Full_Layout)), in.EntId, in.BidId) > 0
+			//不保留 原参标人,获取把原参标人信息
+		} else {
+			entUserId, _ := strconv.ParseInt(in.ToEntUserId, 10, 64)
+			IC.Middleground.UserCenter.IdentityByEntUserId(entUserId)
+		}
+		//查询原跟踪人信息
+		if entUserInfos := IC.MainMysql.SelectBySql(`SELECT name FROM entniche_user WHERE id = ? LIMIT 1`, in.ToEntUserId); entUserInfos != nil && len(*entUserInfos) > 0 {
+			entUserInfo := (*entUserInfos)[0]
+			//用户名称
+			if name := MC.ObjToString(entUserInfo["name"]); name != "" {
+				b2 = true
+				content = fmt.Sprintf(content, name)
+			}
+		}
+		//
+		//保存参标--participate_user
+		b3 = IC.BaseMysql.InsertByTx(tx, "participate_bid_records", map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    in.EntUserId,
+			"position_id":    in.PositionId,
+			"project_id":     in.BidId,
+			"record_content": content,
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		return b && b2 && b3
+	}) {
+		logx.Info(in.PositionId, "---终止---", in.BidId)
+		return fmt.Errorf("终止参标更新信息出错")
+	}
+	return nil
+}
+
+//更新参标信息
+func UpdateParticipateInfo(in *bxcore.ParticipateActionReq) error {
+	if !IC.BaseMysql.ExecTx("终止参标", func(tx *sql.Tx) bool {
+		var (
+			ppu, pph bool
+			now      = time.Now()
+		)
+		//更新参标participate_user
+		ppu = IC.BaseMysql.UpdateOrDeleteBySqlByTx(tx, fmt.Sprintf(`UPDATE participate_user SET state = -1 ,update_date = %s WHERE position_id = ? AND ent_id = ? AND project_id = ?`, date.FormatDate(&now, date.Date_Full_Layout)), in.PositionId, in.EntId, in.BidId) > 0
+		//保存参标记录--participate_bid_records
+		pph = IC.BaseMysql.InsertByTx(tx, "participate_bid_records", map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    in.EntUserId,
+			"position_id":    in.PositionId,
+			"project_id":     in.BidId,
+			"record_content": "终止参标",
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		return ppu && pph
+	}) {
+		logx.Info(in.PositionId, "---终止---", in.BidId)
+		return fmt.Errorf("终止参标更新信息出错")
+	}
+	return nil
+}
+
+//保存参标信息
+func SaveParticipateInfo(in *bxcore.ParticipateActionReq) error {
+	if !IC.BaseMysql.ExecTx("保存|更新参标信息及保存参标记录", func(tx *sql.Tx) bool {
+		var (
+			ppu, pph bool
+			now      = time.Now()
+		)
+		//保存参标记录participate_bid_records
+		if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM `participate_user` WHERE position_id = ? AND project_id = ?  AND ent_id = ?", in.PositionId, in.BidId, in.EntId); c > 0 {
+			ppu = IC.BaseMysql.UpdateOrDeleteBySqlByTx(tx, fmt.Sprintf(`UPDATE participate_user SET state = 0 ,update_date = %s WHERE position_id = ? AND ent_id = ? AND project_id = ?`, date.FormatDate(&now, date.Date_Full_Layout)), in.PositionId, in.EntId, in.BidId) > 0
+		}
+		//保存参标--participate_user
+		pph = IC.BaseMysql.InsertByTx(tx, "participate_bid_records", map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    in.EntUserId,
+			"position_id":    in.PositionId,
+			"project_id":     in.BidId,
+			"record_content": "参标",
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		return ppu && pph
+	}) {
+		logx.Info(in.PositionId, "---保存---", in.BidId)
+		return fmt.Errorf("保存参标信息出错")
+	}
+	return nil
+}
+
+//查询当前招标信息是否已被参标
+func IsParticipatedByBidId(query string) bool {
+	return IC.BaseMysql.CountBySql(query) > 0
+}
+
 //获取参标权限
 //获取参标权限
 func GetParticipateIsAllow(query map[string]interface{}) (b bool) {
 func GetParticipateIsAllow(query map[string]interface{}) (b bool) {
 	if info, ok := IC.Mgo.FindOne(PartTable, query); ok {
 	if info, ok := IC.Mgo.FindOne(PartTable, query); ok {
@@ -33,6 +140,12 @@ func UpdateParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) error {
 		"i_positionid": in.PositionId,
 		"i_positionid": in.PositionId,
 	}
 	}
 	if in.PositionType > 0 {
 	if in.PositionType > 0 {
+		//企业版 判断是否是管理员
+		//判断用户身份
+		userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+		if userInfo.Ent.EntRoleId == 0 {
+			return fmt.Errorf("当前企业身份无权限")
+		}
 		query["i_entid"] = in.EntId
 		query["i_entid"] = in.EntId
 	}
 	}
 	upsert := map[string]interface{}{
 	upsert := map[string]interface{}{

+ 65 - 5
jyBXCore/rpc/service/participate.go

@@ -1,22 +1,82 @@
 package service
 package service
 
 
 import (
 import (
+	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"fmt"
+	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/model/tidb"
 	"jyBXCore/rpc/model/tidb"
 	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/type/bxcore"
+	"jyBXCore/rpc/util"
 )
 )
 
 
 //参标动作:参标、终止参标、划转:in:参标;out:终止参标;transfer:划转
 //参标动作:参标、终止参标、划转:in:参标;out:终止参标;transfer:划转
 func ParticipateDo(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
 func ParticipateDo(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
+	//招标信息解密
+	in.BidId = encrypt.DecodeArticleId2ByCheck(in.BidId)[0]
+	if in.BidId == "" {
+		return nil, fmt.Errorf("当前招标信息有误")
+	}
+	//当前项目是否符合参标条件
+	participateBid := NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	projectInfos := participateBid.GetProjectByInfoId([]string{in.BidId})
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		return nil, fmt.Errorf("当前项目信息不满足参标条件")
+	}
+	//符合参标项目id
+	projectInfo := (*projectInfos)[0]
+	if projectInfo["_id"] != nil && MC.ObjToString(projectInfo["_id"]) != "" {
+		in.BidId = MC.ObjToString(projectInfo["_id"])
+	} else {
+		return nil, fmt.Errorf("当前项目信息有误")
+	}
 	switch in.ActionType {
 	switch in.ActionType {
 	case "in":
 	case "in":
 		//是否允许多人参标
 		//是否允许多人参标
-		//当前项目是否符合参标条件
-		//
-	case "out":
+		if isAllow := util.NewPartUserInfo(in.EntId, in.EntUserId, in.PositionId, in.PositionType).IsALLow(); !isAllow {
+			//如果不允许多人参标 当前项目是否已经有企业其他人员参标
+			query := fmt.Sprintf(`SELECT count(id) FROM participate_user WHERE %s AND project_id = %s AND state >-1`, "%s", in.BidId)
+			if in.PositionType > 0 {
+				query = fmt.Sprintf(query, fmt.Sprintf("ent_id = %d", in.EntId))
+			} else {
+				query = fmt.Sprintf(query, fmt.Sprintf("position_id = %d", in.PositionId))
+			}
+			if ok := tidb.IsParticipatedByBidId(query); ok {
+				return nil, fmt.Errorf("当前项目不允许多人参标")
+			}
+		}
+		//保存参标信息  更新当前企业参标项目记录
+		if err := tidb.SaveParticipateInfo(in); err != nil {
+			return nil, err
+		}
+	case "out": //终止参标
+		if err := tidb.UpdateParticipateInfo(in); err != nil {
+			return nil, err
+		}
 	case "transfer":
 	case "transfer":
-
+		if in.PositionType == 0 {
+			return nil, fmt.Errorf("当前企业身份有误")
+		}
+		//企业版 判断是否是管理员
+		//判断用户身份
+		userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+		if userInfo.Ent.EntRoleId == 0 { //1:企业管理员;2:部门管理员
+			return nil, fmt.Errorf("当前企业身份无权限")
+		}
+		//是否保留原跟踪人?
+		partUser := util.NewPartUserInfo(in.EntId, in.EntUserId, in.PositionId, in.PositionType)
+		isAllow := partUser.IsALLow()
+		if !isAllow && in.IsRetain {
+			//不允许多人参标,但是前端参数又是保留原参标人 互相矛盾
+			return nil, fmt.Errorf("当前项目只允许一人参标")
+		}
+		if err := tidb.TransferParticipate(in); err != nil {
+			return nil, err
+		}
 	}
 	}
-	return nil, nil
+	return &bxcore.ParticipateActionRes{
+		Data: true,
+	}, nil
 }
 }
 
 
 //参标设置更新及设置内容
 //参标设置更新及设置内容

+ 4 - 15
jyBXCore/rpc/service/participateBid.go

@@ -5,8 +5,7 @@ import (
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	elastic "app.yhyue.com/moapp/jybase/esv7"
 	elastic "app.yhyue.com/moapp/jybase/esv7"
 	"fmt"
 	"fmt"
-	"jyBXCore/entity"
-	"jyBXCore/rpc/init"
+	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/type/bxcore"
 	"strings"
 	"strings"
 	"time"
 	"time"
@@ -42,16 +41,6 @@ func NewParticipateBid(entId, entUserId, positionType, positionId int64) Partici
 	}
 	}
 }
 }
 
 
-// ParticipatePowerCheck 身份验证
-func (p *ParticipateBid) ParticipatePowerCheck(userInfoRpc entity.UserInfoRpc) bool {
-	userInfo := userInfoRpc.GetUserPowers()
-	p.EntRoleId = userInfo.Ent.EntRoleId
-	if userInfo.Member.Status > 0 || userInfo.Vip.Status > 0 {
-		return true
-	}
-	return false
-}
-
 // GetProjectByInfoId 根据查询有效的参标项目id(未到开标时间及开标时间不存在的)
 // GetProjectByInfoId 根据查询有效的参标项目id(未到开标时间及开标时间不存在的)
 func (p *ParticipateBid) GetProjectByInfoId(infoIds []string) *[]map[string]interface{} {
 func (p *ParticipateBid) GetProjectByInfoId(infoIds []string) *[]map[string]interface{} {
 	if len(infoIds) == 0 {
 	if len(infoIds) == 0 {
@@ -80,7 +69,7 @@ func (p *ParticipateBid) PersonalExistProject(projectId []string) map[string]str
 	}
 	}
 	argStr := strings.Join(arg, ",")
 	argStr := strings.Join(arg, ",")
 	query := "select project_id from participate_user where position_id = ? and project_id in (%s)  and state>=0"
 	query := "select project_id from participate_user where position_id = ? and project_id in (%s)  and state>=0"
-	rs := init.BaseMysql.SelectBySql(query, fmt.Sprintf(query, argStr), value)
+	rs := IC.BaseMysql.SelectBySql(query, fmt.Sprintf(query, argStr), value)
 	existProjectSet := map[string]struct{}{}
 	existProjectSet := map[string]struct{}{}
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明已经参标 这部分应该显示已参标
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明已经参标 这部分应该显示已参标
 		// 处理成map
 		// 处理成map
@@ -134,7 +123,7 @@ func (p *ParticipateBid) EntExistProject(projectId []string) map[string]string {
 	}
 	}
 	argStr := strings.Join(arg, ",") // todo
 	argStr := strings.Join(arg, ",") // todo
 	query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from participate_user where ent_id=? and  project_id in (%s) and state>=0  group by project_id "
 	query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from participate_user where ent_id=? and  project_id in (%s) and state>=0  group by project_id "
-	rs := init.BaseMysql.SelectBySql(query, fmt.Sprintf(query, argStr), value)
+	rs := IC.BaseMysql.SelectBySql(query, fmt.Sprintf(query, argStr), value)
 	existProjectMap := map[string]string{}
 	existProjectMap := map[string]string{}
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明这个项目公司里面已经参标 处理一下信息用于后边判断是否是自己参标
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明这个项目公司里面已经参标 处理一下信息用于后边判断是否是自己参标
 		// 处理成map
 		// 处理成map
@@ -277,7 +266,7 @@ func ContainId(ids string, objId string) bool {
 //  返回: "张三,李四,王五..."
 //  返回: "张三,李四,王五..."
 func GetNameByUserIds(ids string) *[]map[string]interface{} {
 func GetNameByUserIds(ids string) *[]map[string]interface{} {
 	query := "select  group_concat( name)  from" + TableEntnicheUser + "where id in (" + ids + ") "
 	query := "select  group_concat( name)  from" + TableEntnicheUser + "where id in (" + ids + ") "
-	rs := init.MainMysql.SelectBySql(query)
+	rs := IC.MainMysql.SelectBySql(query)
 	return rs
 	return rs
 }
 }
 
 

+ 156 - 59
jyBXCore/rpc/type/bxcore/bxcore.pb.go

@@ -2668,10 +2668,15 @@ type ParticipateSetUpInfoReq struct {
 	EntUserId    int64            `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       // 企业下用户id
 	EntUserId    int64            `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       // 企业下用户id
 	PositionId   int64            `protobuf:"varint,3,opt,name=positionId,proto3" json:"positionId,omitempty"`     // 职位id
 	PositionId   int64            `protobuf:"varint,3,opt,name=positionId,proto3" json:"positionId,omitempty"`     // 职位id
 	PositionType int64            `protobuf:"varint,4,opt,name=positionType,proto3" json:"positionType,omitempty"` // 职位类型 0个人 1企业
 	PositionType int64            `protobuf:"varint,4,opt,name=positionType,proto3" json:"positionType,omitempty"` // 职位类型 0个人 1企业
-	SetAction    string           `protobuf:"bytes,5,opt,name=setAction,proto3" json:"setAction,omitempty"`        //请求动作:U:更新,默认空
-	IsAllow      string           `protobuf:"bytes,6,opt,name=isAllow,proto3" json:"isAllow,omitempty"`            //是否允许多人参标
-	BidType      []*BidTypeReq    `protobuf:"bytes,7,rep,name=bidType,proto3" json:"bidType,omitempty"`
-	RemindRule   []*RemindRuleReq `protobuf:"bytes,8,rep,name=remindRule,proto3" json:"remindRule,omitempty"`
+	MgoUserId    string           `protobuf:"bytes,5,opt,name=mgoUserId,proto3" json:"mgoUserId,omitempty"`        //原userId
+	AppId        string           `protobuf:"bytes,6,opt,name=appId,proto3" json:"appId,omitempty"`                //剑鱼默认10000
+	UserId       string           `protobuf:"bytes,7,opt,name=userId,proto3" json:"userId,omitempty"`              //用户id
+	NewUserId    int64            `protobuf:"varint,8,opt,name=newUserId,proto3" json:"newUserId,omitempty"`       //base_user_id 新用户id
+	AccountId    int64            `protobuf:"varint,9,opt,name=accountId,proto3" json:"accountId,omitempty"`       //账户id
+	SetAction    string           `protobuf:"bytes,10,opt,name=setAction,proto3" json:"setAction,omitempty"`       //请求动作:U:更新,默认空
+	IsAllow      string           `protobuf:"bytes,11,opt,name=isAllow,proto3" json:"isAllow,omitempty"`           //是否允许多人参标
+	BidType      []*BidTypeReq    `protobuf:"bytes,12,rep,name=bidType,proto3" json:"bidType,omitempty"`
+	RemindRule   []*RemindRuleReq `protobuf:"bytes,13,rep,name=remindRule,proto3" json:"remindRule,omitempty"`
 }
 }
 
 
 func (x *ParticipateSetUpInfoReq) Reset() {
 func (x *ParticipateSetUpInfoReq) Reset() {
@@ -2734,6 +2739,41 @@ func (x *ParticipateSetUpInfoReq) GetPositionType() int64 {
 	return 0
 	return 0
 }
 }
 
 
+func (x *ParticipateSetUpInfoReq) GetMgoUserId() string {
+	if x != nil {
+		return x.MgoUserId
+	}
+	return ""
+}
+
+func (x *ParticipateSetUpInfoReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *ParticipateSetUpInfoReq) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *ParticipateSetUpInfoReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *ParticipateSetUpInfoReq) GetAccountId() int64 {
+	if x != nil {
+		return x.AccountId
+	}
+	return 0
+}
+
 func (x *ParticipateSetUpInfoReq) GetSetAction() string {
 func (x *ParticipateSetUpInfoReq) GetSetAction() string {
 	if x != nil {
 	if x != nil {
 		return x.SetAction
 		return x.SetAction
@@ -3019,10 +3059,15 @@ type ParticipateActionReq struct {
 	EntUserId    int64  `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       // 企业下用户id
 	EntUserId    int64  `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`       // 企业下用户id
 	PositionId   int64  `protobuf:"varint,3,opt,name=positionId,proto3" json:"positionId,omitempty"`     // 职位id
 	PositionId   int64  `protobuf:"varint,3,opt,name=positionId,proto3" json:"positionId,omitempty"`     // 职位id
 	PositionType int64  `protobuf:"varint,4,opt,name=positionType,proto3" json:"positionType,omitempty"` // 职位类型 0个人 1企业
 	PositionType int64  `protobuf:"varint,4,opt,name=positionType,proto3" json:"positionType,omitempty"` // 职位类型 0个人 1企业
-	BidId        string `protobuf:"bytes,5,opt,name=bidId,proto3" json:"bidId,omitempty"`                //招标信息id
-	ToEntUserId  string `protobuf:"bytes,6,opt,name=toEntUserId,proto3" json:"toEntUserId,omitempty"`    //划转对象的企业用户id
-	IsRetain     bool   `protobuf:"varint,7,opt,name=isRetain,proto3" json:"isRetain,omitempty"`         //是否保留原跟踪人
-	ActionType   string `protobuf:"bytes,8,opt,name=actionType,proto3" json:"actionType,omitempty"`      //in:参标;out:终止参标;transfer:划转
+	MgoUserId    string `protobuf:"bytes,5,opt,name=mgoUserId,proto3" json:"mgoUserId,omitempty"`        //原userId
+	AppId        string `protobuf:"bytes,6,opt,name=appId,proto3" json:"appId,omitempty"`                //剑鱼默认10000
+	UserId       string `protobuf:"bytes,7,opt,name=userId,proto3" json:"userId,omitempty"`              //用户id
+	NewUserId    int64  `protobuf:"varint,8,opt,name=newUserId,proto3" json:"newUserId,omitempty"`       //base_user_id 新用户id
+	AccountId    int64  `protobuf:"varint,9,opt,name=accountId,proto3" json:"accountId,omitempty"`       //账户id
+	BidId        string `protobuf:"bytes,10,opt,name=bidId,proto3" json:"bidId,omitempty"`               //招标信息id
+	ToEntUserId  string `protobuf:"bytes,11,opt,name=toEntUserId,proto3" json:"toEntUserId,omitempty"`   //划转对象的企业用户id
+	IsRetain     bool   `protobuf:"varint,12,opt,name=isRetain,proto3" json:"isRetain,omitempty"`        //是否保留原跟踪人
+	ActionType   string `protobuf:"bytes,13,opt,name=actionType,proto3" json:"actionType,omitempty"`     //in:参标;out:终止参标;transfer:划转
 }
 }
 
 
 func (x *ParticipateActionReq) Reset() {
 func (x *ParticipateActionReq) Reset() {
@@ -3085,6 +3130,41 @@ func (x *ParticipateActionReq) GetPositionType() int64 {
 	return 0
 	return 0
 }
 }
 
 
+func (x *ParticipateActionReq) GetMgoUserId() string {
+	if x != nil {
+		return x.MgoUserId
+	}
+	return ""
+}
+
+func (x *ParticipateActionReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *ParticipateActionReq) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *ParticipateActionReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *ParticipateActionReq) GetAccountId() int64 {
+	if x != nil {
+		return x.AccountId
+	}
+	return 0
+}
+
 func (x *ParticipateActionReq) GetBidId() string {
 func (x *ParticipateActionReq) GetBidId() string {
 	if x != nil {
 	if x != nil {
 		return x.BidId
 		return x.BidId
@@ -4041,7 +4121,7 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19,
 	0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19,
 	0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
 	0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
 	0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
 	0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
-	0xae, 0x02, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53,
+	0xb6, 0x03, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53,
 	0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65,
 	0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65,
 	0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49,
 	0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49,
 	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02,
 	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02,
@@ -4050,59 +4130,76 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12,
 	0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12,
 	0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18,
 	0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18,
 	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54,
 	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54,
-	0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
-	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x07, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x2c, 0x0a, 0x07, 0x62,
-	0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62,
-	0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71,
-	0x52, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x72, 0x65, 0x6d,
-	0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e,
-	0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c,
-	0x65, 0x52, 0x65, 0x71, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65,
-	0x22, 0x3a, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12,
-	0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
-	0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20,
-	0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x0d,
-	0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a,
-	0x08, 0x62, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x08, 0x62, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x6d,
-	0x61, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65,
-	0x6d, 0x61, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x14,
-	0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70,
-	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x2c,
-	0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
-	0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65,
-	0x52, 0x65, 0x71, 0x52, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x0a,
-	0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
-	0x32, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64,
-	0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52,
-	0x75, 0x6c, 0x65, 0x22, 0x7f, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
-	0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
-	0x32, 0x1c, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63,
-	0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04,
-	0x64, 0x61, 0x74, 0x61, 0x22, 0x82, 0x02, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
-	0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
-	0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e,
-	0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49,
-	0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70,
-	0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
-	0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x64, 0x49, 0x64, 0x18, 0x05,
+	0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73,
+	0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+	0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x41,
+	0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x73, 0x41, 0x6c,
+	0x6c, 0x6f, 0x77, 0x12, 0x2c, 0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x42, 0x69,
+	0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x52, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70,
+	0x65, 0x12, 0x35, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x18,
+	0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x52,
+	0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x52, 0x0a, 0x72, 0x65,
+	0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x42, 0x69, 0x64, 0x54,
+	0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
+	0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
+	0x74, 0x65, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75,
+	0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74,
+	0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74,
+	0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x6f, 0x64, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07,
+	0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69,
+	0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x2c, 0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x79, 0x70,
+	0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65,
+	0x2e, 0x42, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x52, 0x07, 0x62, 0x69, 0x64,
+	0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75,
+	0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72,
+	0x65, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x52,
+	0x0a, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x22, 0x7f, 0x0a, 0x17, 0x50,
+	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70, 0x49,
+	0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x64, 0x61,
+	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72,
+	0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74,
+	0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8a, 0x03, 0x0a,
+	0x14, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65,
+	0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
+	0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x73,
+	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70,
+	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73,
+	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a,
+	0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61,
+	0x70, 0x70, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
+	0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65,
+	0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75,
+	0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f,
+	0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x64, 0x49, 0x64, 0x18, 0x0a,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x74,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x74,
-	0x6f, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+	0x6f, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x0b, 0x74, 0x6f, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a,
 	0x52, 0x0b, 0x74, 0x6f, 0x45, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a,
-	0x08, 0x69, 0x73, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
+	0x08, 0x69, 0x73, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52,
 	0x08, 0x69, 0x73, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74,
 	0x08, 0x69, 0x73, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74,
-	0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
+	0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
 	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x5e, 0x0a, 0x14, 0x50, 0x61, 0x72,
 	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x5e, 0x0a, 0x14, 0x50, 0x61, 0x72,
 	0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
 	0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
 	0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
 	0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,

+ 40 - 0
jyBXCore/rpc/util/search.go

@@ -359,3 +359,43 @@ func GetPublishTime(y, m int, publishTime string) string {
 	}
 	}
 	return ""
 	return ""
 }
 }
+
+// GetQueryItems 免费 标题(title)  正文(content) 老用户【中标企业(winner)】
+// 付费用户 全部(all)、标题(title)  正文(content)  会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
+// 项目名称projectname和标的物purchasing(ppa)
+func GetQueryItems(selectType string, limitOldTime, registerData int64, isPay bool) (items []string) {
+	if isPay {
+		for _, t := range strings.Split(selectType, ",") {
+			if t == "content" {
+				items = append(items, "detail")
+			} else if t == "buyer" {
+				items = append(items, "mbuyer")
+			} else if t == "winner" {
+				items = append(items, "mwinner")
+			} else if t == "agency" {
+				items = append(items, "magency")
+			} else if t == "title" {
+				items = append(items, "title")
+			} else if t == "ppa" {
+				items = append(items, []string{"purchasing", "projectname.pname"}...)
+			} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+				items = append(items, "filetext")
+			}
+		}
+		return
+	}
+	//老用户 使用付费功能
+	isOldUser := registerData != 0 && registerData < limitOldTime
+	for _, t := range strings.Split(selectType, ",") {
+		if t == "winner" && isOldUser {
+			items = append(items, "mwinner")
+		} else if t == "title" {
+			items = append(items, "title")
+		} else if t == "content" {
+			items = append(items, "detail")
+		} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+			items = append(items, "filetext")
+		}
+	}
+	return
+}