wangchuanjin 2 år sedan
förälder
incheckning
60a1a0ac5d
3 ändrade filer med 75 tillägg och 24 borttagningar
  1. 66 23
      cache/cache.go
  2. 1 1
      p/constant.go
  3. 8 0
      p/public.go

+ 66 - 23
cache/cache.go

@@ -17,28 +17,45 @@ const (
 )
 
 type SubPushList struct {
-	Id            string      `json:"_id"`
-	Title         string      `json:"title"`
-	Area          string      `json:"area"`
-	BuyerClass    string      `json:"buyerClass"`
-	Subtype       string      `json:"subtype"`
-	Industry      string      `json:"industry"`
-	PublishTime   int64       `json:"publishTime"`
-	Ca_index      int64       `json:"ca_index"`
-	Ca_date       int64       `json:"ca_date"`
-	Ca_isvisit    int         `json:"ca_isvisit"`
-	Ca_isvip      int         `json:"ca_isvip"`
-	Ca_type       int         `json:"ca_type"`
-	Ca_fileExists bool        `json:"ca_fileExists"`
-	MatchKeys     []string    `json:"matchKeys"`
-	Budget        interface{} `json:"budget"`
-	BidAmount     interface{} `json:"bidAmount"`
-	Collection    int         `json:"collection"`
-	Buyer         string      `json:"buyer"`
-	ProjectName   string      `json:"projectName"`
-	Winner        string      `json:"winner"`
-	BidOpenTime   int64       `json:"bidOpenTime"`
-	Source        int64       `json:"source"`
+	Id            string        `json:"_id"`
+	Title         string        `json:"title"`
+	Area          string        `json:"area"`
+	BuyerClass    string        `json:"buyerClass"`
+	Subtype       string        `json:"subtype"`
+	Industry      string        `json:"industry"`
+	PublishTime   int64         `json:"publishTime"`
+	Ca_index      int64         `json:"ca_index"`
+	Ca_date       int64         `json:"ca_date"`
+	Ca_isvisit    int           `json:"ca_isvisit"`
+	Ca_isvip      int           `json:"ca_isvip"`
+	Ca_type       int           `json:"ca_type"`
+	Ca_fileExists bool          `json:"ca_fileExists"`
+	MatchKeys     []string      `json:"matchKeys"`
+	Budget        interface{}   `json:"budget"`
+	BidAmount     interface{}   `json:"bidAmount"`
+	Collection    int           `json:"collection"`
+	Buyer         string        `json:"buyer"`
+	ProjectName   string        `json:"projectName"`
+	Winner        string        `json:"winner"`
+	BidOpenTime   int64         `json:"bidOpenTime"`
+	Source        int64         `json:"source"`
+	WinnerInfo    []*WinnerInfo `json:"winnerInfo"`
+	Site          string        `json:"site"`
+	BuyerTel      string        `json:"buyerTel"`
+	BuyerPerson   string        `json:"buyerPerson"`
+	Agency        string        `json:"agency"`
+	AgencyPerson  string        `json:"agencyPerson"`
+	AgencyTel     string        `json:"agencyTel"`
+	SignendTime   int64         `json:"signendTime"`
+	BidendTime    int64         `json:"bidendTime"`
+}
+
+//
+type WinnerInfo struct {
+	Winner       string `json:"winner"`
+	WinnerTel    string `json:"winnerTel"`
+	WinnerPerson string `json:"winnerPerson"`
+	WinnerId     string `json:"winnerId"`
 }
 
 type SubPush struct {
@@ -117,6 +134,23 @@ func NewSubPushList(pushCas []*PushCa) []*SubPushList {
 		if _id == "" {
 			_id = ObjToString((*info)["_id"])
 		}
+		winner := ObjToString((*info)["s_winner"])
+		winnerInfo := []*WinnerInfo{}
+		if winner != "" && len(strings.Split(winner, ",")) > 0 {
+			for wk, wv := range strings.Split(winner, ",") {
+				var winnerId = ""
+				eil, _ := (*info)["entidlist"].([]interface{})
+				if entIdList := ObjArrToStringArr(eil); len(entIdList) > wk { //中标企业id集合
+					winnerId = entIdList[wk]
+				}
+				winnerInfo = append(winnerInfo, &WinnerInfo{
+					Winner:       wv,                                                                                               //中标企业 需要单独处理
+					WinnerTel:    ObjToString((*info)["winnertel"]),                                                                //中标企业联系电话
+					WinnerPerson: ObjToString((*info)["winnerperson"]),                                                             //中标企业联系人
+					WinnerId:     If(winnerId != "" && len([]rune(winnerId)) > 12, EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id  存在winnerId 异常的情况
+				})
+			}
+		}
 		subPushList = append(subPushList, &SubPushList{
 			Id:            EncodeArticleId2ByCheck(_id),
 			Title:         ObjToString((*info)["title"]),
@@ -135,9 +169,18 @@ func NewSubPushList(pushCas []*PushCa) []*SubPushList {
 			BidAmount:     (*info)["bidamount"],
 			Buyer:         ObjToString((*info)["buyer"]),
 			ProjectName:   ObjToString((*info)["projectname"]),
-			Winner:        ObjToString((*info)["s_winner"]),
+			Winner:        winner,
 			BidOpenTime:   Int64All((*info)["bidopentime"]),
 			Source:        p.Source,
+			Site:          ObjToString((*info)["site"]),
+			BuyerTel:      ObjToString((*info)["buyerTel"]),
+			BuyerPerson:   ObjToString((*info)["buyerPerson"]),
+			Agency:        ObjToString((*info)["agency"]),
+			AgencyPerson:  ObjToString((*info)["agencyPerson"]),
+			AgencyTel:     ObjToString((*info)["agencyTel"]),
+			SignendTime:   Int64All((*info)["signendTime"]),
+			BidendTime:    Int64All((*info)["bidendTime"]),
+			WinnerInfo:    winnerInfo,
 		})
 	}
 	return subPushList

+ 1 - 1
p/constant.go

@@ -53,6 +53,6 @@ var (
 	}
 	KeyFilterReg     = regexp.MustCompile("^(项目|中标|公告)$")
 	KeyRetainReg     = regexp.MustCompile("[\\p{Han}a-zA-Z0-9]")
-	SaveBiddingField = []string{"_id", "area", "city", "buyerclass", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "buyer", "bidamount", "budget", "projectname", "projectcode", "s_winner", "agency", "bidopentime", "attachment_count"}
+	SaveBiddingField = []string{"_id", "area", "city", "buyerclass", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "buyer", "bidamount", "budget", "projectname", "projectcode", "s_winner", "agency", "bidopentime", "attachment_count", "site", "buyertel", "buyerperson", "agencyperson", "agencytel", "winnerperson", "winnertel", "signendtime", "bidendtime", "entidlist"}
 	SpaceReg         = regexp.MustCompile("\\s+")
 )

+ 8 - 0
p/public.go

@@ -453,6 +453,14 @@ func LoadBidding(mgo *MongodbSim, dbName, coll string, startTime int64, redisCac
 		"budget":          1,
 		"bidamount":       1,
 		"isValidFile":     1,
+		"site":            1,
+		"agencyperson":    1,
+		"agencytel":       1,
+		"winnerperson":    1,
+		"winnertel":       1,
+		"signendtime":     1,
+		"bidendtime":      1,
+		"entidlist":       1,
 	}).Iter()
 	index := 0
 	for temp := make(map[string]interface{}); it.Next(&temp); {