wangchuanjin 2 年之前
父節點
當前提交
75e22a7a7b
共有 1 個文件被更改,包括 47 次插入22 次删除
  1. 47 22
      public/dataexport.go

+ 47 - 22
public/dataexport.go

@@ -97,23 +97,27 @@ func GetPriceDes_SieveCondition(minPrice, maxPrice string) string {
 
 //招标数据导出筛选
 type BidSearchExport struct {
-	Keywords     string //搜索词
-	Publishtime  string //发布时间
-	Area         string //地区
-	Subtype      string //信息类型
-	Minprice     string //最低价格
-	Maxprice     string //最高价格
-	Industry     string //选中的行业
-	SelectType   string //标题 or 全文
-	Winner       string //中标单位
-	Buyerclass   string //采购单位行业
-	Hasbuyertel  string //是否有采购电话
-	Haswinnertel string //是否有中标电话
-	SelectIds    string //选择单条信息id
-	Notkey       string //排除词
-	FileExists   string //是否有附件
-	City         string //城市
-	BidField     string // 领域化数据: 0101 医疗
+	Keywords        string //搜索词
+	Publishtime     string //发布时间
+	Area            string //地区
+	Subtype         string //信息类型
+	Minprice        string //最低价格
+	Maxprice        string //最高价格
+	Industry        string //选中的行业
+	SelectType      string //标题 or 全文
+	Winner          string //中标单位
+	Buyerclass      string //采购单位行业
+	Hasbuyertel     string //是否有采购电话
+	Haswinnertel    string //是否有中标电话
+	SelectIds       string //选择单条信息id
+	Notkey          string //排除词 排除词(副:五组,每组最多15个字符)
+	FileExists      string //是否有附件
+	City            string //城市
+	BidField        string // 领域化数据: 0101 医疗
+	SearchGroup     int    // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode      int    // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode       int    // 搜索关键词模式;默认0:包含所有,1:包含任意
+	AdditionalWords string // 关键词:附加关键词(副:五组,每组最多15个字符)
 }
 
 func (this *BidSearchExport) PassBidSearchExport(Sysconfig map[string]interface{}) (returnData map[string]interface{}) {
@@ -139,14 +143,32 @@ func (this *BidSearchExport) PassBidSearchExport(Sysconfig map[string]interface{
 	}
 
 	KeyWordSave := []dataexport.KeyWord{}
-	if len(this.Keywords) > 0 {
+	if len(this.Keywords) > 0 || len(this.AdditionalWords) > 0 {
 		_, _, keywords := jy.InterceptSearchKW(this.Keywords, util.IntAllDef(Sysconfig["keywordsLimit"], 35), len(this.Industry) == 0)
 		keywords = strings.Replace(keywords, "+", " ", -1)
-		excludes := []string{}
-		if this.Notkey != "" && len(strings.Split(this.Notkey, " ")) > 0 {
-			excludes = strings.Split(this.Notkey, " ")
+		excludes := []string{}    // 排除词
+		appendWords := []string{} // 附加词
+		//排除词  每组排除词不能超过15个字符
+		if this.Notkey != "" && len(strings.Split(this.Notkey, ",")) > 0 {
+			for _, ak := range strings.Split(this.Notkey, ",") {
+				if len([]rune(ak)) > 15 {
+					excludes = append(excludes, string([]rune(ak)[:15]))
+				} else {
+					excludes = append(excludes, ak)
+				}
+			}
+		}
+		//附加词 每组附加词不能超过15个字符
+		if this.AdditionalWords != "" && len(strings.Split(this.AdditionalWords, ",")) > 0 {
+			for _, ak := range strings.Split(this.AdditionalWords, ",") {
+				if len([]rune(ak)) > 15 {
+					appendWords = append(appendWords, string([]rune(ak)[:15]))
+				} else {
+					appendWords = append(appendWords, ak)
+				}
+			}
 		}
-		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords, Exclude: excludes})
+		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords, Exclude: excludes, Appended: appendWords})
 	}
 
 	//时间
@@ -187,6 +209,9 @@ func (this *BidSearchExport) PassBidSearchExport(Sysconfig map[string]interface{
 		"fileExists":   this.FileExists,
 		"comeintime":   now.Unix(),
 		"bid_field":    this.BidField,
+		"searchGroup":  this.SearchGroup,
+		"searchMode":   this.SearchMode,
+		"wordsMode":    this.WordsMode,
 	}
 	//选择信息id
 	if this.SelectIds != "" {