wcj 5 年之前
父节点
当前提交
f59c9c21b9

+ 4 - 4
src/jfw/modules/pushsubscribe/src/match/job/matchjob.go

@@ -203,7 +203,7 @@ func (m *MatchJob) ToMatch(batchIndex int, matcher Matcher, datas *[]map[string]
 				"vipstatus":     user.VipStatus,
 			})
 			if len(saveBatch) == BulkSize {
-				mongodb.SaveBulk(Pushspace_project, saveBatch...)
+				mongodb.SaveBulk(Pushspace_temp, saveBatch...)
 				saveBatch = []map[string]interface{}{}
 			}
 		}(u, i)
@@ -277,7 +277,7 @@ func (m *MatchJob) ToRelationProject(projectUser *sync.Map) {
 							"infoid":     _id,
 							"userid":     user.Id,
 							"maxid":      list_last_infoid,
-							"toptypes":   user.O_vipjy.TopTypes,
+							"subtypes":   user.O_vipjy.SubTypes,
 							"createtime": time.Now().Unix(),
 						},
 					},
@@ -322,7 +322,7 @@ func (m *MatchJob) LoadBidding(lastId, newId string, lastTime int64) *[]map[stri
 		c_query["_id"] = idQuery
 	}
 	//c_query = map[string]interface{}{
-	//"_id": bson.ObjectIdHex("5da4c4dfa5cb26b9b7ffdc5d"),
+	//"_id": bson.ObjectIdHex("5da6c3bda5cb26b9b7da1ffe"),
 	//}
 	logger.Info("开始加载", Bidding, "数据", c_query)
 	var res []map[string]interface{}
@@ -571,7 +571,7 @@ func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *string) (int, *VipU
 						if s_v == "" {
 							continue
 						}
-						user.O_vipjy.TopTypes = append(user.O_vipjy.TopTypes, s_v)
+						user.O_vipjy.SubTypes = append(user.O_vipjy.SubTypes, s_v)
 						vipUser.Add(s_v, user, &vipUser.InfoTypeUsers)
 					}
 				}

+ 2 - 2
src/jfw/modules/pushsubscribe/src/match/matcher/vipmatch.go

@@ -41,7 +41,7 @@ func (v *VipUser) Match(info *map[string]interface{}) (*map[*UserInfo]*MatchUser
 		area = ""
 	}
 	city, _ := (*info)["city"].(string)
-	toptype, _ := (*info)["toptype"].(string)
+	subtype, _ := (*info)["subtype"].(string)
 	title, _ := (*info)["title"].(string)
 	title = strings.ToUpper(title)
 	//订阅词
@@ -92,7 +92,7 @@ func (v *VipUser) Match(info *map[string]interface{}) (*map[*UserInfo]*MatchUser
 		if k.O_vipjy.ProjectMatch == 1 {
 			projectUsers = append(projectUsers, k)
 		}
-		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[toptype][k] {
+		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[subtype][k] {
 			continue
 		}
 		users[k] = matchUser

+ 1 - 1
src/jfw/modules/pushsubscribe/src/public/entity.go

@@ -40,7 +40,7 @@ type O_jy struct {
 	Infotype map[string]map[string]bool //关键词-信息类型
 }
 type O_vipjy struct {
-	TopTypes     []string
+	SubTypes     []string
 	ProjectMatch int
 }
 

+ 8 - 8
src/jfw/modules/pushsubscribe/src/push/job/projectjob.go

@@ -80,11 +80,11 @@ func (p *ProjectPushJob) Execute() {
 						if !ok {
 							return
 						}
-						topTypes, _ := list[i]["toptypes"].([]interface{})
+						subtypes, _ := list[i]["subtypes"].([]interface{})
 						maxId, _ := list[i]["maxid"].(string)
-						userTopType := map[string]bool{}
-						for _, t := range topTypes {
-							userTopType[util.ObjToString(t)] = true
+						userSubtype := map[string]bool{}
+						for _, t := range subtypes {
+							userSubtype[util.ObjToString(t)] = true
 						}
 						//
 						project, _ := pi.(map[string]interface{})
@@ -100,8 +100,8 @@ func (p *ProjectPushJob) Execute() {
 							if unix-publishtime > Config.ProjectPublishTimeLimit { //发布时间7天之内
 								continue
 							}
-							topType, _ := plm["toptype"].(string)
-							if len(userTopType) > 0 && !userTopType[topType] {
+							subtype, _ := plm["subtype"].(string)
+							if len(userSubtype) > 0 && !userSubtype[subtype] {
 								continue
 							}
 							isExists, err := redis.Exists(Pushcache_2_a, PushInfoKey(userId, infoId))
@@ -140,7 +140,7 @@ func (p *ProjectPushJob) Execute() {
 						}
 					}
 					if len(updateProject) > 0 {
-						mongodb.NewUpdateBulk(Pushspace_project, updateProject...)
+						mongodb.NewUpdateBulk(Pushspace_project, true, true, updateProject...)
 					}
 					if len(updateProject) < BigBulkSize {
 						break
@@ -220,7 +220,7 @@ func (p *ProjectPushJob) loadPushspace_project(batchIndex int, startId *string)
 	it := sess.DB(DbName).C(Pushspace_project).Find(query).Select(map[string]interface{}{
 		"_id":       1,
 		"maxid":     1,
-		"toptypes":  1,
+		"subtypes":  1,
 		"userid":    1,
 		"projectid": 1,
 	}).Sort("-_id", "userid").Iter()