Explorar el Código

feat:历史客户

wangshan hace 3 años
padre
commit
d09d018694

+ 1 - 0
jyBXBuyer/api/bxbuyer.api

@@ -22,6 +22,7 @@ type (
 		UserId         string   `header:"userId"`                //用户id
 		EntId          string   `header:"entId"`                 //企业id
 		EntUserId      string   `header:"entUserId"`             //商机管理企业用户id
+		Customer       []string `json:"customer,optional"`       //历史客户
 		//SortRule       int64    `json:"sortRule"`       //排序规则
 		//PageNum        int64    `json:"pageNum"`        //当前页码
 		//PageSize       int64    `json:"pageSize"`       //每页数据量

+ 1 - 0
jyBXBuyer/api/internal/logic/searchListLogic.go

@@ -48,6 +48,7 @@ func (l *SearchListLogic) SearchList(req *types.BuyerListReq) (resp *types.Commo
 		UserId:         l.r.Header.Get("userId"),
 		EntId:          req.EntId,
 		EntUserId:      req.EntUserId,
+		Customer:       req.Customer,
 	})
 	if err0 != nil {
 		return &types.CommonResp{

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

@@ -15,6 +15,7 @@ type BuyerListReq struct {
 	UserId         string   `header:"userId"`                //用户id
 	EntId          string   `header:"entId"`                 //企业id
 	EntUserId      string   `header:"entUserId"`             //商机管理企业用户id
+	Customer       []string `json:"customer,optional"`       //历史客户
 }
 
 type CommonResp struct {

+ 1 - 0
jyBXBuyer/rpc/bxbuyer.proto

@@ -21,6 +21,7 @@ message BuyerListReq {
   string  platform = 15;//请求平台
   string entId = 16;//企业id
   string entUserId = 17;//商机管理用户id
+  repeated string  customer = 18;//历史客户
 }
 
 message BuyerListResp {

+ 12 - 1
jyBXBuyer/rpc/model/buyerListBYEs.go

@@ -62,6 +62,17 @@ func BuyerListQuery(in *bxbuyer.BuyerListReq) (qstr string) {
 	if len(industry) > 0 {
 		musts = append(musts, fmt.Sprintf(query_bool_must, "subscopeclass", `"`+strings.Join(industry, `","`)+`"`))
 	}
+	if len(in.Customer) > 0 {
+		entcustomerClass := `{"terms":{"buyer":[`
+		for k, v := range in.Customer {
+			if k > 0 {
+				entcustomerClass += `,`
+			}
+			entcustomerClass += `"` + v + `"`
+		}
+		entcustomerClass += `]}}`
+		musts = append(musts, entcustomerClass)
+	}
 	//业务范围
 	boolsNum := 0
 	if in.BusinessScope != "" {
@@ -309,7 +320,7 @@ func IsReceived(buyerNames []string, entUserId string) (isRws map[string]bool) {
 
 //是否为空请求
 func CheckEmpty(in *bxbuyer.BuyerListReq) bool {
-	if in.BuyerName == "" && len(in.BuyerClass) == 0 && len(in.Province) == 0 && len(in.City) == 0 && len(in.Industry) == 0 && in.BusinessScope == "" {
+	if in.BuyerName == "" && len(in.BuyerClass) == 0 && len(in.Province) == 0 && len(in.City) == 0 && len(in.Industry) == 0 && in.BusinessScope == "" && len(in.Customer) == 0 {
 		return true
 	}
 	return false

+ 41 - 31
jyBXBuyer/rpc/type/bxbuyer/bxbuyer.pb.go

@@ -47,6 +47,7 @@ type BuyerListReq struct {
 	Platform       string   `protobuf:"bytes,15,opt,name=platform,proto3" json:"platform,omitempty"`   //请求平台
 	EntId          string   `protobuf:"bytes,16,opt,name=entId,proto3" json:"entId,omitempty"`         //企业id
 	EntUserId      string   `protobuf:"bytes,17,opt,name=entUserId,proto3" json:"entUserId,omitempty"` //商机管理用户id
+	Customer       []string `protobuf:"bytes,18,rep,name=customer,proto3" json:"customer,omitempty"`   //历史客户
 }
 
 func (x *BuyerListReq) Reset() {
@@ -200,6 +201,13 @@ func (x *BuyerListReq) GetEntUserId() string {
 	return ""
 }
 
+func (x *BuyerListReq) GetCustomer() []string {
+	if x != nil {
+		return x.Customer
+	}
+	return nil
+}
+
 type BuyerListResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -417,7 +425,7 @@ var File_bxbuyer_proto protoreflect.FileDescriptor
 
 var file_bxbuyer_proto_rawDesc = []byte{
 	0x0a, 0x0d, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
-	0x07, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x22, 0xf8, 0x03, 0x0a, 0x0c, 0x42, 0x75, 0x79,
+	0x07, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x22, 0x94, 0x04, 0x0a, 0x0c, 0x42, 0x75, 0x79,
 	0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 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,
 	0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
@@ -449,36 +457,38 @@ var file_bxbuyer_proto_rawDesc = []byte{
 	0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
 	0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
 	0x49, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
-	0x72, 0x49, 0x64, 0x22, 0x6b, 0x0a, 0x0d, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
-	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, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72,
-	0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
-	0x22, 0x49, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a,
-	0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f,
-	0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65,
-	0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xc1, 0x01, 0x0a, 0x09,
-	0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79,
-	0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12,
-	0x16, 0x0a, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52,
-	0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69,
-	0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69,
-	0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x43, 0x6f, 0x75, 0x6e,
-	0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
-	0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x18, 0x06, 0x20,
-	0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x12,
-	0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x07, 0x20,
-	0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x32,
-	0x45, 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, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x75,
-	0x79, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x18,
+	0x12, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x22,
+	0x6b, 0x0a, 0x0d, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 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, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79,
+	0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x49, 0x0a, 0x09,
+	0x42, 0x75, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75,
+	0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12,
+	0x26, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
+	0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xc1, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65,
+	0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62,
+	0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x62, 0x75, 0x64,
+	0x67, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12,
+	0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
+	0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69,
+	0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52,
+	0x0a, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69,
+	0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
+	0x0a, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x32, 0x45, 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, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (