duxin пре 2 година
родитељ
комит
ab75e835f1

+ 7 - 7
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -266,18 +266,18 @@ message DeriveRes{
 }
 message Derive{
   string  _id = 1;
-  string  region = 2;
-  string  area = 3;
+  repeated string  region = 2;
+  repeated string  area = 3;
   string  maxprice = 4;
-  string  winner = 6;
-  string  industry = 7;
+  repeated string  winner = 6;
+  repeated string  industry = 7;
   string  minprice = 8;
-  string  buyer = 9;
-  string  buyerclass = 10;
+  repeated string  buyer = 9;
+  repeated string  buyerclass = 10;
   repeated keyWord  keywords = 11;
   string  selectType = 12;
   string  subtype = 13;
-  string  city = 14;
+  repeated string  city = 14;
 }
 message keyWord{
   string keyword = 1;

+ 0 - 147
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -1,147 +0,0 @@
-// Code generated by goctl. DO NOT EDIT!
-// Source: bxsubscribe.proto
-
-package bxsubscribe
-
-import (
-	"context"
-
-	"jyBXSubscribe/rpc/type/bxsubscribe"
-
-	"github.com/zeromicro/go-zero/zrpc"
-	"google.golang.org/grpc"
-)
-
-type (
-	ByPushHistoryResp      = bxsubscribe.ByPushHistoryResp
-	CityList               = bxsubscribe.CityList
-	Derive                 = bxsubscribe.Derive
-	DeriveReq              = bxsubscribe.DeriveReq
-	DeriveRes              = bxsubscribe.DeriveRes
-	DistributorResp        = bxsubscribe.DistributorResp
-	GetDistributorReq      = bxsubscribe.GetDistributorReq
-	GetKeyReq              = bxsubscribe.GetKeyReq
-	GetViewStatusReq       = bxsubscribe.GetViewStatusReq
-	Items                  = bxsubscribe.Items
-	Key                    = bxsubscribe.Key
-	KeyItems               = bxsubscribe.KeyItems
-	KeyResp                = bxsubscribe.KeyResp
-	KeyWord                = bxsubscribe.KeyWord
-	Keys                   = bxsubscribe.Keys
-	MsgDistributorReq      = bxsubscribe.MsgDistributorReq
-	SetReadReq             = bxsubscribe.SetReadReq
-	SomeInfo               = bxsubscribe.SomeInfo
-	SomeInfoReq            = bxsubscribe.SomeInfoReq
-	SomeInfoResp           = bxsubscribe.SomeInfoResp
-	StatusResp             = bxsubscribe.StatusResp
-	SubscribeData          = bxsubscribe.SubscribeData
-	SubscribeInfo          = bxsubscribe.SubscribeInfo
-	SubscribeInfosReq      = bxsubscribe.SubscribeInfosReq
-	SubscribeInfosResp     = bxsubscribe.SubscribeInfosResp
-	UpdateSubScribeInfoReq = bxsubscribe.UpdateSubScribeInfoReq
-	UserResp               = bxsubscribe.UserResp
-	UserStatus             = bxsubscribe.UserStatus
-	ViewStatusResp         = bxsubscribe.ViewStatusResp
-	WinnerInfo             = bxsubscribe.WinnerInfo
-
-	Bxsubscribe 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)
-		// 信息分发
-		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)
-		// 自动数据导出筛选条件查询
-		DeriveShow(ctx context.Context, in *DeriveReq, opts ...grpc.CallOption) (*DeriveRes, error)
-		// 删除自动数据导出筛选条件
-		DeriveDel(ctx context.Context, in *DeriveReq, opts ...grpc.CallOption) (*StatusResp, error)
-	}
-
-	defaultBxsubscribe struct {
-		cli zrpc.Client
-	}
-)
-
-func NewBxsubscribe(cli zrpc.Client) Bxsubscribe {
-	return &defaultBxsubscribe{
-		cli: cli,
-	}
-}
-
-// 获取订阅推送列表
-func (m *defaultBxsubscribe) GetSubList(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*SubscribeInfosResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.GetSubList(ctx, in, opts...)
-}
-
-// 获取订阅推送相关信息
-func (m *defaultBxsubscribe) GetSubSomeInfo(ctx context.Context, in *SomeInfoReq, opts ...grpc.CallOption) (*SomeInfoResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.GetSubSomeInfo(ctx, in, opts...)
-}
-
-// 修改订阅信息接口
-func (m *defaultBxsubscribe) UpdateSubScribeInfo(ctx context.Context, in *UpdateSubScribeInfoReq, opts ...grpc.CallOption) (*StatusResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.UpdateSubScribeInfo(ctx, in, opts...)
-}
-
-// 推送页面筛选导出
-func (m *defaultBxsubscribe) ByPushHistory(ctx context.Context, in *SubscribeInfosReq, opts ...grpc.CallOption) (*ByPushHistoryResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.ByPushHistory(ctx, in, opts...)
-}
-
-// 推送数据浏览状态修改
-func (m *defaultBxsubscribe) SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.SetRead(ctx, in, opts...)
-}
-
-// 关键词获取
-func (m *defaultBxsubscribe) GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.GetKey(ctx, in, opts...)
-}
-
-// 信息分发
-func (m *defaultBxsubscribe) MsgDistributor(ctx context.Context, in *MsgDistributorReq, opts ...grpc.CallOption) (*StatusResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.MsgDistributor(ctx, in, opts...)
-}
-
-// 手动分发人员查询
-func (m *defaultBxsubscribe) GetDistributor(ctx context.Context, in *GetDistributorReq, opts ...grpc.CallOption) (*DistributorResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.GetDistributor(ctx, in, opts...)
-}
-
-// 查看状态
-func (m *defaultBxsubscribe) GetViewStatus(ctx context.Context, in *GetViewStatusReq, opts ...grpc.CallOption) (*ViewStatusResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.GetViewStatus(ctx, in, opts...)
-}
-
-// 自动数据导出筛选条件查询
-func (m *defaultBxsubscribe) DeriveShow(ctx context.Context, in *DeriveReq, opts ...grpc.CallOption) (*DeriveRes, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.DeriveShow(ctx, in, opts...)
-}
-
-// 删除自动数据导出筛选条件
-func (m *defaultBxsubscribe) DeriveDel(ctx context.Context, in *DeriveReq, opts ...grpc.CallOption) (*StatusResp, error) {
-	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
-	return client.DeriveDel(ctx, in, opts...)
-}

