소스 검색

运营商新增接口

WH01243 7 달 전
부모
커밋
13753aad1e

+ 35 - 2
jyBXCore/api/bxcore.api

@@ -219,7 +219,36 @@ type (
 		PageSize        int64    `json:"pageSize,optional"`        //
 		PageNum         int64    `json:"pageNum,optional"`         //
 	}
-
+	operatorSearchCriteriaReq {
+		EntId      int64 `header:"entId,optional"`
+		Tag        int64 `json:"tag,optional"`
+		PositionId int64 `header:"positionId,optional"` //职位id
+	}
+	operatorSearchReq {
+		EntId        int64  `header:"entId,optional"`
+		Tag          int64  `json:"tag,optional"`
+		AppId        string `header:"appId"`
+		PageNum      int64  `json:"pageNum,optional"`
+		PageSize     int64  `json:"pageSize,optional"`
+		Province     string `json:"province,optional"`
+		City         string `json:"city,optional"`
+		Subtype      string `json:"subtype,optional"`
+		TopType      string `json:"toptype,optional"`
+		PublishTime  string `json:"publishTime,optional"`
+		SelectType   string `json:"selectType,optional"`
+		Price        string `json:"price,optional"`
+		Industry     string `json:"industry,optional"`
+		KeyWords     string `json:"keyWords,optional"`
+		District     string `json:"district,optional"`
+		Tagname      string `json:"tagname,optional"`
+		Tagname1     string `json:"tagname1,optional"`
+		Tagname2     string `json:"tagname2,optional"`
+		WordsMode    int64  `json:"wordsMode,optional"`
+		OpeningTime  string `json:"openingTime,optional"`
+		PurchaseTime string `json:"purchaseTime,optional"`
+		WinnerTag    string `json:"winnerTag,optional"`
+		PositionId   int64  `header:"positionId,optional"` //职位id
+	}
 	mobileHotWordReq {
 		AppId   string `header:"appId"`
 		UserId  string `header:"userId,optional"`
@@ -263,6 +292,10 @@ service bxcore-api {
 	post /jybx/core/property/searchCriteria (commonReq) returns (commonResp)
 	@handler mobileHotWord
 	post /jybx/core/mobileHotWord (mobileHotWordReq) returns (commonResp)
+	@handler operatorSearch
+	post /jybx/core/operatorSearch (operatorSearchReq) returns (commonResp)
+	@handler operatorSearchCriteria
+	post /jybx/core/operatorSearchCriteria (operatorSearchCriteriaReq) returns (commonResp)
 }
 
 //直采-采购信息
@@ -312,4 +345,4 @@ type (
 service bxcore-api {
 	@handler purchaseSearch
 	post /core/purchaseSearch (purSearchReq) returns (commonResp)
-}
+}

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

@@ -98,6 +98,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/core/mobileHotWord",
 				Handler: mobileHotWordHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/operatorSearch",
+				Handler: operatorSearchHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/operatorSearchCriteria",
+				Handler: operatorSearchCriteriaHandler(serverCtx),
+			},
 		},
 	)
 

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

@@ -218,6 +218,38 @@ type ProjectDetailReq struct {
 	PageNum         int64    `json:"pageNum,optional"`         //
 }
 
