瀏覽代碼

feat:参标、终止、划转

wangshan 2 年之前
父節點
當前提交
02353b28c8

+ 2 - 1
jyBXCore/api/bxcore.api

@@ -130,7 +130,7 @@ type (
 	//用户参标、终止参标及划转接口开发
 	participateActionReq {
 		baseParam
-		BidId       string `json:"bidId,optional"`                     //招标信息id ,已加密。多个,号隔开
+		BidIds      string `json:"bidIds,optional"`                    //招标信息id ,已加密。多个,号隔开
 		ProjectIds  string `json:"projectIds,optional"`                //项目信息id,已加密。多个,号隔开
 		ToEntUserId string `json:"toEntUserId,optional"`               //划转对象的企业用户id
 		IsRetain    bool   `json:"isRetain,optional"`                  //是否保留原跟踪人
@@ -151,6 +151,7 @@ type (
 		PageSize      int64  `json:"pageSize,default=10"`       //每页数据量
 		PageNum       int64  `json:"pageNum,default=0"`         //当前页码
 		Identity      string `path:"identity,options=mine|ent"` //我的:mine;企业:ent
+		OrderNum      int64  `json:"orderNum,default=0"`        //排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
 	}
 )
 service bxcore-api {

+ 1 - 1
jyBXCore/api/internal/logic/participateActionLogic.go

@@ -39,7 +39,7 @@ func (l *ParticipateActionLogic) ParticipateAction(req *types.ParticipateActionR
 		UserId:       req.UserId,
 		NewUserId:    req.NewUserId,
 		ProjectIds:   req.ProjectIds,
-		BidId:        req.BidId,
+		BidIds:       req.BidIds,
 		ToEntUserId:  req.ToEntUserId,
 		IsRetain:     req.IsRetain,
 		ActionType:   req.ActionType,

+ 1 - 7
jyBXCore/api/internal/logic/participateListLogic.go

@@ -50,14 +50,8 @@ func (l *ParticipateListLogic) ParticipateList(req *types.ParticipateListReq) (r
 		EntUserIds:    req.EntUserIds,
 		PageSize:      req.PageSize,
 		PageNum:       req.PageNum,
+		OrderNum:      req.OrderNum,
 	})
-	if err != nil {
-		return &types.CommonResp{
-			Err_code: res.ErrCode,
-			Err_msg:  res.ErrMsg,
-			Data:     false,
-		}, nil
-	}
 	return &types.CommonResp{
 		Err_code: res.ErrCode,
 		Err_msg:  res.ErrMsg,

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

@@ -122,7 +122,7 @@ type ParticipateSetUpInfoReq struct {
 
 type ParticipateActionReq struct {
 	BaseParam
-	BidId       string `json:"bidId,optional"`                     //招标信息id ,已加密。多个,号隔开
+	BidIds      string `json:"bidIds,optional"`                    //招标信息id ,已加密。多个,号隔开
 	ProjectIds  string `json:"projectIds,optional"`                //项目信息id,已加密。多个,号隔开
 	ToEntUserId string `json:"toEntUserId,optional"`               //划转对象的企业用户id
 	IsRetain    bool   `json:"isRetain,optional"`                  //是否保留原跟踪人
@@ -143,4 +143,5 @@ type ParticipateListReq struct {
 	PageSize      int64  `json:"pageSize,default=10"`       //每页数据量
 	PageNum       int64  `json:"pageNum,default=0"`         //当前页码
 	Identity      string `path:"identity,options=mine|ent"` //我的:mine;企业:ent
+	OrderNum      int64  `json:"orderNum,default=0"`        //排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
 }

+ 5 - 2
jyBXCore/rpc/bxcore.proto

@@ -344,7 +344,7 @@ message ParticipateActionReq{
   string  userId = 7;//用户id
   int64  newUserId = 8;//base_user_id 新用户id
   int64 accountId = 9; //账户id
-  string  bidId = 10;//招标信息id
+  string  bidIds = 10;//招标信息id
   string  toEntUserId = 11;//划转对象的企业用户id
   bool isRetain = 12;//是否保留原跟踪人
   string actionType = 13;//in:参标;out:终止参标;transfer:划转
@@ -378,6 +378,7 @@ message ParticipateListReq{
   string  userId = 19;//用户id
   int64  newUserId = 20;//base_user_id 新用户id
   int64 accountId = 21; //账户id
+  int64 orderNum = 22;//排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
 }
 //参标列表
 message  ParticipateList{
@@ -388,7 +389,9 @@ message  ParticipateList{
   string participants = 5;//参标人 多个,号隔开
   string bidTime = 6;//招标日期
   string bidEndTime = 7;//投标截止日期
-  string updateStatusTime = 8;//参标更新状态
+  string bidOpenTime = 8;//投标截止日期
+  string updateStatusTime = 9;//更新状态时间
+  string updateStatusCon = 10;//投标状态更新
 }
 message  ParticipateData{
   int64 count = 1;

+ 10 - 1
jyBXCore/rpc/internal/logic/participateactionlogic.go

@@ -26,5 +26,14 @@ func NewParticipateActionLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 
 //  项目参标 终止参标 划转等动作 in:参标;out:终止参标;transfer:划转
 func (l *ParticipateActionLogic) ParticipateAction(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
-	return service.ParticipateDo(in)
+	var res = &bxcore.ParticipateActionRes{
+		Data: true,
+	}
+	err := service.ParticipateDo(in)
+	if err != nil {
+		res.ErrCode = -1
+		res.ErrMsg = err.Error()
+		res.Data = false
+	}
+	return res, nil
 }

+ 25 - 0
jyBXCore/rpc/model/es/project.go

@@ -52,3 +52,28 @@ func GetProjectByInfoId(infoIds []string) *[]map[string]interface{} {
 	return projectResult
 
 }
+
+// GetBidInfoByPId 根据项目id查询招标信息id
+func GetBidInfoByPId(infoId string) *[]map[string]interface{} {
+	query := `{
+				  "query": {
+					"bool": {
+					  "must": [
+						{
+						  "term": {
+							"projectset.id": "` + infoId + `"
+						  }
+						}
+					  ]
+					}
+				  },
+				  "from": 0,
+				  "size": 1,
+				  "sort": [],
+				  "facets": {}
+				}`
+
+	projectResult := elastic.Get(IndexProjectSet, TypeProjectSet, query)
+	return projectResult
+
+}

+ 603 - 0
jyBXCore/rpc/model/mysql/participateBid.go

@@ -0,0 +1,603 @@
+package mysql
+
+import (
+	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"database/sql"
+	"encoding/json"
+	"fmt"
+	"github.com/zeromicro/go-zero/core/logx"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/type/bxcore"
+	"strconv"
+	"strings"
+	"time"
+)
+
+var (
+	PartTable = "participate"
+)
+
+//划转参标信息
+func TransferParticipateInfo(projectId string, in *bxcore.ParticipateActionReq) error {
+	defer MC.Catch()
+	//保存或更新新跟踪人
+	if !IC.BaseMysql.ExecTx("划转参标信息", func(tx *sql.Tx) bool {
+		var (
+			b1            = true
+			b2, b3        bool
+			now           = time.Now()
+			content       = "%s划转给%s%s"
+			lastNotes     = ",保留原参标人"
+			fromUserNames []string
+			ids           []int
+		)
+		partInfo := IC.BaseMysql.SelectBySqlByTx(tx, "SELECT id,position_id FROM `participate_user` WHERE  project_id = ?  AND ent_id = ? AND state > -1", projectId, in.EntId)
+		if partInfo == nil || len(*partInfo) == 0 {
+			logx.Info("当前项目不满足划转条件")
+			return false
+		} else {
+			for _, v := range *partInfo {
+				ids = append(ids, MC.IntAll(v["id"]))
+				positionId := MC.Int64All(v["position_id"])
+				userInfo := IC.Middleground.UserCenter.IdentityByPositionId(positionId)
+				if userInfo.EntUserName != "" {
+					fromUserNames = append(fromUserNames, userInfo.EntUserName)
+				}
+			}
+		}
+		if len(fromUserNames) == 0 {
+			logx.Info("原参标人信息查询有误")
+			return false
+		}
+		//是否保留原参标人
+		if !in.IsRetain {
+			lastNotes = ""
+			//不保留 原参标人,获取把原参标人信息
+			//当前项目有参标人 更新参标人状态
+			b1 = IC.BaseMysql.UpdateByTx(tx, "participate_user", map[string]interface{}{
+				"ent_id":     in.EntId,
+				"project_id": projectId,
+			}, map[string]interface{}{
+				"state":       -1,
+				"mark":        -2, //0:参标;1:被划入;-1:终止参标;-2:被划走
+				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+			})
+		}
+		//查询划转人信息
+		entUserId, _ := strconv.ParseInt(in.ToEntUserId, 10, 64)
+		userInfo := IC.Middleground.UserCenter.IdentityByEntUserId(entUserId)
+		positionId := userInfo.PositionId
+		content = fmt.Sprintf(content, strings.Join(fromUserNames, ","), userInfo.EntUserName, lastNotes)
+		//划转记录
+		b2 = IC.BaseMysql.InsertByTx(tx, "participate_bid_records", map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    entUserId,
+			"position_id":    positionId,
+			"project_id":     projectId,
+			"record_content": content,
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		//保存参标--participate_user
+		//查看是否参标过当前项目
+		if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM `participate_user` WHERE position_id = ? AND project_id = ?  AND ent_id = ?", positionId, projectId, in.EntId); c > 0 {
+			//更新
+			b3 = IC.BaseMysql.UpdateByTx(tx, "participate_user", map[string]interface{}{
+				"position_id": positionId,
+				"project_id":  projectId,
+				"ent_id":      in.EntId,
+			}, map[string]interface{}{
+				"state":       0,
+				"mark":        1, //0:参标;1:被划入;-1:终止参标;-2:被划走
+				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+			})
+		} else {
+			//保存
+			b3 = IC.BaseMysql.InsertByTx(tx, "participate_user", map[string]interface{}{
+				"ent_id":      in.EntId,
+				"ent_user_id": entUserId,
+				"position_id": positionId,
+				"project_id":  projectId,
+				"state":       0,
+				"mark":        1, //0:参标;1:被划入;-1:终止参标;-2:被划走
+				"create_date": date.FormatDate(&now, date.Date_Full_Layout),
+				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+			}) > 0
+		}
+		return b1 && b2 && b3
+	}) {
+		logx.Info(in.PositionId, "---终止---", projectId)
+		return fmt.Errorf("终止参标更新信息出错")
+	}
+	return nil
+}
+
+//终止参标
+func CancelParticipateInfo(in *bxcore.ParticipateActionReq, roleId int64) error {
+	defer MC.Catch()
+	if !IC.BaseMysql.ExecTx("终止参标", func(tx *sql.Tx) bool {
+		var (
+			b1, b2 bool
+			now    = time.Now()
+			tip    = "终止参标(被)"
+		)
+		//管理员终止:当前项目 其他参标人也被终止
+		query := map[string]interface{}{
+			"project_id": in.ProjectIds,
+			"ent_id":     in.EntId,
+		}
+		//个人终止:仅仅终止本人参标项目
+		if roleId == 0 {
+			query["position_id"] = in.PositionId
+			tip = "终止参标"
+		}
+		insert := map[string]interface{}{
+			"state":       -1,
+			"mark":        -1, //0:参标;1:被划入;-1:终止参标;-2:被划走
+			"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+		}
+		//更新参标participate_user
+		b1 = IC.BaseMysql.UpdateByTx(tx, "participate_user", query, insert)
+		//保存参标记录--participate_bid_records
+		b2 = 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.ProjectIds,
+			"record_content": tip,
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		return b1 && b2
+	}) {
+		logx.Info(in.PositionId, "---终止---", in.ProjectIds)
+		return fmt.Errorf("终止参标更新信息出错")
+	}
+	return nil
+}
+
+//保存参标信息
+func SaveParticipateInfo(in *bxcore.ParticipateActionReq) error {
+	defer MC.Catch()
+	if !IC.BaseMysql.ExecTx("保存|更新参标信息及保存参标记录", func(tx *sql.Tx) bool {
+		var (
+			b1, b2, b3 bool
+			now        = time.Now()
+		)
+		//保存参标--participate_user
+		//查看是否参标过当前项目
+		if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM `participate_user` WHERE position_id = ? AND project_id = ?  AND ent_id = ?", in.PositionId, in.ProjectIds, in.EntId); c > 0 {
+			//更新
+			b1 = IC.BaseMysql.UpdateByTx(tx, "participate_user", map[string]interface{}{
+				"state":       0,
+				"mark":        0,
+				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+			}, map[string]interface{}{
+				"position_id": in.PositionId,
+				"ent_id":      in.EntId,
+				"project_id":  in.ProjectIds,
+			})
+		} else {
+			//保存
+			b1 = IC.BaseMysql.InsertByTx(tx, "participate_user", map[string]interface{}{
+				"ent_id":      in.EntId,
+				"ent_user_id": in.EntUserId,
+				"position_id": in.PositionId,
+				"project_id":  in.ProjectIds,
+				"state":       0,
+				"mark":        0,
+				"create_date": date.FormatDate(&now, date.Date_Full_Layout),
+				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
+			}) > 0
+		}
+		if !b1 {
+			return false
+		}
+		//保存参标记录participate_bid_records
+		b2 = 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.ProjectIds,
+			"record_content": "参标",
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		if !b2 {
+			return false
+		}
+		//保存或更新项目信息
+		//有问题 其他回滚,项目信息不用回滚
+		b3 = UpdateProjectInfo(in.ProjectIds, es.GetProjectInfo(in.ProjectIds), es.GetBiddingInfo(in.BidIds)) == nil
+		return b1 && b2 && b3
+	}) {
+		logx.Info(in.PositionId, "---保存---", in.BidIds)
+		return fmt.Errorf("保存参标信息出错")
+	}
+	return nil
+}
+
+//查询当前招标信息是否已被参标
+func IsParticipatedByBidId(in *bxcore.ParticipateActionReq) bool {
+	defer MC.Catch()
+	//如果不允许多人参标 当前项目是否已经有企业其他人员参标
+	query := fmt.Sprintf(`SELECT count(id) FROM participate_user WHERE %s AND project_id = %s AND state >-1`, "%s", in.BidIds)
+	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))
+	}
+	return IC.BaseMysql.CountBySql(query) > 0
+}
+
+//获取参标权限
+func GetParticipateIsAllow(query map[string]interface{}) (b bool) {
+	defer MC.Catch()
+	if info, ok := IC.Mgo.FindOne(PartTable, query); ok {
+		if info != nil {
+			if (*info)["i_isallow"] != nil {
+				b = MC.IntAll((*info)["i_isallow"]) > 0
+			}
+		}
+	}
+	return
+}
+
+//更新设置信息
+func UpdateParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) error {
+	defer MC.Catch()
+	query := map[string]interface{}{
+		"i_positionid": in.PositionId,
+	}
+	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
+	}
+	upsert := map[string]interface{}{
+		"i_entid":      in.EntId,
+		"i_entuserid":  in.EntUserId,
+		"i_positionid": in.PositionId,
+		"l_createtime": time.Now().Unix(),
+	}
+	if in.IsAllow != "" {
+		isAllow, _ := strconv.Atoi(in.IsAllow)
+		upsert["i_isallow"] = isAllow
+	}
+	if len(in.BidType) > 0 {
+		upsert["o_bidtype"] = in.BidType
+	}
+	if len(in.RemindRule) > 0 {
+		upsert["o_remindrule"] = in.RemindRule
+	}
+	if ok := IC.Mgo.Update(PartTable, query, map[string]interface{}{
+		"$set": upsert,
+	}, true, false); ok {
+		return nil
+	}
+	return fmt.Errorf("更新失败")
+}
+
+//查询企业|个人参标设置信息
+func GetParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.ParticipateSetUpInfo, error) {
+	defer MC.Catch()
+	query := map[string]interface{}{
+		"i_positionid": in.PositionId,
+	}
+	if in.PositionType > 0 {
+		query["i_entid"] = in.EntId
+	}
+	if setInfo, ok := IC.Mgo.FindOne(PartTable, query); ok {
+		var (
+			isAllow    = ""
+			bidType    []*bxcore.BidTypeReq
+			remindRule []*bxcore.RemindRuleReq
+		)
+		bidType = append(bidType, &bxcore.BidTypeReq{
+			Name:    "直接投标",
+			Content: []string{"未报名", "已报名", "投标决策", "编制投标文件", "递交投标文件", "中标公示", "签合同", "已结束"},
+		}, &bxcore.BidTypeReq{
+			Name:    "渠道投标",
+			Content: []string{"已报名", "签合同", "已结束"},
+		})
+		remindRule = append(remindRule, &bxcore.RemindRuleReq{
+			BidState:  "直接投标",
+			Remainder: 72,
+			Node:      "编制投标文件",
+		})
+		if setInfo != nil {
+			if (*setInfo)["i_isallow"] != nil {
+				isAllow = strconv.Itoa(MC.IntAll((*setInfo)["i_isallow"]))
+			}
+			if (*setInfo)["bidType"] != nil {
+				if sbb, err := json.Marshal((*setInfo)["o_bidtype"]); err == nil {
+					if err := json.Unmarshal(sbb, &bidType); err != nil {
+						logx.Info("bidType json un err:", err.Error())
+						return nil, err
+					}
+				} else {
+					logx.Info("bidType json err:", err.Error())
+					return nil, err
+				}
+			}
+			if (*setInfo)["o_remindrule"] != nil {
+				if sbr, err := json.Marshal((*setInfo)["o_remindrule"]); err == nil {
+					if err := json.Unmarshal(sbr, &remindRule); err != nil {
+						logx.Info("remindRule json un err:", err.Error())
+						return nil, err
+					}
+				} else {
+					logx.Info("remindRule json err:", err.Error())
+					return nil, err
+				}
+			}
+		}
+		return &bxcore.ParticipateSetUpInfo{
+			IsAllow:    isAllow,
+			BidType:    bidType,
+			RemindRule: remindRule,
+		}, nil
+	}
+	return nil, nil
+}
+
+//保存或更新tidb 项目信息
+func UpdateProjectInfo(id string, pInfo map[string]interface{}, bInfo map[string]interface{}) error {
+	//id 项目id
+	//name 项目名称
+	//area  省份
+	//city 城市
+	//buyer 采购单位
+	//budget 预算
+	//bid_open_time  开标时间
+	//bid_time 招标时间  bidding表
+	//bid_end_time 开标结束时间  bidding表
+	//pici 批次 轮询更新数据
+	//
+	projectInfo := map[string]interface{}{
+		"id":     id,
+		"name":   MC.ObjToString(pInfo["projectname"]),
+		"area":   MC.ObjToString(pInfo["area"]),
+		"city":   MC.ObjToString(pInfo["city"]),
+		"buyer":  MC.ObjToString(pInfo["buyer"]),
+		"budget": MC.Int64All(pInfo["budget"]),
+	}
+	if pInfo["bidopentime"] != nil {
+		openTime := pInfo["bidopentime"]
+		projectInfo["bid_open_time"] = date.FormatDateWithObj(&openTime, date.Date_Full_Layout)
+	}
+	if pInfo["pici"] != nil {
+		pici := pInfo["pici"]
+		projectInfo["pici"] = date.FormatDateWithObj(&pici, date.Date_Full_Layout)
+	}
+	// 项目表:zbtime 招标时间是 biding表:publishtime发布时间
+	if pInfo["zbtime"] != nil {
+		bidTime := pInfo["zbtime"]
+		projectInfo["bid_time"] = date.FormatDateWithObj(&bidTime, date.Date_Full_Layout)
+	}
+	if bInfo["bidendtime"] != nil {
+		bidEndTime := bInfo["bidendtime"]
+		projectInfo["bid_end_time"] = date.FormatDateWithObj(&bidEndTime, date.Date_Full_Layout)
+	}
+	if c := IC.BaseMysql.CountBySql(`SELECT COUNT(id) FROM project WHERE id = ?`, id); c > 0 {
+		if ok := IC.BaseMysql.Update("project", map[string]interface{}{
+			"id": id,
+		}, projectInfo); !ok {
+			return fmt.Errorf("项目信息更新异常", id)
+		}
+	} else {
+		if i := IC.BaseMysql.Insert("project", projectInfo); i < 0 {
+			return fmt.Errorf("项目信息插入异常", id)
+		}
+	}
+	return nil
+}
+
+//参标列表其他条件
+func ParticipateListSql(in *bxcore.ParticipateListReq) string {
+	//b  project表
+	//a  participate_user表
+	now := time.Now()
+	nowDate := date.FormatDate(&now, date.Date_Full_Layout)
+	//查询tidb  base_service.project
+	sql := ` `
+	//地区
+	if in.Area != "" {
+		sql += fmt.Sprintf(" AND pt.area IN ('%s') ", strings.ReplaceAll(in.Area, ",", "','"))
+	}
+	//城市
+	if in.City != "" {
+		sql += fmt.Sprintf(" AND pt.city IN ('%s') ", strings.ReplaceAll(in.City, ",", "','"))
+	}
+	//关键词
+	if in.Keywords != "" {
+		kSql := ` AND (`
+		for kk, kv := range strings.Split(in.Keywords, " ") {
+			if kk > 0 {
+				kSql += " OR "
+			}
+			kSql += " pt.name like '%" + kv + "%'"
+		}
+		kSql += `)`
+		sql += kSql
+	}
+	//招标日期
+	if in.BidTime != "" && strings.Contains(in.BidTime, "-") {
+		startTime := strings.Split(in.BidTime, "-")[0]
+		entTime := strings.Split(in.BidTime, "-")[1]
+		if startTime != "" {
+			sql += ` AND pt.bid_time > ` + startTime
+		}
+		if entTime != "" {
+			sql += ` AND pt.bid_time < ` + entTime
+		}
+	}
+	//招标截止日期
+	if in.BidEndTime != "" {
+		startTime := strings.Split(in.BidEndTime, "-")[0]
+		entTime := strings.Split(in.BidEndTime, "-")[1]
+		if startTime != "" {
+			sql += ` AND pt.bid_end_time > ` + startTime
+		}
+		if entTime != "" {
+			sql += ` AND pt.bid_end_time < ` + entTime
+		}
+	}
+	//开标时间
+	if in.BidOpenTime != "" {
+		startTime := strings.Split(in.BidOpenTime, "-")[0]
+		entTime := strings.Split(in.BidOpenTime, "-")[1]
+		if startTime != "" {
+			sql += ` AND pt.bid_open_time > ` + startTime
+		}
+		if entTime != "" {
+			sql += ` AND pt.bid_open_time < ` + entTime
+		}
+	}
+	//投标截止状态1:未截止;2:已截止;3:终止参标
+	if in.BidEndStatus > 0 {
+		switch in.BidEndStatus {
+		case 1:
+			sql += ` AND pt.bid_end_time > ` + nowDate
+		case 2:
+			sql += ` AND pt.bid_end_time < ` + nowDate
+		case 3:
+			sql += ` AND pug.state < 0 `
+		}
+	}
+	//开标状态1:未开标;2:已开标
+	if in.BidOpenStatus > 0 {
+		switch in.BidOpenStatus {
+		case 1:
+			sql += ` AND pt.bid_open_time > ` + nowDate
+		case 2:
+			sql += ` AND pt.bid_open_time < ` + nowDate
+		}
+	}
+	//参标人  管理员权限
+	if in.EntUserIds != "" && in.PositionType > 0 {
+		sql += ` AND pug.ent_user_id in ('` + strings.ReplaceAll(in.EntUserIds, ",", "','") + `')`
+	}
+	//默认按照投标截止日期正序排列、1:开标时间正序、2:更新状态时间倒序
+	switch in.OrderNum {
+	case 1:
+		sql += ` ORDER BY pug.update_date DESC`
+	case 2:
+		sql += ` ORDER BY pt.bid_time ASC`
+	default:
+		sql += ` ORDER BY pt.bid_end_time ASC`
+	}
+	logx.Info(sql)
+	return sql
+}
+
+//个人或员工查询参标列表
+func SingleParticipateList(in *bxcore.ParticipateListReq, otherSql string) (data *bxcore.ParticipateData, err error) {
+	defer MC.Catch()
+	data = &bxcore.ParticipateData{
+		Count: 0,
+		List:  []*bxcore.ParticipateList{},
+	}
+	//员工|个人列表
+	singlePersonSql := `SELECT %s FROM participate_user pug LEFT JOIN project pt ON pug.project_id = pt.id WHERE pug.position_id = ? `
+	singlePersonSql += otherSql
+	countSql := fmt.Sprintf(singlePersonSql, " COUNT(pt.id) ")
+	count := IC.BaseMysql.CountBySql(countSql, in.PositionId)
+	if count > 0 {
+		data.Count = count
+		listSql := fmt.Sprintf(singlePersonSql, "  pug.update_date,pt.* ")
+		//分页
+		listSql += fmt.Sprintf(` LIMIT %d,%d`, in.PageNum, in.PageSize)
+		list := IC.BaseMysql.SelectBySql(listSql, in.PositionId)
+		if list != nil && len(*list) > 0 {
+			for _, v := range *list {
+				data.List = append(data.List, &bxcore.ParticipateList{
+					Id:               encrypt.EncodeArticleId2ByCheck(MC.ObjToString(v["id"])),
+					ProjectName:      MC.ObjToString(v["name"]),
+					Buyer:            MC.ObjToString(v["buyer"]),
+					Budget:           MC.ObjToString(v["budget"]),
+					BidTime:          MC.ObjToString(v["bid_time"]),
+					BidEndTime:       MC.ObjToString(v["bid_end_time"]),
+					BidOpenTime:      MC.ObjToString(v["bid_open_time"]),
+					UpdateStatusTime: MC.ObjToString(v["update_date"]),
+					UpdateStatusCon:  GetParticipateContent(in.PositionId, MC.ObjToString(v["id"])), //查询最后一次 投标状态更新,
+				})
+			}
+			return data, nil
+		}
+		return nil, fmt.Errorf("数据异常")
+	}
+	return data, nil
+}
+
+//管理员获取参标列表数据
+func AdminParticipateList(in *bxcore.ParticipateListReq, otherSql string) (data *bxcore.ParticipateData, err error) {
+	defer MC.Catch()
+	data = &bxcore.ParticipateData{
+		Count: 0,
+		List:  []*bxcore.ParticipateList{},
+	}
+	adminSql := `SELECT %s FROM (SELECT pu.ent_id, pu.project_id, GROUP_CONCAT(pu.ent_user_id SEPARATOR ',') ent_user_id, MAX(pu.update_date) update_date FROM participate_user pu WHERE pu.ent_id = ? AND NOT EXISTS ( SELECT 1 FROM participate_user WHERE project_id = pu.project_id AND state > pu. state ) GROUP BY pu.project_id ) pug LEFT JOIN project pt ON pug.project_id = pt.id`
+	adminSql += otherSql
+	adminCountSql := fmt.Sprintf(adminSql, "COUNT(pt.id)")
+	count := IC.BaseMysql.CountBySql(adminCountSql, in.EntId)
+	if count > 0 {
+		data.Count = count
+		adminListSql := fmt.Sprintf(adminSql, "pt.*, pug.ent_user_id,pug.update_date")
+		list := IC.BaseMysql.SelectBySql(adminListSql, in.EntId)
+		if list != nil && len(*list) > 0 {
+			for _, v := range *list {
+				data.List = append(data.List, &bxcore.ParticipateList{
+					Id:               encrypt.EncodeArticleId2ByCheck(MC.ObjToString(v["id"])),
+					ProjectName:      MC.ObjToString(v["name"]),
+					Buyer:            MC.ObjToString(v["buyer"]),
+					Budget:           MC.ObjToString(v["budget"]),
+					BidTime:          MC.ObjToString(v["bid_time"]),
+					BidEndTime:       MC.ObjToString(v["bid_end_time"]),
+					BidOpenTime:      MC.ObjToString(v["bid_open_time"]),
+					UpdateStatusTime: MC.ObjToString(v["update_date"]),
+					UpdateStatusCon:  GetParticipateContent(in.EntId, MC.ObjToString(v["id"])), //查询最后一次 投标状态更新
+					Participants:     GetParticipateUserName(MC.ObjToString(v["ent_user_id"])), //参标人信息
+				})
+			}
+			return data, nil
+		}
+		return nil, fmt.Errorf("数据异常")
+	}
+	return data, nil
+}
+
+//获取最新参标 更新内容
+func GetParticipateContent(userId int64, projectId string) string {
+	recordsSql := `SELECT record_content FROM participate_bid_records WHERE (ent_id = ? OR position_id = ?) AND project_id = ? ORDER BY create_date DESC LIMIT 1;`
+	records := IC.BaseMysql.SelectBySql(recordsSql, userId, userId, projectId)
+	if records != nil && len(*records) > 0 {
+		rec := (*records)[0]
+		return MC.ObjToString(rec["record_content"])
+	}
+	return ""
+}
+
+//根据ent_user_id 获取参标人昵称,企业管理员现在都是“我”
+func GetParticipateUserName(entUserId string) string {
+	if entUserId != "" {
+		var userNames []string
+		for _, v := range strings.Split(entUserId, ",") {
+			entUserInfos := IC.MainMysql.SelectBySql(`SELECT * FROM entniche_user WHERE id = ?`, v)
+			if entUserInfos != nil && len(*entUserInfos) > 0 {
+				entUserInfo := (*entUserInfos)[0]
+				if entUserInfo["name"] != nil {
+					if userName := MC.ObjToString(entUserInfo["name"]); userName != "" {
+						userNames = append(userNames, userName)
+					}
+				}
+			}
+		}
+		return strings.Join(userNames, ",")
+	}
+	return ""
+}

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

@@ -1,328 +0,0 @@
-package tidb
-
-import (
-	MC "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/date"
-	"database/sql"
-	"encoding/json"
-	"fmt"
-	"github.com/zeromicro/go-zero/core/logx"
-	IC "jyBXCore/rpc/init"
-	"jyBXCore/rpc/model/es"
-	"jyBXCore/rpc/type/bxcore"
-	"strconv"
-	"strings"
-	"time"
-)
-
-var (
-	PartTable = "participate"
-)
-
-//划转参标信息
-func TransferParticipateInfo(projectId string, in *bxcore.ParticipateActionReq) error {
-	defer MC.Catch()
-	//保存或更新新跟踪人
-	if !IC.BaseMysql.ExecTx("划转参标信息", func(tx *sql.Tx) bool {
-		var (
-			b1            = true
-			b2, b3        bool
-			now           = time.Now()
-			content       = "%s划转给%s"
-			fromUserNames []string
-			ids           []int
-		)
-		//是否保留原参标人
-		if !in.IsRetain {
-			//不保留 原参标人,获取把原参标人信息
-			partInfo := IC.BaseMysql.SelectBySqlByTx(tx, "SELECT id,position_id FROM `participate_user` WHERE  project_id = ?  AND ent_id = ? AND state > -1", projectId, in.EntId)
-			if partInfo != nil && len(*partInfo) > 0 {
-				for _, v := range *partInfo {
-					ids = append(ids, MC.IntAll(v["id"]))
-					positionId := MC.Int64All(v["position_id"])
-					userInfo := IC.Middleground.UserCenter.IdentityByPositionId(positionId)
-					fromUserNames = append(fromUserNames, userInfo.EntUserName)
-				}
-			}
-			b1 = 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, projectId) > 0
-		}
-		//查询划转人信息
-		entUserId, _ := strconv.ParseInt(in.ToEntUserId, 10, 64)
-		userInfo := IC.Middleground.UserCenter.IdentityByEntUserId(entUserId)
-		positionId := userInfo.PositionId
-		content = fmt.Sprintf(content, strings.Join(fromUserNames, ","), userInfo.EntUserName)
-		//
-		//保存参标--participate_user
-		b3 = IC.BaseMysql.InsertByTx(tx, "participate_bid_records", map[string]interface{}{
-			"ent_id":         in.EntId,
-			"ent_user_id":    entUserId,
-			"position_id":    positionId,
-			"project_id":     projectId,
-			"record_content": content,
-			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
-		}) > 0
-		return b1 && b2 && b3
-	}) {
-		logx.Info(in.PositionId, "---终止---", projectId)
-		return fmt.Errorf("终止参标更新信息出错")
-	}
-	return nil
-}
-
-//终止参标
-func CancelParticipateInfo(projectId string, in *bxcore.ParticipateActionReq, roleId int64) error {
-	defer MC.Catch()
-	if !IC.BaseMysql.ExecTx("终止参标", func(tx *sql.Tx) bool {
-		var (
-			b1, b2 bool
-			now    = time.Now()
-			tip    = "终止参标(被)"
-		)
-		//管理员终止:当前项目 其他参标人也被终止
-		query := map[string]interface{}{
-			"project_id": projectId,
-			"ent_id":     in.EntId,
-		}
-		//个人终止:仅仅终止本人参标项目
-		if roleId == 0 {
-			query["position_id"] = in.PositionId
-			tip = "终止参标"
-		}
-		insert := map[string]interface{}{
-			"state":       -1,
-			"update_date": date.FormatDate(&now, date.Date_Full_Layout),
-		}
-		//更新参标participate_user
-		b1 = IC.BaseMysql.UpdateByTx(tx, "participate_user", query, insert)
-		//保存参标记录--participate_bid_records
-		b2 = 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":     projectId,
-			"record_content": tip,
-			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
-		}) > 0
-		return b1 && b2
-	}) {
-		logx.Info(in.PositionId, "---终止---", projectId)
-		return fmt.Errorf("终止参标更新信息出错")
-	}
-	return nil
-}
-
-//保存参标信息
-func SaveParticipateInfo(projectId string, in *bxcore.ParticipateActionReq) error {
-	defer MC.Catch()
-	if !IC.BaseMysql.ExecTx("保存|更新参标信息及保存参标记录", func(tx *sql.Tx) bool {
-		var (
-			b1, b2, b3 bool
-			now        = time.Now()
-		)
-		//保存参标--participate_user
-		//查看是否参标过当前项目
-		if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM `participate_user` WHERE position_id = ? AND project_id = ?  AND ent_id = ?", in.PositionId, projectId, in.EntId); c > 0 {
-			//更新
-			b1 = 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, projectId) > 0
-		} else {
-			//保存
-			b1 = IC.BaseMysql.InsertByTx(tx, "participate_user", map[string]interface{}{
-				"ent_id":      in.EntId,
-				"ent_user_id": in.EntUserId,
-				"position_id": in.PositionId,
-				"project_id":  in.PositionId,
-				"state":       0,
-				"create_date": date.FormatDate(&now, date.Date_Full_Layout),
-				"update_date": date.FormatDate(&now, date.Date_Full_Layout),
-			}) > 0
-		}
-		//保存参标记录participate_bid_records
-		b2 = 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":     projectId,
-			"record_content": "参标",
-			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
-		}) > 0
-		//保存或更新项目信息
-		//有问题 其他回滚,项目信息不用回滚
-		b3 = UpdateProjectInfo(projectId, es.GetProjectInfo(projectId), es.GetBiddingInfo(in.BidId)) == nil
-		return b1 && b2 && b3
-	}) {
-		logx.Info(in.PositionId, "---保存---", in.BidId)
-		return fmt.Errorf("保存参标信息出错")
-	}
-	return nil
-}
-
-//查询当前招标信息是否已被参标
-func IsParticipatedByBidId(in *bxcore.ParticipateActionReq) bool {
-	defer MC.Catch()
-	//如果不允许多人参标 当前项目是否已经有企业其他人员参标
-	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))
-	}
-	return IC.BaseMysql.CountBySql(query) > 0
-}
-
-//获取参标权限
-func GetParticipateIsAllow(query map[string]interface{}) (b bool) {
-	defer MC.Catch()
-	if info, ok := IC.Mgo.FindOne(PartTable, query); ok {
-		if info != nil {
-			if (*info)["i_isallow"] != nil {
-				b = MC.IntAll((*info)["i_isallow"]) > 0
-			}
-		}
-	}
-	return
-}
-
-//更新设置信息
-func UpdateParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) error {
-	defer MC.Catch()
-	query := map[string]interface{}{
-		"i_positionid": in.PositionId,
-	}
-	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
-	}
-	upsert := map[string]interface{}{
-		"i_entid":      in.EntId,
-		"i_entuserid":  in.EntUserId,
-		"i_positionid": in.PositionId,
-		"l_createtime": time.Now().Unix(),
-	}
-	if in.IsAllow != "" {
-		isAllow, _ := strconv.Atoi(in.IsAllow)
-		upsert["i_isallow"] = isAllow
-	}
-	if len(in.BidType) > 0 {
-		upsert["o_bidtype"] = in.BidType
-	}
-	if len(in.RemindRule) > 0 {
-		upsert["o_remindrule"] = in.RemindRule
-	}
-	if ok := IC.Mgo.Update(PartTable, query, map[string]interface{}{
-		"$set": upsert,
-	}, true, false); ok {
-		return nil
-	}
-	return fmt.Errorf("更新失败")
-}
-
-//查询企业|个人参标设置信息
-func GetParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.ParticipateSetUpInfo, error) {
-	defer MC.Catch()
-	query := map[string]interface{}{
-		"i_positionid": in.PositionId,
-	}
-	if in.PositionType > 0 {
-		query["i_entid"] = in.EntId
-	}
-	if setInfo, ok := IC.Mgo.FindOne(PartTable, query); ok {
-		var (
-			isAllow    = ""
-			bidType    []*bxcore.BidTypeReq
-			remindRule []*bxcore.RemindRuleReq
-		)
-		bidType = append(bidType, &bxcore.BidTypeReq{
-			Name:    "直接投标",
-			Content: []string{"未报名", "已报名", "投标决策", "编制投标文件", "递交投标文件", "中标公示", "签合同", "已结束"},
-		}, &bxcore.BidTypeReq{
-			Name:    "渠道投标",
-			Content: []string{"已报名", "签合同", "已结束"},
-		})
-		remindRule = append(remindRule, &bxcore.RemindRuleReq{
-			BidState:  "直接投标",
-			Remainder: 72,
-			Node:      "编制投标文件",
-		})
-		if setInfo != nil {
-			if (*setInfo)["i_isallow"] != nil {
-				isAllow = strconv.Itoa(MC.IntAll((*setInfo)["i_isallow"]))
-			}
-			if (*setInfo)["bidType"] != nil {
-				if sbb, err := json.Marshal((*setInfo)["o_bidtype"]); err == nil {
-					if err := json.Unmarshal(sbb, &bidType); err != nil {
-						logx.Info("bidType json un err:", err.Error())
-						return nil, err
-					}
-				} else {
-					logx.Info("bidType json err:", err.Error())
-					return nil, err
-				}
-			}
-			if (*setInfo)["o_remindrule"] != nil {
-				if sbr, err := json.Marshal((*setInfo)["o_remindrule"]); err == nil {
-					if err := json.Unmarshal(sbr, &remindRule); err != nil {
-						logx.Info("remindRule json un err:", err.Error())
-						return nil, err
-					}
-				} else {
-					logx.Info("remindRule json err:", err.Error())
-					return nil, err
-				}
-			}
-		}
-		return &bxcore.ParticipateSetUpInfo{
-			IsAllow:    isAllow,
-			BidType:    bidType,
-			RemindRule: remindRule,
-		}, nil
-	}
-	return nil, nil
-}
-
-//保存或更新tidb 项目信息
-func UpdateProjectInfo(id string, pInfo map[string]interface{}, bInfo map[string]interface{}) error {
-	//id 项目id
-	//name 项目名称
-	//area  省份
-	//city 城市
-	//buyer 采购单位
-	//budget 预算
-	//bid_open_time  开标时间
-	//bid_time 招标时间  bidding表
-	//bid_end_time 开标结束时间  bidding表
-	//pici 批次 轮询更新数据
-	//
-	openTime := pInfo["bidopentime"]
-	pici := pInfo["pici"]
-	bidTime := bInfo["bid_time"]
-	bidEndTime := bInfo["bid_time"]
-	projectInfo := map[string]interface{}{
-		"id":            id,
-		"name":          MC.ObjToString(pInfo["projectname"]),
-		"area":          MC.ObjToString(pInfo["area"]),
-		"city":          MC.ObjToString(pInfo["city"]),
-		"buyer":         MC.ObjToString(pInfo["buyer"]),
-		"budget":        MC.Int64All(pInfo["budget"]),
-		"bid_open_time": date.FormatDateWithObj(&openTime, date.Date_Full_Layout),
-		"bid_time":      date.FormatDateWithObj(&bidTime, date.Date_Full_Layout),
-		"bid_end_time":  date.FormatDateWithObj(&bidEndTime, date.Date_Full_Layout),
-		"pici":          date.FormatDateWithObj(&pici, date.Date_Full_Layout),
-	}
-	if c := IC.BaseMysql.CountBySql(`SELECT COUNT(id) FROM project WHERE id = ?`, id); c > 0 {
-		if ok := IC.BaseMysql.Update("project", map[string]interface{}{
-			"id": id,
-		}, projectInfo); ok {
-			return fmt.Errorf("项目信息更新异常", id)
-		}
-	} else {
-		if i := IC.BaseMysql.Insert("project", projectInfo); i <= 0 {
-			return fmt.Errorf("项目信息插入异常", id)
-		}
-	}
-	return nil
-}