+ 20 - 10
jyBXSubscribe/rpc/model/derivedFiltering.go

@@ -17,31 +17,41 @@ func ScreeningList(userid string) *bxsubscribe.DeriveRes {
 	allData, ok := IC.Mgo.Find("export_search", qy, "comeintime desc", "", false, -1, -1)
 	if ok && allData != nil && len(*allData) > 0 {
 		for _, v := range *allData {
+			region, _ := v["region"].([]interface{})
+			area, _ := v["area"].([]interface{})
+			winner, _ := v["winner"].([]interface{})
+			industry, _ := v["industry"].([]interface{})
+			buyer, _ := v["buyer"].([]interface{})
+			buyerclass, _ := v["buyerclass"].([]interface{})
+			city, _ := v["city"].([]interface{})
 			dataOne := bxsubscribe.Derive{
 				XId:        encrypt.SE.Encode2Hex(common.InterfaceToStr(v["_id"])),
-				Region:     common.InterfaceToStr(v["region"]),
-				Area:       common.InterfaceToStr(v["area"]),
+				Region:     common.ObjArrToStringArr(region),
+				Area:       common.ObjArrToStringArr(area),
 				Maxprice:   common.InterfaceToStr(v["maxprice"]),
-				Winner:     common.InterfaceToStr(v["winner"]),
-				Industry:   common.InterfaceToStr(v["industry"]),
+				Winner:     common.ObjArrToStringArr(winner),
+				Industry:   common.ObjArrToStringArr(industry),
 				Minprice:   common.InterfaceToStr(v["minprice"]),
-				Buyer:      common.InterfaceToStr(v["buyer"]),
-				Buyerclass: common.InterfaceToStr(v["buyerclass"]),
+				Buyer:      common.ObjArrToStringArr(buyer),
+				Buyerclass: common.ObjArrToStringArr(buyerclass),
 				SelectType: common.InterfaceToStr(v["selectType"]),
 				Subtype:    common.InterfaceToStr(v["subtype"]),
-				City:       common.InterfaceToStr(v["city"]),
+				City:       common.ObjArrToStringArr(city),
 			}
-			keyWord, _ := v["keywords"].([]map[string]interface{})
+			keyWord1, _ := v["keywords"].([]interface{})
+			keyWord := common.ObjArrToMapArr(keyWord1)
 			var keys []*bxsubscribe.KeyWord
 			for _, v1 := range keyWord {
 				key := bxsubscribe.KeyWord{
 					Keyword: common.InterfaceToStr(v1["keyword"]),
 				}
-				appended, _ := v1["appended"].([]string)
+				appended1, _ := v1["appended"].([]interface{})
+				appended := common.ObjArrToStringArr(appended1)
 				if len(appended) > 0 {
 					key.Appended = appended
 				}
-				exclude, _ := v1["exclude"].([]string)
+				exclude1, _ := v1["exclude"].([]interface{})
+				exclude := common.ObjArrToStringArr(exclude1)
 				if len(exclude) > 0 {
 					key.Exclude = exclude
 				}

+ 28 - 28
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -2538,18 +2538,18 @@ type Derive struct {
 	unknownFields protoimpl.UnknownFields
 
 	XId        string     `protobuf:"bytes,1,opt,name=_id,json=Id,proto3" json:"_id,omitempty"`
-	Region     string     `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
-	Area       string     `protobuf:"bytes,3,opt,name=area,proto3" json:"area,omitempty"`
+	Region     []string   `protobuf:"bytes,2,rep,name=region,proto3" json:"region,omitempty"`
+	Area       []string   `protobuf:"bytes,3,rep,name=area,proto3" json:"area,omitempty"`
 	Maxprice   string     `protobuf:"bytes,4,opt,name=maxprice,proto3" json:"maxprice,omitempty"`
-	Winner     string     `protobuf:"bytes,6,opt,name=winner,proto3" json:"winner,omitempty"`
-	Industry   string     `protobuf:"bytes,7,opt,name=industry,proto3" json:"industry,omitempty"`
+	Winner     []string   `protobuf:"bytes,6,rep,name=winner,proto3" json:"winner,omitempty"`
+	Industry   []string   `protobuf:"bytes,7,rep,name=industry,proto3" json:"industry,omitempty"`
 	Minprice   string     `protobuf:"bytes,8,opt,name=minprice,proto3" json:"minprice,omitempty"`
-	Buyer      string     `protobuf:"bytes,9,opt,name=buyer,proto3" json:"buyer,omitempty"`
-	Buyerclass string     `protobuf:"bytes,10,opt,name=buyerclass,proto3" json:"buyerclass,omitempty"`
+	Buyer      []string   `protobuf:"bytes,9,rep,name=buyer,proto3" json:"buyer,omitempty"`
+	Buyerclass []string   `protobuf:"bytes,10,rep,name=buyerclass,proto3" json:"buyerclass,omitempty"`
 	Keywords   []*KeyWord `protobuf:"bytes,11,rep,name=keywords,proto3" json:"keywords,omitempty"`
 	SelectType string     `protobuf:"bytes,12,opt,name=selectType,proto3" json:"selectType,omitempty"`
 	Subtype    string     `protobuf:"bytes,13,opt,name=subtype,proto3" json:"subtype,omitempty"`
-	City       string     `protobuf:"bytes,14,opt,name=city,proto3" json:"city,omitempty"`
+	City       []string   `protobuf:"bytes,14,rep,name=city,proto3" json:"city,omitempty"`
 }
 
 func (x *Derive) Reset() {
@@ -2591,18 +2591,18 @@ func (x *Derive) GetXId() string {
 	return ""
 }
 
-func (x *Derive) GetRegion() string {
+func (x *Derive) GetRegion() []string {
 	if x != nil {
 		return x.Region
 	}
-	return ""
+	return nil
 }
 
-func (x *Derive) GetArea() string {
+func (x *Derive) GetArea() []string {
 	if x != nil {
 		return x.Area
 	}
-	return ""
+	return nil
 }
 
 func (x *Derive) GetMaxprice() string {
@@ -2612,18 +2612,18 @@ func (x *Derive) GetMaxprice() string {
 	return ""
 }
 
-func (x *Derive) GetWinner() string {
+func (x *Derive) GetWinner() []string {
 	if x != nil {
 		return x.Winner
 	}
-	return ""
+	return nil
 }
 
-func (x *Derive) GetIndustry() string {
+func (x *Derive) GetIndustry() []string {
 	if x != nil {
 		return x.Industry
 	}
-	return ""
+	return nil
 }
 
 func (x *Derive) GetMinprice() string {
@@ -2633,18 +2633,18 @@ func (x *Derive) GetMinprice() string {
 	return ""
 }
 
-func (x *Derive) GetBuyer() string {
+func (x *Derive) GetBuyer() []string {
 	if x != nil {
 		return x.Buyer
 	}
-	return ""
+	return nil
 }
 
-func (x *Derive) GetBuyerclass() string {
+func (x *Derive) GetBuyerclass() []string {
 	if x != nil {
 		return x.Buyerclass
 	}
-	return ""
+	return nil
 }
 
 func (x *Derive) GetKeywords() []*KeyWord {
@@ -2668,11 +2668,11 @@ func (x *Derive) GetSubtype() string {
 	return ""
 }
 
-func (x *Derive) GetCity() string {
+func (x *Derive) GetCity() []string {
 	if x != nil {
 		return x.City
 	}
-	return ""
+	return nil
 }
 
 type KeyWord struct {
@@ -3087,19 +3087,19 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65,
 	0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe7, 0x02, 0x0a, 0x06, 0x44, 0x65, 0x72, 0x69, 0x76,
 	0x65, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
-	0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
+	0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03,
 	0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72,
-	0x65, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x1a,
+	0x65, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x1a,
 	0x0a, 0x08, 0x6d, 0x61, 0x78, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x08, 0x6d, 0x61, 0x78, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69,
-	0x6e, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e,
+	0x6e, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e,
 	0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x18, 0x07,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x12, 0x1a,
+	0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x12, 0x1a,
 	0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x08, 0x6d, 0x69, 0x6e, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75,
-	0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72,
+	0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72,
 	0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x79, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x0a,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x79, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73,
+	0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x79, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73,
 	0x12, 0x30, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03,
 	0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
 	0x2e, 0x6b, 0x65, 0x79, 0x57, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72,
@@ -3107,7 +3107,7 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x54, 0x79,
 	0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04,
-	0x63, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79,
+	0x63, 0x69, 0x74, 0x79, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79,
 	0x22, 0x59, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x57, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6b,
 	0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65,
 	0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x65,