Procházet zdrojové kódy

fix:p353功能模块修改

duxin před 2 roky
rodič
revize
b91f1efc43

+ 36 - 20
src/jfw/front/classificationTag.go

@@ -1,28 +1,28 @@
 package front
 
 import (
-    qu "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    elastic "app.yhyue.com/moapp/jybase/es"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
-    "app.yhyue.com/moapp/jypkg/public"
-    "encoding/json"
-    "fmt"
-    "jy/src/jfw/config"
-    "jy/src/jfw/jyutil"
-    "jy/src/jfw/paging"
-    "log"
-    "math"
-    "math/rand"
-    "strconv"
-    "sync"
-    "time"
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	elastic "app.yhyue.com/moapp/jybase/es"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/public"
+	"encoding/json"
+	"fmt"
+	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
+	"jy/src/jfw/paging"
+	"log"
+	"math"
+	"math/rand"
+	"strconv"
+	"sync"
+	"time"
 
-    "net/http"
+	"net/http"
 
-    "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 )
 
 type KeyType struct {
@@ -68,6 +68,22 @@ func HotSubjectMatter() []map[string]interface{} {
 	return subjectMatter
 }
 
+// 随机展示200中标企业
+func GetWinnerName() (data []map[string]interface{}) {
+	randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
+	from := randGen.Intn(100)
+
+	//关联中标企业
+	r := elastic.Get("winner", "winner", fmt.Sprintf(`{"query": {"bool": {"must": []}},"_source": ["_id","name"],"from": %d,"size": 200}`, from))
+	if r != nil {
+		for _, v := range *r {
+			v["_id"] = encrypt.EncodeArticleId2ByCheck(qu.InterfaceToStr(v["_id"]))
+			data = append(data, v)
+		}
+	}
+	return
+}
+
 // ContentRecommendation 实用内容推荐
 func ContentRecommendation() []KeyType {
 	if bytes, err := redis.GetBytes(RedisNameNew, "contentRecommendation"); err == nil && bytes != nil {

+ 7 - 7
src/jfw/front/pcIndex.go

@@ -291,7 +291,7 @@ func (f *PcIndex) SearchResult(at, name string) error {
 	if at == "stype" && name == "NJ" {
 		return f.Redirect("/jylab/supsearch/proposedProject.html")
 	}
-	userId := util.ObjToString(f.GetSession("userId"))
+	//userId := util.ObjToString(f.GetSession("userId"))
 	var no = 5
 	var area = ""
 	var stype = ""
@@ -382,8 +382,7 @@ func (f *PcIndex) SearchResult(at, name string) error {
 			}
 		}
 	}
-	if stype == "" && userId == "" {
-	}
+
 	f.T["seoarea"] = area
 	f.T["seostype"] = stype
 	f.T["seotitle"] = seotitle
@@ -417,11 +416,12 @@ func (f *PcIndex) SearchResult(at, name string) error {
 			query1 += `{"term":{"city":"` + city + `"}}`
 		}
 		query1 += `],"should": [],"minimum_should_match": 0}}}`
+		//p353包含采购意向与拟建
 		//获取到昨天数据
-		if stype == "" && userId == "" {
-			// stype = "招标预告,招标公告,招标结果,招标信用信息"
-			stype = "招标,询价,竞谈,变更,单一,竞价,邀标,成交,中标,废标,流标,结果变更,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果"
-		}
+		//if stype == "" && userId == "" {
+		//	// stype = "招标预告,招标公告,招标结果,招标信用信息"
+		//	stype = "拟建,采购意向,招标,询价,竞谈,变更,单一,竞价,邀标,成交,中标,废标,流标,结果变更,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果"
+		//}
 
 		var datas *[]map[string]interface{}
 		if list == nil || len(list.([]interface{})) == 0 {

+ 12 - 12
src/jfw/front/supsearch.go

@@ -101,7 +101,6 @@ func PCS_task() {
 			}
 		}
 	}
-
 }
 
 // 返回内存中列表也的数据,只获取首页,其他页面访问量暂时不多
@@ -344,14 +343,15 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	//--end--
 	userId, _ := p.GetSession("userId").(string)
 	phone, _ := p.GetSession("phone").(string)
-	noLoginBl := false
-	if userId == "" {
-		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
-		if subtype == "" {
-			subtype = "招标预告,招标公告,招标结果,招标信用信息"
-			noLoginBl = true
-		}
-	}
+	//p353包含采购意向与拟建
+	//noLoginBl := false
+	//if userId == "" {
+	//	//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
+	//	if subtype == "" {
+	//		subtype = "招标预告,招标公告,招标结果,招标信用信息"
+	//		noLoginBl = true
+	//	}
+	//}
 	//高级筛选 仅vip用户可查询
 	var (
 		hasBuyerTel, hasWinnerTel = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
@@ -468,9 +468,9 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 			list, count, total = so.GetBidSearchListByCache()
 		}
 	}
