Forráskód Böngészése

Merge branch 'dev_v1.1.40_wh' of BaseService/jyMicroservices into feature/v1.1.40

王浩 1 éve
szülő
commit
8fd833a2c0

+ 23 - 23
jyBXBase/api/bxbase.api

@@ -69,29 +69,29 @@ type (
 
 	//保存筛选条件
 	AddSearchScreen {
-		UserId          string `header:"userId"`
-		AppId           string `header:"appId"` //appId
-		Type            string `header:"type,optional"`
-		Keywords        string `json:"searchvalue,optional"` //搜索词
-		Publishtime     string `json:"publishtime"`          //发布时间
-		City            string `json:"city,optional"`        //城市
-		Area            string `json:"area,optional"`        //地区
-		Subtype         string `json:"subtype,optional"`     //信息类型
-		Minprice        string `json:"minprice,optional"`    //最低价格
-		Maxprice        string `json:"maxprice,optional"`    //最高价格
-		Industry        string `json:"industry,optional"`    //选中的行业
-		SelectType      string `json:"selectType"`           //标题 or 全文
-		Buyerclass      string `json:"buyerclass,optional"`  //采购单位行业
-		Hasbuyertel     string `json:"buyertel,optional"`    //是否有采购电话
-		Haswinnertel    string `json:"winnertel,optional"`   //是否有中标电话
-		FileExists      string `json:"fileExists,optional"`  //附件
-		Notkey          string `json:"notkey,optional"`      //排除词 关键词:排除词(副:五组,每组最多15个字符)
-		InKey           string `json:"inkey,optional"`
-		SearchGroup     int    `json:"searchGroup,optional"`     // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
-		SearchMode      int    `json:"searchMode,optional"`      // 搜索模式:0:精准搜索;1:模糊搜索
-		WordsMode       int    `json:"wordsMode,optional"`       // 搜索关键词模式;默认0:包含所有,1:包含任意
-		AdditionalWords string `json:"additionalWords,optional"` // 关键词:附加关键词(副:五组,每组最多15个字符)
-		RegionMap       string `json:"regionMap,optional"`       //区域
+		UserId          string                         `header:"userId"`
+		AppId           string                         `header:"appId"` //appId
+		Type            string                         `header:"type,optional"`
+		Keywords        string                         `json:"searchvalue,optional"` //搜索词
+		Publishtime     string                         `json:"publishtime"`          //发布时间
+		City            string                         `json:"city,optional"`        //城市
+		Area            string                         `json:"area,optional"`        //地区
+		Subtype         string                         `json:"subtype,optional"`     //信息类型
+		Minprice        string                         `json:"minprice,optional"`    //最低价格
+		Maxprice        string                         `json:"maxprice,optional"`    //最高价格
+		Industry        string                         `json:"industry,optional"`    //选中的行业
+		SelectType      string                         `json:"selectType"`           //标题 or 全文
+		Buyerclass      string                         `json:"buyerclass,optional"`  //采购单位行业
+		Hasbuyertel     string                         `json:"buyertel,optional"`    //是否有采购电话
+		Haswinnertel    string                         `json:"winnertel,optional"`   //是否有中标电话
+		FileExists      string                         `json:"fileExists,optional"`  //附件
+		Notkey          string                         `json:"notkey,optional"`      //排除词 关键词:排除词(副:五组,每组最多15个字符)
+		InKey           string                         `json:"inkey,optional"`
+		SearchGroup     int                            `json:"searchGroup,optional"`     // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode      int                            `json:"searchMode,optional"`      // 搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode       int                            `json:"wordsMode,optional"`       // 搜索关键词模式;默认0:包含所有,1:包含任意
+		AdditionalWords string                         `json:"additionalWords,optional"` // 关键词:附加关键词(副:五组,每组最多15个字符)
+		RegionMap       map[string]map[string][]string `json:"regionMap,optional"`       //区域
 	}
 	//首页最新招标信息
 	NewestReq {

+ 17 - 1
jyBXBase/api/internal/logic/addSearchScreenLogic.go

@@ -29,6 +29,22 @@ func NewAddSearchScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext, r
 }
 
 func (l *AddSearchScreenLogic) AddSearchScreen(req *types.AddSearchScreen) (resp *types.CommonRes, err error) {
+	region := map[string]*bxbase.Area{}
+	if req.RegionMap != nil {
+		for k, v := range req.RegionMap {
+			areaMap := map[string]*bxbase.District{}
+			if v != nil {
+				for k1, v1 := range v {
+					areaMap[k1] = &bxbase.District{
+						District: v1,
+					}
+				}
+			}
+			region[k] = &bxbase.Area{
+				Area: areaMap,
+			}
+		}
+	}
 	res, err0 := l.svcCtx.Bxbase.AddSearch(l.ctx, &bxbase.AddSearchReq{
 		UserId:          req.UserId,
 		Type:            req.Type,
@@ -52,7 +68,7 @@ func (l *AddSearchScreenLogic) AddSearchScreen(req *types.AddSearchScreen) (resp
 		SearchMode:      int64(req.SearchMode),
 		WordsMode:       int64(req.WordsMode),
 		AdditionalWords: req.AdditionalWords,
-		RegionMap:       req.RegionMap,
+		RegionMap:       region,
 	})
 	if err0 != nil {
 		return &types.CommonRes{

+ 17 - 1
jyBXBase/api/internal/logic/checkSearchScreenLogic.go

@@ -29,6 +29,22 @@ func NewCheckSearchScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext,
 }
 
 func (l *CheckSearchScreenLogic) CheckSearchScreen(req *types.AddSearchScreen) (resp *types.CommonRes, err error) {
+	region := map[string]*bxbase.Area{}
+	if req.RegionMap != nil {
+		for k, v := range req.RegionMap {
+			areaMap := map[string]*bxbase.District{}
+			if v != nil {
+				for k1, v1 := range v {
+					areaMap[k1] = &bxbase.District{
+						District: v1,
+					}
+				}
+			}
+			region[k] = &bxbase.Area{
+				Area: areaMap,
+			}
+		}
+	}
 	res, err0 := l.svcCtx.Bxbase.CheckSearch(l.ctx, &bxbase.AddSearchReq{
 		UserId:          req.UserId,
 		Type:            req.Type,
@@ -51,7 +67,7 @@ func (l *CheckSearchScreenLogic) CheckSearchScreen(req *types.AddSearchScreen) (
 		SearchMode:      int64(req.SearchMode),
 		WordsMode:       int64(req.WordsMode),
 		AdditionalWords: req.AdditionalWords,
-		RegionMap:       req.RegionMap,
+		RegionMap:       region,
 	})
 	if err0 != nil {
 		return &types.CommonRes{

+ 23 - 23
jyBXBase/api/internal/types/types.go

@@ -60,29 +60,29 @@ type DelSearchScreen struct {
 }
 
 type AddSearchScreen struct {
-	UserId          string `header:"userId"`
-	AppId           string `header:"appId"` //appId
-	Type            string `header:"type,optional"`
-	Keywords        string `json:"searchvalue,optional"` //搜索词
-	Publishtime     string `json:"publishtime"`          //发布时间
-	City            string `json:"city,optional"`        //城市
-	Area            string `json:"area,optional"`        //地区
-	Subtype         string `json:"subtype,optional"`     //信息类型
-	Minprice        string `json:"minprice,optional"`    //最低价格
-	Maxprice        string `json:"maxprice,optional"`    //最高价格
-	Industry        string `json:"industry,optional"`    //选中的行业
-	SelectType      string `json:"selectType"`           //标题 or 全文
-	Buyerclass      string `json:"buyerclass,optional"`  //采购单位行业
-	Hasbuyertel     string `json:"buyertel,optional"`    //是否有采购电话
-	Haswinnertel    string `json:"winnertel,optional"`   //是否有中标电话
-	FileExists      string `json:"fileExists,optional"`  //附件
-	Notkey          string `json:"notkey,optional"`      //排除词 关键词:排除词(副:五组,每组最多15个字符)
-	InKey           string `json:"inkey,optional"`
-	SearchGroup     int    `json:"searchGroup,optional"`     // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
-	SearchMode      int    `json:"searchMode,optional"`      // 搜索模式:0:精准搜索;1:模糊搜索
-	WordsMode       int    `json:"wordsMode,optional"`       // 搜索关键词模式;默认0:包含所有,1:包含任意
-	AdditionalWords string `json:"additionalWords,optional"` // 关键词:附加关键词(副:五组,每组最多15个字符)
-	RegionMap       string `json:"regionMap,optional"`       //区域
+	UserId          string                         `header:"userId"`
+	AppId           string                         `header:"appId"` //appId
+	Type            string                         `header:"type,optional"`
+	Keywords        string                         `json:"searchvalue,optional"` //搜索词
+	Publishtime     string                         `json:"publishtime"`          //发布时间
+	City            string                         `json:"city,optional"`        //城市
+	Area            string                         `json:"area,optional"`        //地区
+	Subtype         string                         `json:"subtype,optional"`     //信息类型
+	Minprice        string                         `json:"minprice,optional"`    //最低价格
+	Maxprice        string                         `json:"maxprice,optional"`    //最高价格
+	Industry        string                         `json:"industry,optional"`    //选中的行业
+	SelectType      string                         `json:"selectType"`           //标题 or 全文
+	Buyerclass      string                         `json:"buyerclass,optional"`  //采购单位行业
+	Hasbuyertel     string                         `json:"buyertel,optional"`    //是否有采购电话
+	Haswinnertel    string                         `json:"winnertel,optional"`   //是否有中标电话
+	FileExists      string                         `json:"fileExists,optional"`  //附件
+	Notkey          string                         `json:"notkey,optional"`      //排除词 关键词:排除词(副:五组,每组最多15个字符)
+	InKey           string                         `json:"inkey,optional"`
+	SearchGroup     int                            `json:"searchGroup,optional"`     // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode      int                            `json:"searchMode,optional"`      // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode       int                            `json:"wordsMode,optional"`       // 搜索关键词模式;默认0:包含所有,1:包含任意
+	AdditionalWords string                         `json:"additionalWords,optional"` // 关键词:附加关键词(副:五组,每组最多15个字符)
+	RegionMap       map[string]map[string][]string `json:"regionMap,optional"`       //区域
 }
 
 type NewestReq struct {

+ 8 - 2
jyBXBase/rpc/bxbase.proto

@@ -141,8 +141,14 @@ message ListSearchRes{
   int64  wordsMode = 22;// 搜索关键词模式;默认0:包含所有,1:包含任意
   string additionalWords = 23;//关键词:附加关键词(副:五组,每组最多15个字符)
   string district = 24;       //地区
+  map<string,Area> regionMap = 25;       //地区
+}
+message Area{
+  map<string,District> area=1;
+}
+message District{
+  repeated string  district=1;
 }
-
 message AddSearchReq{
   string userId = 1;
   string type = 2;
@@ -166,7 +172,7 @@ message AddSearchReq{
   int64  searchMode = 20;//搜索模式:0:精准搜索;1:模糊搜索
   int64  wordsMode = 21;// 搜索关键词模式;默认0:包含所有,1:包含任意
   string additionalWords = 22;//关键词:附加关键词(副:五组,每组最多15个字符)
-  string RegionMap = 23;       //地区
+  map<string,Area> regionMap = 23;       //地区
 }
 
 message DelSearchReq{

+ 2 - 0
jyBXBase/rpc/bxbase/bxbase.go

@@ -17,12 +17,14 @@ type (
 	AddlabelReq       = bxbase.AddlabelReq
 	AddlabelRes       = bxbase.AddlabelRes
 	AppIdReq          = bxbase.AppIdReq
+	Area              = bxbase.Area
 	BCActionReq       = bxbase.BCActionReq
 	CheckRes          = bxbase.CheckRes
 	ColData           = bxbase.ColData
 	ColList           = bxbase.ColList
 	CommonRes         = bxbase.CommonRes
 	DelSearchReq      = bxbase.DelSearchReq
+	District          = bxbase.District
 	GetLabelActionReq = bxbase.GetLabelActionReq
 	GetLabelActionRes = bxbase.GetLabelActionRes
 	IData             = bxbase.IData

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

@@ -15,8 +15,8 @@ mysql:
         maxIdleConns: 5
 redis:
     addr:
-        - other=192.168.3.11:1712
-        - new=192.168.3.11:1712
+        - other=192.168.3.149:1712
+        - new=192.168.3.149:1712
 es:
     addr: http://192.168.3.241:9205,http://192.168.3.149:9200
     size: 30

+ 10 - 11
jyBXBase/rpc/internal/logic/checksearchlogic.go

@@ -6,7 +6,6 @@ import (
 	"context"
 	"crypto/md5"
 	"fmt"
-	"github.com/gogf/gf/v2/util/gconv"
 	IC "jyBXBase/rpc/init"
 	"jyBXBase/rpc/util"
 	"log"
@@ -67,16 +66,6 @@ func (l *CheckSearchLogic) CheckSearch(in *bxbase.AddSearchReq) (res *bxbase.Che
 	in.NotKey = ValueSort(in.NotKey)
 	in.AdditionalWords = ValueSort(in.AdditionalWords)
 	//区域处理成字符串数组
-	areaArr := []string{}
-	for k, v := range gconv.Map(in.RegionMap) {
-		for k1, v1 := range gconv.Map(v) {
-			for _, v2 := range gconv.Strings(v1) {
-				areaArr = append(areaArr, fmt.Sprintf("%s_%s_%s", k, k1, v2))
-			}
-		}
-	}
-	log.Println(areaArr)
-	in.RegionMap = ValueSort(strings.Join(areaArr, ","))
 	// 搜索分组为 1-招标采购公告时 2 超前项目
 	// 当所选择的信息类型是全选时,需要处理成和全部时一样的空串
 	switch in.SearchGroup {
@@ -91,6 +80,16 @@ func (l *CheckSearchLogic) CheckSearch(in *bxbase.AddSearchReq) (res *bxbase.Che
 	}
 
 	inMap := common.StructToMapMore(in)
+	areaArr := []string{}
+	for k, v := range in.RegionMap {
+		for k1, v1 := range v.Area {
+			for _, v2 := range v1.District {
+				areaArr = append(areaArr, fmt.Sprintf("%s_%s_%s", k, k1, v2))
+			}
+		}
+	}
+	log.Println(areaArr)
+	inMap["regionMap"] = ValueSort(strings.Join(areaArr, ","))
 	inKey := GetKeysByParam(inMap)
 
 	query["in_key"] = inKey

+ 19 - 0
jyBXBase/rpc/internal/logic/showsearchlogic.go

@@ -4,6 +4,7 @@ import (
 	"app.yhyue.com/moapp/jybase/common"
 	"context"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"github.com/zeromicro/go-zero/core/logx"
 	"jyBXBase/rpc/bxbase"
 	IC "jyBXBase/rpc/init"
@@ -97,6 +98,24 @@ func (l *ShowSearchLogic) ShowSearch(in *bxbase.ShowSearchReq) (res *bxbase.Show
 			listSearch.SearchMode = common.Int64All(vlu["searchMode"])
 			listSearch.WordsMode = common.Int64All(vlu["wordsMode"])
 			listSearch.AdditionalWords = common.InterfaceToStr(vlu["additionalWords"])
+			regionMap := gconv.Map(vlu["regionMap"])
+			region := map[string]*bxbase.Area{}
+			if regionMap != nil {
+				for k1, v1 := range regionMap {
+					areaMap := map[string]*bxbase.District{}
+					for k2, v2 := range gconv.Map(v1) {
+						log.Println(gconv.Strings(v2))
+						areaMap[k2] = &bxbase.District{
+							District: gconv.Strings(v2),
+						}
+					}
+					region[k1] = &bxbase.Area{
+						Area: areaMap,
+					}
+
+				}
+			}
+			listSearch.RegionMap = region
 			//ppa,buyer,winner,agency
 			if SelectCheck(listSearch.SelectType, isOld) || listSearch.City != "" || listSearch.Notkey != "" ||
 				(listSearch.Publishtime != "lately-7" && listSearch.Publishtime != "lately-30" && listSearch.Publishtime != "thisyear") ||

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 460 - 332
jyBXBase/rpc/type/bxbase/bxbase.pb.go


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott