Browse Source

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

wangshan 2 years ago
parent
commit
95bf18403c

+ 8 - 0
jyBXBuyer/api/bxbuyer.api

@@ -54,10 +54,18 @@ type (
 		Area         string `json:"area,optional"`         //地区
 		Area         string `json:"area,optional"`         //地区
 		City         string `json:"city,optional"`         //城市
 		City         string `json:"city,optional"`         //城市
 	}
 	}
+	// 采购单位补充信息请求参数
+	BuyerSupplyInfoReq {
+		baseParam
+		Buyer []string `json:"buyer,optional"` //采购单位
+
+	}
 )
 )
 service bxbuyer-api {
 service bxbuyer-api {
 	@handler buyerSearchList
 	@handler buyerSearchList
 	post /jybx/buyer/:userType/buyerList(buyerListReq) returns (commonResp)
 	post /jybx/buyer/:userType/buyerList(buyerListReq) returns (commonResp)
 	@handler relatesInformation
 	@handler relatesInformation
 	post /jybx/buyer/relates/information(relatesInformationReq) returns (commonResp)
 	post /jybx/buyer/relates/information(relatesInformationReq) returns (commonResp)
+	@handler buyerSupplyInfo
+	post /jybx/buyer/supply/info(BuyerSupplyInfoReq) returns (commonResp)
 }
 }

+ 2 - 2
jyBXBuyer/api/etc/bxbuyer-api.yaml

@@ -1,7 +1,7 @@
 Name: bxbuyer-api
 Name: bxbuyer-api
 Host: 0.0.0.0
 Host: 0.0.0.0
 Port: 8007
 Port: 8007
-Timeout: 8000
+Timeout: 30000
 Webrpcport: 8017
 Webrpcport: 8017
 Gateway:
 Gateway:
   ServerCode: jybxbuyer
   ServerCode: jybxbuyer
@@ -12,7 +12,7 @@ Buyer:
     Hosts:
     Hosts:
       - 127.0.0.1:2379
       - 127.0.0.1:2379
     Key: bxbuyer.rpc
     Key: bxbuyer.rpc
-  Timeout: 8000
+  Timeout: 30000
 AppId: 10000
 AppId: 10000
 MgoLogsName: jybxbuyer_logs
 MgoLogsName: jybxbuyer_logs
 MgoLogsCount: 500
 MgoLogsCount: 500

+ 28 - 0
jyBXBuyer/api/internal/handler/buyerSupplyInfoHandler.go

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

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

@@ -22,6 +22,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/buyer/relates/information",
 				Path:    "/jybx/buyer/relates/information",
 				Handler: relatesInformationHandler(serverCtx),
 				Handler: relatesInformationHandler(serverCtx),
 			},
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/buyer/supply/info",
+				Handler: buyerSupplyInfoHandler(serverCtx),
+			},
 		},
 		},
 	)
 	)
 }
 }

+ 46 - 0
jyBXBuyer/api/internal/logic/buyerSupplyInfoLogic.go

@@ -0,0 +1,46 @@
+package logic
+
+import (
+	"context"
+	"jyBXBuyer/rpc/type/bxbuyer"
+
+	"jyBXBuyer/api/internal/svc"
+	"jyBXBuyer/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type BuyerSupplyInfoLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewBuyerSupplyInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyerSupplyInfoLogic {
+	return &BuyerSupplyInfoLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *BuyerSupplyInfoLogic) BuyerSupplyInfo(req *types.BuyerSupplyInfoReq) (resp *types.CommonResp, err error) {
+	res, err0 := l.svcCtx.Buyer.BuyerSupplyInfo(l.ctx, &bxbuyer.BuyerSupplyInfoReq{
+		Buyers:       req.Buyer,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		Phone:        req.Phone,
+	})
+	if err0 != nil {
+		return &types.CommonResp{
+			Err_code: -1,
+			Err_msg:  "错误",
+			Data:     nil,
+		}, nil
+	}
+	return &types.CommonResp{
+		Err_code: res.ErrCode,
+		Err_msg:  res.ErrMsg,
+		Data:     res.Data,
+	}, nil
+}

+ 5 - 0
jyBXBuyer/api/internal/types/types.go

@@ -47,3 +47,8 @@ type RelatesInformationReq struct {
 	Area         string `json:"area,optional"`         //地区
 	Area         string `json:"area,optional"`         //地区
 	City         string `json:"city,optional"`         //城市
 	City         string `json:"city,optional"`         //城市
 }
 }
+
+type BuyerSupplyInfoReq struct {
+	BaseParam
+	Buyer []string `json:"buyer,optional"` //采购单位
+}

+ 26 - 0
jyBXBuyer/rpc/bxbuyer.proto

@@ -73,10 +73,36 @@ message infoList {
   string id = 2;//信息类型id
   string id = 2;//信息类型id
   string publishTime = 3;
   string publishTime = 3;
 }
 }
+// 采购单位搜索获取补充信息
+message BuyerSupplyInfoReq{
+  string appId = 1;//剑鱼默认10000
+  int64  positionId = 2; // 职位id
+  int64  positionType =3;// 职位类型 0个人 1企业
+  string phone = 4 ;// 手机号
+  repeated string buyers = 5;// 采购单位名称
+}
+message BuyerSupplyResp {
+  int64 err_code = 1;
+  string err_msg = 2;
+  repeated  SupplyData data = 3;
+}
+
+message SupplyData {
+  int64 biddingCount = 1;// 招标动态数量
+  int64 contactCount = 2;// 历史联系人数量
+  int64 projectCount = 3;// 采购项目数量
+  float bidAmountCount = 4;// 采购规模
+  string buyer = 5;//采购单位名词
+}
+
+
+
 
 
 service Bxbuyer {
 service Bxbuyer {
   //采购单位搜索
   //采购单位搜索
   rpc BuyerList(BuyerListReq) returns(BuyerListResp);
   rpc BuyerList(BuyerListReq) returns(BuyerListResp);
+  // 采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+  rpc BuyerSupplyInfo(BuyerSupplyInfoReq) returns(BuyerSupplyResp);
   //采购单位画像 关联信息
   //采购单位画像 关联信息
   rpc RelatesInfo(relatesInformationReq) returns(relatesInformationResp);
   rpc RelatesInfo(relatesInformationReq) returns(relatesInformationResp);
 }
 }

+ 11 - 0
jyBXBuyer/rpc/bxbuyer/bxbuyer.go

@@ -17,14 +17,19 @@ type (
 	BuyerList              = bxbuyer.BuyerList
 	BuyerList              = bxbuyer.BuyerList
 	BuyerListReq           = bxbuyer.BuyerListReq
 	BuyerListReq           = bxbuyer.BuyerListReq
 	BuyerListResp          = bxbuyer.BuyerListResp
 	BuyerListResp          = bxbuyer.BuyerListResp
+	BuyerSupplyInfoReq     = bxbuyer.BuyerSupplyInfoReq
+	BuyerSupplyResp        = bxbuyer.BuyerSupplyResp
 	InfoList               = bxbuyer.InfoList
 	InfoList               = bxbuyer.InfoList
 	RelatesInformation     = bxbuyer.RelatesInformation
 	RelatesInformation     = bxbuyer.RelatesInformation
 	RelatesInformationReq  = bxbuyer.RelatesInformationReq
 	RelatesInformationReq  = bxbuyer.RelatesInformationReq
 	RelatesInformationResp = bxbuyer.RelatesInformationResp
 	RelatesInformationResp = bxbuyer.RelatesInformationResp
+	SupplyData             = bxbuyer.SupplyData
 
 
 	Bxbuyer interface {
 	Bxbuyer interface {
 		// 采购单位搜索
 		// 采购单位搜索
 		BuyerList(ctx context.Context, in *BuyerListReq, opts ...grpc.CallOption) (*BuyerListResp, error)
 		BuyerList(ctx context.Context, in *BuyerListReq, opts ...grpc.CallOption) (*BuyerListResp, error)
+		//  采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+		BuyerSupplyInfo(ctx context.Context, in *BuyerSupplyInfoReq, opts ...grpc.CallOption) (*BuyerSupplyResp, error)
 		// 采购单位画像 关联信息
 		// 采购单位画像 关联信息
 		RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error)
 		RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error)
 	}
 	}
