|
@@ -1186,17 +1186,43 @@ func KeyWordHandle(obj map[string]interface{}) string {
|
|
|
return keyword
|
|
|
}
|
|
|
func DescriptionHandle(stype string, obj map[string]interface{}) string {
|
|
|
- descriptionStr := ""
|
|
|
description := ""
|
|
|
pushTime := time.Unix(util.Int64All(obj["publishtime"]), 0)
|
|
|
if stype == "bdprivate" {
|
|
|
//bdprivate
|
|
|
//{项目标题},采购单位:{采购单位名称},成交供应商:{中标企业名称},公告日期:{公告日期}。
|
|
|
- descriptionStr = "%s,采购单位1:%s,成交供应商:%s,公告日期:%s。"
|
|
|
- description = fmt.Sprintf(descriptionStr, util.InterfaceToStr(obj["title"]), util.InterfaceToStr(obj["buyer"]), util.InterfaceToStr(obj["s_winner"]), util.If(util.Int64All(obj["publishtime"]) == 0, "", pushTime.Format("2006年01月02日")))
|
|
|
+ descriptionArr := []string{}
|
|
|
+ if util.InterfaceToStr(obj["title"]) != "" {
|
|
|
+ descriptionArr = append(descriptionArr, util.InterfaceToStr(obj["title"]))
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["buyer"]) != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("采购单位:%s", util.InterfaceToStr(obj["buyer"])))
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["s_winner"]) != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("成交供应商:%s", util.InterfaceToStr(obj["s_winner"])))
|
|
|
+ }
|
|
|
+ if util.Int64All(obj["publishtime"]) != 0 {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("公告日期:%s", pushTime.Format("2006年01月02日")))
|
|
|
+ }
|
|
|
+ description = strings.Join(descriptionArr, ",")
|
|
|
} else {
|
|
|
- descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
|
|
|
- description = fmt.Sprintf(descriptionStr, util.InterfaceToStr(obj["title"]), util.InterfaceToStr(obj["area"]), util.InterfaceToStr(obj["city"]), util.InterfaceToStr(obj["buyer"]), util.If(util.Int64All(obj["publishtime"]) == 0, "", pushTime.Format("2006年01月02日")))
|
|
|
+ //descriptionStr = "%s,项目所属地区是%s%s,项目采购单位是%s,项目发布时间是%s"
|
|
|
+ descriptionArr := []string{}
|
|
|
+ if util.InterfaceToStr(obj["title"]) != "" {
|
|
|
+ descriptionArr = append(descriptionArr, util.InterfaceToStr(obj["title"]))
|
|
|
+ }
|
|
|
+ area := util.InterfaceToStr(obj["area"])
|
|
|
+ city := util.InterfaceToStr(obj["city"])
|
|
|
+ if area != "" || city != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目所属地区是%s%s", area, city))
|
|
|
+ }
|
|
|
+ if util.InterfaceToStr(obj["buyer"]) != "" {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目采购单位是%s", util.InterfaceToStr(obj["buyer"])))
|
|
|
+ }
|
|
|
+ if util.Int64All(obj["publishtime"]) != 0 {
|
|
|
+ descriptionArr = append(descriptionArr, fmt.Sprintf("项目发布时间是%s", pushTime.Format("2006年01月02日")))
|
|
|
+ }
|
|
|
+ description = strings.Join(descriptionArr, ",")
|
|
|
}
|
|
|
return description
|
|
|
}
|