|
@@ -11,6 +11,8 @@ import (
|
|
|
"net/url"
|
|
|
"strconv"
|
|
|
|
|
|
+ "github.com/gogf/gf/v2/util/gconv"
|
|
|
+
|
|
|
"jy/src/jfw/jyutil"
|
|
|
|
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
@@ -18,6 +20,8 @@ import (
|
|
|
util "app.yhyue.com/moapp/jybase/common"
|
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
|
|
|
|
+ . "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
+
|
|
|
elastic "app.yhyue.com/moapp/jybase/es"
|
|
|
"regexp"
|
|
|
"strings"
|
|
@@ -53,6 +57,29 @@ var (
|
|
|
}
|
|
|
seoAgentReg = regexp.MustCompile("Baiduspider|360Spider|bingbot|Googlebot")
|
|
|
detailNeedMosaic map[string]interface{}
|
|
|
+ TypeCodeMap = map[string]string{
|
|
|
+ "拟建": "拟建项目",
|
|
|
+ "采购意向": "采购意向",
|
|
|
+ "预告": "招标预告",
|
|
|
+ "预审": "资格预审",
|
|
|
+ "预审结果": "资格预审结果",
|
|
|
+ "论证意见": "论证意见",
|
|
|
+ "需求公示": "需求公示",
|
|
|
+ "招标": "公开招标",
|
|
|
+ "邀标": "邀请招标",
|
|
|
+ "询价": "询价采购",
|
|
|
+ "竞谈": "竞争性谈判",
|
|
|
+ "单一": "单一来源采购",
|
|
|
+ "竞价": "竞价公告",
|
|
|
+ "变更": "变更公告",
|
|
|
+ "中标": "中标公示",
|
|
|
+ "成交": "成交公告",
|
|
|
+ "废标": "废标公告",
|
|
|
+ "流标": "流标公告",
|
|
|
+ "合同": "合同公告信息",
|
|
|
+ "验收": "验收公告信息",
|
|
|
+ "违规": "违规信息",
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
func (s *Short) Article(stype, id string) error {
|
|
@@ -148,6 +175,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
retMap["subtype"], _ = obj["subtype"].(string)
|
|
|
retMap["subscopeclass"], _ = obj["s_subscopeclass"].(string)
|
|
|
retMap["publishtime"] = util.IntAll(obj["publishtime"])
|
|
|
+ retMap["keywords"] = KeyWordHandle(obj)
|
|
|
+ retMap["description"] = DescriptionHandle(stype, obj)
|
|
|
}
|
|
|
s.T["shareid"] = config.Seoconfig["baiduSEM-p"].(string)
|
|
|
s.T["logid"] = config.Seoconfig["baiduSEM-p"].(string)
|
|
@@ -229,11 +258,11 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
}
|
|
|
s.T["url"] = s.Uri()
|
|
|
+ obj["keywords"] = KeyWordHandle(obj)
|
|
|
+ obj["description"] = DescriptionHandle(stype, obj)
|
|
|
s.T["obj"] = obj
|
|
|
-
|
|
|
content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
|
|
|
- timeout := 60 * 20
|
|
|
- redis.Put("newother", catchKey, string(content), timeout)
|
|
|
+ redis.Put("newother", catchKey, string(content), 60*20)
|
|
|
return s.SetBody(content)
|
|
|
}
|
|
|
} else {
|
|
@@ -332,7 +361,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
canRead := false
|
|
|
if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
|
|
|
((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
|
|
|
- stype == "mailprivate" || stype == "indexcontent" { //邮箱推送
|
|
|
+ stype == "mailprivate" || stype == "indexcontent" || stype == "bdprivate" { //邮箱推送
|
|
|
canRead = true
|
|
|
} else {
|
|
|
canRead = SeeDetailLimit(obj, userId, sid)
|
|
@@ -416,6 +445,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
s.T["advertUrl"] = config.Sysconfig["advertUrl"]
|
|
|
s.T["canRead"] = canRead
|
|
|
obj["industry"] = industry
|
|
|
+ obj["keywords"] = KeyWordHandle(obj)
|
|
|
+ obj["description"] = DescriptionHandle(stype, obj)
|
|
|
s.T["obj"] = obj
|
|
|
//获取打赏文案
|
|
|
s.T["rewardText"], s.T["advertText"] = getRewardText()
|
|
@@ -451,7 +482,7 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
var node bool
|
|
|
if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
|
|
|
((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) || //新超级订阅非采购意向”和“拟建项目”
|
|
|
- stype == "mailprivate" || stype == "indexcontent" { //邮箱推送
|
|
|
+ stype == "mailprivate" || stype == "indexcontent" || stype == "bdprivate" { //邮箱推送
|
|
|
node = true
|
|
|
} else {
|
|
|
_, _, _, objc := pcVRT(sid, indust, stype, isVip || isMember || isEntniche)
|
|
@@ -558,7 +589,8 @@ func (s *Short) LoginCommon(userId, stype, id string) error {
|
|
|
if ssOpenid != nil {
|
|
|
obj["ucbsId"] = encrypt.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
|
|
|
}
|
|
|
-
|
|
|
+ obj["keywords"] = KeyWordHandle(obj)
|
|
|
+ obj["description"] = DescriptionHandle(stype, obj)
|
|
|
s.T["obj"] = obj
|
|
|
s.T["url"] = s.Uri()
|
|
|
return s.Render("/pc/biddetail_rec.html", &s.T)
|
|
@@ -1025,7 +1057,8 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
}
|
|
|
s.T["logid"] = config.Seoconfig["jysskzy"].(string)
|
|
|
s.T["shareid"] = se.EncodeString(shareid)
|
|
|
- s.T["keywords"] = s.GetString("kds")
|
|
|
+ //s.T["keywords"] = s.GetString("kds")
|
|
|
+
|
|
|
s.DisableHttpCache()
|
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, false)
|
|
|
if obj != nil && len(obj) > 0 {
|
|
@@ -1041,6 +1074,7 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
FieldProcessing(obj, "", industry, id, "", userId, stype, false)
|
|
|
obj["urlpath"] = s.Uri()
|
|
|
obj["industry"] = industry
|
|
|
+
|
|
|
if userId == "" {
|
|
|
obj["winnerTitle"] = obj["winner"]
|
|
|
obj["buyerTitle"] = obj["buyer"]
|
|
@@ -1048,19 +1082,21 @@ func (s *Short) NologinCommon(userId, stype, id, sid string) error {
|
|
|
obj["projectcodeTitle"] = obj["projectcode"]
|
|
|
log.Println(time.Now().UnixNano())
|
|
|
obj = Filter(obj)
|
|
|
- obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
|
|
|
+ //obj["description"] = fmt.Sprintf("%s,%s。", obj["title"], baseInfo(obj))
|
|
|
}
|
|
|
+ obj["agency"] = ""
|
|
|
if obj["publishtime"] != nil {
|
|
|
obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["publishtime"]), 0).Format(date.Date_Short_Layout)
|
|
|
}
|
|
|
+ obj["keywords"] = KeyWordHandle(obj)
|
|
|
+ obj["description"] = DescriptionHandle("nologin", obj)
|
|
|
s.T["obj"] = obj
|
|
|
s.T["url"] = s.Uri()
|
|
|
s.T["newBidInfoList"] = tg.GetNewBidInfo()
|
|
|
s.T["industryInfoList"] = tg.GetConsult()
|
|
|
s.T["hotLabelList"] = tg.GetHotLabel(30)
|
|
|
content, _ := s.Render4Cache("/pc/tags/detail.html", &s.T)
|
|
|
- //timeout := 60 * 60 * 24
|
|
|
- //redis.Put("newother", catchKey, string(content), timeout)
|
|
|
+ redis.Put("newother", catchKey, string(content), 60*2)
|
|
|
return s.SetBody(content)
|
|
|
}
|
|
|
} else {
|
|
@@ -1138,3 +1174,96 @@ func RegDetail(html string) string {
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
|
+
|
|
|
+func KeyWordHandle(obj map[string]interface{}) string {
|
|
|
+ keywordArr := []string{}
|
|
|
+ owner := util.InterfaceToStr(obj["owner"])
|
|
|
+ buyer := util.InterfaceToStr(obj["buyer"])
|
|
|
+ if buyer == "" {
|
|
|
+ buyer = owner
|
|
|
+ }
|
|
|
+ if buyer != "" && buyer != config.Sysconfig["detailMosaicTxt"] {
|
|
|
+ keywordArr = append(keywordArr, buyer)
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["s_winner"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
|
|
|
+ keywordArr = append(keywordArr, util.InterfaceToStr(obj["s_winner"]))
|
|
|
+ }
|
|
|
+ if obj["purchasinglist"] != nil && obj["purchasinglist"] != "" {
|
|
|
+ i := 0
|
|
|
+ for _, v := range gconv.SliceMap(obj["purchasinglist"]) {
|
|
|
+ if i == 5 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(v["itemname"]) != "" && util.InterfaceToStr(obj["s_winner"]) != config.Sysconfig["detailMosaicTxt"] {
|
|
|
+ keywordArr = append(keywordArr, util.InterfaceToStr(v["itemname"]))
|
|
|
+ i++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["subtype"]) != "" && util.InterfaceToStr(obj["subtype"]) != "其它" {
|
|
|
+ keywordArr = append(keywordArr, TypeCodeMap[util.InterfaceToStr(obj["subtype"])])
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["area"]) != "" {
|
|
|
+ keywordArr = append(keywordArr, util.InterfaceToStr(obj["area"])+"招标")
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["city"]) != "" {
|
|
|
+ keywordArr = append(keywordArr, util.InterfaceToStr(obj["city"])+"招标")
|
|
|
+ }
|
|
|
+ keywordArr = append(keywordArr, "剑鱼标讯")
|
|
|
+ keyword := strings.Join(keywordArr, ",")
|
|
|
+ return keyword
|
|
|
+}
|
|
|
+func DescriptionHandle(stype string, obj map[string]interface{}) string {
|
|
|
+ description := ""
|
|
|
+ publishtime := util.Int64All(obj["l_publishtime"])
|
|
|
+ if publishtime == 0 {
|
|
|
+ publishtime = util.Int64All(obj["publishtime"])
|
|
|
+ }
|
|
|
+ pushTime := time.Unix(publishtime, 0)
|
|
|
+ title := util.InterfaceToStr(obj["title"])
|
|
|
+ owner := util.InterfaceToStr(obj["owner"])
|
|
|
+ buyer := util.InterfaceToStr(obj["buyer"])
|
|
|
+ if buyer == "" {
|
|
|
+ buyer = owner
|
|
|
+ }
|
|
|
+ s_winner := util.InterfaceToStr(obj["s_winner"])
|
|
|
+ area := util.InterfaceToStr(obj["area"])
|
|
|
+ city := util.InterfaceToStr(obj["city"])
|
|
|
+ if stype == "bdprivate" {
|
|
|
+ //bdprivate
|
|
|
+ //{项目标题},采购单位:{采购单位名称},成交供应商:{中标企业名称},公告日期:{公告日期}。
|
|
|
+ descriptionArr := []string{}
|
|
|
+ if title != "" {
|
|
|
+ descriptionArr = append(descriptionArr, title)
|
|
|
+ }
|
|
|
+ if buyer != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("采购单位:%s", buyer))
|
|
|
+ }
|
|
|
+ if s_winner != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("成交供应商:%s", s_winner))
|
|
|
+ }
|
|
|
+ if publishtime != 0 {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("公告日期:%s", pushTime.Format("2006年01月02日")))
|
|
|
+ }
|
|
|
+ descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
|
|
|
+ description = strings.Join(descriptionArr, ",")
|
|
|
+ } else {
|
|
|
+ //descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
|
|
|
+ descriptionArr := []string{}
|
|
|
+ if title != "" {
|
|
|
+ descriptionArr = append(descriptionArr, title)
|
|
|
+ }
|
|
|
+ if area != "" || city != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目所属地区是%s%s", area, city))
|
|
|
+ }
|
|
|
+ if buyer != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目采购单位是%s", buyer))
|
|
|
+ }
|
|
|
+ if publishtime != 0 {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目发布时间是%s", pushTime.Format("2006年01月02日")))
|
|
|
+ }
|
|
|
+ descriptionArr = append(descriptionArr, "查看该项目信息详情请访问剑鱼标讯官网。")
|
|
|
+ description = strings.Join(descriptionArr, ",")
|
|
|
+ }
|
|
|
+ return description
|
|
|
+}
|