Browse Source

Merge branch 'dev/v1.1.20_fuwencai' of BaseService/jyMicroservices into feature/v1.1.20

fuwencai 2 years ago
parent
commit
510ecbcf73
65 changed files with 7732 additions and 1314 deletions
  1. 115 1
      jyBXCore/api/bxcore.api
  2. 28 0
      jyBXCore/api/internal/handler/participateActionHandler.go
  3. 28 0
      jyBXCore/api/internal/handler/participateContentHandler.go
  4. 28 0
      jyBXCore/api/internal/handler/participateInfoHandler.go
  5. 28 0
      jyBXCore/api/internal/handler/participateListHandler.go
  6. 28 0
      jyBXCore/api/internal/handler/participatePersonsHandler.go
  7. 28 0
      jyBXCore/api/internal/handler/participateRecordsHandler.go
  8. 28 0
      jyBXCore/api/internal/handler/participateSetUpInfoHandler.go
  9. 28 0
      jyBXCore/api/internal/handler/participateShowHandler.go
  10. 45 0
      jyBXCore/api/internal/handler/routes.go
  11. 28 0
      jyBXCore/api/internal/handler/updateBidStatusHandler.go
  12. 59 0
      jyBXCore/api/internal/logic/participateActionLogic.go
  13. 55 0
      jyBXCore/api/internal/logic/participateContentLogic.go
  14. 56 0
      jyBXCore/api/internal/logic/participateInfoLogic.go
  15. 60 0
      jyBXCore/api/internal/logic/participateListLogic.go
  16. 33 0
      jyBXCore/api/internal/logic/participatePersonsLogic.go
  17. 60 0
      jyBXCore/api/internal/logic/participateRecordsLogic.go
  18. 80 0
      jyBXCore/api/internal/logic/participateSetUpInfoLogic.go
  19. 56 0
      jyBXCore/api/internal/logic/participateShowLogic.go
  20. 62 0
      jyBXCore/api/internal/logic/updateBidStatusLogic.go
  21. 95 0
      jyBXCore/api/internal/types/types.go
  22. 1 0
      jyBXCore/entity/db.go
  23. 0 81
      jyBXCore/entity/rpc.go
  24. 2 10
      jyBXCore/go.mod
  25. 300 5
      jyBXCore/rpc/bxcore.proto
  26. 109 8
      jyBXCore/rpc/bxcore/bxcore.go
  27. 3 15
      jyBXCore/rpc/entity/search.go
  28. 4 3
      jyBXCore/rpc/etc/bxcore.yaml
  29. 10 3
      jyBXCore/rpc/etc/db.yaml
  30. 14 0
      jyBXCore/rpc/init/db.go
  31. 15 24
      jyBXCore/rpc/init/init.go
  32. 10 4
      jyBXCore/rpc/internal/config/config.go
  33. 39 0
      jyBXCore/rpc/internal/logic/participateactionlogic.go
  34. 70 0
      jyBXCore/rpc/internal/logic/participatecontentlogic.go
  35. 85 0
      jyBXCore/rpc/internal/logic/participateinfologic.go
  36. 30 0
      jyBXCore/rpc/internal/logic/participatelistlogic.go
  37. 31 0
      jyBXCore/rpc/internal/logic/participatepersonslogic.go
  38. 68 0
      jyBXCore/rpc/internal/logic/participaterecordslogic.go
  39. 30 0
      jyBXCore/rpc/internal/logic/participatesetupinfologic.go
  40. 74 0
      jyBXCore/rpc/internal/logic/participateshowlogic.go
  41. 82 0
      jyBXCore/rpc/internal/logic/updatebidstatuslogic.go
  42. 54 0
      jyBXCore/rpc/internal/server/bxcoreserver.go
  43. 3 1
      jyBXCore/rpc/model/es/es.go
  44. 79 0
      jyBXCore/rpc/model/es/project.go
  45. 1 1
      jyBXCore/rpc/model/es/search.go
  46. 832 0
      jyBXCore/rpc/model/mysql/participateBid.go
  47. 214 0
      jyBXCore/rpc/service/participate.go
  48. 542 0
      jyBXCore/rpc/service/participateBid.go
  49. 1 1
      jyBXCore/rpc/service/search.go
  50. 2639 2
      jyBXCore/rpc/type/bxcore/bxcore.pb.go
  51. 343 1
      jyBXCore/rpc/type/bxcore/bxcore_grpc.pb.go
  52. 37 0
      jyBXCore/rpc/util/participate.go
  53. 40 0
      jyBXCore/rpc/util/search.go
  54. 5 0
      jyBXCore/rpc/util/util.go
  55. 231 0
      jyBXCore/test.http
  56. 3 0
      jyBXSubscribe/api/bxsubscribe.api
  57. 3 0
      jyBXSubscribe/api/internal/logic/subscribeListLogic.go
  58. 3 0
      jyBXSubscribe/api/internal/types/types.go
  59. 40 0
      jyBXSubscribe/entity/rpc.go
  60. 3 0
      jyBXSubscribe/rpc/bxsubscribe.proto
  61. 1 1
      jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go
  62. 23 3
      jyBXSubscribe/rpc/internal/logic/getsublistlogic.go
  63. 1 1
      jyBXSubscribe/rpc/internal/server/bxsubscribeserver.go
  64. 571 996
      jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go
  65. 58 153
      jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

+ 115 - 1
jyBXCore/api/bxcore.api

@@ -2,7 +2,7 @@ syntax = "v1"
 
 info (
 	title: "剑鱼核心模块" // TODO: add title
-	desc: "标讯搜索,标讯详情等"// TODO: add description
+	desc: "标讯搜索、标讯详情、参标逻辑等"// TODO: add description
 	author: "wangshan"
 	email: "wangshan@topnet.net.cn"
 )
@@ -57,10 +57,124 @@ type (
 		Percentage int64  `json:"percentage,optional"` //付费用户占比
 		SearchType string `path:"searchType"`          //get|update|
 	}
+	//参标项目
+	baseParam {
+		EntId        int64  `header:"entId,optional"`     // 企业id
+		EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
+		PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
+		PositionId   int64  `header:"positionId"`         //职位id
+		AccountId    int64  `header:"accountId,optional"` //账户id
+		MgoUserId    string `header:"mgoUserId,optional"` //原userId
+		AppId        string `header:"appId,optional"`     //剑鱼10000
+		UserId       string `header:"userId,optional"`    //用户id
+		NewUserId    int64  `header:"newUserId,optional"` //base_user_id
+	}
+	// 列表数据参标信息请求参数
+	participateShowReq {
+		Ids string `json:"ids"` // 标讯id 逗号分割
+		baseParam
+	}
+	// 详情页参标信息请求参数
+	participateInfoReq {
+		Sid string `json:"sid"` // 标讯id
+		baseParam
+	}
+	// 投标状态更新请求参数
+	updateBidStatusReq {
+		BidType       int64    `json:"bidType"`                // 投标类型 1-直接投标 2-渠道投标
+		BidStage      []string `json:"bidStage,optional"`      // 投标项目阶段 ["未报名","已报名"...]
+		IsWin         int64    `json:"isWin,optional"`         // 是否中标 0-未选择 1-是 2-否
+		ChannelName   string   `json:"channelName,optional"`   // 渠道名称
+		ChannelPerson string   `json:"channelPerson,optional"` // 联系人
+		ChannelPhone  string   `json:"channelPhone,optional"`  //联系电话
+		Winner        string   `json:"winner,optional"`        // 中标单位
+		Sid           string   `json:"sid"`                    // 标讯id
+		baseParam
+	}
+	// 获取投标状态信息
+	participateContentReq {
+		Sid string `json:"sid"` // 标讯id
+		baseParam
+	}
+	// 参标操作记录请求参数
+	participateRecordsReq {
+		Sid      string `json:"sid"`                  // 标讯id
+		Page     int64  `json:"page,default=0"`       // 页码
+		PageSize int64  `json:"pageSize,default=100"` // 每页条数
+		baseParam
+	}
+	// 当前部门/企业下参标人员信息
+	participatePersonsReq {
+		baseParam
+	}
+
+	//投标状态更新:投标类型-投标项目阶段
+	BidTypeReq {
+		Name    string   `json:"name,optional"`
+		Content []string `json:"content,optional"`
+	}
+	//消息提醒设置:
+	RemindRuleReq {
+		BidState  string `json:"bidState,optional"`  //投标规则类型;直接投标;渠道投标;
+		Remainder int64  `json:"remainder,optional"` //距离投标截止日期需要多久开始提醒 单位h
+		Node      string `json:"node,optional"`      //那个节点进行消息提醒;和投标项目阶段绑定
+	}
+	//参标设置信息接口
+	participateSetUpInfoReq {
+		baseParam
+		SetAction  string           `json:"setAction,optional"`  //默认空;U:更新
+		IsAllow    string           `json:"isAllow,optional"`    //是否允许多人同时参标 默认0;允许1
+		BidType    []*BidTypeReq    `json:"bidType,optional"`    //投标类型自定义内容
+		RemindRule []*RemindRuleReq `json:"remindRule,optional"` //消息提醒
+	}
+	//用户参标、终止参标及划转接口开发
+	participateActionReq {
+		baseParam
+		BidIds      string `json:"bidIds,optional"`                    //招标信息id ,已加密。多个,号隔开
+		ProjectIds  string `json:"projectIds,optional"`                //项目信息id,已加密。多个,号隔开
+		ToEntUserId string `json:"toEntUserId,optional"`               //划转对象的企业用户id
+		IsRetain    bool   `json:"isRetain,optional"`                  //是否保留原跟踪人
+		ActionType  string `path:"actionType,options=in|out|transfer"` //in:参标;out:终止参标;transfer:划转
+	}
+	//我的参标项目列表|企业参标项目列表
+	participateListReq {
+		baseParam
+		Area          string `json:"area,optional"`             //省份
+		City          string `json:"city,optional"`             //城市
+		BidTime       string `json:"bidTime,optional"`          //招标日期:开始时间-结束时间
+		BidEndTime    string `json:"bidEndTime,optional"`       //投标截止日期:格式同上
+		BidOpenTime   string `json:"bidOpenTime,optional"`      //开标时间:格式同上
+		BidEndStatus  int64  `json:"bidEndStatus,optional"`     //投标截止状态:1:未截止;2:已截止;3:终止参标
+		BidOpenStatus int64  `json:"bidOpenStatus,optional"`    //开标状态:1:未开标;2:已开标
+		Keywords      string `json:"keywords,optional"`         //查询项目名称 关键词;多个空格隔开
+		EntUserIds    string `json:"entUserIds,optional"`       //企业参标人企业用户id集合,多个,号隔开
+		PageSize      int64  `json:"pageSize,default=10"`       //每页数据量
+		PageNum       int64  `json:"pageNum,default=1"`         //当前页码
+		Identity      string `path:"identity,options=mine|ent"` //我的:mine;企业:ent
+		OrderNum      int64  `json:"orderNum,default=0"`        //排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
+	}
 )
 service bxcore-api {
 	@handler searchList
 	post /jybx/core/:userType/searchList(searchReq) returns (commonResp)
 	@handler limitSearchContent
 	post /jybx/core/:searchType/searchLimit(searchLimitReq) returns (commonResp)
+	@handler participateShow  // 列表数据参标信息接口
+	post /jybx/core/participate/show(participateShowReq) returns (commonResp)
+	@handler ParticipateInfo  // 详情页参标信息接口
+	post /jybx/core/participate/info(participateInfoReq) returns (commonResp)
+	@handler updateBidStatus  // 投标状态更新
+	post /jybx/core/participate/updateBidStatus(updateBidStatusReq) returns (commonResp)
+	@handler ParticipateContent  // 获取投标状态信息
+	post /jybx/core/participate/content(participateContentReq) returns (commonResp)
+	@handler ParticipateRecords  // 参标操作记录
+	post /jybx/core/participate/records(participateRecordsReq) returns (commonResp)
+	@handler ParticipatePersons  // 当前部门/企业下参标人员信息
+	post /jybx/core/participate/persons(participatePersonsReq) returns (commonResp)
+	@handler participateSetUpInfo // 参标设置信息
+	post /jybx/core/participate/setUpInfo(participateSetUpInfoReq) returns (commonResp)
+	@handler participateAction //参标|终止参标|划转项目
+	post /jybx/core/participate/:actionType/info(participateActionReq) returns (commonResp)
+	@handler participateList //我的参标项目列表|企业参标项目列表
+	post /jybx/core/participate/:identity/list(participateListReq) returns (commonResp)
 }

+ 28 - 0
jyBXCore/api/internal/handler/participateActionHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateContentHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateInfoHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateListHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participatePersonsHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateRecordsHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateSetUpInfoHandler.go

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

+ 28 - 0
jyBXCore/api/internal/handler/participateShowHandler.go

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

+ 45 - 0
jyBXCore/api/internal/handler/routes.go

@@ -22,6 +22,51 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/core/:searchType/searchLimit",
 				Handler: limitSearchContentHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/show",
+				Handler: participateShowHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/info",
+				Handler: ParticipateInfoHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/updateBidStatus",
+				Handler: updateBidStatusHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/content",
+				Handler: ParticipateContentHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/records",
+				Handler: ParticipateRecordsHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/persons",
+				Handler: ParticipatePersonsHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/setUpInfo",
+				Handler: participateSetUpInfoHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/:actionType/info",
+				Handler: participateActionHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/participate/:identity/list",
+				Handler: participateListHandler(serverCtx),
+			},
 		},
 	)
 }

+ 28 - 0
jyBXCore/api/internal/handler/updateBidStatusHandler.go

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

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

@@ -0,0 +1,59 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateActionLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateActionLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateActionLogic {
+	return &ParticipateActionLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateActionLogic) ParticipateAction(req *types.ParticipateActionReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateAction(l.ctx, &bxcore.ParticipateActionReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		ProjectIds:   req.ProjectIds,
+		BidIds:       req.BidIds,
+		ToEntUserId:  req.ToEntUserId,
+		IsRetain:     req.IsRetain,
+		ActionType:   req.ActionType,
+	})
+	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,
+		Data:     res.Data,
+	}, nil
+}

+ 55 - 0
jyBXCore/api/internal/logic/participateContentLogic.go