@@ -46,6 +51,12 @@ func (m *defaultBxbuyer) BuyerList(ctx context.Context, in *BuyerListReq, opts .
 	return client.BuyerList(ctx, in, opts...)
 	return client.BuyerList(ctx, in, opts...)
 }
 }
 
 
+//  采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+func (m *defaultBxbuyer) BuyerSupplyInfo(ctx context.Context, in *BuyerSupplyInfoReq, opts ...grpc.CallOption) (*BuyerSupplyResp, error) {
+	client := bxbuyer.NewBxbuyerClient(m.cli.Conn())
+	return client.BuyerSupplyInfo(ctx, in, opts...)
+}
+
 // 采购单位画像 关联信息
 // 采购单位画像 关联信息
 func (m *defaultBxbuyer) RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error) {
 func (m *defaultBxbuyer) RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error) {
 	client := bxbuyer.NewBxbuyerClient(m.cli.Conn())
 	client := bxbuyer.NewBxbuyerClient(m.cli.Conn())

+ 1 - 1
jyBXBuyer/rpc/etc/bxbuyer.yaml

@@ -4,7 +4,7 @@ Etcd:
   Hosts:
   Hosts:
     - 127.0.0.1:2379
     - 127.0.0.1:2379
   Key: bxbuyer.rpc
   Key: bxbuyer.rpc
-Timeout: 8000
+Timeout: 30000
 Webrpcport: 8018
 Webrpcport: 8018
 BuyerCount: 500
 BuyerCount: 500
 DefaultBuyerNames:
 DefaultBuyerNames:

+ 2 - 2
jyBXBuyer/rpc/etc/db.yaml

@@ -1,14 +1,14 @@
 mysql:
 mysql:
     main:
     main:
         dbName: jianyu
         dbName: jianyu
-        address: 192.168.3.11:3366
+        address: 192.168.3.149:3306
         userName: root
         userName: root
         password: Topnet123
         password: Topnet123
         maxOpenConns: 5
         maxOpenConns: 5
         maxIdleConns: 5
         maxIdleConns: 5
 redis:
 redis:
     addr:
     addr:
-        - other=192.168.3.206:1712
+        - other=192.168.3.149:1713
 es:
 es:
     addr: http://192.168.3.241:9205
     addr: http://192.168.3.241:9205
     size: 30
     size: 30

+ 27 - 13
jyBXBuyer/rpc/internal/logic/buyerlistlogic.go

@@ -31,19 +31,19 @@ func NewBuyerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyerLi
 func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerListResp, error) {
 func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerListResp, error) {
 	start2 := time.Now()
 	start2 := time.Now()
 	logx.Info("----:", model.CheckEmpty(in))
 	logx.Info("----:", model.CheckEmpty(in))
-	query, CountQuery := "", ""
 	resp := &bxbuyer.BuyerListResp{}
 	resp := &bxbuyer.BuyerListResp{}
 	// 采购单位搜索过来的 最多查100条
 	// 采购单位搜索过来的 最多查100条
 	if in.PageSize*in.PageNum > IC.C.BuyerSearchLimit {
 	if in.PageSize*in.PageNum > IC.C.BuyerSearchLimit {
 		in.PageNum = IC.C.BuyerSearchLimit / in.PageSize
 		in.PageNum = IC.C.BuyerSearchLimit / in.PageSize
 	}
 	}
-
 	if in.PageNum < 1 {
 	if in.PageNum < 1 {
 		in.PageNum = 1
 		in.PageNum = 1
 	}
 	}
-	if in.PageSize < 1 {
-		in.PageNum = 10
+	if in.PageSize < 1 || in.PageSize > 100 {
+		in.PageSize = 10
 	}
 	}
+	query, CountQuery := "", ""
+	buyerNames := []string{}
 	if model.CheckEmpty(in) {
 	if model.CheckEmpty(in) {
 		//获取缓存数据
 		//获取缓存数据
 		var isBool = true
 		var isBool = true
@@ -53,24 +53,38 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
 			if err := json.Unmarshal(*bs, &resp.Data); err != nil {
 			if err := json.Unmarshal(*bs, &resp.Data); err != nil {
 				isBool = true
 				isBool = true
 				logx.Info("获取redis缓存,序列化异常")
 				logx.Info("获取redis缓存,序列化异常")
+			} else {
+				if len(resp.Data.List) > 0 {
+					for i := 0; i < len(resp.Data.List); i++ {
+						buyerNames = append(buyerNames, resp.Data.List[i].Buyer)
+					}
+				}
+
 			}
 			}
 		}
 		}
 		if isBool {
 		if isBool {
 			query, CountQuery = model.BuyerListRedisCacheQuery(in.PageNum, in.PageSize)
 			query, CountQuery = model.BuyerListRedisCacheQuery(in.PageNum, in.PageSize)
-			resp = model.GetBuyerList(query, CountQuery, in, true)
-			resp = model.SupplyBuyerListData(resp)
-			b, err := json.Marshal(resp.Data)
-			if err == nil {
-				redis.PutBytes("other", fmt.Sprintf(model.P_redis_key, in.PageNum, in.PageSize), &b, model.P_redis_time)
-			} else {
-				logx.Info("缓存数据 序列化异常")
+			buyerNames, resp = model.GetBuyerList(query, CountQuery, true)
+			if len(resp.Data.List) > 0 {
+				model.SupplyBuyerListData(buyerNames, resp)
+				b, err := json.Marshal(resp.Data)
+				if err == nil {
+					redis.PutBytes("other", fmt.Sprintf(model.P_redis_key, in.PageNum, in.PageSize), &b, model.P_redis_time)
+				} else {
+					logx.Info("缓存数据 序列化异常")
+				}
 			}
 			}
 		}
 		}
 	} else {
 	} else {
 		query, CountQuery = model.BuyerListQuery(in)
 		query, CountQuery = model.BuyerListQuery(in)
 		logx.Info("query:", query)
 		logx.Info("query:", query)
-		resp = model.GetBuyerList(query, CountQuery, in, false) // 查询数据
-		resp = model.SupplyBuyerListData(resp)
+		buyerNames, resp = model.GetBuyerList(query, CountQuery, false) // 查询数据
+		if len(resp.Data.List) > 0 {
+			model.SupplyBuyerListData(buyerNames, resp)
+		}
+	}
+	if len(resp.Data.List) > 0 && (in.UserId != "" || in.EntUserId != "") {
+		model.SupplyFollowInfo(in, buyerNames, resp)
 	}
 	}
 	if resp.Data.Count > IC.C.BuyerSearchLimit {
 	if resp.Data.Count > IC.C.BuyerSearchLimit {
 		resp.Data.Count = IC.C.BuyerSearchLimit
 		resp.Data.Count = IC.C.BuyerSearchLimit

+ 36 - 0
jyBXBuyer/rpc/internal/logic/buyersupplyinfologic.go

@@ -0,0 +1,36 @@
+package logic
+
+import (
+	"context"
+	IC "jyBXBuyer/rpc/init"
+	"jyBXBuyer/rpc/internal/svc"
+	"jyBXBuyer/rpc/model"
+	"jyBXBuyer/rpc/type/bxbuyer"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type BuyerSupplyInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewBuyerSupplyInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyerSupplyInfoLogic {
+	return &BuyerSupplyInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+func (l *BuyerSupplyInfoLogic) BuyerSupplyInfo(in *bxbuyer.BuyerSupplyInfoReq) (*bxbuyer.BuyerSupplyResp, error) {
+	resp := &bxbuyer.BuyerSupplyResp{}
+	if len(in.Buyers) == 0 || len(in.Buyers) > int(IC.C.BuyerSearchLimit) {
+		return resp, nil
+	}
+	resp = model.BuyerSupplyInfo(in.Buyers)
+
+	return resp, nil
+}

+ 6 - 0
jyBXBuyer/rpc/internal/server/bxbuyerserver.go

@@ -28,6 +28,12 @@ func (s *BxbuyerServer) BuyerList(ctx context.Context, in *bxbuyer.BuyerListReq)
 	return l.BuyerList(in)
 	return l.BuyerList(in)
 }
 }
 
 
+//  采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+func (s *BxbuyerServer) BuyerSupplyInfo(ctx context.Context, in *bxbuyer.BuyerSupplyInfoReq) (*bxbuyer.BuyerSupplyResp, error) {
+	l := logic.NewBuyerSupplyInfoLogic(ctx, s.svcCtx)
+	return l.BuyerSupplyInfo(in)
+}
+
 // 采购单位画像 关联信息
 // 采购单位画像 关联信息
 func (s *BxbuyerServer) RelatesInfo(ctx context.Context, in *bxbuyer.RelatesInformationReq) (*bxbuyer.RelatesInformationResp, error) {
 func (s *BxbuyerServer) RelatesInfo(ctx context.Context, in *bxbuyer.RelatesInformationReq) (*bxbuyer.RelatesInformationResp, error) {
 	l := logic.NewRelatesInfoLogic(ctx, s.svcCtx)
 	l := logic.NewRelatesInfoLogic(ctx, s.svcCtx)

+ 286 - 113
jyBXBuyer/rpc/model/buyerListBYEs.go

@@ -1,10 +1,12 @@
 package model
 package model
 
 
 import (
 import (
+	"app.yhyue.com/moapp/jybase/redis"
 	"encoding/json"
 	"encoding/json"
 	"fmt"
 	"fmt"
 	IC "jyBXBuyer/rpc/init"
 	IC "jyBXBuyer/rpc/init"
 	"jyBXBuyer/rpc/type/bxbuyer"
 	"jyBXBuyer/rpc/type/bxbuyer"
+	"log"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
@@ -48,8 +50,8 @@ func BuyerListQuery(in *bxbuyer.BuyerListReq) (qstr string, CountQstr string) {
 		musts = append(musts, fmt.Sprintf(query_bool_should, strings.Join(musts_should, ",")))
 		musts = append(musts, fmt.Sprintf(query_bool_should, strings.Join(musts_should, ",")))
 	}
 	}
 	//采购单位名称
 	//采购单位名称
-	if len(in.BuyerName) > 0 {
-		entNameQuery := `{"match_phrase":{"name":"` + in.BuyerName + `"}}`
+	if in.BuyerName != "" {
+		entNameQuery := fmt.Sprintf(`{"multi_match": {"query": "%s","type": "phrase", "fields": ["name"]}}`, in.BuyerName)
 		musts = append(musts, entNameQuery)
 		musts = append(musts, entNameQuery)
 	}
 	}
 	//采购单位类型
 	//采购单位类型
@@ -82,10 +84,10 @@ func SupplyDataQuery(buyerList []string) (query string) {
 	// 查近两年的数据   因为bigmember  BuyerMiniPortrait 查的默认是两年
 	// 查近两年的数据   因为bigmember  BuyerMiniPortrait 查的默认是两年
 	q := `{"size":0,"query": { "bool": { "must": [ {"terms": { "buyer": ["` + strings.Join(buyerList, "\",\"") + `"] }},{"range": {"jgtime": {"gte": %d,"lt": %d} }} ]}}, "aggs": { "buyerBuckets": {"terms": {"field": "buyer"
 	q := `{"size":0,"query": { "bool": { "must": [ {"terms": { "buyer": ["` + strings.Join(buyerList, "\",\"") + `"] }},{"range": {"jgtime": {"gte": %d,"lt": %d} }} ]}}, "aggs": { "buyerBuckets": {"terms": {"field": "buyer"
  },"aggs": {"bidAmountCount": {"sum": {"field": "bidamount"}}}}}}`
  },"aggs": {"bidAmountCount": {"sum": {"field": "bidamount"}}}}}}`
-	start, end := getTimeRage()
+	start, end := getTimeRange()
 	return fmt.Sprintf(q, start.Unix(), end.Unix())
 	return fmt.Sprintf(q, start.Unix(), end.Unix())
 }
 }
-func getTimeRage() (st, et time.Time) {
+func getTimeRange() (st, et time.Time) {
 	now := time.Now()
 	now := time.Now()
 	eYear := now.Year()
 	eYear := now.Year()
 	sYear := now.Year() - 2
 	sYear := now.Year() - 2
@@ -98,20 +100,23 @@ func getTimeRage() (st, et time.Time) {
 }
 }
 
 
 const (
 const (
-	P_INDEX      = "projectset"
-	P_TYPE       = "projectset"
-	P_redis_time = 15 * 24 * 60 * 60      //redis存15天
-	P_redis_key  = "buyerListCache_%d_%d" // 按页存缓存
-	BuyerIndex   = "buyer"                // 采购单位index
-	BuyerType    = "buyer"
-	biddingIndex = "bidding"
-	biddingType  = "bidding"
+	P_INDEX                  = "projectset"
+	P_TYPE                   = "projectset"
+	P_redis_time             = 15 * 24 * 60 * 60      //redis存15天
+	P_redis_key              = "buyerListCache_%d_%d" // 按页存缓存
+	BuyerIndex               = "buyer"                // 采购单位index
+	BuyerType                = "buyer"
+	biddingIndex             = "bidding"
+	biddingType              = "bidding"
+	BuyerSupplyInfoRedisKey  = "BuyerSupplyInfo_%s" // 采购单位补充信息缓存
+	BuyerSupplyInfoRedisTime = 5 * 60               // 采购单位补充信息缓存时间
 )
 )
 
 
-// 查询采购单位列表
-func GetBuyerList(qstr string, CountQuery string, in *bxbuyer.BuyerListReq, isCache bool) (resp *bxbuyer.BuyerListResp) {
+// GetBuyerList 查询采购单位列表
+func GetBuyerList(qstr string, CountQuery string, isCache bool) (buyerNames []string, resp *bxbuyer.BuyerListResp) {
 	t1 := time.Now()
 	t1 := time.Now()
 	total := elastic.Count(BuyerIndex, BuyerType, CountQuery) // 总数
 	total := elastic.Count(BuyerIndex, BuyerType, CountQuery) // 总数
+	logx.Info("耗时1:", time.Since(t1))
 	resp = &bxbuyer.BuyerListResp{
 	resp = &bxbuyer.BuyerListResp{
 		Data: &bxbuyer.BuyerData{
 		Data: &bxbuyer.BuyerData{
 			Count: total,
 			Count: total,
@@ -129,110 +134,115 @@ func GetBuyerList(qstr string, CountQuery string, in *bxbuyer.BuyerListReq, isCa
 	}
 	}
 	for i := 0; i < len(*rs); i++ {
 	for i := 0; i < len(*rs); i++ {
 		tmp := &bxbuyer.BuyerList{
 		tmp := &bxbuyer.BuyerList{
-			Buyer:      MC.ObjToString((*rs)[i]["buyer_name"]),
+			Buyer:      MC.ObjToString((*rs)[i]["name"]),
 			Province:   MC.ObjToString((*rs)[i]["province"]),
 			Province:   MC.ObjToString((*rs)[i]["province"]),
 			City:       MC.ObjToString((*rs)[i]["city"]),
 			City:       MC.ObjToString((*rs)[i]["city"]),
-			BuyerClass: MC.ObjToString((*rs)[i]["buyerclasss"]),
+			BuyerClass: MC.ObjToString((*rs)[i]["buyerclass"]),
 		}
 		}
+		buyerNames = append(buyerNames, tmp.Buyer)
 		resp.Data.List = append(resp.Data.List, tmp)
 		resp.Data.List = append(resp.Data.List, tmp)
-
 	}
 	}
-	var wg sync.WaitGroup
+	logx.Info("耗时;", time.Since(t1).Seconds(), "秒--", time.Since(t1).Microseconds())
+	return
+}
+
+// SupplyFollowInfo 补充是否关注信息
+func SupplyFollowInfo(in *bxbuyer.BuyerListReq, buyerNames []string, resp *bxbuyer.BuyerListResp) *bxbuyer.BuyerListResp {
+
 	//省份和城市 是否查询已关注信息 是否查询已领取信息
 	//省份和城市 是否查询已关注信息 是否查询已领取信息
 	//企业信用库qyxy_std 和es buyer库 查询省份和城市
 	//企业信用库qyxy_std 和es buyer库 查询省份和城市
-	var fiftyArr = []*bxbuyer.BuyerList{}
-	var buyerNames = []string{}
-	for bk, bv := range resp.Data.List {
-		fiftyArr = append(fiftyArr, bv)
-		buyerNames = append(buyerNames, bv.Buyer)
-		if (bk+1)%50 == 0 || len(resp.Data.List) == bk+1 {
-			wg.Add(1)
-			go func(wg *sync.WaitGroup, fiftyArr []*bxbuyer.BuyerList, buyerNames []string, icf, icr bool, userId, entUserId string) {
-				// 关注状态 领取状态
-				//关注状态
-				isFws := map[string]bool{}
-				if icf {
-					isFws = IsFollowd(buyerNames, userId)
-				}
-				//领取状态
-				isRws := map[string]string{}
-				if icr {
-					isRws = IsReceived(buyerNames, entUserId)
-				}
-				//log.Println("---:", isRws)
-				for _, fv := range fiftyArr {
-					if icf {
-						fv.IsFollowed = isFws[fv.Buyer]
-					}
-					if icr {
-						if isRws[fv.Buyer] != "" {
-							fv.RecId = isRws[fv.Buyer]
-							fv.IsReceived = true
-						}
-					}
-				}
-				wg.Done()
-			}(&wg, fiftyArr, buyerNames, in.IsCheckFollow, in.IsCheckReceive, in.UserId, in.EntUserId)
-			fiftyArr = []*bxbuyer.BuyerList{}
-			buyerNames = []string{}
+	//客户领取
+	t2 := time.Now()
+	isRws := map[string]string{}
+	if in.IsCheckReceive {
+		isRws = IsReceived(buyerNames, in.EntUserId)
+	}
+	logx.Info("客户领取耗时:", time.Since(t2))
+	//客户关注
+	t3 := time.Now()
+	isFws := map[string]bool{}
+	if in.IsCheckFollow {
+		isFws = IsFollowd(buyerNames, in.UserId)
+	}
+	logx.Info("采购单位关注耗时:", time.Since(t3))
+	for _, bv := range resp.Data.List {
+		if in.IsCheckReceive {
+			if isRws[bv.Buyer] != "" {
+				bv.IsReceived = true
+				bv.RecId = isRws[bv.Buyer]
+			}
+			if isFws[bv.Buyer] {
+				bv.IsFollowed = true
+			}
 		}
 		}
 	}
 	}
-	wg.Wait()
-
-	logx.Info("耗时;", time.Since(t1).Seconds(), time.Since(t1).Microseconds())
-	return
+	return resp
 }
 }
 
 
-// 补充字段   项目数量 历史联系人数量 采购单位规模
-func SupplyBuyerListData(resp *bxbuyer.BuyerListResp) *bxbuyer.BuyerListResp {
-	start := time.Now()
-	if resp == nil || resp.Data == nil || resp.Data.List == nil || len(resp.Data.List) == 0 {
-		return resp
-	}
-	// buyerList
-	buyerList := []string{}
-	for i := 0; i < len(resp.Data.List); i++ {
-		buyerList = append(buyerList, resp.Data.List[i].Buyer)
-	}
-	t1 := time.Now()
-	query := SupplyDataQuery(buyerList) // 项目数量、采购规模
-	// 聚合查
-	aggs := GetAggs(P_INDEX, P_TYPE, query)
-	logx.Info("项目数量采购规模查询耗时", time.Since(t1))
-	logx.Info("查询语句:", query)
-	type BuyerAggStruct struct {
-		Buckets []struct {
-			Key            string `json:"key,omitempty"`
-			Doc_count      int64  `json:"doc_count,omitempty"`
-			BidAmountCount struct {
-				Value float32 `json:"value,omitempty"`
-			} `json:"bidAmountCount"`
-		} `json:"buckets"`
-	}
-	var buyerBuckets = BuyerAggStruct{}
+// SupplyBuyerListData 补充字段   招标动态数量 项目数量 历史联系人数量 采购单位规模
+func SupplyBuyerListData(buyerNames []string, resp *bxbuyer.BuyerListResp) *bxbuyer.BuyerListResp {
 	type supplyDataStruct struct {
 	type supplyDataStruct struct {
 		ProjectCount   int64
 		ProjectCount   int64
 		BidCount       int64
 		BidCount       int64
 		BidAmountCount float32
 		BidAmountCount float32
+		ContactCount   int64
 	}
 	}
-	// 处理成map 用于后面格式化数据
-	buyerMap := map[string]supplyDataStruct{}
-	if aggs != nil && aggs["buyerBuckets"] != nil {
-		bs, err := aggs["buyerBuckets"].MarshalJSON()
-		if err != nil {
-			resp.ErrCode = -1
-			resp.ErrMsg = "获取数据异常"
+	//buyerNames 是否存在缓存 数据
+	//如果没有 放到一个新的 []string
+	needSearchBuyer := []string{}
+	cacheMap := map[string]supplyDataStruct{}
+	for i := 0; i < len(buyerNames); i++ {
+		bs, err := redis.GetBytes("other", fmt.Sprintf(BuyerSupplyInfoRedisKey, buyerNames[i]))
+		if err == nil && bs != nil && len(*bs) > 0 {
+			tmp := supplyDataStruct{}
+			if err := json.Unmarshal(*bs, &tmp); err == nil {
+				cacheMap[buyerNames[i]] = tmp // 拿到缓存的数据
+			} else {
+				needSearchBuyer = append(needSearchBuyer, buyerNames[i]) // 没有缓存的数据 后边再查
+			}
 		} else {
 		} else {
-			if len(bs) == 0 {
-				resp.ErrMsg = "暂无数据"
+			needSearchBuyer = append(needSearchBuyer, buyerNames[i]) // 没有缓存的数据 后边再查
+		}
+
+	}
+
+	start := time.Now()
+	t1 := time.Now()
+	buyerMap := map[string]supplyDataStruct{} // 聚合的数据
+	if len(needSearchBuyer) > 0 {
+		query := SupplyDataQuery(needSearchBuyer) // 项目数量、采购规模
+		// 聚合查
+		aggs := GetAggs(P_INDEX, P_TYPE, query)
+		logx.Info("查询语句:", query)
+		logx.Info("项目数量采购规模查询耗时:", time.Since(t1))
+		type BuyerAggStruct struct {
+			Buckets []struct {
+				Key            string `json:"key,omitempty"`
+				Doc_count      int64  `json:"doc_count,omitempty"`
+				BidAmountCount struct {
+					Value float32 `json:"value,omitempty"`
+				} `json:"bidAmountCount"`
+			} `json:"buckets"`
+		}
+		var buyerBuckets = BuyerAggStruct{}
+		// 处理成map 用于后面格式化数据
+		if aggs != nil && aggs["buyerBuckets"] != nil {
+			bs, err := aggs["buyerBuckets"].MarshalJSON()
+			if err != nil {
+				resp.ErrCode = -1
+				resp.ErrMsg = "获取数据异常"
 			} else {
 			} else {
-				err := json.Unmarshal(bs, &buyerBuckets)
-				logx.Info(err)
-				if len(buyerBuckets.Buckets) > 0 {
-					for _, v := range buyerBuckets.Buckets {
-						buyerMap[v.Key] = supplyDataStruct{
-							BidAmountCount: v.BidAmountCount.Value,
-							ProjectCount:   v.Doc_count,
+				if len(bs) == 0 {
+					resp.ErrMsg = "暂无数据"
+				} else {
+					err := json.Unmarshal(bs, &buyerBuckets)
+					logx.Info(err)
+					if len(buyerBuckets.Buckets) > 0 {
+						for _, v := range buyerBuckets.Buckets {
+							buyerMap[v.Key] = supplyDataStruct{
+								BidAmountCount: v.BidAmountCount.Value,
+								ProjectCount:   v.Doc_count,
+							}
 						}
 						}
 					}
 					}
 				}
 				}
@@ -244,7 +254,15 @@ func SupplyBuyerListData(resp *bxbuyer.BuyerListResp) *bxbuyer.BuyerListResp {
 	wg := &sync.WaitGroup{}
 	wg := &sync.WaitGroup{}
 	for i := 0; i < len(resp.Data.List); i++ {
 	for i := 0; i < len(resp.Data.List); i++ {
 		buyer := resp.Data.List[i].Buyer
 		buyer := resp.Data.List[i].Buyer
-		// 补充字段
+		// 先查缓存
+		if cacheData, ok := cacheMap[buyer]; ok {
+			resp.Data.List[i].BidAmountCount = cacheData.BidAmountCount
+			resp.Data.List[i].ProjectCount = cacheData.ProjectCount
+			resp.Data.List[i].BiddingCount = cacheData.BidCount
+			resp.Data.List[i].ContactCount = cacheData.ContactCount
+			continue
+		}
+		// 缓存里没有的再查数据补充
 		if supplyData, ok := buyerMap[buyer]; ok {
 		if supplyData, ok := buyerMap[buyer]; ok {
 			resp.Data.List[i].BidAmountCount = supplyData.BidAmountCount
 			resp.Data.List[i].BidAmountCount = supplyData.BidAmountCount
 			resp.Data.List[i].ProjectCount = supplyData.ProjectCount
 			resp.Data.List[i].ProjectCount = supplyData.ProjectCount
@@ -271,9 +289,163 @@ func SupplyBuyerListData(resp *bxbuyer.BuyerListResp) *bxbuyer.BuyerListResp {
 	}
 	}
 	wg.Wait()
 	wg.Wait()
 	logx.Info("SupplyBuyerListData 整体耗时:", time.Since(start))
 	logx.Info("SupplyBuyerListData 整体耗时:", time.Since(start))
+
+	//得到所有数据,包括 redis里的,再存一下
+	go func(respList []*bxbuyer.BuyerList) {
+		for i := 0; i < len(respList); i++ {
+			tmp := supplyDataStruct{
+				ContactCount:   respList[i].ContactCount,
+				BidCount:       respList[i].BiddingCount,
+				ProjectCount:   respList[i].ProjectCount,
+				BidAmountCount: respList[i].BidAmountCount,
+			}
+			// 存redis
+			b, err := json.Marshal(tmp)
+			if err == nil {
+				redis.PutBytes("other", fmt.Sprintf(BuyerSupplyInfoRedisKey, respList[i].Buyer), &b, BuyerSupplyInfoRedisTime+GetRand(60))
+			}
+		}
+	}(resp.Data.List)
+
 	return resp
 	return resp
 }
 }
 
 
+// BuyerSupplyInfo 补充字段
+func BuyerSupplyInfo(buyerNames []string) (resp *bxbuyer.BuyerSupplyResp) {
+	resp = &bxbuyer.BuyerSupplyResp{}
+	start := time.Now()
+	// buyerNames
+	type supplyDataStruct struct {
+		ProjectCount   int64
+		BidCount       int64
+		BidAmountCount float32
+		ContactCount   int64
+	}
+	//buyerNames 是否存在缓存 数据
+	//如果没有 放到一个新的 []string
+	needSearchBuyer := []string{}
+	cacheMap := map[string]supplyDataStruct{}
+	for i := 0; i < len(buyerNames); i++ {
+		bs, err := redis.GetBytes("other", fmt.Sprintf(BuyerSupplyInfoRedisKey, buyerNames[i]))
+		if err == nil && bs != nil && len(*bs) > 0 {
+			tmp := supplyDataStruct{}
+			if err := json.Unmarshal(*bs, &tmp); err == nil {
+				cacheMap[buyerNames[i]] = tmp // 拿到缓存的数据
+			} else {
+				needSearchBuyer = append(needSearchBuyer, buyerNames[i]) // 没有缓存的数据 后边再查
+			}
+
+		} else {
+			needSearchBuyer = append(needSearchBuyer, buyerNames[i]) // 没有缓存的数据 后边再查
+		}
+
+	}
+	buyerMap := map[string]supplyDataStruct{}
+	if len(needSearchBuyer) > 0 {
+		t1 := time.Now()
+		query := SupplyDataQuery(buyerNames) // 项目数量、采购规模
+		// 聚合查
+		aggs := GetAggs(P_INDEX, P_TYPE, query)
+		logx.Info("查询语句:", query)
+		logx.Info("项目数量采购规模查询耗时:", time.Since(t1))
+		type BuyerAggStruct struct {
+			Buckets []struct {
+				Key            string `json:"key,omitempty"`
+				Doc_count      int64  `json:"doc_count,omitempty"`
+				BidAmountCount struct {
+					Value float32 `json:"value,omitempty"`
+				} `json:"bidAmountCount"`
+			} `json:"buckets"`
+		}
+		var buyerBuckets = BuyerAggStruct{}
+		// 处理成map 用于后面格式化数据
+		if aggs != nil && aggs["buyerBuckets"] != nil {
+			bs, err := aggs["buyerBuckets"].MarshalJSON()
+			if err != nil {
+				resp.ErrCode = -1
+				resp.ErrMsg = "获取数据异常"
+			} else {
+				if len(bs) == 0 {
+					resp.ErrMsg = "暂无数据"
+				} else {
+					err := json.Unmarshal(bs, &buyerBuckets)
+					logx.Info(err)
+					if len(buyerBuckets.Buckets) > 0 {
+						for _, v := range buyerBuckets.Buckets {
+							buyerMap[v.Key] = supplyDataStruct{
+								BidAmountCount: v.BidAmountCount.Value,
+								ProjectCount:   v.Doc_count,
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	ch := make(chan int, 10)
+	ch2 := make(chan int, 10)
+	wg := &sync.WaitGroup{}
+	for i := 0; i < len(buyerNames); i++ {
+		buyer := buyerNames[i]
+		resp.Data = append(resp.Data, &bxbuyer.SupplyData{
+			Buyer: buyer,
+		})
+		// 先查缓存
+		if cacheData, ok := cacheMap[buyer]; ok {
+			resp.Data[i].BidAmountCount = cacheData.BidAmountCount
+			resp.Data[i].ProjectCount = cacheData.ProjectCount
+			resp.Data[i].BiddingCount = cacheData.BidCount
+			resp.Data[i].ContactCount = cacheData.ContactCount
+			continue
+		}
+		// 缓存里没有的再查数据补充
+		// 补充字段
+		if supplyData, ok := buyerMap[buyer]; ok {
+			resp.Data[i].BidAmountCount = supplyData.BidAmountCount
+			resp.Data[i].ProjectCount = supplyData.ProjectCount
+		}
+		ch2 <- 1
+		wg.Add(1)
+		go func(list *bxbuyer.SupplyData, buyer string) {
+			defer func() {
+				<-ch2
+				wg.Done()
+			}()
+			list.ContactCount = GetProjectContactCount(buyer) // 补充联系人字段
+		}(resp.Data[i], buyer)
+		ch <- 1
+		wg.Add(1)
+		go func(list *bxbuyer.SupplyData, buyer string) {
+			defer func() {
+				<-ch
+				wg.Done()
+			}()
+			list.BiddingCount = GetNewBiddingCount(buyer)
+		}(resp.Data[i], buyer)
+
+	}
+	wg.Wait()
+	logx.Info(" 整体耗时:", time.Since(start))
+	//得到所有数据,包括 redis里的,再存一下
+	go func(respList []*bxbuyer.SupplyData) {
+		for i := 0; i < len(respList); i++ {
+			tmp := supplyDataStruct{
+				ContactCount:   respList[i].ContactCount,
+				BidCount:       respList[i].BiddingCount,
+				ProjectCount:   respList[i].ProjectCount,
+				BidAmountCount: respList[i].BidAmountCount,
+			}
+			// 存redis
+			b, err := json.Marshal(tmp)
+			if err == nil {
+				redis.PutBytes("other", fmt.Sprintf(BuyerSupplyInfoRedisKey, respList[i].Buyer), &b, BuyerSupplyInfoRedisTime+GetRand(60))
+			}
+		}
+	}(resp.Data)
+	return
+}
+
 func GetProjectContactCount(buyerName string) int64 {
 func GetProjectContactCount(buyerName string) int64 {
 	start := time.Now()
 	start := time.Now()
 	list := []string{}
 	list := []string{}
@@ -284,8 +456,9 @@ func GetProjectContactCount(buyerName string) int64 {
 	if musts == nil || len(musts) == 0 {
 	if musts == nil || len(musts) == 0 {
 		return 0
 		return 0
 	}
 	}
-	searchSql := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"_source":["_id","zbtime","projectname","list"],"sort":[{"zbtime":"desc"}],"size":500}`, strings.Join(musts, ","))
+	searchSql := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"_source":["list"],"sort":[{"zbtime":"desc"}],"size":500}`, strings.Join(musts, ","))
 	projectList := elastic.Get(P_INDEX, P_TYPE, searchSql)
 	projectList := elastic.Get(P_INDEX, P_TYPE, searchSql)
+	logx.Info("GetProjectContactCount esget 耗时", time.Since(start), searchSql)
 	if projectList == nil || len(*projectList) == 0 {
 	if projectList == nil || len(*projectList) == 0 {
 		return 0
 		return 0
 	}
 	}
@@ -342,11 +515,11 @@ func GetNewBiddingCount(buyer string) int64 {
 		return 0
 		return 0
 	}
 	}
 	var mustQuery []string
 	var mustQuery []string
-	st, et := getTimeRage()
+	st, et := getTimeRange()
 	mustQuery = append(mustQuery, fmt.Sprintf(`{"range":{"publishtime":{"gte":%d,"lte":%d}}}`, st.Unix(), et.Unix()))
 	mustQuery = append(mustQuery, fmt.Sprintf(`{"range":{"publishtime":{"gte":%d,"lte":%d}}}`, st.Unix(), et.Unix()))
 	mustQuery = append(mustQuery, fmt.Sprintf(`{"term": {"buyer": "%s"}}`, buyer))
 	mustQuery = append(mustQuery, fmt.Sprintf(`{"term": {"buyer": "%s"}}`, buyer))
-
-	count := elastic.Count(biddingIndex, biddingType, fmt.Sprintf(`{"query":{"bool":{"must":[%s]}}}`, strings.Join(mustQuery, ",")))
+	aa := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}}}`, strings.Join(mustQuery, ","))
+	count := elastic.Count(biddingIndex, biddingType, aa)
 	logx.Info("GetNewBiddingCount 单次耗时:", time.Since(start))
 	logx.Info("GetNewBiddingCount 单次耗时:", time.Since(start))
 	return count
 	return count
 }
 }
@@ -393,17 +566,15 @@ func IsFollowd(buyerNames []string, userId string) (isFws map[string]bool) {
 		},
 		},
 	}
 	}
 	list, ok := IC.Mgo.Find(fc, queryMap, `{"_id":1}`, nil, false, -1, -1)
 	list, ok := IC.Mgo.Find(fc, queryMap, `{"_id":1}`, nil, false, -1, -1)