-	if noLoginBl {
-		subtype = ""
-	}
+	//if noLoginBl {
+	//	subtype = ""
+	//}
 	log.Println("userId:+++", userId)
 	if userId == "" {
 		for _, v := range list {

+ 1 - 7
src/jfw/front/swordfish.go

@@ -142,12 +142,7 @@ func (m *Front) PcAjaxReq() {
 		notkey = m.GetString("notkey")
 		city = m.GetString("city")
 	}
-	if userId == "" {
-		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
-		if subtype == "" {
-			subtype = "招标预告,招标公告,招标结果,招标信用信息"
-		}
-	}
+
 	// p329  非反爬白名单用户不放开  需要处理通用词
 	onList, _ := jyutil.IsOnTheWhitelist(m.Session())
 	searchValueString := m.GetString("searchvalue")
@@ -187,7 +182,6 @@ func (m *Front) PcAjaxReq() {
 		list, count, total = so.GetBidSearchListByCache()
 
 	}
-	log.Println("userId:+++", userId)
 	if userId == "" {
 		for _, v := range list {
 			*v = SearchFilter(*v)

+ 13 - 4
src/jfw/front/tags.go

@@ -460,13 +460,21 @@ func (this *Tags) GetStype(href string) (list []map[string]interface{}) {
 		list = qu.ObjArrToMapArr(l)
 	} else {
 		m := []map[string]interface{}{}
-		data := public.BaseMysql.SelectBySql(`select id,name,pid from seo_words.seo_stype where name !="拟建项目" order by id`)
+		var data []map[string]interface{}
+		newData := public.BaseMysql.SelectBySql(`select id,name,pid from seo_words.seo_stype where name == "拟建项目" and name == "采购意向 "order by id`)
+		if newData != nil && len(*newData) > 0 {
+			data = append(data, *newData...)
+		}
+		oldData := public.BaseMysql.SelectBySql(`select id,name,pid from seo_words.seo_stype where name != "拟建项目" and name != "采购意向 "order by id`)
+		if oldData != nil && len(*oldData) > 0 {
+			data = append(data, *oldData...)
+		}
 		codeMap := map[int64][]int64{}
 		level1 := []int64{}
 		nameToCode := map[string]int64{}
 		codeToName := map[int64]string{}
-		if data != nil && len(*data) > 0 {
-			for _, v := range *data {
+		if len(data) > 0 {
+			for _, v := range data {
 				name := qu.ObjToString(v["name"])
 				pid := qu.Int64All(v["pid"])
 				id := qu.Int64All(v["id"])
@@ -713,9 +721,10 @@ func (this *Tags) GetInsturyKeywords(idstr string) (name, class_1, class_2 strin
 }
 
 // 获取信息类型 【全部是虚假的全部、实则是不包含拟建和采购意向的全部】
+// p353包含采购意向与拟建
 func (this *Tags) GetInfoType(idstr string) (string, string) {
 	if idstr == "all" {
-		return "招标,邀标,询价,竞谈,单一,竞价,变更,中标,成交,废标,流标,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果", ""
+		return "拟建,采购意向,招标,邀标,询价,竞谈,单一,竞价,变更,中标,成交,废标,流标,合同,验收,违规,预告,需求公示,预审,论证意见,预审结果", ""
 	}
 	id, _ := strconv.Atoi(idstr)
 	data := public.BaseMysql.SelectBySql(`select id,name from seo_words.seo_stype where id =?`, id)

+ 22 - 0
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -1,12 +1,14 @@
 package entity
 
 import (
+	"app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"errors"
 	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"log"
+	"math/rand"
 	"strings"
 	"time"
 
@@ -112,6 +114,26 @@ func CreatePortraitManagerForContacts(session *httpsession.Session, entType int6
 	return &Portrait{uid, session}, nil
 }
 
+func NoLoginAssociatedInfo(city string) []map[string]interface{} {
+	var (
+		winnerData []map[string]interface{}
+	)
+	randGen := rand.New(rand.NewSource(time.Now().UnixNano()))
+	from := randGen.Intn(100)
+
+	//关联中标企业
+	if city != "" {
+		r := es.Get("winner", "winner", fmt.Sprintf(`{"query": {"bool": {"must": [{"query_string": {"default_field": "city","query": "%s*"}}]}},"_source": ["_id","name"],"from": %d,"size": 30}`, city, from))
+		if r != nil {
+			winnerData = *r
+		}
+	}
+	for _, v := range winnerData {
+		v["_id"] = encrypt.EncodeArticleId2ByCheck(qutil.InterfaceToStr(v["_id"]))
+	}
+	return winnerData
+}
+
 // CreateSubVipPortraitManager 超级订阅权限校验
 // int -1无权限 1免费权限 2超级订阅次数&采购单位流量包 3使用体验
 func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool, session *httpsession.Session) (*Portrait, int, error, bool) {

+ 12 - 0
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -34,6 +34,7 @@ type EntPortrait struct {
 	buyerMiniPortrait xweb.Mapper `xweb:"/portrait/buyer/miniData"`        //三级页展示采购单位基础画像信息
 	portraitContacts  xweb.Mapper `xweb:"/portrait/contacts"`              // 画像通讯录接口
 
+	noLoginAssociatedInfo xweb.Mapper `xweb:"/portrait/winner/noLoginAssociatedInfo"` //未登录用户画像详情页、关联标讯动态&关联中标企业
 }
 
 // EntDetail 企业基本信息
@@ -501,6 +502,17 @@ func (this *EntPortrait) PortraitContacts() {
 	this.ServeJson(NewResult(rData, errMsg))
 }
 
+func (this *EntPortrait) NoLoginAssociatedInfo() {
+	rData := func() interface{} {
+		city := this.GetString("city")
+		// 未登录用户关联中标企业
+		data := entity.NoLoginAssociatedInfo(city)
+		return data
+
+	}()
+	this.ServeJson(NewResult(rData, nil))
+}
+
 // formatContact 格式化混淆联系人电话
 func formatContact(contactList []map[string]interface{}) (confusing []map[string]interface{}, total int) {
 	total = len(contactList)