@@ -0,0 +1,55 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateContentLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateContentLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateContentLogic {
+	return &ParticipateContentLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateContentLogic) ParticipateContent(req *types.ParticipateContentReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateContent(l.ctx, &bxcore.ParticipateContentReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		Sid:          req.Sid,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "查询失败",
+			Data:     map[string]interface{}{},
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+}

+ 56 - 0
jyBXCore/api/internal/logic/participateInfoLogic.go

@@ -0,0 +1,56 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateInfoLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateInfoLogic {
+	return &ParticipateInfoLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateInfoLogic) ParticipateInfo(req *types.ParticipateInfoReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateInfo(l.ctx, &bxcore.ParticipateInfoReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		Sid:          req.Sid,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "查询失败",
+			Data:     map[string]interface{}{},
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+
+}

+ 60 - 0
jyBXCore/api/internal/logic/participateListLogic.go

@@ -0,0 +1,60 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateListLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateListLogic {
+	return &ParticipateListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateListLogic) ParticipateList(req *types.ParticipateListReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateList(l.ctx, &bxcore.ParticipateListReq{
+		Identity:      req.Identity,
+		EntId:         req.EntId,
+		EntUserId:     req.EntUserId,
+		PositionId:    req.PositionId,
+		PositionType:  req.PositionType,
+		AppId:         req.AppId,
+		MgoUserId:     req.MgoUserId,
+		AccountId:     req.AccountId,
+		UserId:        req.UserId,
+		NewUserId:     req.NewUserId,
+		Area:          req.Area,
+		City:          req.City,
+		BidTime:       req.BidTime,
+		BidEndTime:    req.BidEndTime,
+		BidOpenTime:   req.BidOpenTime,
+		BidEndStatus:  req.BidEndStatus,
+		BidOpenStatus: req.BidOpenStatus,
+		Keywords:      req.Keywords,
+		EntUserIds:    req.EntUserIds,
+		PageSize:      req.PageSize,
+		PageNum:       req.PageNum,
+		OrderNum:      req.OrderNum,
+	})
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+}

+ 33 - 0
jyBXCore/api/internal/logic/participatePersonsLogic.go

@@ -0,0 +1,33 @@
+package logic
+
+import (
+	"context"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipatePersonsLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipatePersonsLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipatePersonsLogic {
+	return &ParticipatePersonsLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipatePersonsLogic) ParticipatePersons(req *types.ParticipatePersonsReq) (resp *types.CommonResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 60 - 0
jyBXCore/api/internal/logic/participateRecordsLogic.go

@@ -0,0 +1,60 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateRecordsLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateRecordsLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateRecordsLogic {
+	return &ParticipateRecordsLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateRecordsLogic) ParticipateRecords(req *types.ParticipateRecordsReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateRecords(l.ctx, &bxcore.ParticipateRecordsReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		Sid:          req.Sid,
+		PageSize:     req.PageSize,
+		Page:         req.Page,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "查询失败",
+			Data: map[string]interface{}{
+				"list":  []map[string]interface{}{},
+				"total": 0,
+			},
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+}

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

@@ -0,0 +1,80 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateSetUpInfoLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateSetUpInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateSetUpInfoLogic {
+	return &ParticipateSetUpInfoLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateSetUpInfoLogic) ParticipateSetUpInfo(req *types.ParticipateSetUpInfoReq) (resp *types.CommonResp, err error) {
+	var (
+		bidType    []*bxcore.BidTypeReq
+		remindRule []*bxcore.RemindRuleReq
+	)
+	if req.SetAction != "" {
+		if len(req.BidType) > 0 {
+			for _, v := range req.BidType {
+				bidType = append(bidType, &bxcore.BidTypeReq{
+					Name:    v.Name,
+					Content: v.Content,
+				})
+			}
+		}
+		if len(req.RemindRule) > 0 {
+			for _, v := range req.RemindRule {
+				remindRule = append(remindRule, &bxcore.RemindRuleReq{
+					BidState:  v.BidState,
+					Remainder: v.Remainder,
+					Node:      v.Node,
+				})
+			}
+		}
+	}
+	res, err := l.svcCtx.BxCore.ParticipateSetUpInfo(l.ctx, &bxcore.ParticipateSetUpInfoReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		AccountId:    req.AccountId,
+		SetAction:    req.SetAction,
+		IsAllow:      req.IsAllow,
+		BidType:      bidType,
+		RemindRule:   remindRule,
+	})
+	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,
+		Data:     res.Data,
+	}, nil
+}

+ 56 - 0
jyBXCore/api/internal/logic/participateShowLogic.go

@@ -0,0 +1,56 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateShowLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewParticipateShowLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateShowLogic {
+	return &ParticipateShowLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *ParticipateShowLogic) ParticipateShow(req *types.ParticipateShowReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.ParticipateShow(l.ctx, &bxcore.ParticipateShowReq{
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		AppId:        req.AppId,
+		MgoUserId:    req.MgoUserId,
+		AccountId:    req.AccountId,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		Ids:          req.Ids,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "查询失败",
+			Data:     []map[string]interface{}{},
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+
+}

+ 62 - 0
jyBXCore/api/internal/logic/updateBidStatusLogic.go

@@ -0,0 +1,62 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+	"net/http"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateBidStatusLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	r      *http.Request
+}
+
+func NewUpdateBidStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *UpdateBidStatusLogic {
+	return &UpdateBidStatusLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		r:      r,
+	}
+}
+
+func (l *UpdateBidStatusLogic) UpdateBidStatus(req *types.UpdateBidStatusReq) (resp *types.CommonResp, err error) {
+	res, err := l.svcCtx.BxCore.UpdateBidStatus(l.ctx, &bxcore.UpdateBidStatusReq{
+		EntId:         req.EntId,
+		EntUserId:     req.EntUserId,
+		PositionId:    req.PositionId,
+		PositionType:  req.PositionType,
+		AppId:         req.AppId,
+		MgoUserId:     req.MgoUserId,
+		AccountId:     req.AccountId,
+		UserId:        req.UserId,
+		NewUserId:     req.NewUserId,
+		BidType:       req.BidType,
+		BidStage:      req.BidStage,
+		ChannelName:   req.ChannelName,
+		ChannelPerson: req.ChannelPerson,
+		ChannelPhone:  req.ChannelPhone,
+		IsWin:         req.IsWin,
+		Winner:        req.Winner,
+		Sid:           req.Sid,
+	})
+	if err != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "更新失败",
+			Data:     false,
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+}

+ 95 - 0
jyBXCore/api/internal/types/types.go

@@ -50,3 +50,98 @@ type SearchLimitReq struct {
 	Percentage int64  `json:"percentage,optional"` //付费用户占比
 	SearchType string `path:"searchType"`          //get|update|
 }
+
+type BaseParam struct {
+	EntId        int64  `header:"entId,optional"`     // 企业id
+	EntUserId    int64  `header:"entUserId,optional"` // 企业下用户id
+	PositionType int64  `header:"positionType"`       // 职位类型 0个人 1企业
+	PositionId   int64  `header:"positionId"`         //职位id
+	AccountId    int64  `header:"accountId,optional"` //账户id
+	MgoUserId    string `header:"mgoUserId,optional"` //原userId
+	AppId        string `header:"appId,optional"`     //剑鱼10000
+	UserId       string `header:"userId,optional"`    //用户id
+	NewUserId    int64  `header:"newUserId,optional"` //base_user_id
+}
+
+type ParticipateShowReq struct {
+	Ids string `json:"ids"` // 标讯id 逗号分割
+	BaseParam
+}
+
+type ParticipateInfoReq struct {
+	Sid string `json:"sid"` // 标讯id
+	BaseParam
+}
+
+type UpdateBidStatusReq struct {
+	BidType       int64    `json:"bidType"`                // 投标类型 1-直接投标 2-渠道投标
+	BidStage      []string `json:"bidStage,optional"`      // 投标项目阶段 ["未报名","已报名"...]
+	IsWin         int64    `json:"isWin,optional"`         // 是否中标 0-未选择 1-是 2-否
+	ChannelName   string   `json:"channelName,optional"`   // 渠道名称
+	ChannelPerson string   `json:"channelPerson,optional"` // 联系人
+	ChannelPhone  string   `json:"channelPhone,optional"`  //联系电话
+	Winner        string   `json:"winner,optional"`        // 中标单位
+	Sid           string   `json:"sid"`                    // 标讯id
+	BaseParam
+}
+
+type ParticipateContentReq struct {
+	Sid string `json:"sid"` // 标讯id
+	BaseParam
+}
+
+type ParticipateRecordsReq struct {
+	Sid      string `json:"sid"`                  // 标讯id
+	Page     int64  `json:"page,default=0"`       // 页码
+	PageSize int64  `json:"pageSize,default=100"` // 每页条数
+	BaseParam
+}
+
+type ParticipatePersonsReq struct {
+	BaseParam
+}
+
+type BidTypeReq struct {
+	Name    string   `json:"name,optional"`
+	Content []string `json:"content,optional"`
+}
+
+type RemindRuleReq struct {
+	BidState  string `json:"bidState,optional"`  //投标规则类型;直接投标;渠道投标;
+	Remainder int64  `json:"remainder,optional"` //距离投标截止日期需要多久开始提醒 单位h
+	Node      string `json:"node,optional"`      //那个节点进行消息提醒;和投标项目阶段绑定
+}
+
+type ParticipateSetUpInfoReq struct {
+	BaseParam
+	SetAction  string           `json:"setAction,optional"`  //默认空;U:更新
+	IsAllow    string           `json:"isAllow,optional"`    //是否允许多人同时参标 默认0;允许1
+	BidType    []*BidTypeReq    `json:"bidType,optional"`    //投标类型自定义内容
+	RemindRule []*RemindRuleReq `json:"remindRule,optional"` //消息提醒
+}
+
+type ParticipateActionReq struct {
+	BaseParam
+	BidIds      string `json:"bidIds,optional"`                    //招标信息id ,已加密。多个,号隔开
+	ProjectIds  string `json:"projectIds,optional"`                //项目信息id,已加密。多个,号隔开
+	ToEntUserId string `json:"toEntUserId,optional"`               //划转对象的企业用户id
+	IsRetain    bool   `json:"isRetain,optional"`                  //是否保留原跟踪人
+	ActionType  string `path:"actionType,options=in|out|transfer"` //in:参标;out:终止参标;transfer:划转
+}
+
+type ParticipateListReq struct {
+	BaseParam
+	Area          string `json:"area,optional"`             //省份
+	City          string `json:"city,optional"`             //城市
+	BidTime       string `json:"bidTime,optional"`          //招标日期:开始时间-结束时间
+	BidEndTime    string `json:"bidEndTime,optional"`       //投标截止日期:格式同上
+	BidOpenTime   string `json:"bidOpenTime,optional"`      //开标时间:格式同上
+	BidEndStatus  int64  `json:"bidEndStatus,optional"`     //投标截止状态:1:未截止;2:已截止;3:终止参标
+	BidOpenStatus int64  `json:"bidOpenStatus,optional"`    //开标状态:1:未开标;2:已开标
+	Keywords      string `json:"keywords,optional"`         //查询项目名称 关键词;多个空格隔开
+	EntUserIds    string `json:"entUserIds,optional"`       //企业参标人企业用户id集合,多个,号隔开
+	PageSize      int64  `json:"pageSize,default=10"`       //每页数据量
+	PageNum       int64  `json:"pageNum,default=1"`         //当前页码
+	Identity      string `path:"identity,options=mine|ent"` //我的:mine;企业:ent
+	OrderNum      int64  `json:"orderNum,default=0"`        //排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
+}

+ 1 - 0
jyBXCore/entity/db.go

@@ -22,6 +22,7 @@ type MongoStruct struct {
 //
 type Mysql struct {
 	Main *MysqlStruct `json:"main"`
+	Base *MysqlStruct `json:"base"`
 }
 
 //mysql

+ 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
-}

+ 2 - 10
jyBXCore/go.mod

@@ -6,8 +6,8 @@ require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
 	app.yhyue.com/moapp/jypkg v0.0.0-20230313120532-c305dbfd6a62
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
-	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230222052351-9d6fad062447
 	github.com/go-sql-driver/mysql v1.7.0
+	github.com/gogf/gf/v2 v2.0.6
 	github.com/zeromicro/go-zero v1.4.4
 	google.golang.org/grpc v1.53.0
 	google.golang.org/protobuf v1.28.1
@@ -16,8 +16,8 @@ require (
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547 // indirect
-	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e // indirect
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230222052351-9d6fad062447 // indirect
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.7 // indirect
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.13 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
@@ -48,19 +48,15 @@ require (
 	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.1 // indirect
-	github.com/josharian/intern v1.0.0 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
-	github.com/mailru/easyjson v0.7.7 // indirect
 	github.com/mattn/go-colorable v0.1.9 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect
 	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
-	github.com/nsqio/go-nsq v1.1.0 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
-	github.com/olivere/elastic/v7 v7.0.22 // indirect
 	github.com/openzipkin/zipkin-go v0.4.0 // indirect
 	github.com/pelletier/go-toml/v2 v2.0.6 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
@@ -69,13 +65,10 @@ require (
 	github.com/prometheus/common v0.37.0 // indirect
 	github.com/prometheus/procfs v0.8.0 // indirect
 	github.com/spaolacci/murmur3 v1.1.0 // indirect
-	github.com/tealeg/xlsx v1.0.5 // indirect
-	github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
-	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
 	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.5 // indirect
@@ -104,7 +97,6 @@ require (
 	golang.org/x/time v0.3.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
 	google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
-	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect

+ 300 - 5
jyBXCore/rpc/bxcore.proto

@@ -37,11 +37,11 @@ message SearchReq {
   string interceptOtherWords = 31;//关键词截取后 后面三个字
   string bidField = 32;//领域化标识
   string accountId = 33; //账户id
-  string positionType =34; //职位类型 0个人 1企业
+  string positionType = 34; //职位类型 0个人 1企业
   string positionId = 35;  //职位id
   string mgoUserId = 36;  //原userId
-  string limitFlag =37; //未登录用户生成一个随机id
-  bool isNew=38;//未登录用户首次请求
+  string limitFlag = 37; //未登录用户生成一个随机id
+  bool isNew = 38;//未登录用户首次请求
 }
 
 message SearchResp {
@@ -58,8 +58,8 @@ message SearchData {
   int64 total = 6;//查询总结果数量
   string remark = 7;//备注
   int64 interceptLimit = 8;//关键词截取长度
-  string interceptOtherWords= 9;//关键词截取剩余关键词
-  string interceptKeyWords= 10;//关键词截取后的关键词
+  string interceptOtherWords = 9;//关键词截取剩余关键词
+  string interceptKeyWords = 10;//关键词截取后的关键词
 }
 
 message  SearchList {
@@ -129,9 +129,304 @@ message SearchLimitResp {
   string err_msg = 2;
   string data = 3;
 }
+// 列表数据参标信息请求参数
+message ParticipateShowReq{
+  string ids = 1; // 标讯id  逗号分割
+  int64  entId = 2;//企业id
+  int64  entUserId = 3;// 企业下用户id
+  int64  positionId = 4; // 职位id
+  int64  positionType =5;// 职位类型 0个人 1企业
+  string mgoUserId = 6;  //原userId
+  string appId = 7;//剑鱼默认10000
+  string userId = 8;//用户id
+  int64 newUserId = 9;//base_user_id 新用户id
+  int64 accountId = 10; //账户id
+
+}
+
+// 列表数据参标信息返回值
+message ShowInfo{
+  string id = 1;// 标讯id
+  int64 value = 2; // 按钮显示值:0-参标   1- 已参标
+}
+message ParticipateShowRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  repeated ShowInfo data = 3;
+}
+// 详情页参标信息请求参数
+message ParticipateInfoReq{
+  string sid = 1; // 标讯id
+  int64  entId = 2;//企业id
+  int64  entUserId = 3;// 企业下用户id
+  int64  positionId = 4;// 职位id
+  int64  positionType =5;// 职位类型 0个人 1企业
+  string mgoUserId = 6;  //原userId
+  string appId = 7;//剑鱼默认10000
+  string userId = 8;//用户id
+  int64 newUserId = 9;//base_user_id 新用户id
+  int64 accountId = 10; //账户id
+
+}
+// 详情页参标信息返回值
+message ParticipateDetailInfo{
+  bool showParticipate = 1;// 是否显示参标按钮  true-显示  false-不显示
+  bool showStopParticipate = 2;//
+  bool showTransfer = 3;// 转给同事按钮是否展示:true-展示 false-不展示
+  string userName = 4;//参标人姓名 逗号分割
+  string projectId = 5;// 项目id
+  int64 bidEndTime = 6 ;// 投标截止时间
+
+}
+message ParticipateInfoRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  ParticipateDetailInfo data = 3;
+}
+// 投标状态更新请求参数
+message UpdateBidStatusReq{
+  int64  bidType = 1; // 投标类型 1-直接投标 2-渠道投标
+  repeated string bidStage = 2;// 投标项目阶段 ["未报名","已报名"...]
+  int64 isWin = 3;// 是否中标 0-未选择 1-是 2-否
+  string channelName = 4; // 渠道名称
+  string channelPerson = 5; // 联系人
+  string channelPhone = 6; //联系电话
+  string winner = 7;// 中标单位
+  string sid = 8;// 标讯id
+  int64  entId = 9;//企业id
+  int64  entUserId = 10;// 企业下用户id
+  int64  positionId = 11; // 职位id
+  int64  positionType =12;// 职位类型 0个人 1企业
+  string mgoUserId = 13;  //原userId
+  string appId = 14;//剑鱼默认10000
+  string  userId = 15;//用户id
+  int64  newUserId = 16;//base_user_id 新用户id
+  int64 accountId = 17; //账户id
+
+}
+// 投标状态更新返回值
+message UpdateBidStatusRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  bool data = 3;
+}
+
+// 获取投标状态信息
+message ParticipateContentReq{
+  string sid = 1; // 标讯id
+  int64  entId = 2; //企业id
+  int64  entUserId = 3; // 企业下用户id
+  int64  positionId = 4; // 职位id
+  int64  positionType =5;// 职位类型 0个人 1企业
+  string mgoUserId = 6;  //原userId
+  string appId = 7;//剑鱼默认10000
+  string  userId = 8;//用户id
+  int64  newUserId = 9;//base_user_id 新用户id
+  int64 accountId = 10; //账户id
+
+}
+
+// 获取投标状态信息结果
+message ParticipateContentData{
+  int64  bidType = 1; // 投标类型 1-直接投标 2-渠道投标
+  repeated string bidStage = 2;// 投标项目阶段 ["未报名","已报名"...]
+  int64 isWin = 3;// 是否中标 0-未选择 1-是 2-否
+  string channelName = 4; // 渠道名称
+  string channelPerson = 5; // 联系人
+  string channelPhone = 6; //联系电话
+  string winner = 7;// 中标单位
+}
+
+message ParticipateContentRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  ParticipateContentData data = 3;
+}
+// 参标操作记录请求参数
+message ParticipateRecordsReq{
+  int64  page = 1;// 页码
+  int64  pageSize = 2;// 每页条数
+  string sid = 3; // 标讯id
+  int64  entId = 4; //企业id
+  int64  entUserId = 5; // 企业下用户id
+  int64  positionId = 6; // 职位id
+  int64  positionType =7;// 职位类型 0个人 1企业
+  string mgoUserId = 8;  //原userId
+  string appId = 9;//剑鱼默认10000
+  string  userId = 10;//用户id
+  int64  newUserId = 11;//base_user_id 新用户id
+  int64  accountId = 12; //账户id
+
+}
+// 参标操作记录返回
+message ParticipateRecords{
+  string recordsData = 1; // 操作记录
+  string updateDate = 2;  // 更新时间
+  string updatePerson = 3; // 更新人
+}
+message ParticipateRecordsData {
+  repeated ParticipateRecords list = 1; // 操作记录
+  int64 total = 2 ;
+}
+message ParticipateRecordsRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  ParticipateRecordsData data = 3;
+}
+// 当前部门/企业下参标人员信息
+message ParticipatePersonsReq{
+  int64  entId = 1; //企业id
+  int64  entUserId = 2; // 企业下用户id
+  int64  positionId = 3; // 职位id
+  int64  positionType =4;// 职位类型 0个人 1企业
+  string mgoUserId = 5;  //原userId
+  string appId = 6;//剑鱼默认10000
+  string  userId = 7;//用户id
+  string  newUserId = 8;//base_user_id 新用户id
+  string accountId = 9; //账户id
+
+}
+
+message ParticipatePerson{
+  string userId = 1;
+  string name = 2;
+}
+
+message ParticipatePersonsRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  repeated ParticipatePerson data = 3;
+}
+//
+message ParticipateSetUpInfoReq{
+  int64  entId = 1; //企业id
+  int64  entUserId = 2; // 企业下用户id
+  int64  positionId = 3; // 职位id
+  int64  positionType =4;// 职位类型 0个人 1企业
+  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{
+  string name = 1;//直接投标;渠道投标
+  repeated string content = 2;//投标项目阶段内容
+}
+//消息提醒设置:
+message  RemindRuleReq{
+  string bidState = 1; //投标规则类型;0:直接投标;1:渠道投标;
+  int64 remainder = 2;//距离投标截止日期需要多久开始提醒 单位h
+  string node = 3;//那个节点进行消息提醒;和投标项目阶段绑定
+}
+//设置信息内容
+message ParticipateSetUpInfo{
+  string  isAllow = 1;//是否允许多人参标  默认0 开启是1
+  repeated BidTypeReq bidType = 2;
+  repeated RemindRuleReq remindRule = 3;
+}
+//设置信息范围内容
+message ParticipateSetUpInfoRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  ParticipateSetUpInfo data = 3;
+}
+//
+message ParticipateActionReq{
+  int64  entId = 1; //企业id
+  int64  entUserId = 2; // 企业下用户id
+  int64  positionId = 3; // 职位id
+  int64  positionType =4;// 职位类型 0个人 1企业
+  string mgoUserId = 5;  //原userId
+  string appId = 6;//剑鱼默认10000
+  string  userId = 7;//用户id
+  int64  newUserId = 8;//base_user_id 新用户id
+  int64 accountId = 9; //账户id
+  string  bidIds = 10;//招标信息id
+  string  toEntUserId = 11;//划转对象的企业用户id
+  bool isRetain = 12;//是否保留原跟踪人
+  string actionType = 13;//in:参标;out:终止参标;transfer:划转
+  string projectIds = 14;//项目ids 多个,号隔开
+}
+//
+message ParticipateActionRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  bool data = 3;
+}
+message ParticipateListReq{
+  int64 entId = 1; //企业id
+  int64 entUserId = 2; // 企业下用户id
+  int64 positionId = 3; // 职位id
+  int64 positionType =4;// 职位类型 0个人 1企业
+  string identity = 5;//我的:mine;企业:ent
+  string area = 6; //省份
+  string city = 7; //城市
+  string bidTime = 8;//招标日期:开始时间-结束时间
+  string bidEndTime = 9;//投标截止日期:格式同上
+  string bidOpenTime = 10;//开标时间:格式同上
+  int64 bidEndStatus = 11;//投标截止状态:1:未截止;2:已截止;3:终止参标
+  int64 bidOpenStatus = 12;//开标状态:1:已开标;2:未开标
+  string keywords = 13;//查询项目名称 关键词;多个空格隔开
+  string entUserIds = 14;//企业参标人企业用户id集合,多个,号隔开
+  int64 pageSize = 15;//每页数据量
+  int64 pageNum =16;//当前页码
+  string mgoUserId = 17;  //原userId
+  string appId = 18;//剑鱼默认10000
+  string  userId = 19;//用户id
+  int64  newUserId = 20;//base_user_id 新用户id
+  int64 accountId = 21; //账户id
+  int64 orderNum = 22;//排序:0:投标截止日期正序、1:开标时间正序、2:更新状态时间倒叙
+}
+//参标列表
+message  ParticipateList{
+  string id = 1;//项目id
+  string projectName = 2;//项目名称
+  string buyer = 3;//采购单位
+  string budget = 4;//预算
+  string participants = 5;//参标人 多个,号隔开
+  string bidTime = 6;//招标日期
+  string bidEndTime = 7;//投标截止日期
+  string bidOpenTime = 8;//投标截止日期
+  string updateStatusTime = 9;//更新状态时间
+  string updateStatusCon = 10;//投标状态更新
+}
+message  ParticipateData{
+  int64 count = 1;
+  repeated ParticipateList list = 2;
+}
+message ParticipateListRes{
+  int64 err_code = 1;
+  string err_msg = 2;
+  ParticipateData data = 3;
+}
+//
 service BxCore {
   //标讯搜索结果列表数据
   rpc GetSearchList(SearchReq) returns(SearchResp);
   //标讯搜索限制内容
   rpc SearchLimit(SearchLimitReq) returns(SearchLimitResp);
+  // 列表数据参标信息接口
+  rpc ParticipateShow(ParticipateShowReq) returns(ParticipateShowRes);
+  // 详情页参标信息接口
+  rpc ParticipateInfo(ParticipateInfoReq) returns(ParticipateInfoRes);
+  //  投标状态更新
+  rpc UpdateBidStatus(UpdateBidStatusReq) returns(UpdateBidStatusRes);
+  // 获取投标状态信息
+  rpc ParticipateContent(ParticipateContentReq) returns(ParticipateContentRes);
+  // 参标操作记录
+  rpc ParticipateRecords(ParticipateRecordsReq) returns (ParticipateRecordsRes);
+  // 当前部门/企业下参标人员信息
+  rpc ParticipatePersons(ParticipatePersonsReq) returns (ParticipatePersonsRes);
+  // 参标设置信息
+  rpc ParticipateSetUpInfo(ParticipateSetUpInfoReq) returns (ParticipateSetUpInfoRes);
+  // 项目参标 终止参标 划转等动作
+  rpc ParticipateAction(ParticipateActionReq) returns (ParticipateActionRes);
+  // 我的参标项目列表|企业参标项目列表
+  rpc ParticipateList(ParticipateListReq) returns (ParticipateListRes);
 }

+ 109 - 8
jyBXCore/rpc/bxcore/bxcore.go

@@ -13,20 +13,67 @@ import (
 )
 
 type (
-	PInfo           = bxcore.PInfo
-	SearchData      = bxcore.SearchData
-	SearchLimitReq  = bxcore.SearchLimitReq
-	SearchLimitResp = bxcore.SearchLimitResp
-	SearchList      = bxcore.SearchList
-	SearchReq       = bxcore.SearchReq
-	SearchResp      = bxcore.SearchResp
-	WinnerInfo      = bxcore.WinnerInfo
+	BidTypeReq              = bxcore.BidTypeReq
+	PInfo                   = bxcore.PInfo
+	ParticipateActionReq    = bxcore.ParticipateActionReq
+	ParticipateActionRes    = bxcore.ParticipateActionRes
+	ParticipateContentData  = bxcore.ParticipateContentData
+	ParticipateContentReq   = bxcore.ParticipateContentReq
+	ParticipateContentRes   = bxcore.ParticipateContentRes
+	ParticipateData         = bxcore.ParticipateData
+	ParticipateDetailInfo   = bxcore.ParticipateDetailInfo
+	ParticipateInfoReq      = bxcore.ParticipateInfoReq
+	ParticipateInfoRes      = bxcore.ParticipateInfoRes
+	ParticipateList         = bxcore.ParticipateList
+	ParticipateListReq      = bxcore.ParticipateListReq
+	ParticipateListRes      = bxcore.ParticipateListRes
+	ParticipatePerson       = bxcore.ParticipatePerson
+	ParticipatePersonsReq   = bxcore.ParticipatePersonsReq
+	ParticipatePersonsRes   = bxcore.ParticipatePersonsRes
+	ParticipateRecords      = bxcore.ParticipateRecords
+	ParticipateRecordsData  = bxcore.ParticipateRecordsData
+	ParticipateRecordsReq   = bxcore.ParticipateRecordsReq
+	ParticipateRecordsRes   = bxcore.ParticipateRecordsRes
+	ParticipateSetUpInfo    = bxcore.ParticipateSetUpInfo
+	ParticipateSetUpInfoReq = bxcore.ParticipateSetUpInfoReq
+	ParticipateSetUpInfoRes = bxcore.ParticipateSetUpInfoRes
+	ParticipateShowReq      = bxcore.ParticipateShowReq
+	ParticipateShowRes      = bxcore.ParticipateShowRes
+	RemindRuleReq           = bxcore.RemindRuleReq
+	SearchData              = bxcore.SearchData
+	SearchLimitReq          = bxcore.SearchLimitReq
+	SearchLimitResp         = bxcore.SearchLimitResp
+	SearchList              = bxcore.SearchList
+	SearchReq               = bxcore.SearchReq
+	SearchResp              = bxcore.SearchResp
+	ShowInfo                = bxcore.ShowInfo
+	UpdateBidStatusReq      = bxcore.UpdateBidStatusReq
+	UpdateBidStatusRes      = bxcore.UpdateBidStatusRes
+	WinnerInfo              = bxcore.WinnerInfo
 
 	BxCore interface {
 		// 标讯搜索结果列表数据
 		GetSearchList(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchResp, error)
 		// 标讯搜索限制内容
 		SearchLimit(ctx context.Context, in *SearchLimitReq, opts ...grpc.CallOption) (*SearchLimitResp, error)
+		//  列表数据参标信息接口
+		ParticipateShow(ctx context.Context, in *ParticipateShowReq, opts ...grpc.CallOption) (*ParticipateShowRes, error)
+		//  详情页参标信息接口
+		ParticipateInfo(ctx context.Context, in *ParticipateInfoReq, opts ...grpc.CallOption) (*ParticipateInfoRes, error)
+		//   投标状态更新
+		UpdateBidStatus(ctx context.Context, in *UpdateBidStatusReq, opts ...grpc.CallOption) (*UpdateBidStatusRes, error)
+		//  获取投标状态信息
+		ParticipateContent(ctx context.Context, in *ParticipateContentReq, opts ...grpc.CallOption) (*ParticipateContentRes, error)
+		//  参标操作记录
+		ParticipateRecords(ctx context.Context, in *ParticipateRecordsReq, opts ...grpc.CallOption) (*ParticipateRecordsRes, error)
+		//  当前部门/企业下参标人员信息
+		ParticipatePersons(ctx context.Context, in *ParticipatePersonsReq, opts ...grpc.CallOption) (*ParticipatePersonsRes, error)
+		//  参标设置信息
+		ParticipateSetUpInfo(ctx context.Context, in *ParticipateSetUpInfoReq, opts ...grpc.CallOption) (*ParticipateSetUpInfoRes, error)
+		//  项目参标 终止参标 划转等动作
+		ParticipateAction(ctx context.Context, in *ParticipateActionReq, opts ...grpc.CallOption) (*ParticipateActionRes, error)
+		//  我的参标项目列表|企业参标项目列表
+		ParticipateList(ctx context.Context, in *ParticipateListReq, opts ...grpc.CallOption) (*ParticipateListRes, error)
 	}
 
 	defaultBxCore struct {
@@ -51,3 +98,57 @@ func (m *defaultBxCore) SearchLimit(ctx context.Context, in *SearchLimitReq, opt
 	client := bxcore.NewBxCoreClient(m.cli.Conn())
 	return client.SearchLimit(ctx, in, opts...)
 }
+
+//  列表数据参标信息接口
+func (m *defaultBxCore) ParticipateShow(ctx context.Context, in *ParticipateShowReq, opts ...grpc.CallOption) (*ParticipateShowRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateShow(ctx, in, opts...)
+}
+
+//  详情页参标信息接口
+func (m *defaultBxCore) ParticipateInfo(ctx context.Context, in *ParticipateInfoReq, opts ...grpc.CallOption) (*ParticipateInfoRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateInfo(ctx, in, opts...)
+}
+
+//   投标状态更新
+func (m *defaultBxCore) UpdateBidStatus(ctx context.Context, in *UpdateBidStatusReq, opts ...grpc.CallOption) (*UpdateBidStatusRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.UpdateBidStatus(ctx, in, opts...)
+}
+
+//  获取投标状态信息
+func (m *defaultBxCore) ParticipateContent(ctx context.Context, in *ParticipateContentReq, opts ...grpc.CallOption) (*ParticipateContentRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateContent(ctx, in, opts...)
+}
+
+//  参标操作记录
+func (m *defaultBxCore) ParticipateRecords(ctx context.Context, in *ParticipateRecordsReq, opts ...grpc.CallOption) (*ParticipateRecordsRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateRecords(ctx, in, opts...)
+}
+
+//  当前部门/企业下参标人员信息
+func (m *defaultBxCore) ParticipatePersons(ctx context.Context, in *ParticipatePersonsReq, opts ...grpc.CallOption) (*ParticipatePersonsRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipatePersons(ctx, in, opts...)
+}
+
+//  参标设置信息
+func (m *defaultBxCore) ParticipateSetUpInfo(ctx context.Context, in *ParticipateSetUpInfoReq, opts ...grpc.CallOption) (*ParticipateSetUpInfoRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateSetUpInfo(ctx, in, opts...)
+}
+
+//  项目参标 终止参标 划转等动作
+func (m *defaultBxCore) ParticipateAction(ctx context.Context, in *ParticipateActionReq, opts ...grpc.CallOption) (*ParticipateActionRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateAction(ctx, in, opts...)
+}
+
+//  我的参标项目列表|企业参标项目列表
+func (m *defaultBxCore) ParticipateList(ctx context.Context, in *ParticipateListReq, opts ...grpc.CallOption) (*ParticipateListRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.ParticipateList(ctx, in, opts...)
+}

+ 3 - 15
jyBXCore/rpc/entity/search.go

@@ -6,10 +6,9 @@ import (
 	"encoding/json"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
-	"jyBXCore/entity"
-	"jyBXCore/rpc/bxcore"
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/service"
+	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/util"
 	"strconv"
 	"strings"
@@ -162,26 +161,15 @@ func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
 	positionType, _ := strconv.ParseInt(in.PositionType, 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
 	//默认搜索范围
 	if in.SelectType == "" {
 		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.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
 	//	详情页判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限

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

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

+ 10 - 3
jyBXCore/rpc/etc/db.yaml

@@ -1,15 +1,22 @@
 mysql:
     main:
         dbName: jianyu
-        address: 192.168.3.11:3366
+        address: 192.168.3.149:3306
         userName: root
         password: Topnet123
         maxOpenConns: 5
         maxIdleConns: 5
+    base:
+        dbName: base_service
+        address: 192.168.3.217:4000
+        userName: root
+        password: =PDT49#80Z!RVv52_z
+        maxOpenConns: 5
+        maxIdleConns: 5
 redis:
     addr:
-        - other=192.168.3.206:1712
-        - newother=192.168.3.206:1712
+        - other=192.168.3.149:1712
+        - newother=192.168.3.149:1712
 es:
     addr: http://192.168.3.206:9800
     size: 50

+ 14 - 0
jyBXCore/rpc/init/db.go

@@ -17,6 +17,7 @@ import (
 
 var (
 	MainMysql  *mysql.Mysql
+	BaseMysql  *mysql.Mysql
 	Mgo        mongodb.MongodbSim
 	MgoBidding mongodb.MongodbSim //标讯详情等(第一版没用)
 )
@@ -62,6 +63,19 @@ func MysqlInit(mm *entity.Mysql) {
 		}
 		MainMysql.Init()
 	}
+	//初始化 mysql-base
+	if mm.Base.Address != "" {
+		logx.Info("--初始化 tidb--")
+		BaseMysql = &mysql.Mysql{
+			Address:      mm.Base.Address,
+			UserName:     mm.Base.UserName,
+			PassWord:     mm.Base.Password,
+			DBName:       mm.Base.DbName,
+			MaxOpenConns: mm.Base.MaxOpenConns,
+			MaxIdleConns: mm.Base.MaxIdleConns,
+		}
+		BaseMysql.Init()
+	}
 }
 
 //

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

@@ -1,31 +1,26 @@
 package init
 
 import (
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"flag"
 	"fmt"
 	_ "github.com/go-sql-driver/mysql"
 	"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/zrpc"
 	"jyBXCore/entity"
 	"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() {
 	//基本配置
@@ -57,12 +52,8 @@ func init() {
 	LabelInit()
 	//
 	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
 		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 {

+ 39 - 0
jyBXCore/rpc/internal/logic/participateactionlogic.go

@@ -0,0 +1,39 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/service"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateActionLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateActionLogic {
+	return &ParticipateActionLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  项目参标 终止参标 划转等动作 in:参标;out:终止参标;transfer:划转
+func (l *ParticipateActionLogic) ParticipateAction(in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
+	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
+}

+ 70 - 0
jyBXCore/rpc/internal/logic/participatecontentlogic.go

@@ -0,0 +1,70 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/service"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateContentLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateContentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateContentLogic {
+	return &ParticipateContentLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  获取投标状态信息
+func (l *ParticipateContentLogic) ParticipateContent(in *bxcore.ParticipateContentReq) (*bxcore.ParticipateContentRes, error) {
+	// 验证权限
+	result := &bxcore.ParticipateContentRes{
+		ErrCode: -1,
+	}
+	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	// 不是超级订阅 也不是大会员
+	if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
+		result.ErrMsg = "没有权限"
+		return result, nil
+	}
+	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	participateService.EntRoleId = userInfo.Ent.EntRoleId
+	// 信息id解密
+	infoList, _ := service.DecodeId(in.Sid)
+	if len(infoList) == 0 {
+		result.ErrMsg = "信息id无效"
+		return result, nil
+	}
+	// 根据标讯id 查询项目信息
+	projectInfos := es.GetProjectByInfoId(infoList)
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		result.ErrMsg = "未查询到项目信息"
+		return result, nil
+	}
+	// 验证身份
+	projectId := common.ObjToString((*projectInfos)[0]["_id"])
+	if !participateService.CheckBidPower(projectId, false) {
+		result.ErrMsg = "没有查看权限"
+		return result, nil
+	}
+	//  查询
+	data := participateService.GetLastBidStatus(projectId)
+	formatData := participateService.ParticipateContentFormat(data)
+	return &bxcore.ParticipateContentRes{
+		ErrCode: 0,
+		Data:    &formatData,
+	}, nil
+}

+ 85 - 0
jyBXCore/rpc/internal/logic/participateinfologic.go

@@ -0,0 +1,85 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/service"
+	"jyBXCore/rpc/util"
+	"time"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateInfoLogic {
+	return &ParticipateInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  详情页参标信息接口
+func (l *ParticipateInfoLogic) ParticipateInfo(in *bxcore.ParticipateInfoReq) (*bxcore.ParticipateInfoRes, error) {
+	format := &bxcore.ParticipateDetailInfo{}
+	result := bxcore.ParticipateInfoRes{
+		ErrMsg:  "",
+		ErrCode: -1,
+		Data:    format,
+	}
+	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	//不是超级订阅 也不是大会员
+	if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
+		result.ErrMsg = "没有权限"
+		return &result, nil
+	}
+	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	participateService.EntRoleId = userInfo.Ent.EntRoleId
+	// 信息id解密
+	infoList, infoSet := service.DecodeId(in.Sid)
+	if len(infoList) == 0 {
+		result.ErrMsg = "信息id无效"
+		return &result, nil
+	}
+	// 2. 根据标讯id 查询项目信息
+	projectInfos := es.GetProjectByInfoId(infoList)
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		result.ErrMsg = "未查询到项目信息"
+		return &result, nil
+	}
+	// 判断是否已经过了开标时间
+	var isValid bool
+	bidopentime := common.Int64All((*projectInfos)[0]["bidopentime"])
+	bidendtime := common.Int64All((*projectInfos)[0]["bidendtime"])
+	if time.Now().Unix() >= bidopentime || bidopentime == 0 {
+		isValid = true
+	}
+	//   获取项目id
+	_, projectIds := service.HandlerProjectId(*projectInfos, infoSet)
+	//区分个人和企业
+	var formatData *bxcore.ParticipateDetailInfo
+	switch int(in.PositionType) {
+	case service.PositionTypePersonal:
+		existList := participateService.PersonalExistProject(projectIds)
+		formatData = participateService.DetailPersonalFormat(existList, isValid, bidendtime)
+	case service.PositionTypeEnt:
+		isAllow := util.IsALLow(in.EntId)
+		existList := participateService.EntExistProject(projectIds)                              // 查询出已经存在的
+		formatData = participateService.DetailEntFormat(existList, isValid, isAllow, bidendtime) // 格式化数据
+	}
+	result.ErrCode = 0
+	result.Data = formatData
+	return &result, nil
+
+}

+ 30 - 0
jyBXCore/rpc/internal/logic/participatelistlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/service"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateListLogic {
+	return &ParticipateListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  我的参标项目列表|企业参标项目列表
+func (l *ParticipateListLogic) ParticipateList(in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes, error) {
+	return service.ParticipateList(in)
+}

+ 31 - 0
jyBXCore/rpc/internal/logic/participatepersonslogic.go

@@ -0,0 +1,31 @@
+package logic
+
+import (
+	"context"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipatePersonsLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipatePersonsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipatePersonsLogic {
+	return &ParticipatePersonsLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  当前部门/企业下参标人员信息
+func (l *ParticipatePersonsLogic) ParticipatePersons(in *bxcore.ParticipatePersonsReq) (*bxcore.ParticipatePersonsRes, error) {
+	// todo: add your logic here and delete this line
+
+	return &bxcore.ParticipatePersonsRes{}, nil
+}

+ 68 - 0
jyBXCore/rpc/internal/logic/participaterecordslogic.go

@@ -0,0 +1,68 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	"fmt"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/service"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateRecordsLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateRecordsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateRecordsLogic {
+	return &ParticipateRecordsLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  参标操作记录
+func (l *ParticipateRecordsLogic) ParticipateRecords(in *bxcore.ParticipateRecordsReq) (*bxcore.ParticipateRecordsRes, error) {
+	// 验证权限
+	result := &bxcore.ParticipateRecordsRes{
+		ErrCode: -1,
+	}
+	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	// 不是超级订阅 也不是大会员
+	if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
+		result.ErrMsg = "没有权限"
+		return result, nil
+	}
+	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	participateService.EntRoleId = userInfo.Ent.EntRoleId
+	// 信息id解密
+	infoList, _ := service.DecodeId(in.Sid)
+	if len(infoList) == 0 {
+		result.ErrMsg = "无效的信息id"
+		return result, nil
+	}
+	// 根据标讯id 查询项目信息
+	projectInfos := es.GetProjectByInfoId(infoList)
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		result.ErrMsg = "未查询到项目信息"
+		return result, nil
+	}
+	// 验证身份
+	projectId := common.ObjToString((*projectInfos)[0]["_id"])
+	if !participateService.CheckBidPower(projectId, false) {
+		return result, fmt.Errorf("没有该项目操作记录查看权限")
+	}
+	//  查询
+	data := participateService.GetBidRecords(projectId, in.Page, in.PageSize)
+	return &bxcore.ParticipateRecordsRes{
+		ErrCode: 0,
+		Data:    data,
+	}, nil
+}

+ 30 - 0
jyBXCore/rpc/internal/logic/participatesetupinfologic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/service"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateSetUpInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateSetUpInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateSetUpInfoLogic {
+	return &ParticipateSetUpInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  参标设置信息
+func (l *ParticipateSetUpInfoLogic) ParticipateSetUpInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.ParticipateSetUpInfoRes, error) {
+	return service.GetParticipateSetInfo(in)
+}

+ 74 - 0
jyBXCore/rpc/internal/logic/participateshowlogic.go

@@ -0,0 +1,74 @@
+package logic
+
+import (
+	"context"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/service"
+	"jyBXCore/rpc/type/bxcore"
+	"jyBXCore/rpc/util"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ParticipateShowLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewParticipateShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParticipateShowLogic {
+	return &ParticipateShowLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//  列表数据参标信息接口
+func (l *ParticipateShowLogic) ParticipateShow(in *bxcore.ParticipateShowReq) (*bxcore.ParticipateShowRes, error) {
+	result := bxcore.ParticipateShowRes{
+		ErrMsg:  "",
+		ErrCode: -1,
+		Data:    []*bxcore.ShowInfo{},
+	}
+	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	//不是超级订阅 也不是大会员
+	if userInfo.Vip.Status < 0 && userInfo.Member.Status < 0 {
+		result.ErrMsg = "没有权限"
+		return &result, nil
+	}
+	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	participateService.EntRoleId = userInfo.Ent.EntRoleId
+	// 2. 根据标讯id 查询项目信息 拿到有效的项目id (无项目信息或者已经过开标时间  则不展示按钮  在开标时间内或者没有开标时间字段需要展示)
+	// 信息id解密
+	infoList, infoSet := service.DecodeId(in.Ids)
+	if len(infoList) == 0 {
+		result.ErrMsg = "信息id无效"
+		return &result, nil
+	}
+	// 查有效项目id信息
+	projectInfos := es.GetValidProjectByInfoId(infoList)
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		result.ErrMsg = "未查询到信息"
+		return &result, nil
+	}
+	// 记录信息id和项目id的映射  用于最后处理返回数据
+	infoM, projectIds := service.HandlerProjectId(*projectInfos, infoSet)
+	// 3. 查询参标信息 处理按钮 区分个人和企业
+	var formatList []*bxcore.ShowInfo
+	switch int(in.PositionType) {
+	case service.PositionTypePersonal:
+		existList := participateService.PersonalExistProject(projectIds)
+		formatList = participateService.ListPersonalFormat(existList, infoM)
+	case service.PositionTypeEnt:
+		isAllow := util.IsALLow(in.EntId)
+		existList := participateService.EntExistProject(projectIds)              // 查询出已经存在的
+		formatList = participateService.ListEntFormat(existList, infoM, isAllow) // 格式化数据
+	}
+	result.ErrCode = 0
+	result.Data = formatList
+	return &result, nil
+}

+ 82 - 0
jyBXCore/rpc/internal/logic/updatebidstatuslogic.go

@@ -0,0 +1,82 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"context"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/service"
+	"time"
+
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateBidStatusLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewUpdateBidStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateBidStatusLogic {
+	return &UpdateBidStatusLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+//   投标状态更新
+func (l *UpdateBidStatusLogic) UpdateBidStatus(in *bxcore.UpdateBidStatusReq) (*bxcore.UpdateBidStatusRes, error) {
+	result := &bxcore.UpdateBidStatusRes{
+		ErrCode: -1,
+	}
+	// 1. 判断身份是否有权限 不是超级订阅也不是大会员  则直接返回不展示
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	// 不是超级订阅 也不是大会员
+	if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
+		result.ErrMsg = "没有权限"
+		return result, nil
+	}
+	participateService := service.NewParticipateBid(in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+	participateService.EntRoleId = userInfo.Ent.EntRoleId
+	// 信息id解密
+	infoList, _ := service.DecodeId(in.Sid)
+	if len(infoList) == 0 {
+		result.ErrMsg = "信息id无效"
+		return result, nil
+	}
+	// 根据标讯id 查询项目信息
+	projectInfos := es.GetProjectByInfoId(infoList)
+	if projectInfos == nil || len(*projectInfos) == 0 {
+		result.ErrMsg = "未查询到项目信息"
+		return result, nil
+	}
+	// 判断是否已经过了开标时间
+	var isValid bool
+	bidopentime := common.Int64All((*projectInfos)[0]["bidopentime"])
+	projectId := common.ObjToString((*projectInfos)[0]["_id"])
+	if time.Now().Unix() >= bidopentime || bidopentime == 0 {
+		isValid = true
+	}
+	if !isValid {
+		result.ErrMsg = "已经过开标时间,无法更新"
+		return result, nil
+	}
+	// 验证身份
+	if !participateService.CheckBidPower(projectId, true) {
+		result.ErrMsg = "没有更新权限"
+		return result, nil
+	}
+	// 2. 更新
+	flag := participateService.UpdateBidStatus(in, projectId)
+	if !flag {
+		result.ErrMsg = "更新失败"
+	} else {
+		result.ErrCode = 0
+	}
+	result.Data = flag
+	return result, nil
+}

+ 54 - 0
jyBXCore/rpc/internal/server/bxcoreserver.go

@@ -33,3 +33,57 @@ func (s *BxCoreServer) SearchLimit(ctx context.Context, in *bxcore.SearchLimitRe
 	l := logic.NewSearchLimitLogic(ctx, s.svcCtx)
 	return l.SearchLimit(in)
 }
+
+//  列表数据参标信息接口
+func (s *BxCoreServer) ParticipateShow(ctx context.Context, in *bxcore.ParticipateShowReq) (*bxcore.ParticipateShowRes, error) {
+	l := logic.NewParticipateShowLogic(ctx, s.svcCtx)
+	return l.ParticipateShow(in)
+}
+
+//  详情页参标信息接口
+func (s *BxCoreServer) ParticipateInfo(ctx context.Context, in *bxcore.ParticipateInfoReq) (*bxcore.ParticipateInfoRes, error) {
+	l := logic.NewParticipateInfoLogic(ctx, s.svcCtx)
+	return l.ParticipateInfo(in)
+}
+
+//   投标状态更新
+func (s *BxCoreServer) UpdateBidStatus(ctx context.Context, in *bxcore.UpdateBidStatusReq) (*bxcore.UpdateBidStatusRes, error) {
+	l := logic.NewUpdateBidStatusLogic(ctx, s.svcCtx)
+	return l.UpdateBidStatus(in)
+}
+
+//  获取投标状态信息
+func (s *BxCoreServer) ParticipateContent(ctx context.Context, in *bxcore.ParticipateContentReq) (*bxcore.ParticipateContentRes, error) {
+	l := logic.NewParticipateContentLogic(ctx, s.svcCtx)
+	return l.ParticipateContent(in)
+}
+
+//  参标操作记录
+func (s *BxCoreServer) ParticipateRecords(ctx context.Context, in *bxcore.ParticipateRecordsReq) (*bxcore.ParticipateRecordsRes, error) {
+	l := logic.NewParticipateRecordsLogic(ctx, s.svcCtx)
+	return l.ParticipateRecords(in)
+}
+
+//  当前部门/企业下参标人员信息
+func (s *BxCoreServer) ParticipatePersons(ctx context.Context, in *bxcore.ParticipatePersonsReq) (*bxcore.ParticipatePersonsRes, error) {
+	l := logic.NewParticipatePersonsLogic(ctx, s.svcCtx)
+	return l.ParticipatePersons(in)
+}
+
+//  参标设置信息
+func (s *BxCoreServer) ParticipateSetUpInfo(ctx context.Context, in *bxcore.ParticipateSetUpInfoReq) (*bxcore.ParticipateSetUpInfoRes, error) {
+	l := logic.NewParticipateSetUpInfoLogic(ctx, s.svcCtx)
+	return l.ParticipateSetUpInfo(in)
+}
+
+//  项目参标 终止参标 划转等动作
+func (s *BxCoreServer) ParticipateAction(ctx context.Context, in *bxcore.ParticipateActionReq) (*bxcore.ParticipateActionRes, error) {
+	l := logic.NewParticipateActionLogic(ctx, s.svcCtx)
+	return l.ParticipateAction(in)
+}
+
+//  我的参标项目列表|企业参标项目列表
+func (s *BxCoreServer) ParticipateList(ctx context.Context, in *bxcore.ParticipateListReq) (*bxcore.ParticipateListRes, error) {
+	l := logic.NewParticipateListLogic(ctx, s.svcCtx)
+	return l.ParticipateList(in)
+}

+ 3 - 1
jyBXCore/rpc/model/es/es.go

@@ -28,7 +28,9 @@ const (
 	BidSearchFieldOfVip     = BidSearchFieldBase + `,"buyertel","buyerperson","agency","agencytel","agencyperson","s_winner","winnertel","winnerperson","signendtime","bidendtime","projectinfo","entidlist"`            //付费列表字段
 	BidSearchFieldFile      = `,"isValidFile"`                                                                                                                                                                           //根据配置开关 选择是否显示 是否有附件提示,IC.C.FileSignBool
 	BidSearchDomainField    = BidSearchFieldOfVip + `,"purchasing"`                                                                                                                                                      //领域数据字段基本字段
-	//DefaultFields       = `"title"`                                                                                                                                                                                                      //最新招标信息
+	//DefaultFields       = `"title"`
+	IndexProjectSet = "projectset" // 项目信息es index
+	TypeProjectSet  = "projectset" // 项目信息es type                                                                                                                                                                                                  //最新招标信息
 )
 
 var (

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

@@ -0,0 +1,79 @@
+package es
+
+import (
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"fmt"
+	"strings"
+	"time"
+)
+
+//项目信息 项目id
+func GetProjectInfo(id string) map[string]interface{} {
+	projectInfos := elastic.GetById(IndexProjectSet, TypeProjectSet, id)
+	if projectInfos != nil && len(*projectInfos) > 0 {
+		return (*projectInfos)[0]
+	}
+	return nil
+}
+
+//招标信息 招标信息id
+func GetBiddingInfo(id string) map[string]interface{} {
+	biddingInfos := elastic.GetById(INDEX, TYPE, id)
+	if biddingInfos != nil && len(*biddingInfos) > 0 {
+		return (*biddingInfos)[0]
+	}
+	return nil
+}
+
+// GetValidProjectByInfoId 根据查询有效的参标项目id(未到开标时间及开标时间不存在的)
+func GetValidProjectByInfoId(infoIds []string) *[]map[string]interface{} {
+	if len(infoIds) == 0 {
+		return nil
+	}
+	nowTime := time.Now().Unix()
+	query := `{"_source":["_id","list.infoid"],"query": {"bool": {"must": [{"terms": {"list.infoid": ["` + strings.Join(infoIds, "\",\"") + `"]}},
+        {"bool": {"should": [{"range": {"bidopentime": {"gte": ` + fmt.Sprint(nowTime) + `}}},
+        {"constant_score": {"filter": {"missing": {"field": "bidopentime"
+                    } } } }] }}]}}}`
+
+	projectResult := elastic.Get(IndexProjectSet, TypeProjectSet, query)
+	return projectResult
+
+}
+
+// GetProjectByInfoId 根据信息id查询项目id
+func GetProjectByInfoId(infoIds []string) *[]map[string]interface{} {
+	if len(infoIds) == 0 {
+		return nil
+	}
+	query := `{"_source":["_id","list.infoid","ids","bidopentime","bidendtime"],"query":{"bool":{"must":[{"terms":{"list.infoid":["` + strings.Join(infoIds, "\",\"") + `"]}}]}}}`
+
+	projectResult := elastic.Get(IndexProjectSet, TypeProjectSet, query)
+	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
+
+}

+ 1 - 1
jyBXCore/rpc/model/es/search.go

@@ -5,8 +5,8 @@ import (
 	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
-	"jyBXCore/rpc/bxcore"
 	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/type/bxcore"
 	"strconv"
 	"strings"
 	"time"

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

@@ -0,0 +1,832 @@
+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"
+	"log"
+	"strconv"
+	"strings"
+	"time"
+)
+
+//投标状态更新内容
+type PartStatusContent struct {
+	BidStage      []string `json:"bidStage"`      //投标项目阶段
+	BidType       int64    `json:"bidType"`       //投标类型
+	ChannelName   string   `json:"channelName"`   //渠道名称
+	ChannelPerson string   `json:"channelPerson"` //联系人
+	ChannelPhone  string   `json:"channelPhone"`  //联系电话
+	IsWin         int64    `json:"isWin"`         //渠道是否中标
+	Winner        string   `json:"winner"`        //中标单位
+}
+
+//参标
+type RecordsContent struct {
+	After       PartStatusContent `json:"after"`       //更新前
+	Before      PartStatusContent `json:"before"`      //更新后
+	ChangeField []string          `json:"changeField"` //更新字段
+	Content     string            `json:"content"`     //更新内容
+}
+
+var (
+	PartTable                  = "participate"
+	ParticipateBidRecordsTable = "participate_bid_records"
+	ParticipateUserTable       = "participate_user" // 参标用户表
+	EntnicheUserTable          = "entniche_user"    // 企业用户表
+)
+
+//划转参标信息
+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 "+ParticipateUserTable+" 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, ParticipateUserTable, 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, ParticipateBidRecordsTable, map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    entUserId,
+			"position_id":    positionId,
+			"project_id":     projectId,
+			"record_type":    0,
+			"record_content": content,
+			"create_date":    date.FormatDate(&now, date.Date_Full_Layout),
+		}) > 0
+		//保存参标--participate_user
+		//查看是否参标过当前项目
+		if c := IC.BaseMysql.CountBySql("SELECT count(id) FROM "+ParticipateUserTable+" WHERE position_id = ? AND project_id = ?  AND ent_id = ?", positionId, projectId, in.EntId); c > 0 {
+			//更新
+			b3 = IC.BaseMysql.UpdateByTx(tx, ParticipateUserTable, 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, ParticipateUserTable, 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, ParticipateUserTable, query, insert)
+		//保存参标记录--participate_bid_records
+		b2 = IC.BaseMysql.InsertByTx(tx, ParticipateBidRecordsTable, map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    in.EntUserId,
+			"position_id":    in.PositionId,
+			"project_id":     in.ProjectIds,
+			"record_type":    0,
+			"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 "+ParticipateUserTable+" WHERE position_id = ? AND project_id = ?  AND ent_id = ?", in.PositionId, in.ProjectIds, in.EntId); c > 0 {
+			//更新
+			b1 = IC.BaseMysql.UpdateByTx(tx, ParticipateUserTable, 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, ParticipateUserTable, 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, ParticipateBidRecordsTable, map[string]interface{}{
+			"ent_id":         in.EntId,
+			"ent_user_id":    in.EntUserId,
+			"position_id":    in.PositionId,
+			"project_id":     in.ProjectIds,
+			"record_type":    0,
+			"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 `+ParticipateUserTable+` 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
+	conditionSql := ` WHERE 1=1 `
+	//地区
+	if in.Area != "" {
+		conditionSql += fmt.Sprintf(" AND pt.area IN ('%s') ", strings.ReplaceAll(in.Area, ",", "','"))
+	}
+	//城市
+	if in.City != "" {
+		conditionSql += 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 += `)`
+		conditionSql += kSql
+	}
+	//招标日期
+	if in.BidTime != "" && strings.Contains(in.BidTime, "-") {
+		startTime := strings.Split(in.BidTime, "-")[0]
+		entTime := strings.Split(in.BidTime, "-")[1]
+		if startTime != "" {
+			startTimeInt, _ := strconv.ParseInt(startTime, 10, 64)
+			conditionSql += ` AND pt.bid_time > '` + date.FormatDateByInt64(&startTimeInt, date.Date_Full_Layout) + `'`
+		}
+		if entTime != "" {
+			entTimeInt, _ := strconv.ParseInt(entTime, 10, 64)
+			conditionSql += ` AND pt.bid_time < '` + date.FormatDateByInt64(&entTimeInt, date.Date_Full_Layout) + `'`
+		}
+	}
+	//招标截止日期
+	if in.BidEndTime != "" {
+		//投标截止日期规则:
+		//1、开始时间小于当前时间 ,结束时间大于当前时间,投标截止状态按钮未截止和已截止可用;
+		//2、结束时间小于当前时间|开始时间大于当前时间,投标截止状态按钮未截止和已截止不可用;
+		//3、需要前端做成连动
+		startTime := strings.Split(in.BidEndTime, "-")[0]
+		endTime := strings.Split(in.BidEndTime, "-")[1]
+		startTimeInt, _ := strconv.ParseInt(startTime, 10, 64)
+		endTimeInt, _ := strconv.ParseInt(endTime, 10, 64)
+		if startTimeInt > 0 && endTimeInt > 0 && startTimeInt > endTimeInt {
+			logx.Info(fmt.Sprintf("投标截止日期 %d 开始时间 大于 结束时间%d!!!", startTimeInt, endTimeInt))
+		} else {
+			switch in.BidEndStatus {
+			case 0:
+				if startTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time > '` + date.FormatDateByInt64(&startTimeInt, date.Date_Full_Layout) + `'`
+				}
+				if endTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time < '` + date.FormatDateByInt64(&endTimeInt, date.Date_Full_Layout) + `'`
+				}
+			case 1: //投标截止状态:1:未截止;2:已截止;3:终止参标
+				//未截止:
+				var (
+					endBool = true
+				)
+				//如果结束时间存在且小于当前时间,投标截止日期 范围都是已截止 不会存在未截止的数据
+				if endTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time < '` + date.FormatDateByInt64(&endTimeInt, date.Date_Full_Layout) + `'`
+					endBool = endTimeInt > now.Unix()
+				}
+				//开始时间小于 当前时间
+				if endBool && now.Unix() > startTimeInt {
+					startTimeInt = now.Unix()
+				}
+				//存在开始时间为0的情况
+				if startTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time > '` + date.FormatDateByInt64(&startTimeInt, date.Date_Full_Layout) + `'`
+				}
+			case 2: //投标截止状态:1:未截止;2:已截止;3:终止参标
+				//如果开始时间存在且大于当前时间,投标截止日期 范围都是未截止 不会存在已截止的数据
+				var (
+					startBool = true
+				)
+				if startTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time > '` + date.FormatDateByInt64(&startTimeInt, date.Date_Full_Layout) + `'`
+					startBool = startTimeInt < now.Unix()
+				}
+				if startBool && (endTimeInt == 0 || now.Unix() < endTimeInt) {
+					endTimeInt = now.Unix()
+				}
+				//存在结束时间为0的情况
+				if endTimeInt > 0 {
+					conditionSql += ` AND pt.bid_end_time < '` + date.FormatDateByInt64(&endTimeInt, date.Date_Full_Layout) + `'`
+				}
+			case 3:
+				conditionSql += ` AND pug.state < 0 `
+			}
+		}
+	} else if in.BidEndStatus > 0 { //投标截止状态1:未截止;2:已截止;3:终止参标
+		switch in.BidEndStatus {
+		case 1:
+			conditionSql += ` AND pt.bid_end_time > '` + nowDate + `'`
+		case 2:
+			conditionSql += ` AND pt.bid_end_time < '` + nowDate + `'`
+		case 3:
+			conditionSql += ` AND pug.state < 0 `
+		}
+	}
+	//开标时间
+	if in.BidOpenTime != "" {
+		startTime := strings.Split(in.BidOpenTime, "-")[0]
+		entTime := strings.Split(in.BidOpenTime, "-")[1]
+		if startTime != "" {
+			startTimeInt, _ := strconv.ParseInt(startTime, 10, 64)
+			conditionSql += ` AND pt.bid_open_time > '` + date.FormatDateByInt64(&startTimeInt, date.Date_Full_Layout) + `'`
+		}
+		if entTime != "" {
+			entTimeInt, _ := strconv.ParseInt(entTime, 10, 64)
+			conditionSql += ` AND pt.bid_open_time < '` + date.FormatDateByInt64(&entTimeInt, date.Date_Full_Layout) + `'`
+		}
+	}
+	//开标状态1:未开标;2:已开标
+	if in.BidOpenStatus > 0 {
+		switch in.BidOpenStatus {
+		case 1:
+			conditionSql += ` AND pt.bid_open_time > '` + nowDate + `'`
+		case 2:
+			conditionSql += ` AND pt.bid_open_time < '` + nowDate + `'`
+		}
+	}
+	//参标人  管理员权限
+	if in.EntUserIds != "" && in.PositionType > 0 {
+		conditionSql += ` AND  (`
+		for k, v := range strings.Split(in.EntUserIds, ",") {
+			if k > 0 {
+				conditionSql += " OR "
+			}
+			conditionSql += ` FIND_IN_SET(` + v + ` , pug.ent_user_id) `
+		}
+		conditionSql += `)`
+	}
+	//默认按照投标截止日期正序排列、1:开标时间正序、2:更新状态时间倒序
+	switch in.OrderNum {
+	case 1:
+		conditionSql += ` ORDER BY pt.bid_open_time ASC`
+	case 2:
+		conditionSql += ` ORDER BY pug.update_date DESC`
+	default:
+		conditionSql += ` ORDER BY pt.bid_end_time ASC`
+	}
+	logx.Info(conditionSql)
+	return conditionSql
+}
+
+//个人或员工查询参标列表
+func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (data *bxcore.ParticipateData, err error) {
+	defer MC.Catch()
+	data = &bxcore.ParticipateData{
+		Count: 0,
+		List:  []*bxcore.ParticipateList{},
+	}
+	//员工|个人列表
+	singlePersonSql := `SELECT %s FROM ` + ParticipateUserTable + ` pug LEFT JOIN project pt ON pug.project_id = pt.id WHERE pug.position_id = ? `
+	singlePersonSql += conditionSql
+	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("s", in.PositionId, MC.ObjToString(v["id"])), //查询最后一次 投标状态更新,
+				})
+			}
+			return data, nil
+		}
+		return nil, fmt.Errorf("数据异常")
+	}
+	return data, nil
+}
+
+//管理员获取参标列表数据
+func AdminParticipateList(in *bxcore.ParticipateListReq, conditionSql 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,MAX(pu.state) state FROM ` + ParticipateUserTable + ` pu WHERE pu.ent_id = ? AND NOT EXISTS ( SELECT 1 FROM ` + ParticipateUserTable + ` 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`
+	adminCountSql := fmt.Sprintf(adminSql, "COUNT(pt.id)") + conditionSql
+	log.Println(adminCountSql)
+	count := IC.BaseMysql.CountBySql(adminCountSql, in.EntId)
+	if count > 0 {
+		data.Count = count
+		in.PageNum = (in.PageNum - 1) * in.PageSize
+		adminListSql := fmt.Sprintf(adminSql, " pt.*, pug.ent_user_id,pug.update_date ") + conditionSql + fmt.Sprintf(" LIMIT %d,%d", in.PageNum, in.PageSize)
+		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("e", 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(s string, id int64, projectId string) string {
+	identitySql := `ent_id = ?`
+	if s == "s" {
+		identitySql = `position_id = ?`
+	}
+	recordsSql := `SELECT record_content,record_type FROM ` + ParticipateBidRecordsTable + ` WHERE ` + identitySql + ` AND project_id = ? ORDER BY create_date DESC LIMIT 1;`
+	records := IC.BaseMysql.SelectBySql(recordsSql, id, projectId)
+	if records != nil && len(*records) > 0 {
+		rec := (*records)[0]
+		switch MC.IntAll(rec["record_type"]) {
+		case 0:
+			return MC.ObjToString(rec["record_content"])
+		case 1:
+			recordContent := *MC.ObjToMap(rec["record_content"])
+			rb, err := json.Marshal(recordContent)
+			if err != nil {
+				log.Println(err.Error())
+				return ""
+			}
+			var rc = RecordsContent{
+				After:  PartStatusContent{},
+				Before: PartStatusContent{},
+			}
+			err1 := json.Unmarshal(rb, &rc)
+			if err1 == nil {
+				return rc.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 ""
+}
+
+// GetBidContentEnt 企业版 获取投标状态更新内容
+func GetBidContentEnt(projectId string, entId int64) *[]map[string]interface{} {
+	// record_type '默认0:参标、划转、取消参标;1:投标状态更新存储'
+	query := "SELECT * FROM " + ParticipateBidRecordsTable + " where project_id=? and ent_id=? and record_type=1 order by create_date desc limit 1; "
+	return IC.BaseMysql.SelectBySql(query, projectId, entId)
+}
+
+// GetBidContentPersonal 个人版 获取投标状态更新内容
+func GetBidContentPersonal(projectId string, positionId int64) *[]map[string]interface{} {
+	query := "SELECT * FROM " + ParticipateBidRecordsTable + " where project_id=? and position_id=? and  record_type=1  order by create_date desc limit 1;"
+	return IC.BaseMysql.SelectBySql(query, projectId, positionId)
+}
+
+// UpdateBidContent 更新投标状态信息以及操作记录
+func UpdateBidContent(recordData map[string]interface{}) (flag bool) {
+	r2 := IC.BaseMysql.Insert(ParticipateBidRecordsTable, recordData)
+	return r2 > 0
+}
+
+// InsertBidContent 新增投标状态信息及操作记录
+func InsertBidContent(recordData map[string]interface{}) (flag bool) {
+	r2 := IC.BaseMysql.Insert(ParticipateBidRecordsTable, recordData)
+	return r2 > 0
+}
+
+// GetBidRecordsEnt 获取操作记录列表企业
+func GetBidRecordsEnt(projectId string, entId, page, pageSize int64) (rs *[]map[string]interface{}, total int64) {
+	query := "SELECT * FROM " + ParticipateBidRecordsTable + " where project_id=? and ent_id=?   order by create_date desc limit ?,?"
+	countQuery := "SELECT count(id) FROM " + ParticipateBidRecordsTable + " where project_id=? and ent_id=? ;"
+	rs = IC.BaseMysql.SelectBySql(query, projectId, entId, (page-1)*pageSize, pageSize)
+	total = IC.BaseMysql.CountBySql(countQuery, projectId, entId)
+	return rs, total
+}
+
+// GetBidRecordsPersonal 获取操作记录列表个人
+func GetBidRecordsPersonal(projectId string, positionId, page, pageSize int64) (rs *[]map[string]interface{}, total int64) {
+	query := "SELECT * FROM " + ParticipateBidRecordsTable + " where project_id=? and position_id=?   order by create_date desc limit ?,?;"
+	countQuery := "SELECT count(id) FROM " + ParticipateBidRecordsTable + " where project_id=? and position_id=? ;"
+	rs = IC.BaseMysql.SelectBySql(query, projectId, positionId, (page-1)*pageSize, pageSize)
+	total = IC.BaseMysql.CountBySql(countQuery, projectId, positionId)
+	return rs, total
+}
+
+// GetUserMap 查询用户id的姓名
+func GetUserMap(userIds string) (rs *[]map[string]interface{}) {
+	query := fmt.Sprintf("select id,name from entniche_user where id in (%s)", userIds)
+	rs = IC.MainMysql.SelectBySql(query)
+	return rs
+}
+
+// CheckParticipateManager 验证项目id是否是该管理员企业下的参标项目
+func CheckParticipateManager(projectId string, entId int64, valid bool) (flag bool) {
+	stateStr := "" // 是否需要验证是正在参标
+	if valid {
+		stateStr = " and state=0"
+	}
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_id=?" + stateStr
+	return IC.BaseMysql.CountBySql(query, projectId, entId) > 0
+}
+
+// CheckParticipateEntUser 验证项目id是否是该企业用户参标的项目
+func CheckParticipateEntUser(projectId string, entUserId int64, valid bool) (flag bool) {
+	stateStr := "" // 是否需要验证是正在参标
+	if valid {
+		stateStr = " and state=0"
+	}
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_user_id=?" + stateStr
+	return IC.BaseMysql.CountBySql(query, projectId, entUserId) > 0
+
+}
+
+// CheckParticipatePersonal 查询项目id是否是该用户参标项目
+func CheckParticipatePersonal(projectId string, positionId int64, valid bool) (flag bool) {
+	stateStr := "" // 是否需要验证是正在参标 终止参标的用户还能查看记录,但是不能更新状态
+	if valid {
+		stateStr = " and state=0"
+	}
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and position_id=?" + stateStr
+	return IC.BaseMysql.CountBySql(query, projectId, positionId) > 0
+}
+
+// GetNameByUserIds 获取用户名字符串
+//  参数:逗号分割的用户id "11,22,333..."
+//  返回: "张三,李四,王五..."
+func GetNameByUserIds(ids string) *[]map[string]interface{} {
+	query := "select  group_concat(name) as name  from " + EntnicheUserTable + " where id in (" + ids + ") "
+	rs := IC.MainMysql.SelectBySql(query)
+	return rs
+}
+
+// ParticipateProjectPersonal 查询给定项目id中已经参标的项目id
+func ParticipateProjectPersonal(positionId int64, projectId []string) *[]map[string]interface{} {
+	// 1. 查询出已经参标的
+	var arg []string
+	var value []interface{}
+	value = append(value, positionId)
+	for i := 0; i < len(projectId); i++ {
+		arg = append(arg, "?")
+		value = append(value, projectId[i])
+	}
+	argStr := strings.Join(arg, ",")
+	query := "select project_id from " + ParticipateUserTable + " where position_id = ? and project_id in (%s)  and state=0"
+	rs := IC.BaseMysql.SelectBySql(fmt.Sprintf(query, argStr), value...)
+	return rs
+}
+
+// ParticipateProjectEnt 查询给定项目id中已经参标的项目id
+func ParticipateProjectEnt(entId int64, projectId []string) *[]map[string]interface{} {
+	// 1. 查询出已经参标的
+	var arg []string
+	var value []interface{}
+	value = append(value, entId)
+	for i := 0; i < len(projectId); i++ {
+		arg = append(arg, "?")
+		value = append(value, projectId[i])
+	}
+	argStr := strings.Join(arg, ",")
+	query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from " + EntnicheUserTable + " where ent_id=? and  project_id in (%s) and state=0  group by project_id "
+	rs := IC.BaseMysql.SelectBySql(fmt.Sprintf(query, argStr), value...)
+	return rs
+}

+ 214 - 0
jyBXCore/rpc/service/participate.go

@@ -0,0 +1,214 @@
+package service
+
+import (
+	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"fmt"
+	"github.com/zeromicro/go-zero/core/logx"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/model/mysql"
+	"jyBXCore/rpc/type/bxcore"
+	"jyBXCore/rpc/util"
+	"strings"
+)
+
+//我的参标项目|企业参标项目 列表
+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 = ""
+		}
+	}
+	if in.PageNum < 1 {
+		in.PageNum = 1
+	}
+	if in.PageSize < 1 {
+		in.PageSize = 10
+	}
+	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
+}
+
+/*
+已过投标截止日期项目
+(1)	不显示终止投标倒计时
+(2)	显示参标人信息
+(3)	无终止参标操作入口
+(4)	不能划转
+(5)	不能参标
+*/
+
+//参标动作:参标、终止参标、划转:in:参标;out:终止参标;transfer:划转
+func ParticipateDo(in *bxcore.ParticipateActionReq) error {
+	defer MC.Catch()
+	var (
+		tip = "参标"
+	)
+	switch in.ActionType {
+	case "out":
+		tip = "终止参标"
+	case "transfer":
+		tip = "划转"
+	}
+	//企业版 判断是否是管理员
+	//判断用户身份
+	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	switch in.ActionType {
+	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 {
+			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 := mysql.IsParticipatedByBidId(in); ok {
+				return fmt.Errorf("当前项目不允许多人参标")
+			}
+		}
+		//保存参标信息  更新当前企业参标项目记录
+		if err := mysql.SaveParticipateInfo(in); err != nil {
+			return err
+		}
+	case "out": //终止参标
+		if in.ProjectIds == "" {
+			return fmt.Errorf("项目信息有误")
+		}
+		in.ProjectIds = strings.Split(in.ProjectIds, ",")[0]
+		//招标信息解密
+		in.ProjectIds = encrypt.DecodeArticleId2ByCheck(in.ProjectIds)[0]
+		if in.ProjectIds == "" {
+			return fmt.Errorf("当前项目信息有误")
+		}
+		if err := mysql.CancelParticipateInfo(in, userInfo.Ent.EntRoleId); err != nil {
+			return err
+		}
+	case "transfer":
+		if in.ProjectIds == "" {
+			return fmt.Errorf("项目信息有误")
+		}
+		//个人版
+		if in.PositionType == 0 {
+			return fmt.Errorf("当前企业身份有误")
+		}
+		//非管理员
+		if userInfo.Ent.EntRoleId == 0 { //1:企业管理员;2:部门管理员
+			return fmt.Errorf("当前企业身份无权限")
+		}
+		//判断划转人
+		if in.ToEntUserId == "" {
+			return fmt.Errorf("划转对象不能为空")
+		}
+		//是否保留原跟踪人?
+		isAllow := util.IsALLow(in.EntId)
+		if in.IsRetain && !isAllow {
+			//不允许多人参标,但是前端参数又是保留原参标人 互相矛盾
+			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 := 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 nil
+}
+
+//参标设置更新及设置内容
+func GetParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) (*bxcore.ParticipateSetUpInfoRes, error) {
+	defer MC.Catch()
+	res := &bxcore.ParticipateSetUpInfoRes{Data: &bxcore.ParticipateSetUpInfo{
+		IsAllow:    "0",
+		BidType:    nil,
+		RemindRule: nil,
+	}}
+	switch in.SetAction {
+	case "U": //update 更新设置信息
+		res.Data = nil
+		if err := mysql.UpdateParticipateSetInfo(in); err != nil {
+			res.ErrCode = -1
+			res.ErrMsg = err.Error()
+		}
+	default: //默认查询对应设置信息
+		//查询对应用户设置信息
+		//未设置过 返回默认配置
+		if info, err := mysql.GetParticipateSetInfo(in); err == nil {
+			res.Data = info
+		} else {
+			res.ErrCode = -1
+			res.ErrMsg = err.Error()
+		}
+	}
+	return res, nil
+}

+ 542 - 0
jyBXCore/rpc/service/participateBid.go

@@ -0,0 +1,542 @@
+package service
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"encoding/json"
+	"fmt"
+	"github.com/gogf/gf/v2/container/gset"
+	"github.com/zeromicro/go-zero/core/logx"
+	"jyBXCore/rpc/model/mysql"
+	"jyBXCore/rpc/type/bxcore"
+	"jyBXCore/rpc/util"
+	"strings"
+)
+
+const (
+	PositionTypeEnt      = 1 // 职位类型企业
+	PositionTypePersonal = 0 // 职位类型个人
+
+	ButtonValueParticipate  = 0 // 参标按钮 显示值 0-参标
+	ButtonValueParticipated = 1 // 按钮显示值 列表页面 1-已参标
+
+	RoleEntManager    = 1 //  企业管理员角色
+	RoleDepartManager = 2 //  部门管理员角色
+
+	BidTypeDirect = 1 //  直接投标
+	BidTypeChanel = 2 //  渠道投标
+
+	RecordTypeBidStatus = 1 //  存储类型 1:投标状态更新
+
+)
+
+type ParticipateBid struct {
+	EntId        int64
+	EntUserId    int64
+	PositionType int64
+	PositionId   int64
+	EntRoleId    int64 // 角色
+}
+
+func NewParticipateBid(entId, entUserId, positionType, positionId int64) ParticipateBid {
+	return ParticipateBid{
+		EntId:        entId,
+		EntUserId:    entUserId,
+		PositionType: positionType,
+		PositionId:   positionId,
+	}
+}
+
+// PersonalExistProject 个人版要展示的参标按钮  查询出已经参标的项目信息 用于后边格式化数据
+func (p *ParticipateBid) PersonalExistProject(projectId []string) map[string]struct{} {
+	rs := mysql.ParticipateProjectPersonal(p.PositionId, projectId)
+	existProjectSet := map[string]struct{}{}
+	if rs != nil && len(*rs) > 0 { // 如果查到了  说明已经参标 这部分应该显示已参标
+		// 处理成map
+		for i := 0; i < len(*rs); i++ {
+			existId := common.ObjToString((*rs)[i]["project_id"])
+			existProjectSet[existId] = struct{}{}
+		}
+	}
+	return existProjectSet
+}
+
+// ListPersonalFormat 列表页个人版 参标按钮 格式化数据
+func (p *ParticipateBid) ListPersonalFormat(existProjectSet map[string]struct{}, infoM map[string]string) []*bxcore.ShowInfo {
+	// 处理成 要返回的返回数据
+	var formatList []*bxcore.ShowInfo
+	for k, v := range infoM {
+		buttonValue := ButtonValueParticipate // 不存在应该显示参标
+		if _, ok := existProjectSet[v]; ok {  // 存在说明应该显示已参标
+			buttonValue = ButtonValueParticipated
+		}
+		formatList = append(formatList, &bxcore.ShowInfo{
+			Id:    encrypt.EncodeArticleId2ByCheck(k),
+			Value: int64(buttonValue),
+		})
+	}
+	return formatList
+}
+
+// EntExistProject 企业版 查出来企业下已经参标的这个项目的以及参标人信息  用于后边格式化数据判断有没有自己
+func (p *ParticipateBid) EntExistProject(projectId []string) map[string]string {
+	rs := mysql.ParticipateProjectEnt(p.EntId, projectId)
+	existProjectMap := map[string]string{}
+	if rs != nil && len(*rs) > 0 { // 如果查到了  说明这个项目公司里面已经参标 处理一下信息用于后边判断是否是自己参标
+		// 处理成map
+		for i := 0; i < len(*rs); i++ {
+			existId := common.ObjToString((*rs)[i]["project_id"])
+			personIds := common.ObjToString((*rs)[i]["personIds"])
+			existProjectMap[existId] = personIds
+		}
+	}
+	return existProjectMap
+}
+
+// ListEntFormat 企业版 列表页数据格式化
+func (p *ParticipateBid) ListEntFormat(existProjectMap, infoM map[string]string, isAllow bool) []*bxcore.ShowInfo {
+	// 处理成 要返回的返回数据
+	var formatList []*bxcore.ShowInfo
+	for k, v := range infoM {
+		buttonValue := ButtonValueParticipate      // 不存在时-显示参标
+		if userIds, ok := existProjectMap[v]; ok { // 存在时 说明项目在企业下已经参标 需要进一步判断
+			// 判断已经存在的参标人中是否包含自己  包含时 显示成已参标
+			if ContainId(userIds, common.InterfaceToStr(p.EntUserId)) {
+				buttonValue = ButtonValueParticipated
+			} else if isAllow { // 不包含自己时需要 进一步判断公司设置是否允许多人参标
+				// 允许时显示成 参标
+				buttonValue = ButtonValueParticipate
+			} else { // 不允许时 跳过该条信息
+				continue
+			}
+
+		}
+		formatList = append(formatList, &bxcore.ShowInfo{
+			Id:    encrypt.EncodeArticleId2ByCheck(k),
+			Value: int64(buttonValue),
+		})
+	}
+	return formatList
+
+}
+
+// DetailEntFormat 企业版 详情页数据格式化  返回数据 参标按钮 终止参标按钮 转给同事按钮 参标人姓名
+func (p *ParticipateBid) DetailEntFormat(existProjectMap map[string]string, isValid, isAllow bool, bidEndTime int64) (formatData *bxcore.ParticipateDetailInfo) {
+	// 处理成 要返回的返回数据
+	formatData = &bxcore.ParticipateDetailInfo{}
+	if len(existProjectMap) == 0 && isValid {
+		//  无参标人   展示参标按钮   其余按钮不显示
+		formatData.ShowParticipate = true
+		return
+	}
+	formatData.BidEndTime = bidEndTime
+	persons := ""
+	projectId := ""
+	for k, v := range existProjectMap { // 这是为了取参标人id信息 列表页是多条数据 详情页这里 map里面只会有一条数据
+		projectId = k
+		persons = v
+		break
+	}
+	// 参标人信息 处理成姓名
+	nameRs := mysql.GetNameByUserIds(persons)
+	if nameRs != nil && len(*nameRs) > 0 {
+		formatData.UserName = common.ObjToString((*nameRs)[0]["name"])
+	}
+	if !isValid {
+		return
+	}
+	// 如果是管理员 显示 终止参标按钮、转给同事按钮
+	if p.EntRoleId == RoleEntManager || p.EntRoleId == RoleDepartManager {
+		formatData.ProjectId = encrypt.EncodeArticleId2ByCheck(projectId)
+		formatData.ShowStopParticipate = true
+		formatData.ShowTransfer = true
+	}
+	// 如果包含自己 显示终止参标按钮
+	if ContainId(persons, common.InterfaceToStr(p.EntUserId)) {
+		formatData.ShowStopParticipate = true
+	} else if isAllow { // 如果允许多人 显示参标按钮
+		formatData.ShowParticipate = true
+	}
+	return
+
+}
+
+// DetailPersonalFormat 详情页个人版 按钮格式化数据
+func (p *ParticipateBid) DetailPersonalFormat(existProjectSet map[string]struct{}, isValid bool, bidEndTime int64) (formatData *bxcore.ParticipateDetailInfo) {
+	// 处理成 要返回的返回数据
+	formatData = &bxcore.ParticipateDetailInfo{}
+	if !isValid {
+		return
+	}
+	// 存在在说明已经参标  显示终止参标
+	if len(existProjectSet) > 0 {
+		formatData.BidEndTime = bidEndTime
+		formatData.ShowStopParticipate = true
+	} else {
+		// 不存在则说明 未参标 参标按钮展示
+		formatData.ShowParticipate = true
+	}
+	return
+}
+
+// HandlerProjectId 返回信息的映射集合,项目id列表
+func HandlerProjectId(projectInfos []map[string]interface{}, infoIds map[string]struct{}) (map[string]string, []string) {
+	result := map[string]string{}
+	projectIdList := []string{}
+	//  记录infoid 和项目id 对应关系  用于最后处理返回的数据
+	for i := 0; i < len(projectInfos); i++ {
+		_id := common.ObjToString(projectInfos[i]["_id"])
+		projectIdList = append(projectIdList, _id)
+		list, b := projectInfos[i]["list"].([]interface{})
+		if !b {
+			continue
+		}
+		for j := 0; j < len(list); j++ {
+			infoidMap := common.ObjToMap(list[j])
+			if infoidMap == nil {
+				continue
+			}
+			infoid := common.ObjToString((*infoidMap)["infoid"])
+			if _, ok := infoIds[infoid]; ok && infoid != "" {
+				result[infoid] = _id
+				break
+			}
+		}
+	}
+	return result, projectIdList
+
+}
+
+// DecodeId  解密标讯id 返回一个信息id的列表 和 集合
+func DecodeId(ids string) (result []string, resultSet map[string]struct{}) {
+	idList := strings.Split(ids, ",")
+	resultSet = map[string]struct{}{}
+	for i := 0; i < len(idList); i++ {
+		decodeArray := encrypt.DecodeArticleId2ByCheck(idList[i])
+		if len(decodeArray) == 1 && decodeArray[0] != "" {
+			result = append(result, decodeArray[0])
+			resultSet[decodeArray[0]] = struct{}{}
+		}
+	}
+	return
+}
+
+// ContainId 用于判断给定的逗号分割的字符串中是否包含 目标的字符串
+func ContainId(ids string, objId string) bool {
+	list := strings.Split(ids, ",")
+	for i := 0; i < len(list); i++ {
+		if list[i] == objId {
+			return true
+		}
+	}
+	return false
+}
+
+// CheckBidPower 投标状态更新/查看记录 验证权限(参标人或者是该企业下的管理员)
+func (p *ParticipateBid) CheckBidPower(projectId string, valid bool) (b bool) {
+
+	switch p.PositionType {
+	case PositionTypePersonal:
+		// 查个人id
+		b = mysql.CheckParticipatePersonal(projectId, p.PositionId, valid)
+	case PositionTypeEnt:
+		// 查企业
+		if p.EntRoleId == RoleEntManager || p.EntRoleId == RoleDepartManager {
+			b = mysql.CheckParticipateManager(projectId, p.EntId, valid)
+		} else {
+			// 查参标人
+			b = mysql.CheckParticipateEntUser(projectId, p.PositionId, valid)
+		}
+	}
+	return
+}
+
+// UpdateBidStatus 更新投标状态
+func (p *ParticipateBid) UpdateBidStatus(in *bxcore.UpdateBidStatusReq, projectId string) (flag bool) {
+	if p.PositionType == PositionTypeEnt {
+		pLock := util.GetParticipateLock(fmt.Sprintf("%d_%s", p.EntId, projectId))
+		pLock.Lock()
+		defer pLock.Unlock()
+	}
+	// 如果查出来旧的 那么就需要做新旧对比
+	oldMap := p.GetLastBidStatus(projectId) // 查询出最新的招标状态信息
+	// 新的
+	if in.BidStage == nil {
+		in.BidStage = []string{}
+	}
+	newMap := map[string]interface{}{
+		"bidType":       in.BidType,
+		"bidStage":      in.BidStage,
+		"isWin":         in.IsWin,
+		"channelName":   in.ChannelName,
+		"channelPerson": in.ChannelPerson,
+		"channelPhone":  in.ChannelPhone,
+		"winner":        in.Winner,
+	}
+	// 新旧对比 处理成要保存的字段
+	recordContent, err := processRecordStr(oldMap, newMap)
+	if err != nil {
+		return false
+	}
+	// 保存
+	recordData := map[string]interface{}{
+		"ent_id":         p.EntId,
+		"ent_user_id":    p.EntUserId,
+		"position_id":    p.PositionId,
+		"project_id":     projectId,
+		"record_content": recordContent,
+		"record_type":    RecordTypeBidStatus,
+		"create_date":    date.NowFormat(date.Date_Full_Layout),
+	}
+	flag = mysql.InsertBidContent(recordData)
+	return
+
+}
+
+// GetLastBidStatus 获取投标状态信息
+func (p *ParticipateBid) GetLastBidStatus(projectId string) map[string]interface{} {
+	rs := map[string]interface{}{}
+	// 查询项目投标信息 区分企业和个人
+	var result *[]map[string]interface{}
+	switch p.PositionType {
+	case PositionTypeEnt:
+		result = mysql.GetBidContentEnt(projectId, p.EntId)
+	case PositionTypePersonal:
+		result = mysql.GetBidContentPersonal(projectId, p.PositionId)
+	}
+	if rs != nil && len(*result) > 0 {
+		content := common.ObjToMap((*result)[0]["record_content"])
+		if content != nil {
+			bidStatus := common.ObjToMap((*content)["after"])
+			if bidStatus != nil {
+				rs = *bidStatus
+			}
+		}
+	}
+	return rs
+
+}
+func (p ParticipateBid) ParticipateContentFormat(data map[string]interface{}) (rs bxcore.ParticipateContentData) {
+	if data == nil {
+		return
+	}
+	rs.BidType = common.Int64All(data["bidType"])
+	rs.ChannelPhone = common.ObjToString(data["channelPhone"])
+	rs.ChannelPerson = common.ObjToString(data["channelPerson"])
+	rs.ChannelName = common.ObjToString(data["channelName"])
+	rs.IsWin = common.Int64All(data["isWin"])
+	rs.Winner = common.ObjToString(data["winner"])
+	tmp := data["bidStage"].([]interface{})
+	rs.BidStage = common.ObjArrToStringArr(tmp)
+
+	return rs
+}
+
+// GetBidRecords 获取操作记录
+func (p *ParticipateBid) GetBidRecords(projectId string, page, pageSize int64) *bxcore.ParticipateRecordsData {
+	data := bxcore.ParticipateRecordsData{}
+	var rs *[]map[string]interface{}
+	var total int64
+	if page < 1 {
+		page = 1
+	}
+	if pageSize == 0 {
+		pageSize = 500
+	}
+	switch p.PositionType {
+	case PositionTypeEnt:
+		// 1. 查询出操作记录
+		rs, total = mysql.GetBidRecordsEnt(projectId, p.EntId, page, pageSize)
+	case PositionTypePersonal:
+		//  个人版不展示姓名
+		rs, total = mysql.GetBidRecordsPersonal(projectId, p.PositionId, page, pageSize)
+
+	}
+	if rs == nil || len(*rs) == 0 {
+		return &data
+	}
+	data.Total = total
+	data.List = p.BidRecordsFormat(*rs)
+	return &data
+}
+
+// BidRecordsFormat 获取操作记录格式化
+func (p ParticipateBid) BidRecordsFormat(data []map[string]interface{}) []*bxcore.ParticipateRecords {
+	records := []*bxcore.ParticipateRecords{}
+	switch p.PositionType {
+
+	case PositionTypeEnt:
+		// 用户id
+		// 拿到所有的用户id
+		userIdArr := []string{}
+		userIdMap := map[int64]string{}
+		for i := 0; i < len(data); i++ {
+			userId := common.Int64All(data[i]["ent_user_id"])
+			if _, ok := userIdMap[userId]; !ok {
+				userIdMap[userId] = ""
+				userIdArr = append(userIdArr, fmt.Sprint(userId))
+			}
+		}
+
+		// 根据id查询出姓名{id:name}
+		userIdMap = getUserIdName(userIdArr)
+		// 遍历数据  换成姓名
+		for i := 0; i < len(data); i++ {
+			id := common.Int64All(data[i]["ent_user_id"])
+			person := ""
+			if name, ok := userIdMap[id]; ok {
+				person = name
+			}
+			tmp := bxcore.ParticipateRecords{
+				RecordsData:  common.ObjToString(data[i]["record_content"]),
+				UpdateDate:   common.ObjToString(data[i]["create_date"]),
+				UpdatePerson: person,
+			}
+			records = append(records, &tmp)
+
+		}
+	case PositionTypePersonal:
+		// 遍历数据  换成姓名
+		for i := 0; i < len(data); i++ {
+			tmp := bxcore.ParticipateRecords{
+				RecordsData: common.ObjToString(data[i]["record_content"]),
+				UpdateDate:  common.ObjToString(data[i]["create_date"]),
+			}
+			records = append(records, &tmp)
+
+		}
+	}
+	return records
+}
+
+// 获取id和姓名的对应关系
+func getUserIdName(userIdArr []string) map[int64]string {
+	rs := map[int64]string{}
+	if len(userIdArr) > 0 {
+		userIdStr := strings.Join(userIdArr, ",")
+		userRs := mysql.GetUserMap(userIdStr)
+		if userRs == nil || len(*userRs) == 0 {
+			return rs
+		}
+		for i := 0; i < len(*userRs); i++ {
+			user := (*userRs)[i]
+			id := common.Int64All(user["id"])
+			name := common.ObjToString(user["name"])
+			rs[id] = name
+		}
+	}
+	return rs
+}
+
+// 处理操作动作
+var (
+	ParticipateBidContentKey = map[string]string{
+		"bidType":       "投标类型",
+		"bidStage":      "投标项目阶段",
+		"isWin":         "是否中标",
+		"channelName":   "渠道名称",
+		"channelPerson": "联系人",
+		"channelPhone":  "联系电话",
+		"winner":        "中标单位",
+	}
+	BidTypeMap = map[int]interface{}{
+		BidTypeDirect: "直接投标",
+		BidTypeChanel: "渠道投标",
+	}
+	WinMap = map[int]interface{}{
+		1: "是",
+		2: "否",
+		0: "未选择",
+	}
+)
+
+// 处理操作记录
+func processRecordStr(oldMap, newMap map[string]interface{}) (recordContent string, err error) {
+	actonStr := "%s%s%s"
+	changeField := []string{}
+	result := []string{}
+	for k, fieldName := range ParticipateBidContentKey {
+		changeStr := ""
+		switch k {
+		case "bidType":
+			oldv := common.IntAll(oldMap[k])
+			newv := common.IntAll(newMap[k])
+			if oldv == newv { // 没有改变
+				continue
+			}
+			newBidType := BidTypeMap[newv]
+			if newBidType == nil {
+				newBidType = "未选择"
+			}
+			if oldv == 0 && newv != 0 { // 说明是新增
+				changeStr = fmt.Sprintf(actonStr, fieldName, ": (新增)", newBidType)
+			} else { // 调整
+				changeStr = fmt.Sprintf(actonStr, fieldName, "(调整):", newBidType)
+
+			}
+		case "isWin":
+			oldV := common.IntAll(oldMap[k])
+			newV := common.IntAll(newMap[k])
+			if oldV == newV { // 没有改变
+				continue
+			}
+			fieldName := fieldName
+			if common.IntAll(newMap["bidType"]) == BidTypeChanel {
+				fieldName = fmt.Sprintf("%s%s", "渠道", fieldName)
+			}
+			changeStr = fmt.Sprintf(actonStr, fieldName, "(调整) 为", WinMap[newV])
+		case "bidStage":
+			bidAction := "%s%s"
+			bidChangeArr := []string{}
+			oldSet := gset.NewFrom(oldMap[k])
+			newSet := gset.NewFrom(newMap[k])
+			// 判断相等
+			if oldSet.Equal(newSet) {
+				continue
+			}
+			// 差集计算
+			// 取消勾选的
+			cancleSet := oldSet.Diff(newSet)
+			cancleSet.Iterator(func(v interface{}) bool {
+				bidChangeArr = append(bidChangeArr, fmt.Sprintf(bidAction, "(取消勾选)", v))
+				return true
+			})
+			// 新增的
+			addSet := newSet.Diff(oldSet)
+			addSet.Iterator(func(v interface{}) bool {
+				bidChangeArr = append(bidChangeArr, fmt.Sprintf(bidAction, "(新增)", v))
+				fmt.Println(v)
+				return true
+			})
+			tmpStr := strings.Join(bidChangeArr, " ")
+			changeStr = fmt.Sprintf(actonStr, fieldName, " :", tmpStr)
+		default:
+			oldV := common.ObjToString(oldMap[k])
+			newV := common.ObjToString(newMap[k])
+			if oldV == newV { // 没有变化
+				continue
+			}
+			changeStr = fmt.Sprintf(actonStr, fieldName, "(调整)为", fmt.Sprintf("\"%s\"", newV))
+		}
+		result = append(result, changeStr)
+		changeField = append(changeField, k)
+	}
+	recordMap := map[string]interface{}{
+		"content":     strings.Join(result, ";"), // 变更内容 文字描述
+		"before":      oldMap,                    // 变更前
+		"after":       newMap,                    // 变更后
+		"changeField": changeField,               // 涉及变更的字段
+	}
+
+	tmp, err := json.Marshal(recordMap)
+	if err != nil {
+		logx.Error("序列化操作记录失败:", err)
+		return "", err
+	}
+	if len(result) == 0 {
+		logx.Error("没有更新的内容:", recordContent)
+		err = fmt.Errorf("没有变更的内容,不用更新")
+	}
+	return string(tmp), err
+}

+ 1 - 1
jyBXCore/rpc/service/search.go

@@ -3,9 +3,9 @@ package service
 import (
 	MC "app.yhyue.com/moapp/jybase/common"
 	"github.com/zeromicro/go-zero/core/logx"
-	"jyBXCore/rpc/bxcore"
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/model/es"
+	"jyBXCore/rpc/type/bxcore"
 	"jyBXCore/rpc/util"
 	"strings"
 	"time"

File diff suppressed because it is too large
+ 2639 - 2
jyBXCore/rpc/type/bxcore/bxcore.pb.go


+ 343 - 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.20.0--rc2
+// - protoc             v3.19.4
 // source: bxcore.proto
 
 package bxcore
@@ -26,6 +26,24 @@ type BxCoreClient interface {
 	GetSearchList(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchResp, error)
 	//标讯搜索限制内容
 	SearchLimit(ctx context.Context, in *SearchLimitReq, opts ...grpc.CallOption) (*SearchLimitResp, error)
+	// 列表数据参标信息接口
+	ParticipateShow(ctx context.Context, in *ParticipateShowReq, opts ...grpc.CallOption) (*ParticipateShowRes, error)
+	// 详情页参标信息接口
+	ParticipateInfo(ctx context.Context, in *ParticipateInfoReq, opts ...grpc.CallOption) (*ParticipateInfoRes, error)
+	//  投标状态更新
+	UpdateBidStatus(ctx context.Context, in *UpdateBidStatusReq, opts ...grpc.CallOption) (*UpdateBidStatusRes, error)
+	// 获取投标状态信息
+	ParticipateContent(ctx context.Context, in *ParticipateContentReq, opts ...grpc.CallOption) (*ParticipateContentRes, error)
+	// 参标操作记录
+	ParticipateRecords(ctx context.Context, in *ParticipateRecordsReq, opts ...grpc.CallOption) (*ParticipateRecordsRes, error)
+	// 当前部门/企业下参标人员信息
+	ParticipatePersons(ctx context.Context, in *ParticipatePersonsReq, opts ...grpc.CallOption) (*ParticipatePersonsRes, error)
+	// 参标设置信息
+	ParticipateSetUpInfo(ctx context.Context, in *ParticipateSetUpInfoReq, opts ...grpc.CallOption) (*ParticipateSetUpInfoRes, error)
+	// 项目参标 终止参标 划转等动作
+	ParticipateAction(ctx context.Context, in *ParticipateActionReq, opts ...grpc.CallOption) (*ParticipateActionRes, error)
+	// 我的参标项目列表|企业参标项目列表
+	ParticipateList(ctx context.Context, in *ParticipateListReq, opts ...grpc.CallOption) (*ParticipateListRes, error)
 }
 
 type bxCoreClient struct {
@@ -54,6 +72,87 @@ func (c *bxCoreClient) SearchLimit(ctx context.Context, in *SearchLimitReq, opts
 	return out, nil
 }
 
+func (c *bxCoreClient) ParticipateShow(ctx context.Context, in *ParticipateShowReq, opts ...grpc.CallOption) (*ParticipateShowRes, error) {
+	out := new(ParticipateShowRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateShow", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateInfo(ctx context.Context, in *ParticipateInfoReq, opts ...grpc.CallOption) (*ParticipateInfoRes, error) {
+	out := new(ParticipateInfoRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) UpdateBidStatus(ctx context.Context, in *UpdateBidStatusReq, opts ...grpc.CallOption) (*UpdateBidStatusRes, error) {
+	out := new(UpdateBidStatusRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/UpdateBidStatus", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateContent(ctx context.Context, in *ParticipateContentReq, opts ...grpc.CallOption) (*ParticipateContentRes, error) {
+	out := new(ParticipateContentRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateContent", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateRecords(ctx context.Context, in *ParticipateRecordsReq, opts ...grpc.CallOption) (*ParticipateRecordsRes, error) {
+	out := new(ParticipateRecordsRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateRecords", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipatePersons(ctx context.Context, in *ParticipatePersonsReq, opts ...grpc.CallOption) (*ParticipatePersonsRes, error) {
+	out := new(ParticipatePersonsRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipatePersons", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateSetUpInfo(ctx context.Context, in *ParticipateSetUpInfoReq, opts ...grpc.CallOption) (*ParticipateSetUpInfoRes, error) {
+	out := new(ParticipateSetUpInfoRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateSetUpInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateAction(ctx context.Context, in *ParticipateActionReq, opts ...grpc.CallOption) (*ParticipateActionRes, error) {
+	out := new(ParticipateActionRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateAction", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *bxCoreClient) ParticipateList(ctx context.Context, in *ParticipateListReq, opts ...grpc.CallOption) (*ParticipateListRes, error) {
+	out := new(ParticipateListRes)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/ParticipateList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // BxCoreServer is the server API for BxCore service.
 // All implementations must embed UnimplementedBxCoreServer
 // for forward compatibility
@@ -62,6 +161,24 @@ type BxCoreServer interface {
 	GetSearchList(context.Context, *SearchReq) (*SearchResp, error)
 	//标讯搜索限制内容
 	SearchLimit(context.Context, *SearchLimitReq) (*SearchLimitResp, error)
+	// 列表数据参标信息接口
+	ParticipateShow(context.Context, *ParticipateShowReq) (*ParticipateShowRes, error)
+	// 详情页参标信息接口
+	ParticipateInfo(context.Context, *ParticipateInfoReq) (*ParticipateInfoRes, error)
+	//  投标状态更新
+	UpdateBidStatus(context.Context, *UpdateBidStatusReq) (*UpdateBidStatusRes, error)
+	// 获取投标状态信息
+	ParticipateContent(context.Context, *ParticipateContentReq) (*ParticipateContentRes, error)
+	// 参标操作记录
+	ParticipateRecords(context.Context, *ParticipateRecordsReq) (*ParticipateRecordsRes, error)
+	// 当前部门/企业下参标人员信息
+	ParticipatePersons(context.Context, *ParticipatePersonsReq) (*ParticipatePersonsRes, error)
+	// 参标设置信息
+	ParticipateSetUpInfo(context.Context, *ParticipateSetUpInfoReq) (*ParticipateSetUpInfoRes, error)
+	// 项目参标 终止参标 划转等动作
+	ParticipateAction(context.Context, *ParticipateActionReq) (*ParticipateActionRes, error)
+	// 我的参标项目列表|企业参标项目列表
+	ParticipateList(context.Context, *ParticipateListReq) (*ParticipateListRes, error)
 	mustEmbedUnimplementedBxCoreServer()
 }
 
@@ -75,6 +192,33 @@ func (UnimplementedBxCoreServer) GetSearchList(context.Context, *SearchReq) (*Se
 func (UnimplementedBxCoreServer) SearchLimit(context.Context, *SearchLimitReq) (*SearchLimitResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SearchLimit not implemented")
 }
+func (UnimplementedBxCoreServer) ParticipateShow(context.Context, *ParticipateShowReq) (*ParticipateShowRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateShow not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateInfo(context.Context, *ParticipateInfoReq) (*ParticipateInfoRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateInfo not implemented")
+}
+func (UnimplementedBxCoreServer) UpdateBidStatus(context.Context, *UpdateBidStatusReq) (*UpdateBidStatusRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UpdateBidStatus not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateContent(context.Context, *ParticipateContentReq) (*ParticipateContentRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateContent not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateRecords(context.Context, *ParticipateRecordsReq) (*ParticipateRecordsRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateRecords not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipatePersons(context.Context, *ParticipatePersonsReq) (*ParticipatePersonsRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipatePersons not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateSetUpInfo(context.Context, *ParticipateSetUpInfoReq) (*ParticipateSetUpInfoRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateSetUpInfo not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateAction(context.Context, *ParticipateActionReq) (*ParticipateActionRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateAction not implemented")
+}
+func (UnimplementedBxCoreServer) ParticipateList(context.Context, *ParticipateListReq) (*ParticipateListRes, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ParticipateList not implemented")
+}
 func (UnimplementedBxCoreServer) mustEmbedUnimplementedBxCoreServer() {}
 
 // UnsafeBxCoreServer may be embedded to opt out of forward compatibility for this service.
@@ -124,6 +268,168 @@ func _BxCore_SearchLimit_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 }
 
+func _BxCore_ParticipateShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateShowReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateShow(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateShow",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateShow(ctx, req.(*ParticipateShowReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateInfoReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateInfo(ctx, req.(*ParticipateInfoReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_UpdateBidStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(UpdateBidStatusReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).UpdateBidStatus(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/UpdateBidStatus",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).UpdateBidStatus(ctx, req.(*UpdateBidStatusReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateContentReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateContent(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateContent",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateContent(ctx, req.(*ParticipateContentReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateRecordsReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateRecords(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateRecords",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateRecords(ctx, req.(*ParticipateRecordsReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipatePersons_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipatePersonsReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipatePersons(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipatePersons",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipatePersons(ctx, req.(*ParticipatePersonsReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateSetUpInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateSetUpInfoReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateSetUpInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateSetUpInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateSetUpInfo(ctx, req.(*ParticipateSetUpInfoReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateActionReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateAction(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateAction",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateAction(ctx, req.(*ParticipateActionReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _BxCore_ParticipateList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ParticipateListReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).ParticipateList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/ParticipateList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).ParticipateList(ctx, req.(*ParticipateListReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // BxCore_ServiceDesc is the grpc.ServiceDesc for BxCore service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -139,6 +445,42 @@ var BxCore_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "SearchLimit",
 			Handler:    _BxCore_SearchLimit_Handler,
 		},
+		{
+			MethodName: "ParticipateShow",
+			Handler:    _BxCore_ParticipateShow_Handler,
+		},
+		{
+			MethodName: "ParticipateInfo",
+			Handler:    _BxCore_ParticipateInfo_Handler,
+		},
+		{
+			MethodName: "UpdateBidStatus",
+			Handler:    _BxCore_UpdateBidStatus_Handler,
+		},
+		{
+			MethodName: "ParticipateContent",
+			Handler:    _BxCore_ParticipateContent_Handler,
+		},
+		{
+			MethodName: "ParticipateRecords",
+			Handler:    _BxCore_ParticipateRecords_Handler,
+		},
+		{
+			MethodName: "ParticipatePersons",
+			Handler:    _BxCore_ParticipatePersons_Handler,
+		},
+		{
+			MethodName: "ParticipateSetUpInfo",
+			Handler:    _BxCore_ParticipateSetUpInfo_Handler,
+		},
+		{
+			MethodName: "ParticipateAction",
+			Handler:    _BxCore_ParticipateAction_Handler,
+		},
+		{
+			MethodName: "ParticipateList",
+			Handler:    _BxCore_ParticipateList_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "bxcore.proto",

+ 37 - 0
jyBXCore/rpc/util/participate.go

@@ -0,0 +1,37 @@
+package util
+
+import (
+	"jyBXCore/rpc/model/mysql"
+	"sync"
+)
+
+var (
+	PLock *ParticipateLock
+)
+
+//是否允许多人参标
+func IsALLow(entId int64) bool {
+	return mysql.GetParticipateIsAllow(map[string]interface{}{
+		"i_entid": entId,
+	})
+}
+
+type ParticipateLock struct {
+	sync.Mutex
+	UserLock map[string]*sync.Mutex
+}
+
+func NewParticipateLock() *ParticipateLock {
+	return &ParticipateLock{
+		UserLock: make(map[string]*sync.Mutex),
+	}
+}
+
+func GetParticipateLock(str string) *sync.Mutex {
+	PLock.Lock()
+	if PLock.UserLock[str] == nil {
+		PLock.UserLock[str] = &sync.Mutex{}
+	}
+	PLock.Unlock()
+	return PLock.UserLock[str]
+}

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

@@ -359,3 +359,43 @@ func GetPublishTime(y, m int, publishTime string) string {
 	}
 	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
+}

+ 5 - 0
jyBXCore/rpc/util/util.go

@@ -0,0 +1,5 @@
+package util
+
+func init() {
+	PLock = NewParticipateLock()
+}

+ 231 - 0
jyBXCore/test.http

@@ -0,0 +1,231 @@
+// p300 投标项目管理接口测试
+### rpc接口测试
+###  列表页 个人
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateShow
+
+{
+  "ids":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D,ABCY2FddT1YLy8vNGN6c2I%2FIzNfCSd3cXhyKA4ZLTogUX5wHDNUCkw%3D",
+  "entId": 0,
+  "entUserId": 0,
+  "positionId": 1204781659,
+  "positionType": 0,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "641aa7bcac1c8e639bc15cdb",
+  "newUserId": 486050,
+  "accountId": 360058
+}
+
+###  列表页 企业
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateShow
+
+{
+  "ids":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D,ABCY2FddT1YLy8vNGN6c2I%2FIzNfCSd3cXhyKA4ZLTogUX5wHDNUCkw%3D",
+  "entId": 25922,
+  "entUserId": 6116,
+  "positionId": 1205051263,
+  "positionType": 1,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "1205051263",
+  "newUserId": 486050,
+  "accountId": 360157
+}
+
+
+### 详情页参标信息 -正常
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateInfo
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "entId": 25922,
+  "entUserId": 6116,
+  "positionId": 1205051263,
+  "positionType": 1,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "1205051263",
+  "newUserId": 486050,
+  "accountId": 360157
+}
+### 详情页参标信息-无权限
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateInfo
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "entId": 25922,
+  "entUserId": 6117,
+  "positionId": 1205051265,
+  "positionType": 1,
+  "mgoUserId": "644a493516f19b49b8451716",
+  "appId": 10000,
+  "userId": "1205051265",
+  "newUserId": 725515,
+  "accountId": 360158
+}
+
+
+
+
+### 更新投标状态
+GRPC 127.0.0.1:8003/bxcore.BxCore/UpdateBidStatus
+
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "entId": 25922,
+  "entUserId": 6116,
+  "positionId": 1205051263,
+  "positionType": 1,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "1205051263",
+  "newUserId": 486050,
+  "accountId": 360157,
+  "bidType": 1,
+  "bidStage": [],
+  "isWin": 1,
+  "channelName": "阿勒泰",
+  "channelPerson": "若羌",
+  "channelPhone": "",
+  "winner": ""
+
+}
+
+
+### 获取最新的投标状态内容
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateContent
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "entId": 25922,
+  "entUserId": 6116,
+  "positionId": 1205051263,
+  "positionType": 1,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "1205051263",
+  "newUserId": 486050,
+  "accountId": 360157
+
+
+}
+
+
+### 获取操作记录  页面不传默认 500
+GRPC 127.0.0.1:8003/bxcore.BxCore/ParticipateRecords
+
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "entId": 25922,
+  "entUserId": 6116,
+  "positionId": 1205051263,
+  "positionType": 1,
+  "mgoUserId": "641aa7bcac1c8e639bc15cdb",
+  "appId": 10000,
+  "userId": "1205051263",
+  "newUserId": 486050,
+  "accountId": 360157,
+  "page": 1,
+  "pageSize": 10
+
+
+}
+
+### api接口测试
+### 列表页参标信息接口
+POST http://127.0.0.1:8004/jybx/core/participate/show
+Content-Type: application/json
+entId: 25922
+entUserId: 6116
+positionId: 1205051263
+positionType: 1
+mgoUserId: 641aa7bcac1c8e639bc15cdb
+appId: 10000
+userId: 1205051263
+newUserId: 486050
+accountId: 360157
+
+{
+  "ids":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D,ABCY2EAdi4vKygvM3xhcHUJJzACHj1mZnB%2FPDgZKSEwc3xzeVJUCg4%3D"
+}
+
+###  详情页参标信息接口
+POST http://127.0.0.1:8004/jybx/core/participate/info
+Content-Type: application/json
+entId: 25922
+entUserId: 6116
+positionId: 1205051263
+positionType: 1
+mgoUserId: 641aa7bcac1c8e639bc15cdb
+appId: 10000
+userId: 1205051263
+newUserId: 486050
+accountId: 360157
+
+{
+"sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D"
+}
+
+
+
+###  更新参标状态
+POST http://127.0.0.1:8004/jybx/core/participate/updateBidStatus
+Content-Type: application/json
+entId: 25922
+entUserId: 6116
+positionId: 1205051263
+positionType: 1
+mgoUserId: 641aa7bcac1c8e639bc15cdb
+appId: 10000
+userId: 1205051263
+newUserId: 486050
+accountId: 360157
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "bidType": 2,
+  "bidStage": [],
+  "isWin": 2,
+  "channelName": "霍尔果斯",
+  "channelPerson": "若羌",
+  "channelPhone": "",
+  "winner": ""
+}
+
+###  参标操作记录 页码不传时 默认500
+POST http://127.0.0.1:8004/jybx/core/participate/records
+Content-Type: application/json
+entId: 25922
+entUserId: 6116
+positionId: 1205051263
+positionType: 1
+mgoUserId: 641aa7bcac1c8e639bc15cdb
+appId: 10000
+userId: 1205051263
+newUserId: 486050
+accountId: 360157
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D",
+  "page": 1,
+  "pageSize": 5
+}
+
+###  获取最新的投标状态信息
+POST http://127.0.0.1:8004/jybx/core/participate/content
+Content-Type: application/json
+entId: 25922
+entUserId: 6116
+positionId: 1205051263
+positionType: 1
+mgoUserId: 641aa7bcac1c8e639bc15cdb
+appId: 10000
+userId: 1205051263
+newUserId: 486050
+accountId: 360157
+
+{
+  "sid":"ABCY2FddTxYLyo4And1c08ODCcoGjF0XGB%2BKDggPSFFYFJwGC9UCa0%3D"
+}

+ 3 - 0
jyBXSubscribe/api/bxsubscribe.api

@@ -34,6 +34,9 @@ type (
 		IsEnt        bool   `json:"isEnt,optional"`
 		SelectIds    string `json:"selectIds,optional"`
 		PositionType int64  `header:"positionType,optional"`
+		MgoUserId    string `header:"mgoUserId,optional"`  //原userId
+		AccountId    string `header:"accountId,optional"`  //账户id
+		PositionId   string `header:"positionId,optional"` //职位id
 	}
 	//
 	someInfoReq {

+ 3 - 0
jyBXSubscribe/api/internal/logic/subscribeListLogic.go

@@ -50,6 +50,9 @@ func (l *SubscribeListLogic) SubscribeList(req *types.SubscribeReq) (resp *types
 		NewUserId:    req.NewUserId,
 		IsEnt:        req.IsEnt,
 		PositionType: req.PositionType,
+		AccountId:    req.AccountId,
+		PositionId:   req.PositionId,
+		MgoUserId:    req.MgoUserId,
 	})
 	if err != nil {
 		return &types.CommonResp{

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

@@ -26,6 +26,9 @@ type SubscribeReq struct {
 	IsEnt        bool   `json:"isEnt,optional"`
 	SelectIds    string `json:"selectIds,optional"`
 	PositionType int64  `header:"positionType,optional"`
+	MgoUserId    string `header:"mgoUserId,optional"`  //原userId
+	AccountId    string `header:"accountId,optional"`  //账户id
+	PositionId   string `header:"positionId,optional"` //职位id
 }
 
 type SomeInfoReq struct {

+ 40 - 0
jyBXSubscribe/entity/rpc.go

@@ -0,0 +1,40 @@
+package entity
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
+	"context"
+)
+
+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
+}

+ 3 - 0
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -28,6 +28,9 @@ message SubscribeInfosReq {
   bool IsEnt = 22;
   string SelectIds = 23;
   int64 positionType = 24;
+  string accountId = 25; //账户id
+  string positionId = 26;  //职位id
+  string mgoUserId = 27;  //原userId
 }
 
 message SubscribeInfosResp {

+ 1 - 1
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT.
+// Code generated by goctl. DO NOT EDIT!
 // Source: bxsubscribe.proto
 
 package bxsubscribe

+ 23 - 3
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -2,11 +2,12 @@ package logic
 
 import (
 	"context"
+	"jyBXSubscribe/entity"
 	IC "jyBXSubscribe/rpc/init"
 	"jyBXSubscribe/rpc/internal/svc"
 	"jyBXSubscribe/rpc/model"
 	"jyBXSubscribe/rpc/type/bxsubscribe"
-	"jyBXSubscribe/rpc/util"
+	"strconv"
 	"strings"
 	"time"
 
@@ -41,10 +42,29 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	if in.PageNum == 1 {
 		go model.UpdateUserPushUnread(in.UserId, in.UserType)
 	}
+	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
+	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
+	entId, _ := strconv.ParseInt(in.EntId, 10, 64)
+	entUserId, _ := strconv.ParseInt(in.EntUserId, 10, 64)
+	userInfoRpc := entity.UserInfoRpc{
+		AppId:        in.AppId,
+		UserId:       in.UserId,
+		BaseUserId:   in.NewUserId,
+		EntId:        entId,
+		EntUserId:    entUserId,
+		AccountId:    accountId,
+		PositionType: in.PositionType,
+		PositionId:   positionId,
+		MgoUserId:    in.MgoUserId,
+	}
+	//判断用户身份
+	userInfo := userInfoRpc.GetUserPowers()
+	//是否是付费用户
+	isPay := !userInfo.Free.IsFree
 	isPayUser := false
-	userInfo := util.GetVipState(IC.MainMysql, IC.Mgo, in.UserId)
+
 	//付费用户
-	if in.UserType != "fType" && userInfo.IsPayedUser() {
+	if in.UserType != "fType" && isPay {
 		isPayUser = true
 	}
 	//分发员工

+ 1 - 1
jyBXSubscribe/rpc/internal/server/bxsubscribeserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT.
+// Code generated by goctl. DO NOT EDIT!
 // Source: bxsubscribe.proto
 
 package server

File diff suppressed because it is too large
+ 571 - 996
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go


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

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

Some files were not shown because too many files changed in this diff