-	if ok && list != nil {
-		if len(*list) > 0 {
-			isFws = map[string]bool{}
-			for _, lv := range *list {
-				if MC.ObjToString(lv["name"]) != "" {
-					isFws[MC.ObjToString(lv["name"])] = true
-				}
+	if ok && len(*list) > 0 {
+		isFws = map[string]bool{}
+		for _, lv := range *list {
+			if MC.ObjToString(lv["name"]) != "" {
+				isFws[MC.ObjToString(lv["name"])] = true
 			}
 			}
 		}
 		}
 	} else {
 	} else {
-		logx.Info("采购单位是否已关注信息异常")
+		logx.Info("采购单位是否已关注信息异常  or  未查到数据")
 	}
 	}
 	return
 	return
 }
 }
@@ -416,6 +587,8 @@ var (
 // 领取状态
 // 领取状态
 func IsReceived(buyerNames []string, entUserId string) (isRws map[string]string) {
 func IsReceived(buyerNames []string, entUserId string) (isRws map[string]string) {
 	//新加领取的客户id----保证领取的唯一性
 	//新加领取的客户id----保证领取的唯一性
+	aa := fmt.Sprintf("SELECT ecn.id,  ecn.name  FROM %s ecn,%s  euu WHERE ecn.id = euu.customer_id AND euu.user_id =? AND ecn.`name` IN  ('%s') AND (euu.source_type =1 or euu.source_type=4)", Entniche_customer, Entniche_user_customer, strings.Join(buyerNames, "','"))
+	log.Println(aa)
 	receInfos := IC.MainMysql.SelectBySql(fmt.Sprintf("SELECT ecn.id,  ecn.name  FROM %s ecn,%s  euu WHERE ecn.id = euu.customer_id AND euu.user_id =? AND ecn.`name` IN  ('%s') AND (euu.source_type =1 or euu.source_type=4)", Entniche_customer, Entniche_user_customer, strings.Join(buyerNames, "','")), entUserId)
 	receInfos := IC.MainMysql.SelectBySql(fmt.Sprintf("SELECT ecn.id,  ecn.name  FROM %s ecn,%s  euu WHERE ecn.id = euu.customer_id AND euu.user_id =? AND ecn.`name` IN  ('%s') AND (euu.source_type =1 or euu.source_type=4)", Entniche_customer, Entniche_user_customer, strings.Join(buyerNames, "','")), entUserId)
 	if receInfos != nil {
 	if receInfos != nil {
 		if len(*receInfos) > 0 {
 		if len(*receInfos) > 0 {

+ 12 - 0
jyBXBuyer/rpc/model/util.go

@@ -0,0 +1,12 @@
+package model
+
+import (
+	"math/rand"
+	"time"
+)
+
+func GetRand(n int) int {
+	randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
+	// 获取一个范围在 [0, ) 的随机整数
+	return randGen.Intn(n)
+}

+ 1 - 1
jyBXBuyer/rpc/service/service.go

@@ -58,7 +58,7 @@ func GetRelatesInfo(in *bxbuyer.RelatesInformationReq) *bxbuyer.RelatesInformati
 	}
 	}
 	//关联动态:采购单位标讯动态
 	//关联动态:采购单位标讯动态
 	if in.Buyer != "" {
 	if in.Buyer != "" {
-		biddingQuery := fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"buyer":"%s"}}]} },"sort": [{"publishtime": "desc"}],"from":0,"size":%d }`, in.Buyer, in.BuyerCount)
+		biddingQuery := fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"buyer":"%s"}}],"must_not":[{"terms":{"subtype":["采购意向","拟建"]}}]}},"sort": [{"publishtime": "desc"}],"from":0,"size":%d }`, in.Buyer, in.BuyerCount)
 		biddingList := elastic.Get("bidding", "bidding", biddingQuery)
 		biddingList := elastic.Get("bidding", "bidding", biddingQuery)
 		if len(*biddingList) > 0 {
 		if len(*biddingList) > 0 {
 			var biddingInfos []*bxbuyer.InfoList
 			var biddingInfos []*bxbuyer.InfoList

+ 325 - 28
jyBXBuyer/rpc/type/bxbuyer/bxbuyer.pb.go

@@ -726,6 +726,228 @@ func (x *InfoList) GetPublishTime() string {
 	return ""
 	return ""
 }
 }
 
 
+// 采购单位搜索获取补充信息
+type BuyerSupplyInfoReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AppId        string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`                //剑鱼默认10000
+	PositionId   int64    `protobuf:"varint,2,opt,name=positionId,proto3" json:"positionId,omitempty"`     // 职位id
+	PositionType int64    `protobuf:"varint,3,opt,name=positionType,proto3" json:"positionType,omitempty"` // 职位类型 0个人 1企业
+	Phone        string   `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`                // 手机号
+	Buyers       []string `protobuf:"bytes,5,rep,name=buyers,proto3" json:"buyers,omitempty"`              // 采购单位名称
+}
+
+func (x *BuyerSupplyInfoReq) Reset() {
+	*x = BuyerSupplyInfoReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxbuyer_proto_msgTypes[8]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *BuyerSupplyInfoReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BuyerSupplyInfoReq) ProtoMessage() {}
+
+func (x *BuyerSupplyInfoReq) ProtoReflect() protoreflect.Message {
+	mi := &file_bxbuyer_proto_msgTypes[8]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use BuyerSupplyInfoReq.ProtoReflect.Descriptor instead.
+func (*BuyerSupplyInfoReq) Descriptor() ([]byte, []int) {
+	return file_bxbuyer_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *BuyerSupplyInfoReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *BuyerSupplyInfoReq) GetPositionId() int64 {
+	if x != nil {
+		return x.PositionId
+	}
+	return 0
+}
+
+func (x *BuyerSupplyInfoReq) GetPositionType() int64 {
+	if x != nil {
+		return x.PositionType
+	}
+	return 0
+}
+
+func (x *BuyerSupplyInfoReq) GetPhone() string {
+	if x != nil {
+		return x.Phone
+	}
+	return ""
+}
+
+func (x *BuyerSupplyInfoReq) GetBuyers() []string {
+	if x != nil {
+		return x.Buyers
+	}
+	return nil
+}
+
+type BuyerSupplyResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ErrCode int64         `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3" json:"err_code,omitempty"`
+	ErrMsg  string        `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
+	Data    []*SupplyData `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *BuyerSupplyResp) Reset() {
+	*x = BuyerSupplyResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxbuyer_proto_msgTypes[9]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *BuyerSupplyResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BuyerSupplyResp) ProtoMessage() {}
+
+func (x *BuyerSupplyResp) ProtoReflect() protoreflect.Message {
+	mi := &file_bxbuyer_proto_msgTypes[9]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use BuyerSupplyResp.ProtoReflect.Descriptor instead.
+func (*BuyerSupplyResp) Descriptor() ([]byte, []int) {
+	return file_bxbuyer_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *BuyerSupplyResp) GetErrCode() int64 {
+	if x != nil {
+		return x.ErrCode
+	}
+	return 0
+}
+
+func (x *BuyerSupplyResp) GetErrMsg() string {
+	if x != nil {
+		return x.ErrMsg
+	}
+	return ""
+}
+
+func (x *BuyerSupplyResp) GetData() []*SupplyData {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+type SupplyData struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	BiddingCount   int64   `protobuf:"varint,1,opt,name=biddingCount,proto3" json:"biddingCount,omitempty"`      // 招标动态数量
+	ContactCount   int64   `protobuf:"varint,2,opt,name=contactCount,proto3" json:"contactCount,omitempty"`      // 历史联系人数量
+	ProjectCount   int64   `protobuf:"varint,3,opt,name=projectCount,proto3" json:"projectCount,omitempty"`      // 采购项目数量
+	BidAmountCount float32 `protobuf:"fixed32,4,opt,name=bidAmountCount,proto3" json:"bidAmountCount,omitempty"` // 采购规模
+	Buyer          string  `protobuf:"bytes,5,opt,name=buyer,proto3" json:"buyer,omitempty"`                     //采购单位名词
+}
+
+func (x *SupplyData) Reset() {
+	*x = SupplyData{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxbuyer_proto_msgTypes[10]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *SupplyData) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SupplyData) ProtoMessage() {}
+
+func (x *SupplyData) ProtoReflect() protoreflect.Message {
+	mi := &file_bxbuyer_proto_msgTypes[10]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use SupplyData.ProtoReflect.Descriptor instead.
+func (*SupplyData) Descriptor() ([]byte, []int) {
+	return file_bxbuyer_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *SupplyData) GetBiddingCount() int64 {
+	if x != nil {
+		return x.BiddingCount
+	}
+	return 0
+}
+
+func (x *SupplyData) GetContactCount() int64 {
+	if x != nil {
+		return x.ContactCount
+	}
+	return 0
+}
+
+func (x *SupplyData) GetProjectCount() int64 {
+	if x != nil {
+		return x.ProjectCount
+	}
+	return 0
+}
+
+func (x *SupplyData) GetBidAmountCount() float32 {
+	if x != nil {
+		return x.BidAmountCount
+	}
+	return 0
+}
+
+func (x *SupplyData) GetBuyer() string {
+	if x != nil {
+		return x.Buyer
+	}
+	return ""
+}
+
 var File_bxbuyer_proto protoreflect.FileDescriptor
 var File_bxbuyer_proto protoreflect.FileDescriptor
 
 
 var file_bxbuyer_proto_rawDesc = []byte{
 var file_bxbuyer_proto_rawDesc = []byte{
@@ -831,18 +1053,51 @@ var file_bxbuyer_proto_rawDesc = []byte{
 	0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
 	0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
 	0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
 	0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62,
 	0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62,
-	0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x95, 0x01, 0x0a, 0x07, 0x42, 0x78, 0x62,
-	0x75, 0x79, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73,
-	0x74, 0x12, 0x15, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65,
-	0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79,
-	0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x4e, 0x0a, 0x0b, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12,
-	0x1e, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65,
-	0x73, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a,
-	0x1f, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65,
-	0x73, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
-	0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x62, 0x06, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x12, 0x42, 0x75, 0x79,
+	0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12,
+	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+	0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+	0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74,
+	0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+	0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x6f, 0x73,
+	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f,
+	0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12,
+	0x16, 0x0a, 0x06, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x06, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x22, 0x6e, 0x0a, 0x0f, 0x42, 0x75, 0x79, 0x65, 0x72,
+	0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72,
+	0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72,
+	0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x27,
+	0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62,
+	0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x44, 0x61, 0x74,
+	0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xb6, 0x01, 0x0a, 0x0a, 0x53, 0x75, 0x70, 0x70,
+	0x6c, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x69, 0x64, 0x64, 0x69, 0x6e,
+	0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x62, 0x69,
+	0x64, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f,
+	0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22,
+	0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75,
+	0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x43,
+	0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x62, 0x69, 0x64, 0x41,
+	0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75,
+	0x79, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72,
+	0x32, 0xdf, 0x01, 0x0a, 0x07, 0x42, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x09,
+	0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x62, 0x78, 0x62, 0x75,
+	0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
+	0x1a, 0x16, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x0f, 0x42, 0x75, 0x79, 0x65,
+	0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x62, 0x78,
+	0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c,
+	0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79,
+	0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x4e, 0x0a, 0x0b, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x49, 0x6e, 0x66,
+	0x6f, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x6c, 0x61,
+	0x74, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
+	0x71, 0x1a, 0x1f, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x6c, 0x61,
+	0x74, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
+	0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 }
 
 
 var (
 var (
@@ -857,7 +1112,7 @@ func file_bxbuyer_proto_rawDescGZIP() []byte {
 	return file_bxbuyer_proto_rawDescData
 	return file_bxbuyer_proto_rawDescData
 }
 }
 
 
-var file_bxbuyer_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_bxbuyer_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
 var file_bxbuyer_proto_goTypes = []interface{}{
 var file_bxbuyer_proto_goTypes = []interface{}{
 	(*BuyerListReq)(nil),           // 0: bxbuyer.BuyerListReq
 	(*BuyerListReq)(nil),           // 0: bxbuyer.BuyerListReq
 	(*BuyerListResp)(nil),          // 1: bxbuyer.BuyerListResp
 	(*BuyerListResp)(nil),          // 1: bxbuyer.BuyerListResp
@@ -867,22 +1122,28 @@ var file_bxbuyer_proto_goTypes = []interface{}{
 	(*RelatesInformationResp)(nil), // 5: bxbuyer.relatesInformationResp
 	(*RelatesInformationResp)(nil), // 5: bxbuyer.relatesInformationResp
 	(*RelatesInformation)(nil),     // 6: bxbuyer.relatesInformation
 	(*RelatesInformation)(nil),     // 6: bxbuyer.relatesInformation
 	(*InfoList)(nil),               // 7: bxbuyer.infoList
 	(*InfoList)(nil),               // 7: bxbuyer.infoList
+	(*BuyerSupplyInfoReq)(nil),     // 8: bxbuyer.BuyerSupplyInfoReq
+	(*BuyerSupplyResp)(nil),        // 9: bxbuyer.BuyerSupplyResp
+	(*SupplyData)(nil),             // 10: bxbuyer.SupplyData
 }
 }
 var file_bxbuyer_proto_depIdxs = []int32{
 var file_bxbuyer_proto_depIdxs = []int32{
-	2, // 0: bxbuyer.BuyerListResp.data:type_name -> bxbuyer.BuyerData
-	3, // 1: bxbuyer.BuyerData.list:type_name -> bxbuyer.BuyerList
-	6, // 2: bxbuyer.relatesInformationResp.data:type_name -> bxbuyer.relatesInformation
-	7, // 3: bxbuyer.relatesInformation.buyerList:type_name -> bxbuyer.infoList
-	7, // 4: bxbuyer.relatesInformation.biddingList:type_name -> bxbuyer.infoList
-	0, // 5: bxbuyer.Bxbuyer.BuyerList:input_type -> bxbuyer.BuyerListReq
-	4, // 6: bxbuyer.Bxbuyer.RelatesInfo:input_type -> bxbuyer.relatesInformationReq
-	1, // 7: bxbuyer.Bxbuyer.BuyerList:output_type -> bxbuyer.BuyerListResp
-	5, // 8: bxbuyer.Bxbuyer.RelatesInfo:output_type -> bxbuyer.relatesInformationResp
-	7, // [7:9] is the sub-list for method output_type
-	5, // [5:7] is the sub-list for method input_type
-	5, // [5:5] is the sub-list for extension type_name
-	5, // [5:5] is the sub-list for extension extendee
-	0, // [0:5] is the sub-list for field type_name
+	2,  // 0: bxbuyer.BuyerListResp.data:type_name -> bxbuyer.BuyerData
+	3,  // 1: bxbuyer.BuyerData.list:type_name -> bxbuyer.BuyerList
+	6,  // 2: bxbuyer.relatesInformationResp.data:type_name -> bxbuyer.relatesInformation
+	7,  // 3: bxbuyer.relatesInformation.buyerList:type_name -> bxbuyer.infoList
+	7,  // 4: bxbuyer.relatesInformation.biddingList:type_name -> bxbuyer.infoList
+	10, // 5: bxbuyer.BuyerSupplyResp.data:type_name -> bxbuyer.SupplyData
+	0,  // 6: bxbuyer.Bxbuyer.BuyerList:input_type -> bxbuyer.BuyerListReq
+	8,  // 7: bxbuyer.Bxbuyer.BuyerSupplyInfo:input_type -> bxbuyer.BuyerSupplyInfoReq
+	4,  // 8: bxbuyer.Bxbuyer.RelatesInfo:input_type -> bxbuyer.relatesInformationReq
+	1,  // 9: bxbuyer.Bxbuyer.BuyerList:output_type -> bxbuyer.BuyerListResp
+	9,  // 10: bxbuyer.Bxbuyer.BuyerSupplyInfo:output_type -> bxbuyer.BuyerSupplyResp
+	5,  // 11: bxbuyer.Bxbuyer.RelatesInfo:output_type -> bxbuyer.relatesInformationResp
+	9,  // [9:12] is the sub-list for method output_type
+	6,  // [6:9] is the sub-list for method input_type
+	6,  // [6:6] is the sub-list for extension type_name
+	6,  // [6:6] is the sub-list for extension extendee
+	0,  // [0:6] is the sub-list for field type_name
 }
 }
 
 
 func init() { file_bxbuyer_proto_init() }
 func init() { file_bxbuyer_proto_init() }
@@ -987,6 +1248,42 @@ func file_bxbuyer_proto_init() {
 				return nil
 				return nil
 			}
 			}
 		}
 		}
+		file_bxbuyer_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*BuyerSupplyInfoReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxbuyer_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*BuyerSupplyResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxbuyer_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*SupplyData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	}
 	type x struct{}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
@@ -994,7 +1291,7 @@ func file_bxbuyer_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_bxbuyer_proto_rawDesc,
 			RawDescriptor: file_bxbuyer_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
-			NumMessages:   8,
+			NumMessages:   11,
 			NumExtensions: 0,
 			NumExtensions: 0,
 			NumServices:   1,
 			NumServices:   1,
 		},
 		},

