Browse Source

Merge branch 'master' into hotfix/v4.9.82.2

yuelujie 7 months ago
parent
commit
84e8dcfe29

+ 1 - 1
src/go.mod

@@ -4,7 +4,7 @@ go 1.20
 
 require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
-	app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae
+	app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
 	app.yhyue.com/moapp/jypkg v1.23.2
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.20

+ 2 - 2
src/go.sum

@@ -15,8 +15,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJ
 app.yhyue.com/moapp/jybase v0.0.0-20230419121327-bedf77840ba6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jybase v0.0.0-20231025021840-2f91c944ecdd/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
-app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae h1:zprLO87oURhdr/ccUORXvuZ7zp/LBGxMqUZUzQemISw=
-app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395 h1:HcYhZ7lTC1yYNsLPyh/DV9sltKnpZ/BhHodGxaQzwiU=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=

+ 1 - 1
src/jfw/filter/pcUserSalesFilter.go

@@ -35,7 +35,7 @@ func (l *pcSalesFilter) Do() bool {
 		return true
 	}
 	for _, v := range bindurl {
-		if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
+		if (v.MatchString(l.R.URL.Path) || v.MatchString(l.R.URL.String())) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
 			return true
 		}
 	}

+ 3 - 2
src/jfw/filter/wxUserSalesFilter.go

@@ -1,13 +1,14 @@
 package filter
 
 import (
-	"app.yhyue.com/moapp/jypkg/public"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
 	"net/http"
 	"strings"
 	"time"
 
+	"app.yhyue.com/moapp/jypkg/public"
+
 	qu "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
@@ -32,7 +33,7 @@ func (l *salesFilter) Do() bool {
 		return true
 	}
 	for _, v := range bindurl {
-		if v.MatchString(l.R.URL.Path) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
+		if (v.MatchString(l.R.URL.Path) || v.MatchString(l.R.URL.String())) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
 			return true
 		}
 	}

+ 1 - 1
src/jfw/modules/app/src/go.mod

@@ -3,7 +3,7 @@ module jy/src/jfw/modules/app/src
 go 1.20
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae
+	app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
 	app.yhyue.com/moapp/jypkg v1.23.2
 	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20231226074509-942d80dc34eb

+ 2 - 3
src/jfw/modules/app/src/go.sum

@@ -17,14 +17,13 @@ app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJ
 app.yhyue.com/moapp/jybase v0.0.0-20230419121327-bedf77840ba6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jybase v0.0.0-20231025021840-2f91c944ecdd/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
-app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae h1:zprLO87oURhdr/ccUORXvuZ7zp/LBGxMqUZUzQemISw=
-app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395 h1:HcYhZ7lTC1yYNsLPyh/DV9sltKnpZ/BhHodGxaQzwiU=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
 app.yhyue.com/moapp/jypkg v1.23.2 h1:FOjnWKd1GBZBwzqDd9q4H4X291lgGZugmoR5/rpKN3o=
 app.yhyue.com/moapp/jypkg v1.23.2/go.mod h1:FylaC4MJ4G36WndktgeZfc8jTq3uvBGWIwbk02xfdQI=
-app.yhyue.com/moapp/jypkg v1.23.2/go.mod h1:FylaC4MJ4G36WndktgeZfc8jTq3uvBGWIwbk02xfdQI=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 6 - 1
src/jfw/modules/publicapply/src/detail/consts/consts.go