+ 95 - 48
jyBXCore/rpc/service/participate.go

@@ -7,7 +7,7 @@ import (
 	"github.com/zeromicro/go-zero/core/logx"
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/model/es"
-	"jyBXCore/rpc/model/tidb"
+	"jyBXCore/rpc/model/mysql"
 	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/util"
 	"strings"
@@ -15,15 +15,33 @@ import (
 
 //我的参标项目|企业参标项目 列表
 func ParticipateList(in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes, error) {
-	//管理员
+	defer MC.Catch()
+	res := &bxcore.ParticipateListRes{Data: &bxcore.ParticipateData{}}
 	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 {
 			in.EntUserIds = ""
 		}
 	}
-	//查询tidb  base_service.project
-	return nil, nil
+	switch in.Identity {
+	case "mine": //员工|个人列表
+		r, e := mysql.SingleParticipateList(in, mysql.ParticipateListSql(in))
+		if e != nil {
+			res.ErrCode = -1
+			res.ErrMsg = e.Error()
+			return res, nil
+		}
+		res.Data = r
+	case "ent": //企业管理员
+		r, e := mysql.AdminParticipateList(in, mysql.ParticipateListSql(in))
+		if e != nil {
+			res.ErrCode = -1
+			res.ErrMsg = e.Error()
+			return res, nil
+		}
+		res.Data = r
+	}
+	return res, nil
 }
 
 /*
@@ -36,7 +54,7 @@ func ParticipateList(in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes,
 */
 
 //参标动作:参标、终止参标、划转:in:参标;out:终止参标;transfer:划转
-func ParticipateDo(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
+func ParticipateDo(in *bxcore.ParticipateActionReq) error {
 	defer MC.Catch()
 	var (
 		tip = "参标"
@@ -51,85 +69,114 @@ func ParticipateDo(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRe
 	//判断用户身份
 	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
 	switch in.ActionType {
-	case "in":
-		var (
-			projectId = ""
-		)
-		//招标信息解密
-		in.BidId = encrypt.DecodeArticleId2ByCheck(in.BidId)[0]
-		if in.BidId == "" {
-			return nil, fmt.Errorf("当前招标信息有误")
-		}
-		//当前项目是否符合参标条件
-		projectInfos := es.GetProjectByInfoId([]string{in.BidId})
-		if projectInfos == nil || len(*projectInfos) == 0 {
-			return nil, fmt.Errorf(fmt.Sprintf("当前项目信息不满足%s条件", tip))
-		}
-		//符合参标项目id
-		projectInfo := (*projectInfos)[0]
-		if projectInfo["_id"] != nil && MC.ObjToString(projectInfo["_id"]) != "" {
-			//项目信息id
-			projectId = MC.ObjToString(projectInfo["_id"])
+	case "in": //参标针对单个招标信息 或者 项目
+		if in.BidIds == "" && in.ProjectIds == "" {
+			return fmt.Errorf("缺少参数")
+		}
+		if in.ProjectIds != "" {
+			in.ProjectIds = strings.Split(in.ProjectIds, ",")[0]
+			in.ProjectIds = encrypt.DecodeArticleId2ByCheck(in.ProjectIds)[0]
+			if in.ProjectIds == "" {
+				return fmt.Errorf("当前招标信息有误")
+			}
+			//当前项目是否符合参标条件
+			projectInfos := es.GetBidInfoByPId(in.ProjectIds)
+			if projectInfos == nil || len(*projectInfos) == 0 {
+				return fmt.Errorf(fmt.Sprintf("当前项目信息不满足%s条件", tip))
+			}
+			//符合参标项目id
+			projectInfo := (*projectInfos)[0]
+			if projectInfo["sourceinfoid"] != nil && MC.ObjToString(projectInfo["sourceinfoid"]) != "" {
+				//招标信息id
+				in.BidIds = MC.ObjToString(projectInfo["sourceinfoid"])
+			} else {
+				return fmt.Errorf("当前项目信息有误")
+			}
 		} else {
-			return nil, fmt.Errorf("当前项目信息有误")
+			in.BidIds = strings.Split(in.BidIds, ",")[0]
+			//招标信息解密
+			in.BidIds = encrypt.DecodeArticleId2ByCheck(in.BidIds)[0]
+			if in.BidIds == "" {
+				return fmt.Errorf("当前招标信息有误")
+			}
+			//当前项目是否符合参标条件
+			projectInfos := es.GetProjectByInfoId(strings.Split(in.BidIds, ","))
+			if projectInfos == nil || len(*projectInfos) == 0 {
+				return fmt.Errorf(fmt.Sprintf("当前项目信息不满足%s条件", tip))
+			}
+			//符合参标项目id
+			projectInfo := (*projectInfos)[0]
+			if projectInfo["_id"] != nil && MC.ObjToString(projectInfo["_id"]) != "" {
+				//项目信息id
+				in.ProjectIds = MC.ObjToString(projectInfo["_id"])
+			} else {
+				return fmt.Errorf("当前项目信息有误")
+			}
 		}
 		//是否允许多人参标
 		if isAllow := util.IsALLow(in.EntId); !isAllow {
-			if ok := tidb.IsParticipatedByBidId(in); ok {
-				return nil, fmt.Errorf("当前项目不允许多人参标")
+			if ok := mysql.IsParticipatedByBidId(in); ok {
+				return fmt.Errorf("当前项目不允许多人参标")
 			}
 		}
 		//保存参标信息  更新当前企业参标项目记录
-		if err := tidb.SaveParticipateInfo(projectId, in); err != nil {
-			return nil, err
+		if err := mysql.SaveParticipateInfo(in); err != nil {
+			return err
 		}
 	case "out": //终止参标
-		if len(strings.Split(in.ProjectIds, ",")) == 0 {
-			return nil, fmt.Errorf("项目信息有误")
+		if in.ProjectIds == "" {
+			return fmt.Errorf("项目信息有误")
 		}
-		projectId := strings.Split(in.ProjectIds, ",")[0]
+		in.ProjectIds = strings.Split(in.ProjectIds, ",")[0]
 		//招标信息解密
-		projectId = encrypt.DecodeArticleId2ByCheck(projectId)[0]
-		if projectId == "" {
-			return nil, fmt.Errorf("当前项目信息有误")
+		in.ProjectIds = encrypt.DecodeArticleId2ByCheck(in.ProjectIds)[0]
+		if in.ProjectIds == "" {
+			return fmt.Errorf("当前项目信息有误")
 		}
-		if err := tidb.CancelParticipateInfo(projectId, in, userInfo.Ent.EntRoleId); err != nil {
-			return nil, err
+		if err := mysql.CancelParticipateInfo(in, userInfo.Ent.EntRoleId); err != nil {
+			return err
 		}
 	case "transfer":
-		if len(strings.Split(in.ProjectIds, ",")) == 0 {
-			return nil, fmt.Errorf("项目信息有误")
+		if in.ProjectIds == "" {
+			return fmt.Errorf("项目信息有误")
 		}
 		//个人版
 		if in.PositionType == 0 {
-			return nil, fmt.Errorf("当前企业身份有误")
+			return fmt.Errorf("当前企业身份有误")
 		}
 		//非管理员
 		if userInfo.Ent.EntRoleId == 0 { //1:企业管理员;2:部门管理员
-			return nil, fmt.Errorf("当前企业身份无权限")
+			return fmt.Errorf("当前企业身份无权限")
+		}
+		//判断划转人
+		if in.ToEntUserId == "" {
+			return fmt.Errorf("划转对象不能为空")
 		}
 		//是否保留原跟踪人?
 		isAllow := util.IsALLow(in.EntId)
 		if in.IsRetain && !isAllow {
 			//不允许多人参标,但是前端参数又是保留原参标人 互相矛盾
-			return nil, fmt.Errorf("当前项目只允许一人参标")
+			return fmt.Errorf("当前项目只允许一人参标")
 		}
 		//in.ProjectIds //项目id
 		projectIds := strings.Split(in.ProjectIds, ",")
+		projectNum := 0
 		for _, v := range projectIds {
 			projectId := encrypt.DecodeArticleId2ByCheck(v)[0]
 			if projectId == "" {
 				continue
 			}
-			if err := tidb.TransferParticipateInfo(projectId, in); err != nil {
+			if err := mysql.TransferParticipateInfo(projectId, in); err != nil {
 				logx.Info(fmt.Sprintf("是否允许多人参标:%v, 项目id:%s,企业id:%d,划转对象entuserid:%s,划转异常:", isAllow, projectId, in.EntId, in.ToEntUserId))
 				continue
 			}
+			projectNum += 1
+		}
+		if projectNum != len(projectIds) {
+			return fmt.Errorf("划转失败")
 		}
 	}
-	return &bxcore.ParticipateActionRes{
-		Data: true,
-	}, nil
+	return nil
 }
 
 //参标设置更新及设置内容
@@ -143,14 +190,14 @@ func GetParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.Particip
 	switch in.SetAction {
 	case "U": //update 更新设置信息
 		res.Data = nil
-		if err := tidb.UpdateParticipateSetInfo(in); err != nil {
+		if err := mysql.UpdateParticipateSetInfo(in); err != nil {
 			res.ErrCode = -1
 			res.ErrMsg = err.Error()
 		}
 	default: //默认查询对应设置信息
 		//查询对应用户设置信息
 		//未设置过 返回默认配置
-		if info, err := tidb.GetParticipateSetInfo(in); err == nil {
+		if info, err := mysql.GetParticipateSetInfo(in); err == nil {
 			res.Data = info
 		} else {
 			res.ErrCode = -1

+ 174 - 144
jyBXCore/rpc/type/bxcore/bxcore.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.28.0
-// 	protoc        v3.19.4
+// 	protoc        v3.15.5
 // source: bxcore.proto
 
 package bxcore
@@ -3064,7 +3064,7 @@ type ParticipateActionReq struct {
 	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
+	BidIds       string `protobuf:"bytes,10,opt,name=bidIds,proto3" json:"bidIds,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:划转
@@ -3166,9 +3166,9 @@ func (x *ParticipateActionReq) GetAccountId() int64 {
 	return 0
 }
 
-func (x *ParticipateActionReq) GetBidId() string {
+func (x *ParticipateActionReq) GetBidIds() string {
 	if x != nil {
-		return x.BidId
+		return x.BidIds
 	}
 	return ""
 }
@@ -3291,6 +3291,7 @@ type ParticipateListReq struct {
 	UserId        string `protobuf:"bytes,19,opt,name=userId,proto3" json:"userId,omitempty"`                //用户id
 	NewUserId     int64  `protobuf:"varint,20,opt,name=newUserId,proto3" json:"newUserId,omitempty"`         //base_user_id 新用户id
 	AccountId     int64  `protobuf:"varint,21,opt,name=accountId,proto3" json:"accountId,omitempty"`         //账户id
+	OrderNum      int64  `protobuf:"varint,22,opt,name=orderNum,proto3" json:"orderNum,omitempty"`           //排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
 }
 
 func (x *ParticipateListReq) Reset() {
@@ -3472,6 +3473,13 @@ func (x *ParticipateListReq) GetAccountId() int64 {
 	return 0
 }
 
+func (x *ParticipateListReq) GetOrderNum() int64 {
+	if x != nil {
+		return x.OrderNum
+	}
+	return 0
+}
+
 //参标列表
 type ParticipateList struct {
 	state         protoimpl.MessageState
@@ -3485,7 +3493,9 @@ type ParticipateList struct {
 	Participants     string `protobuf:"bytes,5,opt,name=participants,proto3" json:"participants,omitempty"`         //参标人 多个,号隔开
 	BidTime          string `protobuf:"bytes,6,opt,name=bidTime,proto3" json:"bidTime,omitempty"`                   //招标日期
 	BidEndTime       string `protobuf:"bytes,7,opt,name=bidEndTime,proto3" json:"bidEndTime,omitempty"`             //投标截止日期
-	UpdateStatusTime string `protobuf:"bytes,8,opt,name=updateStatusTime,proto3" json:"updateStatusTime,omitempty"` //参标更新状态
+	BidOpenTime      string `protobuf:"bytes,8,opt,name=bidOpenTime,proto3" json:"bidOpenTime,omitempty"`           //投标截止日期
+	UpdateStatusTime string `protobuf:"bytes,9,opt,name=updateStatusTime,proto3" json:"updateStatusTime,omitempty"` //更新状态时间
+	UpdateStatusCon  string `protobuf:"bytes,10,opt,name=updateStatusCon,proto3" json:"updateStatusCon,omitempty"`  //投标状态更新
 }
 
 func (x *ParticipateList) Reset() {
@@ -3569,6 +3579,13 @@ func (x *ParticipateList) GetBidEndTime() string {
 	return ""
 }
 
+func (x *ParticipateList) GetBidOpenTime() string {
+	if x != nil {
+		return x.BidOpenTime
+	}
+	return ""
+}
+
 func (x *ParticipateList) GetUpdateStatusTime() string {
 	if x != nil {
 		return x.UpdateStatusTime
@@ -3576,6 +3593,13 @@ func (x *ParticipateList) GetUpdateStatusTime() string {
 	return ""
 }
 
+func (x *ParticipateList) GetUpdateStatusCon() string {
+	if x != nil {
+		return x.UpdateStatusCon
+	}
+	return ""
+}
+
 type ParticipateData struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -4223,7 +4247,7 @@ var file_bxcore_proto_rawDesc = []byte{
 	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, 0xaa, 0x03, 0x0a,
+	0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xac, 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,
@@ -4241,145 +4265,151 @@ var file_bxcore_proto_rawDesc = []byte{
 	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,
-	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,
-	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,
-	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, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
-	0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70,
-	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x73, 0x22, 0x5e, 0x0a, 0x14, 0x50, 0x61, 0x72,
-	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,
-	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, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf0, 0x04, 0x0a, 0x12, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 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, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e,
-	0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e,
-	0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x06, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79,
-	0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07,
-	0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62,
-	0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64,
-	0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45,
-	0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65,
-	0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x69, 0x64,
-	0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x69, 0x64, 0x45,
-	0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
-	0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d,
-	0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0c, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x61, 0x74,
-	0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x0d,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1e,
-	0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x0e, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x1a,
-	0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61,
-	0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67,
-	0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x18, 0x11, 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, 0x12, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x18, 0x13, 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, 0x14, 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, 0x15, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xfb, 0x01, 0x0a,
-	0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74,
-	0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
-	0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61,
-	0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x64, 0x67,
-	0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74,
-	0x12, 0x22, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73,
-	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
-	0x61, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e,
-	0x0a, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a,
+	0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x69, 0x64, 0x49, 0x64, 0x73, 0x18,
+	0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x64, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a,
+	0x0b, 0x74, 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, 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, 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, 0x12, 0x1e, 0x0a, 0x0a, 0x70,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x73, 0x22, 0x5e, 0x0a, 0x14, 0x50,
+	0x61, 0x72, 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, 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, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8c, 0x05, 0x0a, 0x12,
+	0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 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, 0x1a, 0x0a, 0x08, 0x69, 0x64,
+	0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64,
+	0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x06,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69,
+	0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x18,
+	0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x45,
+	0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x69,
+	0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x69, 0x64, 0x4f,
+	0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62,
+	0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x69,
+	0x64, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x0c, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24,
+	0x0a, 0x0d, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
+	0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74,
+	0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73,
+	0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73,
+	0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x0e,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73,
+	0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0f, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07,
+	0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70,
+	0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x67, 0x6f, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x18, 0x11, 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, 0x12, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x18, 0x13, 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,
+	0x14, 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, 0x15, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1a,
+	0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x16, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x22, 0xc7, 0x02, 0x0a, 0x0f, 0x50,
+	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e,
+	0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20,
+	0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65,
+	0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74,
+	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x22,
+	0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
+	0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x69, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
+	0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b,
+	0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0b, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a,
 	0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x69,
-	0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
-	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x54, 0x0a, 0x0f, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a,
-	0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f,
-	0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
-	0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74,
-	0x22, 0x75, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c,
-	0x69, 0x73, 0x74, 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, 0x2b, 0x0a, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72,
-	0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74,
-	0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xd3, 0x06, 0x0a, 0x06, 0x42, 0x78, 0x43, 0x6f,
-	0x72, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c,
-	0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61,
-	0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e,
-	0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x53, 0x65,
-	0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x63, 0x6f,
-	0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65,
-	0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63,
-	0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0f, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1a, 0x2e,
-	0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
-	0x74, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f,
-	0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x68,
-	0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
-	0x70, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72,
-	0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
-	0x12, 0x49, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x69, 0x64, 0x53, 0x74, 0x61,
-	0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x42, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a,
-	0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42,
-	0x69, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x12, 0x50,
-	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
-	0x74, 0x12, 0x1d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
-	0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
-	0x1a, 0x1d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63,
-	0x69, 0x70, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x12,
-	0x52, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x52, 0x65,
-	0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50,
-	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
-	0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73,
-	0x52, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
-	0x74, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 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, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 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, 0x73, 0x52, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x74, 0x69,
-	0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12,
-	0x1f, 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, 0x65, 0x71,
-	0x1a, 0x1f, 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, 0x65,
-	0x73, 0x12, 0x4f, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65,
-	0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e,
-	0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61,
-	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
-	0x65, 0x73, 0x12, 0x49, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74,
-	0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50,
-	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
-	0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
-	0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x42, 0x0a, 0x5a,
-	0x08, 0x2e, 0x2f, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x33,
+	0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x75, 0x70,
+	0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x6e, 0x18, 0x0a, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75,
+	0x73, 0x43, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a,
+	0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x78,
+	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x75, 0x0a, 0x12, 0x50, 0x61,
+	0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 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, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74,
+	0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74,
+	0x61, 0x32, 0xd3, 0x06, 0x0a, 0x06, 0x42, 0x78, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x36, 0x0a, 0x0d,
+	0x47, 0x65, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e,
+	0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71,
+	0x1a, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69,
+	0x6d, 0x69, 0x74, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61,
+	0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78,
+	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65,
+	0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x77,
+	0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72,
+	0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12,
+	0x49, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x49, 0x6e,
+	0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74,
+	0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1a,
+	0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x0f, 0x55, 0x70,
+	0x64, 0x61, 0x74, 0x65, 0x42, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e,
+	0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x69, 0x64,
+	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f,
+	0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x69, 0x64, 0x53, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
+	0x70, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x62, 0x78,
+	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65,
+	0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x62, 0x78, 0x63,
+	0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x43,
+	0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x12, 0x50, 0x61, 0x72,
+	0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12,
+	0x1d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
+	0x70, 0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d,
+	0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x12, 0x52, 0x0a,
+	0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x73,
+	0x6f, 0x6e, 0x73, 0x12, 0x1d, 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, 0x73, 0x52,
+	0x65, 0x71, 0x1a, 0x1d, 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, 0x73, 0x52, 0x65,
+	0x73, 0x12, 0x58, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65,
+	0x53, 0x65, 0x74, 0x55, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 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, 0x65, 0x71, 0x1a, 0x1f, 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, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x11, 0x50,
+	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x12, 0x1c, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63,
+	0x69, 0x70, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c,
+	0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
+	0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x0f,
+	0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12,
+	0x1a, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
+	0x70, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x62, 0x78,
+	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x62, 0x78, 0x63,
+	0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 1 - 1
jyBXCore/rpc/type/bxcore/bxcore_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.19.4
+// - protoc             v3.15.5
 // source: bxcore.proto
 
 package bxcore

+ 2 - 2
jyBXCore/rpc/util/participate.go

@@ -1,10 +1,10 @@
 package util
 
-import "jyBXCore/rpc/model/tidb"
+import "jyBXCore/rpc/model/mysql"
 
 //是否允许多人参标
 func IsALLow(entId int64) bool {
-	return tidb.GetParticipateIsAllow(map[string]interface{}{
+	return mysql.GetParticipateIsAllow(map[string]interface{}{
 		"i_entid": entId,
 	})
 }