+ 38 - 0
jyBXBuyer/rpc/type/bxbuyer/bxbuyer_grpc.pb.go

@@ -24,6 +24,8 @@ const _ = grpc.SupportPackageIsVersion7
 type BxbuyerClient interface {
 type BxbuyerClient interface {
 	//采购单位搜索
 	//采购单位搜索
 	BuyerList(ctx context.Context, in *BuyerListReq, opts ...grpc.CallOption) (*BuyerListResp, error)
 	BuyerList(ctx context.Context, in *BuyerListReq, opts ...grpc.CallOption) (*BuyerListResp, error)
+	// 采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+	BuyerSupplyInfo(ctx context.Context, in *BuyerSupplyInfoReq, opts ...grpc.CallOption) (*BuyerSupplyResp, error)
 	//采购单位画像 关联信息
 	//采购单位画像 关联信息
 	RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error)
 	RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error)
 }
 }
@@ -45,6 +47,15 @@ func (c *bxbuyerClient) BuyerList(ctx context.Context, in *BuyerListReq, opts ..
 	return out, nil
 	return out, nil
 }
 }
 
 
+func (c *bxbuyerClient) BuyerSupplyInfo(ctx context.Context, in *BuyerSupplyInfoReq, opts ...grpc.CallOption) (*BuyerSupplyResp, error) {
+	out := new(BuyerSupplyResp)
+	err := c.cc.Invoke(ctx, "/bxbuyer.Bxbuyer/BuyerSupplyInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *bxbuyerClient) RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error) {
 func (c *bxbuyerClient) RelatesInfo(ctx context.Context, in *RelatesInformationReq, opts ...grpc.CallOption) (*RelatesInformationResp, error) {
 	out := new(RelatesInformationResp)
 	out := new(RelatesInformationResp)
 	err := c.cc.Invoke(ctx, "/bxbuyer.Bxbuyer/RelatesInfo", in, out, opts...)
 	err := c.cc.Invoke(ctx, "/bxbuyer.Bxbuyer/RelatesInfo", in, out, opts...)
@@ -60,6 +71,8 @@ func (c *bxbuyerClient) RelatesInfo(ctx context.Context, in *RelatesInformationR
 type BxbuyerServer interface {
 type BxbuyerServer interface {
 	//采购单位搜索
 	//采购单位搜索
 	BuyerList(context.Context, *BuyerListReq) (*BuyerListResp, error)
 	BuyerList(context.Context, *BuyerListReq) (*BuyerListResp, error)
+	// 采购单位搜索补充信息 招标动态数量 、历史联系人数量、项目数量、采购规模
+	BuyerSupplyInfo(context.Context, *BuyerSupplyInfoReq) (*BuyerSupplyResp, error)
 	//采购单位画像 关联信息
 	//采购单位画像 关联信息
 	RelatesInfo(context.Context, *RelatesInformationReq) (*RelatesInformationResp, error)
 	RelatesInfo(context.Context, *RelatesInformationReq) (*RelatesInformationResp, error)
 	mustEmbedUnimplementedBxbuyerServer()
 	mustEmbedUnimplementedBxbuyerServer()
@@ -72,6 +85,9 @@ type UnimplementedBxbuyerServer struct {
 func (UnimplementedBxbuyerServer) BuyerList(context.Context, *BuyerListReq) (*BuyerListResp, error) {
 func (UnimplementedBxbuyerServer) BuyerList(context.Context, *BuyerListReq) (*BuyerListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method BuyerList not implemented")
 	return nil, status.Errorf(codes.Unimplemented, "method BuyerList not implemented")
 }
 }
+func (UnimplementedBxbuyerServer) BuyerSupplyInfo(context.Context, *BuyerSupplyInfoReq) (*BuyerSupplyResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method BuyerSupplyInfo not implemented")
+}
 func (UnimplementedBxbuyerServer) RelatesInfo(context.Context, *RelatesInformationReq) (*RelatesInformationResp, error) {
 func (UnimplementedBxbuyerServer) RelatesInfo(context.Context, *RelatesInformationReq) (*RelatesInformationResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method RelatesInfo not implemented")
 	return nil, status.Errorf(codes.Unimplemented, "method RelatesInfo not implemented")
 }
 }
@@ -106,6 +122,24 @@ func _Bxbuyer_BuyerList_Handler(srv interface{}, ctx context.Context, dec func(i
 	return interceptor(ctx, in, info, handler)
 	return interceptor(ctx, in, info, handler)
 }
 }
 
 
+func _Bxbuyer_BuyerSupplyInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(BuyerSupplyInfoReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxbuyerServer).BuyerSupplyInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxbuyer.Bxbuyer/BuyerSupplyInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxbuyerServer).BuyerSupplyInfo(ctx, req.(*BuyerSupplyInfoReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Bxbuyer_RelatesInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 func _Bxbuyer_RelatesInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(RelatesInformationReq)
 	in := new(RelatesInformationReq)
 	if err := dec(in); err != nil {
 	if err := dec(in); err != nil {
@@ -135,6 +169,10 @@ var Bxbuyer_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "BuyerList",
 			MethodName: "BuyerList",
 			Handler:    _Bxbuyer_BuyerList_Handler,
 			Handler:    _Bxbuyer_BuyerList_Handler,
 		},
 		},
+		{
+			MethodName: "BuyerSupplyInfo",
+			Handler:    _Bxbuyer_BuyerSupplyInfo_Handler,
+		},
 		{
 		{
 			MethodName: "RelatesInfo",
 			MethodName: "RelatesInfo",
 			Handler:    _Bxbuyer_RelatesInfo_Handler,
 			Handler:    _Bxbuyer_RelatesInfo_Handler,