@@ -34,6 +34,7 @@ var (
 	SpecialArea = map[string]bool{"北京": true, "上海": true, "天津": true, "重庆": true}
 	MapStype    = map[string]bool{
 		"content":         true,
+		"yyszb":           true,
 		"entservice":      true,
 		"bdprivate":       true,
 		"mailprivate":     true,
@@ -53,7 +54,7 @@ var (
 	QyxyEntNameCacheKey = "jydetail_qyxy_%s"
 	CustomerCacheKey    = "jydetail_customer_%s_%s_%s"
 	CacheAdvanceKey     = "jydetail_advance_%s"
-	TokenLen            = 5
+	TokenLen            = 6
 	TypeCodeMap         = map[string]string{
 		"拟建":   "拟建项目",
 		"采购意向": "采购意向",
@@ -86,6 +87,7 @@ var (
 	BaseQuery     = `{"query":{"bool":{"must":[%s],"must_not":[]}}}`
 	PageTypeCheck = map[string]bool{
 		"content":         false,
+		"yyszb":           false,
 		"entservice":      true,
 		"bdprivate":       true,
 		"mailprivate":     true,
@@ -93,6 +95,9 @@ var (
 		"indexcontent":    true, //老首页 seo入口 供爬虫使用
 		"advancedProject": false,
 	}
+	FirstTypeCheck = map[string]bool{
+		"yyszb": true, //运营商专版
+	}
 	GetTopType = func(subtype, top string) string {
 		switch subtype {
 		case "招标", "邀标", "询价", "竞谈", "单一", "竞价", "变更":

+ 4 - 4
src/jfw/modules/publicapply/src/detail/dao/advanced.go

@@ -34,10 +34,10 @@ type Advanced struct {
 	IsMobile  bool                 //
 }
 
-func NewAdvancedInfo(id, pageType, detailKey string, ui util.SessUserInfo, sess *httpsession.Session, r *http.Request, token string) *Advanced {
+func (s *SDao) NewAdvancedInfo(ui util.SessUserInfo, sess *httpsession.Session, r *http.Request, token string) *Advanced {
 	ad := &Advanced{
-		Id:        id,
-		PageType:  pageType,
+		Id:        s.Id,
+		PageType:  s.PageType,
 		UserInfo:  ui,
 		Sess:      sess,
 		R:         r,
@@ -66,7 +66,7 @@ func NewAdvancedInfo(id, pageType, detailKey string, ui util.SessUserInfo, sess
 	if res != nil && len(*res) > 0 {
 		err := json.Unmarshal(*res, &ad.BidInfo)
 		if err != nil {
-			log.Println("--进阶接口 数据初始化异常:--", detailKey)
+			log.Println("--进阶接口 数据初始化异常:--", s.Label)
 		}
 	}
 	return ad

+ 117 - 16
src/jfw/modules/publicapply/src/detail/dao/baseInfo.go

@@ -24,6 +24,7 @@ import (
 
 type BaseInfo struct {
 	Id         string               //信息id
+	FirstType  string               //详情页类型
 	PageType   string               //详情页类型
 	UserInfo   util.SessUserInfo    //用户信息
 	Sess       *httpsession.Session //
@@ -33,12 +34,13 @@ type BaseInfo struct {
 	FromUserId string               //分享者用户id
 }
 
-func NewBaseInfo(id, pageType string, ui util.SessUserInfo, fromUserId string, sess *httpsession.Session, r *http.Request) *BaseInfo {
+func (s *SDao) NewBaseInfo(ui util.SessUserInfo, sess *httpsession.Session, r *http.Request) *BaseInfo {
 	return &BaseInfo{
-		Id:         id,
-		PageType:   pageType,
+		Id:         s.Id,
+		FirstType:  s.FirstType,
+		PageType:   s.PageType,
 		UserInfo:   ui,
-		FromUserId: fromUserId,
+		FromUserId: s.UserId,
 		Sess:       sess,
 		R:          r,
 		IsMobile:   consts.MobileReg.MatchString(r.UserAgent()),
@@ -65,14 +67,21 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 		Topnet:    false,
 		BindPhone: false,
 	}
+	advancedBool := true //是否有权限获取进阶信息
 	resResp := config.Middleground.ResourceCenter.Haspowers(b.UserInfo.AccountId, b.UserInfo.EntAccountId, b.UserInfo.EntId, b.UserInfo.EntUserId)
 	if resResp != nil && len(resResp.Powers) > 0 {
 		for _, pv := range resResp.Powers {
 			switch strings.TrimSpace(pv) {
 			case "bi_yx_topnet": //拓普
 				bi.Topnet = true
-			case "ygzc_cgxx":
-				bi.Purchase = true //阳光采购
+			case "ygzc_cgxx": //阳光采购
+				bi.Purchase = true
+				advancedBool = false
+			case "bi_sj_yyszs": //运营商专版
+				bi.Operator = true
+				if b.PageType == "yyszb" {
+					advancedBool = false
+				}
 			}
 		}
 	}
@@ -95,6 +104,7 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 		isEntService  = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
 		pageTypeCheck = consts.PageTypeCheck
 		isPay         = isVip || isMember || isEntniche
+		routeKey      = fmt.Sprintf("%s%s", b.FirstType, b.PageType)
 	)
 
 	//企业级商机管理权限判断
@@ -116,10 +126,10 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 	}
 	//redis 缓存数据
 	var detailKey = func() string {
-		if bi.Topnet {
+		if bi.Topnet || bi.Purchase || bi.Operator {
 			bi.CanRead = true
 			return "pay" //可以看全部
-		} else if (isVip && isOldVip) || isMember || isEntniche || pageTypeCheck[b.PageType] || privateData || bi.Purchase {
+		} else if (isVip && isOldVip) || isMember || isEntniche || pageTypeCheck[b.PageType] || privateData {
 			bi.CanRead = true
 			return "pay" //可以看全部
 		} else if isVip && !isOldVip {
@@ -134,15 +144,15 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 	}()
 	//数据获取及简单处理
 	var GetBidInfo = func() (subtype string, obj map[string]interface{}, err error) {
-		detailCacheKey := fmt.Sprintf(consts.CacheKey, detailKey, b.PageType, b.Id, common.If(b.IsMobile, "mobile", "pc"))
+		detailCacheKey := fmt.Sprintf(consts.CacheKey, detailKey, routeKey, b.Id, common.If(b.IsMobile, "mobile", "pc"))
 		//如果缓存没有数据 查看 是否有权限
 		res, errRids := redis.GetBytes(consts.RedisLimitation, detailCacheKey)
 		if errRids != nil || res == nil || len(*res) == 0 {
-			obj = GetBiddingData(b.Id)
+			obj = b.GetBiddingData()
 		} else {
 			err = json.Unmarshal(*res, &obj)
 			if err != nil || obj == nil {
-				obj = GetBiddingData(b.Id)
+				obj = b.GetBiddingData()
 			}
 		}
 		if obj != nil && len(obj) > 0 {
@@ -223,9 +233,9 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 		return nil
 	}
 	err = BidInfoFormat()
-	if bi.CanRead && bi.BaseInfo.InfoAttribute == "" && err == nil {
+	if bi.CanRead && advancedBool && err == nil {
 		//token
-		token := fmt.Sprintf("%s#%s#%s#%s#%s", b.Id, b.PageType, fmt.Sprintf("%d", time.Now().Unix()), b.UserInfo.UserId, common.If(bi.CanRead, detailKey, "").(string))
+		token := fmt.Sprintf("%s#%s#%s#%s#%s#%s", b.Id, b.FirstType, b.PageType, fmt.Sprintf("%d", time.Now().Unix()), b.UserInfo.UserId, common.If(bi.CanRead, detailKey, "").(string))
 		bi.Token = encrypt.SE.EncodeString(token)
 		//存缓存
 		redis.Put(consts.RedisLimitation, fmt.Sprintf(consts.CacheAdvanceKey, bi.Token), bi, common.If(isPay, consts.DetailRedisByPayTimeOut, consts.DetailRedisByFreeTimeOut).(int))
@@ -243,7 +253,7 @@ func (b *BaseInfo) MinBidBaseInfo() (bi *BidInfo, err error) {
 	detailCacheKey := fmt.Sprintf(consts.MinCacheKey, b.Id, common.If(b.IsMobile, "mobile", "pc"))
 	//数据获取及简单处理
 	var bidInfo = func() {
-		obj := GetBiddingData(b.Id)
+		obj := b.GetBiddingData()
 		if len(obj) == 0 {
 			err = fmt.Errorf("未查到当前招标信息")
 			log.Println("--未查到数据--:", b.Id)
@@ -302,11 +312,102 @@ func (b *BaseInfo) MinBidBaseInfo() (bi *BidInfo, err error) {
 }
 
 // GetBid 获取活动用户的id
-func GetBid(auId string) (bid string) {
+func GetBid(auId string) (s *SDao) {
+	s = &SDao{}
 	rs := db.BaseMysql.SelectBySql(fmt.Sprintf("select bidding_id from %s  where  au_id=?", consts.TableActivateBidding), auId)
 	if rs == nil || len(*rs) == 0 {
 		return
 	}
-	bid = common.InterfaceToStr((*rs)[0]["bidding_id"])
+	s.Id = common.InterfaceToStr((*rs)[0]["bidding_id"])
+	return
+}
+
+var (
+	customerField = []string{
+		"projectId", "toptype", "subtype", "title", "area", "city",
+		"district", "publishtime", "projectcode", "projectname",
+		"buyer", "buyerclass", "budget", "buyerperson", "buyertel",
+		"s_winner", "bidamount", "winnerperson", "winnertel",
+		"agency", "agencyperson", "agencytel", "href", "detail",
+		"docstarttime", "docendtime", "bidstarttime", "bidendtime",
+		"bidopentime", "isCompetitors", "pici", "industry",
+		"region", "expurasingtime", "bid",
+	}
+	biddingField = []string{
+		"s_subscopeclass", "purchasing", "site", "infoattribute",
+		"signendtime", "buyerhint", "entidlist", "winnerorder",
+		"winner", "infoformat", "isValidFile", "projectinfo",
+	}
+)
+
+// 详情页数据
+func (b *BaseInfo) GetBiddingData() (obj map[string]interface{}) {
+	isCustomer := consts.FirstTypeCheck[b.PageType]
+	fields := biddingField
+	bId := b.Id
+	obj = make(map[string]interface{})
+	if isCustomer {
+		entId := common.Int64All(b.Sess.Get("entId"))
+		cds := db.BaseMysql.SelectBySql(`SELECT * FROM bi_service.customer_data cd  WHERE cd.infoid = ? AND cd.eid = ? ORDER BY cd.id  DESC `, bId, entId)
+		if cds == nil || len(*cds) == 0 {
+			return
+		}
+		cd := (*cds)[0]
+		for _, v := range customerField {
+			switch v {
+			case "detail": //详情页
+				details := db.BaseMysql.SelectBySql(`SELECT  cdyg.details FROM  bi_service.customer_data_yys_gl cdyg WHERE cdyg.info_id = ? ORDER BY cdyg.id  DESC  `, bId)
+				if details != nil && len(*details) > 0 {
+					obj[v] = (*details)[0]["details"]
+				}
+			case "industry": //行业
+				if cd[v] == nil {
+					continue
+				}
+				code := common.IntAll(cd[v])
+				scopeClass := db.BaseMysql.SelectBySql(`SELECT dyad.name FRoM bi_service.d_yys_analyze_dimensions dyad WHERE dyad.code = ?`, code)
+				if scopeClass != nil && len(*scopeClass) > 0 {
+					obj["s_subscopeclass"] = (*scopeClass)[0]["name"] //用户自定义的行业
+				}
+			case "isCompetitors": //是否竞品网站
+				if common.InterfaceToStr(cd[v]) == "是" {
+					obj["href"] = b.R.URL
+				}
+			case "bid": //标讯bidding的id
+				bId = common.InterfaceToStr(cd[v])
+				//uuid
+				if len([]rune(bId)) > 24 || bId == "" {
+					bId = ""
+					continue
+				}
+				obj[v] = bId
+			default:
+				if cd[v] == nil {
+					continue
+				}
+				obj[v] = cd[v]
+			}
+			fields = append(fields, v)
+		}
+	}
+	if len([]rune(bId)) == 0 {
+		return
+	}
+	cObj, ok := db.Mgo_Bidding.FindById(db.DbConf.Mongodb.Bidding.Collection, bId, nil)
+	if ok && (cObj == nil || *cObj == nil || len(*cObj) == 0) {
+		cObj, ok = db.Mgo_Bidding.FindById(db.DbConf.Mongodb.Bidding.Collection_change, bId, nil)
+	}
+	if cObj == nil || len(*cObj) == 0 {
+		return
+	}
+	if !isCustomer {
+		obj = *cObj
+	} else {
+		for _, v := range fields {
+			if (*cObj)[v] != nil && obj[v] == nil {
+				obj[v] = (*cObj)[v]
+			}
+		}
+	}
 	return
 }

+ 14 - 12
src/jfw/modules/publicapply/src/detail/dao/bidCheck.go

@@ -11,33 +11,35 @@ import (
 	"time"
 )
 
-func BidTokenCheck(token string) (id, pageType, userId, label string, err error) {
+func BidTokenCheck(token string) (s *SDao) {
+	s = &SDao{}
 	if token == "" {
-		err = fmt.Errorf(api.Error_msg_1002)
+		s.Err = fmt.Errorf(api.Error_msg_1002)
 		return
 	}
 	token = encrypt.SE.DecodeString(token)
 	if token == "" {
-		err = fmt.Errorf("token出错")
+		s.Err = fmt.Errorf("token出错")
 		return
 	}
 	tokens := strings.Split(token, "#")
 	if len(tokens) != consts.TokenLen {
-		err = fmt.Errorf("token解析异常")
+		s.Err = fmt.Errorf("token解析异常")
 		return
 	}
-	id = tokens[0]
-	if id == "" || len(id) < 20 {
-		err = fmt.Errorf("token解析获取参数异常")
+	s.Id = tokens[0]
+	if s.Id == "" || len(s.Id) < 20 {
+		s.Err = fmt.Errorf("token解析获取参数异常")
 		return
 	}
-	pageType = tokens[1]
-	tokenTime, _ := strconv.ParseInt(tokens[2], 10, 64)
+	s.FirstType = tokens[1]
+	s.PageType = tokens[2]
+	tokenTime, _ := strconv.ParseInt(tokens[3], 10, 64)
 	if time.Now().Unix()-tokenTime > config.Config.TokenExpireTime {
-		err = fmt.Errorf("token 已失效")
+		s.Err = fmt.Errorf("token 已失效")
 		return
 	}
-	userId = tokens[3]
-	label = tokens[4]
+	s.UserId = tokens[4]
+	s.Label = tokens[5]
 	return
 }

+ 37 - 20
src/jfw/modules/publicapply/src/detail/dao/bidding.go

@@ -236,16 +236,6 @@ func SeeDetailLimit(sessUser util.SessUserInfo, sid string) bool {
 	return false
 }
 
-// 详情页数据
-func GetBiddingData(id string) (obj map[string]interface{}) {
-	cObj, ok := db.Mgo_Bidding.FindById(db.DbConf.Mongodb.Bidding.Collection, id, nil)
-	if ok && (cObj == nil || *cObj == nil || len(*cObj) == 0) {
-		cObj, ok = db.Mgo_Bidding.FindById(db.DbConf.Mongodb.Bidding.Collection_change, id, nil)
-	}
-	obj = *cObj
-	return
-}
-
 // 没有权限招标信息处理
 func (bi *BidInfo) BiddingDataFormatNoPower(obj map[string]interface{}, id string) {
 	//基本信息
@@ -271,6 +261,9 @@ func (bi *BidInfo) BiddingDataFormatNoPower(obj map[string]interface{}, id strin
 func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, id string) {
 	//基本信息
 	bi.BaseInfo.Id = encrypt.EncodeArticleId2ByCheck(id)
+	if bId := common.InterfaceToStr(obj["bid"]); bId != "" {
+		bi.BaseInfo.BId = encrypt.EncodeArticleId2ByCheck(bId)
+	}
 	industry := common.ObjToString(obj["s_subscopeclass"])
 	if industry != "" {
 		industry = strings.Replace(industry, "它", "他", -1)
@@ -296,12 +289,22 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, id string) {
 		bi.BaseInfo.SubType = bi.BaseInfo.TopType
 	}
 	bi.BaseInfo.BidAmount = common.Int64All(obj["bidamount"])
+	bidamount := common.Float64All(obj["bidamount"])
+	if bidamount > 0 {
+		bi.BaseInfo.BidAmount = int64(bidamount)
+	}
 	bi.BaseInfo.Budget = common.Int64All(obj["budget"])
+	budget := common.Float64All(obj["budget"])
+	if budget > 0 {
+		bi.BaseInfo.Budget = int64(budget)
+	}
 	bi.BaseInfo.PublishTime = common.Int64All(obj["publishtime"])
 	bi.BaseInfo.BuyerSeoId = EsSeoId(false, common.InterfaceToStr(obj["buyer"]))
 	bi.BaseInfo.RecommendedService = common.IntAll(obj["recommended_service"])
 	bi.BaseInfo.InfoAttribute = common.InterfaceToStr(obj["infoattribute"])
 	bi.BaseInfo.PublicType = common.InterfaceToStr(obj["public_type"])
+	//中标企业
+	winners := common.InterfaceToStr(obj["s_winner"])
 	//摘要
 	switch bi.BaseInfo.SubType {
 	case "拟建":
@@ -391,7 +394,7 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, id string) {
 			bi.Abstract.Default.AgencyPerson = common.ObjToString(obj["agencyperson"])
 			bi.Abstract.Default.AgencyTel = common.ObjToString(obj["agencytel"])
 			bi.Abstract.Default.BidEndTime = common.Int64All(obj["bidendtime"])
-			bi.Abstract.Default.BidAmount = common.Float64All(obj["bidamount"])
+			bi.Abstract.Default.BidAmount = float64(bi.BaseInfo.BidAmount)
 			entIdList, _ := obj["entidlist"].([]interface{})
 			entIds := common.ObjArrToStringArr(entIdList)
 			if obj["winnerorder"] != nil {
@@ -402,8 +405,6 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, id string) {
 					bi.Abstract.Default.WinnerInfos, bi.Abstract.Default.WinnerSeoMap = WinnerInfo(common.ObjToString(winnerOrder["entname"]), entIds, true)
 				}
 			} else if obj["s_winner"] != nil || obj["winner"] != nil {
-				//中标企业
-				winners := common.InterfaceToStr(obj["s_winner"])
 				if winners == "" {
 					winners = common.InterfaceToStr(obj["winner"])
 				}
@@ -423,16 +424,32 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, id string) {
 	obj["infoformat"] = infoFormat //信息类型,1代表标讯,2代表拟建,3代表产权
 	//href="#"为竞品
 	href := common.ObjToString(obj["href"])
-	//竞品及剑鱼信息发布的招标信息,不显示查看原文
-	if time.Now().Unix() < dc.Config.OriginalTime { // 12.3 号 数据处理之前
-		if href != "" && href != "#" && common.ObjToString(obj["site"]) != consts.JyTxt {
+	//运营商专版
+	if bi.Operator {
+		bi.Detail.OriginalHref = href
+		if href != "" {
 			bi.Detail.OriginalShow = true
 		}
+		if winners != "" {
+			bi.Abstract.Default.WinnerInfos = []entity.WinnerInfo{}
+			bi.Abstract.Default.WinnerInfos = append(bi.Abstract.Default.WinnerInfos, entity.WinnerInfo{
+				Winner:       winners,
+				WinnerPerson: common.ObjToString(obj["winnerperson"]),
+				WinnerTel:    common.ObjToString(obj["winnertel"]),
+			})
+		}
 	} else {
-		//1、不展示是剑鱼链接逻辑:href为剑鱼链接的;(包含 需要登录的源网站)
-		//2、数据生效时间:2024.12.3号;(2024.12.3号前完成脚本及数据更新)--- 张金坤
-		if href != "" && !strings.Contains(href, "jianyu360.cn") {
-			bi.Detail.OriginalShow = true
+		//竞品及剑鱼信息发布的招标信息,不显示查看原文
+		if time.Now().Unix() < dc.Config.OriginalTime { // 12.3 号 数据处理之前
+			if href != "" && href != "#" && common.ObjToString(obj["site"]) != consts.JyTxt {
+				bi.Detail.OriginalShow = true
+			}
+		} else {
+			//1、不展示是剑鱼链接逻辑:href为剑鱼链接的;(包含 需要登录的源网站)
+			//2、数据生效时间:2024.12.3号;(2024.12.3号前完成脚本及数据更新)--- 张金坤
+			if href != "" && !strings.Contains(href, "jianyu360.c") {
+				bi.Detail.OriginalShow = true
+			}
 		}
 	}
 	//附件  且  附件可用

+ 10 - 0
src/jfw/modules/publicapply/src/detail/dao/dao.go

@@ -0,0 +1,10 @@
+package dao
+
+type SDao struct {
+	Id        string
+	FirstType string
+	PageType  string
+	UserId    string
+	Label     string
+	Err       error
+}

+ 5 - 13
src/jfw/modules/publicapply/src/detail/dao/preAgent.go

@@ -9,6 +9,7 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/detail/consts"
 	"jy/src/jfw/modules/publicapply/src/detail/util"
+	"log"
 	"net/http"
 	"strings"
 	"time"
@@ -33,6 +34,7 @@ type PreAgentReq struct {
 	IsWX       bool                 //
 	PageType   string               //地址请求类型
 	Id         string               //信息id
+	FirstType  string               //article|nologin
 }
 
 // 预处理信息 返回信息
@@ -56,20 +58,9 @@ func NewPreAgentReq(ui util.SessUserInfo, sess *httpsession.Session, r *http.Req
 		CurReferer: r.Referer(),
 	}
 	refer := r.Referer() //链接
-	//if len(strings.Split(refer, r.Host)) > 1 { //三级页面链接
-	//	refer = strings.Split(refer, r.Host)[1] //链接
-	//}
 	if refer != "" {
 		req.Url = refer
-		req.Id, req.PageType = util.BiddingIdHandle(req.Url)
-		//urls := strings.Split(strings.Split(refer, ".html")[0], "/")
-		//if len(urls) > 3 {
-		//	req.PageType = urls[len(urls)-2]
-		//	req.Id = urls[len(urls)-1]
-		//	if !strings.Contains(req.Id, "+") { //新加密算法解密
-		//		req.Id, _ = url.QueryUnescape(req.Id)
-		//	}
-		//}
+		req.Id, req.FirstType, req.PageType = util.BiddingIdHandle(req.Url)
 	}
 	params, err := util.GetParamsByUrl(r)
 	if err != nil {
@@ -150,7 +141,8 @@ func (p *PreAgentReq) PreAgent() (res PreAgentRes, err error) {
 	if !p.IsMobile && p.PageType == "indexcontent" {
 		p.PageType = "content"
 	}
-	token := fmt.Sprintf("%s#%s#%s#%s#%s", p.Id, p.PageType, fmt.Sprintf("%d", now.Unix()), p.UserInfo.UserId, encrypt.SE.Decode4Hex(fromUserId))
+	token := fmt.Sprintf("%s#%s#%s#%s#%s#%s", p.Id, p.FirstType, p.PageType, fmt.Sprintf("%d", now.Unix()), p.UserInfo.UserId, encrypt.SE.Decode4Hex(fromUserId))
+	log.Println(p.UserInfo.Phone, "--token--:", token)
 	consts.TokenLen = len(strings.Split(token, "#"))
 	res.Token = encrypt.SE.EncodeString(token)
 	res.ShareOpenid = fromUserId

+ 3 - 0
src/jfw/modules/publicapply/src/detail/entity/entity.go

@@ -11,11 +11,13 @@ type BidInfo struct {
 	Token     string                 `json:"token"`                //
 	Purchase  bool                   `json:"purchase"`             //阳光直采-采购信息
 	BindPhone bool                   `json:"bindPhone"`            //是否绑定手机号
+	Operator  bool                   `json:"operator"`             //运营商专版
 }
 
 // 基本信息
 type BidBaseInfo struct {
 	Id                 string `json:"id"`                 //基本信息id
+	BId                string `json:"bId"`                //bidding - id
 	Title              string `json:"title"`              //标题
 	Site               string `json:"site"`               //数据来源
 	ProjectName        string `json:"projectName"`        //项目名称
@@ -138,6 +140,7 @@ type Attachment struct {
 type DetailInfo struct {
 	Detail       string       `json:"detail"`       //详情
 	OriginalShow bool         `json:"originalShow"` //是否可以查看原文链接
+	OriginalHref string       `json:"originalHref"` //原文链接
 	Attachments  []Attachment `json:"attachments"`  //附件信息
 	RewardText   string       `json:"rewardText"`   //打赏文案
 }

+ 16 - 14
src/jfw/modules/publicapply/src/detail/service/service.go

@@ -19,20 +19,21 @@ func (d *Detail) AdvancedInfo() {
 		}
 		//接收参数
 		token := d.GetString("token") //加密后的信息id
-		bdId, pageType, tUserId, powerCheck, err := dao.BidTokenCheck(token)
-		if err != nil {
-			return Result{Data: nil, Error_code: -1, Error_msg: err.Error()}
+		sd := dao.BidTokenCheck(token)
+		//bdId, pageType, tUserId, powerCheck, err := dao.BidTokenCheck(token)
+		if sd.Err != nil {
+			return Result{Data: nil, Error_code: -1, Error_msg: sd.Err.Error()}
 		}
 		//
-		if powerCheck == "" {
+		if sd.Label == "" {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
 		//用户信息
 		ub := util.GetUserBaseInfo(d.Session())
-		if tUserId != "" && ub.UserId != tUserId {
+		if sd.UserId != "" && ub.UserId != sd.UserId {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
-		advancedInfo := dao.NewAdvancedInfo(bdId, pageType, powerCheck, ub, d.Session(), d.Request, token)
+		advancedInfo := sd.NewAdvancedInfo(ub, d.Session(), d.Request, token)
 		if !util.IsNeedLogin(ub.UserId, advancedInfo.PageType) {
 			return Result{Data: nil, Error_msg: Error_msg_1001}
 		}
@@ -54,16 +55,17 @@ func (d *Detail) BaseInfo() {
 		}
 		//接收参数
 		token := d.GetString("token") //加密后的信息id
-		bdId, pageType, tUserId, fUserId, err := dao.BidTokenCheck(token)
-		if err != nil {
-			return Result{Data: nil, Error_code: -1, Error_msg: err.Error()}
+		sd := dao.BidTokenCheck(token)
+		//bdId, firstType, pageType, tUserId, fUserId, err := dao.BidTokenCheck(token)
+		if sd.Err != nil {
+			return Result{Data: nil, Error_code: -1, Error_msg: sd.Err.Error()}
 		}
 		//用户信息
 		ub := util.GetUserBaseInfo(d.Session())
-		if tUserId != "" && ub.UserId != tUserId {
+		if sd.UserId != "" && ub.UserId != sd.UserId {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
-		baseInfo := dao.NewBaseInfo(bdId, pageType, ub, fUserId, d.Session(), d.Request)
+		baseInfo := sd.NewBaseInfo(ub, d.Session(), d.Request)
 		if !util.IsNeedLogin(ub.UserId, baseInfo.PageType) {
 			return Result{Data: nil, Error_msg: Error_msg_1001}
 		}
@@ -165,11 +167,11 @@ func (d *Detail) MinBaseInfo() {
 		if id == "" {
 			return Result{Data: nil, Error_msg: Error_msg_1003}
 		}
-		bid := dao.GetBid(id)
-		if bid == "" {
+		sd := dao.GetBid(id)
+		if sd.Id == "" {
 			return Result{Data: nil, Error_code: -1, Error_msg: Error_msg_1003}
 		}
-		baseInfo := dao.NewBaseInfo(bid, "", util.SessUserInfo{}, "", d.Session(), d.Request)
+		baseInfo := sd.NewBaseInfo(util.SessUserInfo{}, d.Session(), d.Request)
 		data, err1 := baseInfo.MinBidBaseInfo()
 		if err1 != nil {
 			return Result{Error_code: -1, Error_msg: err1.Error()}

+ 3 - 1
src/jfw/modules/publicapply/src/detail/util/util.go

@@ -161,10 +161,11 @@ func DataFormat(data interface{}) Result {
 	return Result{Data: data}
 }
 
+// yyszb  运营商专版
 var regArt = regexp.MustCompile(`/(article|nologin)/([^/]+)/(.+)\.html`)
 
 // 标讯详情页处理
-func BiddingIdHandle(href string) (id, pageType string) {
+func BiddingIdHandle(href string) (id, firstType, pageType string) {
 	if strings.Contains(href, "link=") && strings.Contains(href, "page_workDesktop") {
 		hrefPage, err := url.QueryUnescape(href)
 		if err == nil {
@@ -172,6 +173,7 @@ func BiddingIdHandle(href string) (id, pageType string) {
 		}
 	}
 	if matches := regArt.FindStringSubmatch(href); len(matches) > 3 {
+		firstType = matches[1]
 		pageType = matches[2]
 		if encryptionId := matches[3]; encryptionId != "" {
 			if !strings.Contains(encryptionId, "=") {

+ 1 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -3,7 +3,7 @@ module jy/src/jfw/modules/publicapply/src
 go 1.20
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66
+	app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
 	app.yhyue.com/moapp/jypkg v1.26.8
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20241213060113-ac41966a58ec

+ 2 - 2
src/jfw/modules/publicapply/src/go.sum

@@ -15,8 +15,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJ
 app.yhyue.com/moapp/jybase v0.0.0-20230419121327-bedf77840ba6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jybase v0.0.0-20231025021840-2f91c944ecdd/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
-app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66 h1:kCRYqzclN4dtGuGC89ID2w5lGrJgqZC8bNL8mRR+tiU=
-app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395 h1:HcYhZ7lTC1yYNsLPyh/DV9sltKnpZ/BhHodGxaQzwiU=
+app.yhyue.com/moapp/jybase v0.0.0-20241218100930-3aa57dbda395/go.mod h1:XHNATN6tsJKHdCB0DbUtFdPPHXexTUFyB3RlO+lUUoM=
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=

BIN
src/web/staticres/commonFunctions/scfxdzbg.png


BIN
src/web/staticres/commonFunctions/zbcgss.png


+ 2 - 1
src/web/templates/pc/template/index/activity-dialog.html

@@ -163,8 +163,9 @@
 
     // 首页活动弹窗迁移至工作桌面首页
     var showDay = localStorage.tc;
+    var __nol = getParam('nol')
     // p599改为有广告位返回值则展示,无则不展示,显示时机服务端判断
-    if(adv_img){
+    if(adv_img && !__nol){
       // 展示广告位
       $("#index_tc").css("display","block");
       $("#close2x").css("display","block");