|
@@ -476,7 +476,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
tmp["bidopentime"] = qu.Int64All(bidopentime)
|
|
|
}
|
|
|
//数据存到usermail,并且根据公告id去重
|
|
|
- if dataTable == 1 && noticeFilter == 1 {
|
|
|
+ /*if dataTable == 1 && noticeFilter == 1 {
|
|
|
log.Println("datag", appid+"_"+qu.ObjToString(tmp["id"]))
|
|
|
isExists, err := redis.Exists("datag", appid+"_"+qu.ObjToString(tmp["id"]))
|
|
|
if err != nil {
|
|
@@ -485,7 +485,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
log.Println("信息id重复 ", qu.ObjToString(tmp["id"]))
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
//存到mysql pushentniche表中,根据公告id去重
|
|
|
if dataTable == 2 {
|
|
|
isExist, err := redis.Exists("other", "entexportdata_"+qu.ObjToString(tmp["id"])+"_"+fmt.Sprintln(entId))
|
|
@@ -625,8 +625,8 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
if isDis && tmp["winner_type"] == "集成商" {
|
|
|
return
|
|
|
}
|
|
|
- if noticeFilter == 1 && dataTable == 0 && isOk {
|
|
|
- ok := checkBidId(appid, id)
|
|
|
+ if noticeFilter == 1 && (dataTable == 0 || dataTable == 1) && isOk {
|
|
|
+ ok := checkBidId(appid, id, dataTable)
|
|
|
if !ok {
|
|
|
isOk = false
|
|
|
tmp["chongfu"] = id
|
|
@@ -1410,17 +1410,21 @@ func InitProjectId(appid string) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func checkBidId(appid, id string) bool {
|
|
|
+func checkBidId(appid, id string, dataTable int) bool {
|
|
|
isOk := true
|
|
|
- userMailData, ok := Mgo.FindOne(SaveUserMail, bson.M{"appid": appid, "id": id})
|
|
|
- if ok && userMailData != nil && *userMailData != nil {
|
|
|
- log.Println("用户 ", appid, " 在 ", SaveUserMail, " 中找到重复公告id ", id)
|
|
|
- isOk = false
|
|
|
+ if dataTable == 1 {
|
|
|
+ count := MgoCus.Count(SaveUserMail, bson.M{"appid": appid, "id": id})
|
|
|
+ if count > 0 {
|
|
|
+ log.Println("用户 ", appid, " 在 ", SaveUserMail, " 中找到重复公告id ", id)
|
|
|
+ isOk = false
|
|
|
+ }
|
|
|
}
|
|
|
- userHistoryData, oks := Mgo.FindOne(SaveColl, bson.M{"appid": appid, "id": id})
|
|
|
- if oks && userHistoryData != nil && *userHistoryData != nil {
|
|
|
- log.Println("用户 ", appid, " 在 ", SaveColl, " 中找到重复公告id ", id)
|
|
|
- isOk = false
|
|
|
+ if dataTable == 0 {
|
|
|
+ count := Mgo.Count(SaveColl, bson.M{"appid": appid, "id": id})
|
|
|
+ if count > 0 {
|
|
|
+ log.Println("用户 ", appid, " 在 ", SaveColl, " 中找到重复公告id ", id)
|
|
|
+ isOk = false
|
|
|
+ }
|
|
|
}
|
|
|
return isOk
|
|
|
}
|