+type OperatorSearchCriteriaReq struct {
+	EntId      int64 `header:"entId,optional"`
+	Tag        int64 `json:"tag,optional"`
+	PositionId int64 `header:"positionId,optional"` //职位id
+}
+
+type OperatorSearchReq struct {
+	EntId        int64  `header:"entId,optional"`
+	Tag          int64  `json:"tag,optional"`
+	AppId        string `header:"appId"`
+	PageNum      int64  `json:"pageNum,optional"`
+	PageSize     int64  `json:"pageSize,optional"`
+	Province     string `json:"province,optional"`
+	City         string `json:"city,optional"`
+	Subtype      string `json:"subtype,optional"`
+	TopType      string `json:"toptype,optional"`
+	PublishTime  string `json:"publishTime,optional"`
+	SelectType   string `json:"selectType,optional"`
+	Price        string `json:"price,optional"`
+	Industry     string `json:"industry,optional"`
+	KeyWords     string `json:"keyWords,optional"`
+	District     string `json:"district,optional"`
+	Tagname      string `json:"tagname,optional"`
+	Tagname1     string `json:"tagname1,optional"`
+	Tagname2     string `json:"tagname2,optional"`
+	WordsMode    int64  `json:"wordsMode,optional"`
+	OpeningTime  string `json:"openingTime,optional"`
+	PurchaseTime string `json:"purchaseTime,optional"`
+	WinnerTag    string `json:"winnerTag,optional"`
+	PositionId   int64  `header:"positionId,optional"` //职位id
+}
+
 type MobileHotWordReq struct {
 	AppId   string `header:"appId"`
 	UserId  string `header:"userId,optional"`
@@ -257,7 +289,7 @@ type PurSearchReq struct {
 	FileExists       int64  `json:"fileExists,optional"`               //附件
 	Publisher        int64  `json:"publisher,optional"`                //发布者:可选:全部、用户发布:1、平台发布:2。
 	KeyWords         string `json:"keyWords,optional"`                 //关键词
-	AdditionalWords  string `json:"additionalWords,optional"`          // 附加词
+	AdditionalWords  string `json:"additionalWords,optional"`          //附加词
 	SearchMode       int64  `json:"searchMode,optional"`               //搜索模式:0:精准搜索;1:模糊搜索
 	WordsMode        int64  `json:"wordsMode,optional"`                //搜索关键词模式;默认0:包含所有,1:包含任意
 }

+ 3 - 2
jyBXCore/entity/db.go

@@ -19,8 +19,9 @@ type MongoStruct struct {
 }
 
 type Mysql struct {
-	Main *MysqlStruct `json:"main"`
-	Base *MysqlStruct `json:"base"`
+	Main      *MysqlStruct `json:"main"`
+	Base      *MysqlStruct `json:"base"`
+	BiService *MysqlStruct `json:"biService"`
 }
 
 // mysql

+ 39 - 0
jyBXCore/rpc/bxcore.proto

@@ -727,6 +727,41 @@ message  PurchaseList {
   string originalTitle = 25;//原标题
   int64 isNew = 26; //是否是新的网站来源 is_yg_new==1
 }
+message OperatorSearchCriteriaReq{
+  int64 entId = 1;
+  int64 tag=2;
+  int64 positionId=3;
+}
+message OperatorSearchReq{
+  int64  entId = 1;//企业id 没有企业 企业id=0
+  int64  pageNum =2;//当前页码
+  int64  pageSize = 3;//每页数量
+  string  province = 4;//省份
+  string  city = 5;//城市
+  string  subtype = 6;//信息类型-二级
+  string  topType = 7;//信息类型-一级分类
+  string  publishTime = 8;//发布时间
+  string selectType = 9;//搜索范围:标题;正文等
+  string  price = 10;//价格
+  string industry = 11;//行业
+  int64 searchMode = 12;//搜索模式:0:精准搜索;1:模糊搜索
+  int64 wordsMode = 13;//搜索关键词模式;默认0:包含所有,1:包含任意
+  string keyWords = 14;//关键词:多个空格隔开(主)
+  string  district = 15;//区县
+  string  tagname=16;
+  string  tagname1=17;
+  string  tagname2=18;
+  int64   tag=19;
+  string openingTime=20;
+  string purchaseTime=21;
+  string winnerTag=22;
+  int64 positionId=23;
+}
+message  OperatorSearchResp{
+  int64 error_code = 1;
+  string error_msg = 2;
+  bytes data = 3;
+}
 //
 service BxCore {
   //标讯搜索结果列表数据
@@ -763,4 +798,8 @@ service BxCore {
   rpc SearchHotKey(HotKeysReq)returns(HotKeysRes);
   //采购信息搜索
   rpc PurchaseSearch(PurchaseReq)returns(PurchaseResp);
+  //运营商搜索条件
+  rpc OperatorSearchCriteria(OperatorSearchCriteriaReq)returns(OperatorSearchResp);
+  //运营商搜索
+  rpc OperatorSearch(OperatorSearchReq)returns(OperatorSearchResp);
 }

+ 98 - 57
jyBXCore/rpc/bxcoreclient/bxcore.go

@@ -13,63 +13,72 @@ import (
 )
 
 type (
-	BI                       = bxcore.BI
-	BidTypeReq               = bxcore.BidTypeReq
-	DetailData               = bxcore.DetailData
-	DetailDataRes            = bxcore.DetailDataRes
-	MenuList                 = bxcore.MenuList
-	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
-	PolymerizeSearchReq      = bxcore.PolymerizeSearchReq
-	PolymerizeSearchResp     = bxcore.PolymerizeSearchResp
-	ProjectDetailData        = bxcore.ProjectDetailData
-	ProjectDetailsReq        = bxcore.ProjectDetailsReq
-	ProjectStatisticsData    = bxcore.ProjectStatisticsData
-	ProjectStatisticsDataRes = bxcore.ProjectStatisticsDataRes
-	PushStatisticsData       = bxcore.PushStatisticsData
-	PushStatisticsDataRes    = bxcore.PushStatisticsDataRes
-	RemindRuleReq            = bxcore.RemindRuleReq
-	Search                   = bxcore.Search
-	SearchCriteriaRes        = bxcore.SearchCriteriaRes
-	SearchData               = bxcore.SearchData
-	SearchLimitReq           = bxcore.SearchLimitReq
-	SearchLimitResp          = bxcore.SearchLimitResp
-	SearchList               = bxcore.SearchList
-	SearchMap                = bxcore.SearchMap
-	SearchReq                = bxcore.SearchReq
-	SearchResp               = bxcore.SearchResp
-	SearchReturn             = bxcore.SearchReturn
-	ShowInfo                 = bxcore.ShowInfo
-	SourceItem               = bxcore.SourceItem
-	StageValue               = bxcore.StageValue
-	StatisticsListReq        = bxcore.StatisticsListReq
-	TipInfo                  = bxcore.TipInfo
-	UpdateBidStatusReq       = bxcore.UpdateBidStatusReq
-	UpdateBidStatusRes       = bxcore.UpdateBidStatusRes
-	WinnerInfo               = bxcore.WinnerInfo
+	BI                        = bxcore.BI
+	BidTypeReq                = bxcore.BidTypeReq
+	DetailData                = bxcore.DetailData
+	DetailDataRes             = bxcore.DetailDataRes
+	HotKeysReq                = bxcore.HotKeysReq
+	HotKeysRes                = bxcore.HotKeysRes
+	MenuList                  = bxcore.MenuList
+	OperatorSearchCriteriaReq = bxcore.OperatorSearchCriteriaReq
+	OperatorSearchReq         = bxcore.OperatorSearchReq
+	OperatorSearchResp        = bxcore.OperatorSearchResp
+	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
+	PolymerizeSearchReq       = bxcore.PolymerizeSearchReq
+	PolymerizeSearchResp      = bxcore.PolymerizeSearchResp
+	ProjectDetailData         = bxcore.ProjectDetailData
+	ProjectDetailsReq         = bxcore.ProjectDetailsReq
+	ProjectStatisticsData     = bxcore.ProjectStatisticsData
+	ProjectStatisticsDataRes  = bxcore.ProjectStatisticsDataRes
+	PurchaseData              = bxcore.PurchaseData
+	PurchaseList              = bxcore.PurchaseList
+	PurchaseReq               = bxcore.PurchaseReq
+	PurchaseResp              = bxcore.PurchaseResp
+	PushStatisticsData        = bxcore.PushStatisticsData
+	PushStatisticsDataRes     = bxcore.PushStatisticsDataRes
+	RemindRuleReq             = bxcore.RemindRuleReq
+	Search                    = bxcore.Search
+	SearchCriteriaRes         = bxcore.SearchCriteriaRes
+	SearchData                = bxcore.SearchData
+	SearchLimitReq            = bxcore.SearchLimitReq
+	SearchLimitResp           = bxcore.SearchLimitResp
+	SearchList                = bxcore.SearchList
+	SearchMap                 = bxcore.SearchMap
+	SearchReq                 = bxcore.SearchReq
+	SearchResp                = bxcore.SearchResp
+	SearchReturn              = bxcore.SearchReturn
+	ShowInfo                  = bxcore.ShowInfo
+	SourceItem                = bxcore.SourceItem
+	StageValue                = bxcore.StageValue
+	StatisticsListReq         = bxcore.StatisticsListReq
+	TipInfo                   = bxcore.TipInfo
+	UpdateBidStatusReq        = bxcore.UpdateBidStatusReq
+	UpdateBidStatusRes        = bxcore.UpdateBidStatusRes
+	WinnerInfo                = bxcore.WinnerInfo
 
 	BxCore interface {
 		// 标讯搜索结果列表数据
@@ -102,6 +111,14 @@ type (
 		PolymerizeSearch(ctx context.Context, in *PolymerizeSearchReq, opts ...grpc.CallOption) (*PolymerizeSearchResp, error)
 		ProjectDetails(ctx context.Context, in *ProjectDetailsReq, opts ...grpc.CallOption) (*DetailDataRes, error)
 		PropertySearchCriteria(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchCriteriaRes, error)
+		// 热搜词
+		SearchHotKey(ctx context.Context, in *HotKeysReq, opts ...grpc.CallOption) (*HotKeysRes, error)
+		// 采购信息搜索
+		PurchaseSearch(ctx context.Context, in *PurchaseReq, opts ...grpc.CallOption) (*PurchaseResp, error)
+		// 运营商搜索条件
+		OperatorSearchCriteria(ctx context.Context, in *OperatorSearchCriteriaReq, opts ...grpc.CallOption) (*OperatorSearchResp, error)
+		// 运营商搜索
+		OperatorSearch(ctx context.Context, in *OperatorSearchReq, opts ...grpc.CallOption) (*OperatorSearchResp, error)
 	}
 
 	defaultBxCore struct {
@@ -208,3 +225,27 @@ func (m *defaultBxCore) PropertySearchCriteria(ctx context.Context, in *SearchRe
 	client := bxcore.NewBxCoreClient(m.cli.Conn())
 	return client.PropertySearchCriteria(ctx, in, opts...)
 }
+
+// 热搜词
+func (m *defaultBxCore) SearchHotKey(ctx context.Context, in *HotKeysReq, opts ...grpc.CallOption) (*HotKeysRes, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.SearchHotKey(ctx, in, opts...)
+}
+
+// 采购信息搜索
+func (m *defaultBxCore) PurchaseSearch(ctx context.Context, in *PurchaseReq, opts ...grpc.CallOption) (*PurchaseResp, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.PurchaseSearch(ctx, in, opts...)
+}
+
+// 运营商搜索条件
+func (m *defaultBxCore) OperatorSearchCriteria(ctx context.Context, in *OperatorSearchCriteriaReq, opts ...grpc.CallOption) (*OperatorSearchResp, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.OperatorSearchCriteria(ctx, in, opts...)
+}
+
+// 运营商搜索
+func (m *defaultBxCore) OperatorSearch(ctx context.Context, in *OperatorSearchReq, opts ...grpc.CallOption) (*OperatorSearchResp, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.OperatorSearch(ctx, in, opts...)
+}

+ 7 - 0
jyBXCore/rpc/etc/db.yaml

@@ -13,6 +13,13 @@ mysql:
         password: =PDT49#80Z!RVv52_z
         maxOpenConns: 5
         maxIdleConns: 5
+    biService:
+        dbName: bi_service
+        address: 192.168.3.217:4000
+        userName: root
+        password: =PDT49#80Z!RVv52_z
+        maxOpenConns: 5
+        maxIdleConns: 5
 redis:
     addr:
         - other=192.168.3.149:1712

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

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

+ 3 - 1
jyBXCore/rpc/internal/logic/getsearchlistlogic.go

@@ -57,7 +57,7 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 		// 搜索范围只允许筛选 标题和正文 其他的过滤掉
 		var selectType []string
 		selectTypeSplit := strings.Split(in.SelectType, ",")
-		// 未登录用户只能搜标题和正文
+		// 未登录用户只能搜标题和正文Spli
 		for i := 0; i < len(selectTypeSplit); i++ {
 			if selectTypeSplit[i] == "title" || selectTypeSplit[i] == "content" {
 				selectType = append(selectType, selectTypeSplit[i])
@@ -191,6 +191,8 @@ func (l *GetSearchListLogic) GetSearchList(in *bxcore.SearchReq) (*bxcore.Search
 			log.Println("2查询耗时:", time.Since(t2))
 		}
 		// 精准模式不足50条的非空标讯查询 匹配模糊查询数
+		ikWords := util.HttpEs(in.KeyWords, "ik_smart", IC.DB.Es.Addr)
+		log.Println(ikWords)
 		if res.Count < IC.C.PaySearchLimit.PrecisionNum && in.SearchMode == 0 && in.KeyWords != "" {
 			ks.SearchParamsHandle(nin, isWhite)
 			res.BCount = service.GetBidSearchCount(nin)

+ 36 - 0
jyBXCore/rpc/internal/logic/operatorsearchcriterialogic.go

@@ -0,0 +1,36 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/service"
+	"context"
+	"encoding/json"
+
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type OperatorSearchCriteriaLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewOperatorSearchCriteriaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OperatorSearchCriteriaLogic {
+	return &OperatorSearchCriteriaLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 运营商搜索条件
+func (l *OperatorSearchCriteriaLogic) OperatorSearchCriteria(in *bxcore.OperatorSearchCriteriaReq) (*bxcore.OperatorSearchResp, error) {
+	// todo: add your logic here and delete this line
+	data := service.GetCriteria(in.EntId, in.PositionId)
+	infoByte, _ := json.Marshal(data)
+	return &bxcore.OperatorSearchResp{
+		Data: infoByte,
+	}, nil
+}

+ 63 - 0
jyBXCore/rpc/internal/logic/operatorsearchlogic.go

@@ -0,0 +1,63 @@
+package logic
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/service"
+	"context"
+	"encoding/json"
+
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/type/bxcore"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type OperatorSearchLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewOperatorSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OperatorSearchLogic {
+	return &OperatorSearchLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 运营商搜索
+func (l *OperatorSearchLogic) OperatorSearch(in *bxcore.OperatorSearchReq) (*bxcore.OperatorSearchResp, error) {
+	// todo: add your logic here and delete this line
+	operator := service.Operator{
+		EntId:        in.EntId,
+		Tag:          in.Tag,
+		PageNum:      in.PageNum,
+		PageSize:     in.PageSize,
+		Province:     in.Province,
+		City:         in.City,
+		District:     in.District,
+		Subtype:      in.Subtype,
+		TopType:      in.TopType,
+		PublishTime:  in.PublishTime,
+		SelectType:   in.SelectType,
+		Price:        in.Price,
+		Tagname:      in.Tagname,
+		Tagname1:     in.Tagname1,
+		Tagname2:     in.Tagname2,
+		WordsMode:    in.WordsMode,
+		KeyWords:     in.KeyWords,
+		PurchaseTime: in.PurchaseTime,
+		OpeningTime:  in.OpeningTime,
+		WinnerTag:    in.WinnerTag,
+		PositionId:   in.PositionId,
+	}
+	count, data := service.SearchList(operator)
+	result := map[string]interface{}{
+		"Data":  data,
+		"Count": count,
+	}
+	infoByte, _ := json.Marshal(result)
+	return &bxcore.OperatorSearchResp{
+		Data: infoByte,
+	}, nil
+}

+ 22 - 10
jyBXCore/rpc/internal/server/bxcoreserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: bxcore.proto
 
 package server
@@ -34,55 +34,55 @@ func (s *BxCoreServer) SearchLimit(ctx context.Context, in *bxcore.SearchLimitRe
 	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)
@@ -127,3 +127,15 @@ func (s *BxCoreServer) PurchaseSearch(ctx context.Context, in *bxcore.PurchaseRe
 	l := logic.NewPurchaseSearchLogic(ctx, s.svcCtx)
 	return l.PurchaseSearch(in)
 }
+
+// 运营商搜索条件
+func (s *BxCoreServer) OperatorSearchCriteria(ctx context.Context, in *bxcore.OperatorSearchCriteriaReq) (*bxcore.OperatorSearchResp, error) {
+	l := logic.NewOperatorSearchCriteriaLogic(ctx, s.svcCtx)
+	return l.OperatorSearchCriteria(in)
+}
+
+// 运营商搜索
+func (s *BxCoreServer) OperatorSearch(ctx context.Context, in *bxcore.OperatorSearchReq) (*bxcore.OperatorSearchResp, error) {
+	l := logic.NewOperatorSearchLogic(ctx, s.svcCtx)
+	return l.OperatorSearch(in)
+}

+ 765 - 0
jyBXCore/rpc/service/operator.go

@@ -0,0 +1,765 @@
+package service
+
+import (
+	elastic "app.yhyue.com/moapp/jybase/es"
+	IC "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/init"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"log"
+	"strings"
+)
+
+var (
+	yysIndex = "bidding_customer_v1"
+	yysType  = "bidding_customer_v1"
+)
+
+func GetCriteria(entId, positionId int64) map[int]interface{} {
+	result := map[int]interface{}{}
+	//for i := 0; i < 1; i++ {
+	for i := 0; i < 3; i++ {
+		result[i] = getGetCriteriaType(entId, positionId, int64(i))
+	}
+	return result
+}
+func getGetCriteriaType(entId, positionId, tag int64) []map[string]interface{} {
+	data := []map[string]interface{}{}
+	if tag == 1 {
+		data = append(data, map[string]interface{}{
+			"key":        "purchaseTime",
+			"type":       "dateTimeList",
+			"label":      "预计采购时间",
+			"defaultVal": []string{},
+			"props": map[string]interface{}{
+				"multiple": false,
+			},
+			"options": []map[string]interface{}{
+				{
+					"label": "全部", "value": "",
+				},
+				{
+					"label": "本月", "value": "thisMonth",
+				},
+				{
+					"label": "下月", "value": "nextMonth",
+				},
+				{
+					"label": "自定义", "value": "exact",
+				},
+			},
+		})
+	} else {
+		data = append(data, map[string]interface{}{
+			"key":        "openingTime",
+			"type":       "dateTimeList",
+			"label":      "开标日期",
+			"defaultVal": []string{},
+			"props": map[string]interface{}{
+				"multiple": false,
+			},
+			"options": []map[string]interface{}{
+				{
+					"label": "全部", "value": "",
+				},
+				{
+					"label": "本周", "value": "thisWeek",
+				},
+				{
+					"label": "下周", "value": "nextWeek",
+				},
+				{
+					"label": "本月", "value": "thisMonth",
+				},
+				{
+					"label": "自定义", "value": "exact",
+				},
+			},
+		})
+	}
+	//私有标签处理
+	getlalArr := getLabel(entId)
+	if len(getlalArr) > 0 {
+		data = append(data, getlalArr...)
+	}
+	//查询都显示什么数据
+	labelArr := IC.BiMysql.SelectBySql(`SELECT * FROM customer_data_yys_config WHERE ent_id = ? and config_type="筛选条件" and  config_class=? ORDER BY id`, entId, tag)
+	if labelArr != nil && len(*labelArr) > 0 {
+		for _, v := range *labelArr {
+			configName := gconv.String(v["config_name"])
+			switch configName {
+			case "行业":
+				industryArr := getConfiguration("行业", "industry", entId)
+				if len(industryArr) > 0 {
+					data = append(data, map[string]interface{}{
+						"key":        "industry",
+						"type":       "selectList",
+						"label":      "行业",
+						"defaultVal": []string{},
+						"props": map[string]interface{}{
+							"multiple": false,
+						},
+						"options": industryArr,
+					})
+				}
+
+			case "中标人标签":
+				winnerArr := getConfiguration("运营商中标标签", "winner_tag", entId)
+				if len(winnerArr) > 0 {
+					data = append(data, map[string]interface{}{
+						"key":        "winnerTag",
+						"type":       "selectList",
+						"label":      "中标人标签",
+						"defaultVal": []string{},
+						"props": map[string]interface{}{
+							"multiple": false,
+						},
+						"options": winnerArr,
+					})
+				}
+			case "信息类型":
+				//查看是否有二级信息
+				isExist := false
+				for _, v := range *labelArr {
+					configName1 := gconv.String(v["config_name"])
+					if configName1 == "信息类型二级" {
+						isExist = true
+					}
+				}
+				if isExist {
+					data = append(data, map[string]interface{}{
+						"key":            "subtype",
+						"type":           "selectList",
+						"label":          "信息类型",
+						"cascader":       true,
+						"collectionMark": 1,
+						"defaultVal":     "{}",
+						"childLabel":     "信息类型二级",
+						"props": map[string]interface{}{
+							"multiple": false,
+						},
+						"options": []map[string]interface{}{
+							{
+								"label":    "全部",
+								"value":    "",
+								"children": []map[string]interface{}{},
+							},
+							{
+								"label": "预告",
+								"value": "预告",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "预告", "value": "预告"},
+									{"label": "预审", "value": "预审"},
+									{"label": "预审结果", "value": "预审结果"},
+									{"label": "论证意见", "value": "论证意见"},
+									{"label": "需求公示", "value": "需求公示"},
+									{"label": "其它", "value": "其它"},
+								},
+							}, {
+								"label": "招标",
+								"value": "招标",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "变更", "value": "变更"},
+									{"label": "邀标", "value": "邀标"},
+									{"label": "询价", "value": "询价"},
+									{"label": "竞谈", "value": "竞谈"},
+									{"label": "单一", "value": "单一"},
+									{"label": "竞价", "value": "竞价"},
+									{"label": "招标", "value": "招标"},
+									{"label": "其它", "value": "其它"},
+								},
+							}, {
+								"label": "结果",
+								"value": "结果",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "废标", "value": "废标"},
+									{"label": "流标", "value": "流标"},
+									{"label": "结果变更", "value": "结果变更"},
+									{"label": "中标", "value": "中标"},
+									{"label": "成交", "value": "成交"},
+									{"label": "其它", "value": "其它"},
+								},
+							}, {
+								"label": "采购意向",
+								"value": "采购意向",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "采购意向", "value": "采购意向"},
+								},
+							}, {
+								"label": "拟建",
+								"value": "拟建",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "拟建", "value": "拟建"},
+								},
+							}, {
+								"label": "其它",
+								"value": "其它",
+								"children": []map[string]interface{}{
+									{"label": "全部", "value": ""},
+									{"label": "合同", "value": "合同"},
+									{"label": "验收", "value": "验收"},
+									{"label": "违规", "value": "违规"},
+									{"label": "其它", "value": "其它"},
+								},
+							}}})
+				} else {
+					data = append(data, map[string]interface{}{
+						"key":            "subtype",
+						"type":           "selectList",
+						"label":          "信息类型",
+						"cascader":       true,
+						"collectionMark": 1,
+						"defaultVal":     "{}",
+						"props": map[string]interface{}{
+							"multiple": false,
+						},
+						"options": []map[string]interface{}{
+							{
+								"label":    "全部",
+								"value":    "",
+								"children": []map[string]interface{}{},
+							},
+							{
+								"label":    "预告",
+								"value":    "预告",
+								"children": []map[string]interface{}{},
+							}, {
+								"label":    "招标",
+								"value":    "招标",
+								"children": []map[string]interface{}{},
+							}, {
+								"label":    "结果",
+								"value":    "结果",
+								"children": []map[string]interface{}{},
+							}, {
+								"label":    "采购意向",
+								"value":    "采购意向",
+								"children": []map[string]interface{}{},
+							}, {
+								"label":    "拟建",
+								"value":    "拟建",
+								"children": []map[string]interface{}{},
+							}, {
+								"label":    "其它",
+								"value":    "其它",
+								"children": []map[string]interface{}{},
+							}}})
+				}
+
+			case "省份":
+				areaMap := getArea(entId, positionId, labelArr)
+				if areaMap != nil && len(areaMap) != 0 {
+					data = append(data, areaMap)
+				}
+			}
+		}
+	}
+	return data
+}
+func getConfiguration(conditionName, conditionType string, entId int64) []map[string]interface{} {
+	data := IC.BiMysql.SelectBySql(`SELECT
+					DISTINCT b.name,b.code
+				FROM
+					customer_data_yys_permissions  a  INNER JOIN   customer_data_yys_permission_elements  b  
+				on  
+					a.ent_id = ?
+					and a.is_delete = 0 
+					AND a.element_name = ?
+				and  FIND_IN_SET( b.code,a.element_value)	
+				and  b.element_field=?`, entId, conditionName, conditionType)
+	options := []map[string]interface{}{}
+	if data != nil && len(*data) > 0 {
+		options = append(options, map[string]interface{}{
+			"label": "全部",
+			"value": "",
+		})
+		for _, v := range *data {
+			name := gconv.String(v["name"])
+			code := gconv.Int64(v["code"])
+			options = append(options, map[string]interface{}{
+				"label": name,
+				"value": code,
+			})
+		}
+	}
+	return options
+}
+func getLabel(entId int64) []map[string]interface{} {
+	// 私有标签查询
+	data := []map[string]interface{}{}
+	labelArr := IC.BiMysql.SelectBySql(`SELECT * FROM private_label WHERE ent_id = ? AND level > 0 ORDER BY id`, entId)
+	if labelArr != nil && len(*labelArr) != 0 {
+		// 使用切片来存储一级标签及其对应的二级、三级标签
+		labelIdArr := []int64{}
+		labels := make(map[int64]map[string]interface{})         // 存储各级标签
+		labelOptions := make(map[int64][]map[string]interface{}) // 存储各级标签的选项
+		for _, m := range *labelArr {
+			key := "tagname"
+			switch len(labels) {
+			case 1:
+				key = "tagname1"
+			case 2:
+				key = "tagname2"
+			}
+			level := gconv.Int64(m["level"])
+			name := gconv.String(m["name"])
+			pid := gconv.Int64(m["pid"]) // 将 pid 转换为 int64
+			id := gconv.Int64(m["id"])   // 将 id 转换为 int64
+			if level == 1 {
+				labelIdArr = append(labelIdArr, id)
+				// 处理一级标签
+				labels[id] = map[string]interface{}{
+					"id":         id,
+					"key":        key,
+					"type":       "dateTimeList",
+					"label":      name,
+					"defaultVal": []string{},
+					"props": map[string]interface{}{
+						"multiple": false,
+					},
+					"options": []map[string]interface{}{}, // 初始化选项
+				}
+			} else {
+				// 处理二级和三级标签
+				if _, exists := labels[pid]; exists {
+					labelOptions[pid] = append(labelOptions[pid], map[string]interface{}{
+						"label": name,
+						"value": name,
+					})
+				}
+			}
+		}
+		// 将标签及其选项添加到最终数据中
+		for _, m := range labelIdArr {
+			for _, label := range labels {
+				id := gconv.Int64(label["id"])
+				if id == m {
+					if options, exists := labelOptions[label["id"].(int64)]; exists && len(options) > 0 {
+						label["options"] = options
+					}
+					data = append(data, label)
+				}
+			}
+		}
+	}
+	return data
+}
+func getArea(entid, positionId int64, labelArr *[]map[string]interface{}) map[string]interface{} {
+	data := make(map[string]map[string][]string)
+	// 私有标签查询
+	areaArr := IC.BiMysql.SelectBySql(`
+		SELECT
+			t0.area, t0.city, t0.district
+		FROM
+			bi_service.customer_data t0
+		INNER JOIN (
+			SELECT
+				ent_id AS 企业_ID,
+				MAX(CASE WHEN element_name = '行业' THEN element_value END) AS 行业要素值,
+				MAX(CASE WHEN element_name = '运营商中标标签' THEN element_value END) AS 中标标签要素值,
+				MAX(CASE WHEN element_name = '地区' THEN element_value END) AS 地区要素值,
+				MAX(CASE WHEN element_name = '经营单位' THEN element_value END) AS 经营单位要素值 
+			FROM
+				bi_service.customer_data_yys_permissions 
+			WHERE
+				is_delete = 0  and    position_id=? and   ent_id=?
+		) t1 ON  t0.eid = t1.企业_ID 
+		WHERE 
+			(t1.行业要素值 IS NULL OR FIND_IN_SET(t0.INDUSTRY, t1.行业要素值)) AND 
+			(t1.地区要素值 IS NULL OR FIND_IN_SET(t0.REGION, t1.地区要素值)) AND 
+			(t1.中标标签要素值 IS NULL OR FIND_IN_SET(t0.WINNER_TAG, t1.中标标签要素值)) AND 
+			(t1.经营单位要素值 IS NULL OR FIND_IN_SET(t0.tagname2, t1.经营单位要素值)) AND 
+			(t0.STATUS = 1) 
+		GROUP BY area, city, district`, positionId, entid)
+	if areaArr == nil || len(*areaArr) == 0 {
+		//查找全局变量
+		areaArr = IC.BiMysql.SelectBySql(`
+		SELECT
+			area,
+			city,
+			district 
+		FROM
+			customer_data 
+		WHERE
+			eid = ? 
+		GROUP BY
+			area,
+			city,
+			district 
+		ORDER BY
+			area,
+			city,
+			district;`, entid)
+	}
+	if areaArr != nil && len(*areaArr) > 0 {
+		for _, m := range *areaArr {
+			area := gconv.String(m["area"])
+			city := gconv.String(m["city"])
+			district := gconv.String(m["district"])
+			if area == "" || city == "" {
+				continue // 跳过无效的区域或城市
+			}
+			if _, exists := data[area]; !exists {
+				data[area] = make(map[string][]string)
+			}
+			if district != "" {
+				data[area][city] = append(data[area][city], district)
+			} else {
+				data[area][city] = []string{} // 存储空数组以表示没有区
+			}
+		}
+	}
+	isCity, isDistrict := false, false
+	for _, v := range *labelArr {
+		configName := gconv.String(v["config_name"])
+		if configName == "城市" {
+			isCity = true
+		} else if configName == "区县" {
+			isDistrict = true
+		}
+	}
+	if !isCity {
+		//没有设置市区
+		for k := range data {
+			data[k] = map[string][]string{}
+		}
+	} else if !isDistrict {
+		//没有设置区县
+		for k, v := range data {
+			for k1 := range v {
+				v[k1] = []string{}
+			}
+			data[k] = v
+		}
+	}
+	if len(data) > 0 {
+		return map[string]interface{}{
+			"key":        "area",
+			"type":       "component-popup",
+			"label":      "城市",
+			"defaultVal": []string{},
+			"props": map[string]interface{}{
+				"multiple": false,
+			},
+			"options": data,
+		}
+	}
+	return map[string]interface{}{}
+}
+
+type Operator struct {
+	EntId        int64 //企业id 没有企业 企业id=0
+	Tag          int64
+	PageNum      int64  //当前页码
+	PageSize     int64  //每页数量
+	Province     string //省份
+	City         string //城市
+	District     string //区县
+	Subtype      string //信息类型-二级
+	TopType      string //信息类型-一级分类
+	PublishTime  string //发布时间
+	SelectType   string //搜索范围:标题;正文等
+	Price        string //价格
+	Tagname      string
+	Tagname1     string
+	Tagname2     string
+	WordsMode    int64  //搜索关键词模式;默认0:包含所有,1:包含任意
+	KeyWords     string //关键词:多个空格隔开(主)
+	PurchaseTime string //采购时间
+	OpeningTime  string //开标时间
+	Industry     string
+	WinnerTag    string
+	PositionId   int64
+}
+
+func SearchList(operator Operator) (int64, *[]map[string]interface{}) {
+	if operator.PageSize == 0 {
+		operator.PageSize = 10
+	}
+	start := (operator.PageNum - 1) * operator.PageSize
+	if start < 0 {
+		start = 0
+	}
+	var query = `{"query":{"bool":{"must":[%s],"filter":[%s]}},"from":"%d","size":"%d","sort":[{"publishtime":{"order":"desc"}}],
+	"minimum_should_match":1,
+	"should":[{"exists":{"field":"bidamount"}},{"bool":{"should":[{"exists":{"field":"budget"}},{"bool":{"must_not":[{"exists":{"field":"budget"}}]}}],"must_not":[{"exists":{"field":"bidamount"}}]}}]}`
+	shouldStr := `{"bool":{"should":[%s]}}`
+	mustArr := []string{}
+	filterArr := []string{
+		fmt.Sprintf(`{"match":{"ent_id":"%s"}}`, gconv.String(operator.EntId)),
+	}
+	//must处理
+	//filter处理
+	if operator.Tag == 1 {
+		mustArr = append(mustArr, `{"match":{"subtype":["采购意向"]}}`)
+		operator.Subtype = ""
+		operator.TopType = ""
+	} else if operator.Tag == 2 {
+		mustArr = append(mustArr, `{"exists":{"field":"price"}}`)
+		operator.Subtype = ""
+		operator.TopType = ""
+	}
+	if operator.PublishTime != "" {
+		pushTime := strings.Split(operator.PublishTime, "_")
+		for k, v := range pushTime {
+			if k == 0 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"publishtime":{"gte":"%d"}}}`, v))
+				}
+			}
+			if k == 1 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"publishtime":{"gte":"%d"}}}`, v))
+				}
+			}
+		}
+	}
+	//采购时间
+	if operator.PurchaseTime != "" {
+		purchaseTime := strings.Split(operator.PurchaseTime, "_")
+		for k, v := range purchaseTime {
+			if k == 0 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"expurasingtime":{"gte":"%d"}}}`, v))
+				}
+			}
+			if k == 1 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"publishtime":{"gte":"%d"}}}`, v))
+				}
+			}
+		}
+	}
+	//开标时间
+	if operator.OpeningTime != "" {
+		openingTime := strings.Split(operator.OpeningTime, "_")
+		for k, v := range openingTime {
+			if k == 0 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"bidopentime":{"gte":"%d"}}}`, v))
+				}
+			}
+			if k == 1 {
+				if v != "" {
+					filterArr = append(filterArr, fmt.Sprint(`{"range":{"publishtime":{"gte":"%d"}}}`, v))
+				}
+			}
+		}
+	}
+	//关键词
+	if operator.KeyWords != "" {
+		if operator.WordsMode == 1 {
+			keyArr := []string{}
+			for _, v := range strings.Split(operator.KeyWords, ",") {
+				keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"%s":"%s"}`, operator.SelectType, v))
+			}
+			mustArr = append(mustArr, fmt.Sprintf(shouldStr, strings.Join(keyArr, ",")))
+		} else {
+			for _, v := range strings.Split(operator.KeyWords, ",") {
+				filterArr = append(filterArr, fmt.Sprintf(`{"match_phrase":{"%s":"%s"}}`, operator.SelectType, v))
+			}
+		}
+	}
+	//信息类型一级
+	//{"match":{"toptype":"结果"}},{"terms":{"subtype":["结果变更","中标"]}}
+	topType := []string{}
+	subtype := []string{}
+	if operator.TopType != "" {
+		for k, v := range gconv.Map(operator.TopType) {
+			topType = append(topType, k)
+			for _, v1 := range gconv.Interfaces(v) {
+				subtype = append(subtype, gconv.String(v1))
+			}
+		}
+		if len(topType) > 0 {
+			filterArr = append(filterArr, fmt.Sprintf(`{"match":{"toptype":"%s"}}`), strings.Join(topType, `","`))
+		}
+		//信息类型二级
+		if len(subtype) > 0 {
+			filterArr = append(filterArr, fmt.Sprintf(`{"match":{"subtype":["%s"]}}`, strings.Join(subtype, `","`)))
+		}
+	}
+	//私有标签1
+	if operator.Tagname != "" {
+		keyArr := []string{}
+		for _, v := range strings.Split(operator.Tagname, ",") {
+			keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"tagname":"%s"}`, v))
+		}
+		mustArr = append(mustArr, fmt.Sprintf(shouldStr, strings.Join(keyArr, ",")))
+
+	}
+	//私有标签2
+	if operator.Tagname1 != "" {
+		keyArr := []string{}
+		for _, v := range strings.Split(operator.Tagname1, ",") {
+			keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"tagname":"%s"}`, v))
+		}
+		mustArr = append(mustArr, fmt.Sprintf(shouldStr, strings.Join(keyArr, ",")))
+
+	}
+	//私有标签3
+	if operator.Tagname2 != "" {
+		keyArr := []string{}
+		for _, v := range strings.Split(operator.Tagname2, ",") {
+			keyArr = append(keyArr, fmt.Sprintf(`{"match_phrase":{"tagname":"%s"}`, v))
+		}
+		mustArr = append(mustArr, fmt.Sprintf(shouldStr, strings.Join(keyArr, ",")))
+	}
+	//价格处理
+	if operator.Price != "" {
+		priceArr := strings.Split(operator.Price, "-")
+		minPrice := gconv.Int64(priceArr[0])
+		maxPrice := gconv.Int64(priceArr[1])
+		bidamountArr := []string{`
+		{
+			"exists": {
+				"field": "bidamount"
+			}
+		}`, fmt.Sprintf(`
+		{
+								"range": {
+									"bidamount": {
+										"gte": %s
+									}
+								}
+							}
+		`, gconv.String(minPrice))}
+		budgetArr := []string{`
+		{
+			"exists": {
+				"field": "budget"
+			}
+		}`, fmt.Sprintf(`
+		{
+								"range": {
+									"budget": {
+										"gte": %s
+									}
+								}
+							}
+		`, gconv.String(minPrice))}
+		if maxPrice > 0 {
+			bidamountArr = append(bidamountArr, fmt.Sprintf(`
+		{
+								"range": {
+									"bidamount": {
+										"lte": "%s"
+									}
+								}
+							}
+		`, gconv.String(minPrice)))
+			budgetArr = append(budgetArr, fmt.Sprintf(`
+		{
+								"range": {
+									"budget": {
+										"lte": "%s"
+									}
+								}
+							}
+		`, gconv.String(minPrice)))
+		}
+		mustArr = append(mustArr, fmt.Sprintf(`{"bool":{"should":[{"bool":{"filter":[%s]}},{"bool":{"filter":[%s],"must_not":[{"exists":{"field":"bidamount"}}]}}]}}`, strings.Join(bidamountArr, ","), strings.Join(budgetArr, ",")))
+	}
+	//地区搜索
+	area := []string{}
+	city := []string{}
+	district := []string{}
+	if operator.Province != "" {
+		for k, v := range gconv.Map(operator.Province) {
+			area = append(area, gconv.String(k))
+			for k1, v1 := range gconv.Map(v) {
+				city = append(city, k1)
+				for _, v3 := range gconv.SliceStr(v1) {
+					district = append(district, fmt.Sprintf("%s_%s"), k1, v3)
+				}
+			}
+		}
+		if len(area) > 0 {
+			query1 := ""
+			query1 += `{"terms":{"area":[`
+			for k, v := range strings.Split(operator.Province, ",") {
+				if k > 0 {
+					query1 += `,`
+				}
+				query1 += `"` + v + `"`
+			}
+			query1 += `]}}`
+			filterArr = append(filterArr, query1)
+		}
+		//市--未登录用户不能根据市和地区筛选
+		if len(city) > 0 {
+			query1 := ""
+			query1 += `{"terms":{"city":[`
+			for k, v := range strings.Split(operator.City, ",") {
+				if k > 0 {
+					query1 += `,`
+				}
+				query1 += `"` + v + `"`
+			}
+			query1 += `]}}`
+			filterArr = append(filterArr, query1)
+		}
+		if len(district) > 0 {
+			query1 := ""
+			for k, v := range strings.Split(operator.District, ",") {
+				if k > 0 {
+					query1 += `,`
+				}
+				cityName := strings.Split(v, "_")[0]
+				districtName := strings.Split(v, "_")[1]
+				queryBoolMustAndDistrict := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
+				query1 += fmt.Sprintf(queryBoolMustAndDistrict, cityName, districtName)
+			}
+			filterArr = append(filterArr, query1)
+		}
+	}
+	//行业处理
+	if operator.Industry != "" {
+		filterArr = append(filterArr, fmt.Sprintf(`{"match":{"industry":["%s"]}}`, strings.ReplaceAll(operator.Industry, ",", `","`)))
+	}
+	//中标人标签处理
+	if operator.WinnerTag != "" {
+		filterArr = append(filterArr, fmt.Sprintf(`{"match":{"winner_tag":["%s"]}}`, strings.ReplaceAll(operator.WinnerTag, ",", `","`)))
+
+	}
+	//查看自己是否定制
+	configData := IC.BiMysql.SelectBySql(`SELECT
+	MAX( CASE WHEN element_name = '行业' THEN element_value END ) AS industry,
+	MAX( CASE WHEN element_name = '运营商中标标签' THEN element_value END ) AS winner_tag,
+	MAX( CASE WHEN element_name = '地区' THEN element_value END ) AS region,
+	MAX( CASE WHEN element_name = '经营单位' THEN element_value END ) AS tagname 
+FROM
+	bi_service.customer_data_yys_permissions 
+WHERE
+	is_delete = 0 
+	AND position_id = ? 
+	AND ent_id = ?`, operator.PositionId, operator.EntId)
+	if configData != nil && len(*configData) > 0 {
+		tagname := gconv.String((*configData)[0]["tagname"])
+		region := gconv.String((*configData)[0]["region"])
+		winner_tag := gconv.String((*configData)[0]["winner_tag"])
+		industry := gconv.String((*configData)[0]["industry"])
+		if tagname != "" {
+			filterArr = append(filterArr, fmt.Sprintf(`{"terms":{"tagname":["%s"]}}`, strings.Join(strings.Split(tagname, ","), `","`)))
+		}
+		if region != "" {
+			filterArr = append(filterArr, fmt.Sprintf(`{"terms":{"region":["%s"]}}`, strings.Join(strings.Split(region, ","), `","`)))
+		}
+		if winner_tag != "" {
+			filterArr = append(filterArr, fmt.Sprintf(`{"terms":{"winner_tag":["%s"]}}`, strings.Join(strings.Split(winner_tag, ","), `","`)))
+		}
+		if industry != "" {
+			filterArr = append(filterArr, fmt.Sprintf(`{"terms":{"industry":["%s"]}}`, strings.Join(strings.Split(industry, ","), `","`)))
+		}
+	}
+	//es  sql拼接
+	queryStr := fmt.Sprintf(query, strings.Join(mustArr, ","), strings.Join(filterArr, ","), start, operator.PageSize)
+	fmt.Println(queryStr)
+	count, data := elastic.GetWithCount(yysIndex, yysType, "", queryStr)
+	log.Println()
+	return count, data
+}