ソースを参照

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

xuzhiheng 5 年 前
コミット
1f2ef286b0

+ 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,
 				"vipstatus":     user.VipStatus,
 			})
 			})
 			if len(saveBatch) == BulkSize {
 			if len(saveBatch) == BulkSize {
-				mongodb.SaveBulk(Pushspace_project, saveBatch...)
+				mongodb.SaveBulk(Pushspace_temp, saveBatch...)
 				saveBatch = []map[string]interface{}{}
 				saveBatch = []map[string]interface{}{}
 			}
 			}
 		}(u, i)
 		}(u, i)
@@ -277,7 +277,7 @@ func (m *MatchJob) ToRelationProject(projectUser *sync.Map) {
 							"infoid":     _id,
 							"infoid":     _id,
 							"userid":     user.Id,
 							"userid":     user.Id,
 							"maxid":      list_last_infoid,
 							"maxid":      list_last_infoid,
-							"toptypes":   user.O_vipjy.TopTypes,
+							"subtypes":   user.O_vipjy.SubTypes,
 							"createtime": time.Now().Unix(),
 							"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["_id"] = idQuery
 	}
 	}
 	//c_query = map[string]interface{}{
 	//c_query = map[string]interface{}{
-	//"_id": bson.ObjectIdHex("5da4c4dfa5cb26b9b7ffdc5d"),
+	//"_id": bson.ObjectIdHex("5da6c3bda5cb26b9b7da1ffe"),
 	//}
 	//}
 	logger.Info("开始加载", Bidding, "数据", c_query)
 	logger.Info("开始加载", Bidding, "数据", c_query)
 	var res []map[string]interface{}
 	var res []map[string]interface{}
@@ -571,7 +571,7 @@ func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *string) (int, *VipU
 						if s_v == "" {
 						if s_v == "" {
 							continue
 							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)
 						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 = ""
 		area = ""
 	}
 	}
 	city, _ := (*info)["city"].(string)
 	city, _ := (*info)["city"].(string)
-	toptype, _ := (*info)["toptype"].(string)
+	subtype, _ := (*info)["subtype"].(string)
 	title, _ := (*info)["title"].(string)
 	title, _ := (*info)["title"].(string)
 	title = strings.ToUpper(title)
 	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 {
 		if k.O_vipjy.ProjectMatch == 1 {
 			projectUsers = append(projectUsers, k)
 			projectUsers = append(projectUsers, k)
 		}
 		}
-		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[toptype][k] {
+		if !v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[subtype][k] {
 			continue
 			continue
 		}
 		}
 		users[k] = matchUser
 		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 //关键词-信息类型
 	Infotype map[string]map[string]bool //关键词-信息类型
 }
 }
 type O_vipjy struct {
 type O_vipjy struct {
-	TopTypes     []string
+	SubTypes     []string
 	ProjectMatch int
 	ProjectMatch int
 }
 }
 
 

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

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

+ 7 - 7
src/jfw/modules/weixin/src/wx/wx.go

@@ -102,7 +102,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 	}
 	}
 	autoReply_reg, _ := regexp.Compile("剑鱼|招标|中标|订阅|公告|项目|设置|推送")
 	autoReply_reg, _ := regexp.Compile("剑鱼|招标|中标|订阅|公告|项目|设置|推送")
 	shalong_text, shalong_img := "", ""
 	shalong_text, shalong_img := "", ""
-	log.Println(len(autoReply_reg.FindStringIndex(r.Content)))
+	//	log.Println(len(autoReply_reg.FindStringIndex(r.Content)))
 	if strings.Replace(r.Content, " ", "", -1) == "沙龙" {
 	if strings.Replace(r.Content, " ", "", -1) == "沙龙" {
 		shalong_text, shalong_img = shalongActive.Get()
 		shalong_text, shalong_img = shalongActive.Get()
 	}
 	}
@@ -213,8 +213,8 @@ func pcSetUserKeys(user map[string]interface{}, shareid, pccodepre string) (map[
 	result := "fail"
 	result := "fail"
 	subkey := redis.Get("sso", "pc_subscribe_"+shareid)
 	subkey := redis.Get("sso", "pc_subscribe_"+shareid)
 	keys := strings.Split(fmt.Sprint(subkey), " ")
 	keys := strings.Split(fmt.Sprint(subkey), " ")
-	log.Println(subkey)
-	log.Println(keys)
+	//	log.Println(subkey)
+	//	log.Println(keys)
 	if subkey != nil {
 	if subkey != nil {
 		if o_jy, ok := user["o_jy"].(map[string]interface{}); ok {
 		if o_jy, ok := user["o_jy"].(map[string]interface{}); ok {
 			if tmp, ok := o_jy["a_key"].([]interface{}); ok {
 			if tmp, ok := o_jy["a_key"].([]interface{}); ok {
@@ -242,7 +242,7 @@ func pcSetUserKeys(user map[string]interface{}, shareid, pccodepre string) (map[
 							}
 							}
 							if result != "repeat" {
 							if result != "repeat" {
 								keys := strings.Split(fmt.Sprint(subkey), " ")
 								keys := strings.Split(fmt.Sprint(subkey), " ")
-								log.Println("==:", keys)
+								//								log.Println("==:", keys)
 								tmp = append(tmp, map[string]interface{}{"key": keys})
 								tmp = append(tmp, map[string]interface{}{"key": keys})
 								o_jy["a_key"] = tmp
 								o_jy["a_key"] = tmp
 								result = "ok"
 								result = "ok"
@@ -329,7 +329,7 @@ func saveUser(u *UserInfo, source, pre, RSource string) (bool, string, string) {
 	isJyopUser := strings.HasPrefix(source, "Jyop")
 	isJyopUser := strings.HasPrefix(source, "Jyop")
 	pcresult := "" //pc订阅结果
 	pcresult := "" //pc订阅结果
 	subkey := ""   //pc订阅关键词
 	subkey := ""   //pc订阅关键词
-	log.Println("保存用户:", subkey)
+	//	log.Println("保存用户:", subkey)
 	fg := false
 	fg := false
 	tusers, ok := tools.MQFW.Find("user", map[string]interface{}{
 	tusers, ok := tools.MQFW.Find("user", map[string]interface{}{
 		"s_unionid": u.UnionId,
 		"s_unionid": u.UnionId,
@@ -1396,7 +1396,7 @@ func YjHandle(w http.ResponseWriter, r *http.Request) {
 	} else {
 	} else {
 		tmp := map[string]interface{}{}
 		tmp := map[string]interface{}{}
 		json.Unmarshal(ret, &tmp)
 		json.Unmarshal(ret, &tmp)
-		log.Println(tmp)
+		//		log.Println(tmp)
 		url := tmp["url"].(string)
 		url := tmp["url"].(string)
 		w.Write([]byte(url))
 		w.Write([]byte(url))
 	}
 	}
@@ -1559,7 +1559,7 @@ func vipFastSubscribe(user *map[string]interface{}, keyWord, openId string) (ret
 		}
 		}
 		if keysCount+len(keysFilter) > 300 {
 		if keysCount+len(keysFilter) > 300 {
 			//vip订阅超过300组关键词
 			//vip订阅超过300组关键词
-			log.Println("vip订阅超过300组关键词-----")
+			//			log.Println("vip订阅超过300组关键词-----")
 			return -3, strings.Replace(keyWord, "+", " ", -1), hasOldKey
 			return -3, strings.Replace(keyWord, "+", " ", -1), hasOldKey
 		}
 		}
 	}
 	}

+ 32 - 30
src/web/templates/weixin/historypush.html

@@ -96,9 +96,9 @@
 				hasNextPage = sessionStorage.historypushHasNextPage=="true"?true:false;
 				hasNextPage = sessionStorage.historypushHasNextPage=="true"?true:false;
 				scrollTop = sessionStorage.historypushScrollTop;
 				scrollTop = sessionStorage.historypushScrollTop;
 				dataCache = JSON.parse(sessionStorage.historypushDataCache);
 				dataCache = JSON.parse(sessionStorage.historypushDataCache);
-				isVipSub = sessionStorage.isVipSub=="true"?true:false;;
-				isPassCount = sessionStorage.isPassCount=="true"?true:false;;
-				haskey = sessionStorage.haskey=="true"?true:false;;
+				isVipSub = sessionStorage.isVipSub=="true"?true:false;
+				isPassCount = sessionStorage.isPassCount=="true"?true:false;
+				haskey = sessionStorage.haskey=="true"?true:false;
 				isOnTail = sessionStorage.isOnTail;
 				isOnTail = sessionStorage.isOnTail;
 				isExpire = sessionStorage.isExpire;
 				isExpire = sessionStorage.isExpire;
 				userId = sessionStorage.userId;
 				userId = sessionStorage.userId;
@@ -109,10 +109,12 @@
 			    }
 			    }
 				$("#list>*").remove();
 				$("#list>*").remove();
 				count = 0;
 				count = 0;
+				firstPage = dataCache;
 				if(dataCache.length==0){
 				if(dataCache.length==0){
 					hasNoData();
 					hasNoData();
+				}else{
+					structureHtml(dataCache,true);
 				}
 				}
-				structureHtml(dataCache,true);
 				$(window).scrollTop(scrollTop);
 				$(window).scrollTop(scrollTop);
 				sessionStorage.removeItem("historypushDataCache");
 				sessionStorage.removeItem("historypushDataCache");
 				sessionStorage.removeItem("historypushPageIndexCache");
 				sessionStorage.removeItem("historypushPageIndexCache");
@@ -152,21 +154,6 @@
 						isExpire = data.isExpire;
 						isExpire = data.isExpire;
 						sessionStorage.isExpire = isExpire;
 						sessionStorage.isExpire = isExpire;
 						sessionStorage.setItem(userId+"_searchTime",firstTime);
 						sessionStorage.setItem(userId+"_searchTime",firstTime);
-						if(!firstPage.length>0 && !haskey){
-							if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
-								sessionStorage.removeItem("keysetindexToHistory");
-								if(sessionStorage.keysetindexToHistory=="1"){
-									wx.ready(function () {
-										wx.closeWindow();
-									});
-								}else{
-									setTimeout(function(){
-										wx.closeWindow();
-									},2000);
-								}
-								return
-							}
-						}
 						showPage();
 						showPage();
 					},
 					},
 					error: function(xhr, type){
 					error: function(xhr, type){
@@ -248,22 +235,37 @@
 			//地区渲染
 			//地区渲染
   			mapData();
   			mapData();
 			if(!isVipSub){
 			if(!isVipSub){
-				history.pushState({},"","");
-				if(isInTSguide){
-					if(localStorage){
-						localStorage.removeItem("tsGuide_status");
-					}
-					window.location.href='/front/tenderSubscribe/guide';
-				}else{
-					window.location.href='/wxkeyset/keyset/index';
-				}
+				$(".normal_set").show();
+				$(".tab_left .area").hide();
 				$(".vip_banner").show();
 				$(".vip_banner").show();
 				$(".subscribe").css("margin-top","2rem");
 				$(".subscribe").css("margin-top","2rem");
 				if(isPassCount){
 				if(isPassCount){
 					$(".open_remind").show();
 					$(".open_remind").show();
 				}
 				}
-				$(".normal_set").show();
-				$(".tab_left .area").hide();
+				if(!firstPage.length>0 && !haskey){
+					if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
+						sessionStorage.removeItem("keysetindexToHistory");
+						if(sessionStorage.keysetindexToHistory=="1"){
+							wx.ready(function () {
+								wx.closeWindow();
+							});
+						}else{
+							setTimeout(function(){
+								wx.closeWindow();
+							},2000);
+						}
+						return
+					}
+					history.pushState({},"","");
+					if(isInTSguide){
+						if(localStorage){
+							localStorage.removeItem("tsGuide_status");
+						}
+						window.location.href='/front/tenderSubscribe/guide';
+					}else{
+						window.location.href='/wxkeyset/keyset/index';
+					}
+				}
 			}else{
 			}else{
 				if(!haskey){
 				if(!haskey){
 					$(".set_keyword").show();
 					$(".set_keyword").show();

+ 5 - 0
src/web/templates/weixin/wxkeyset/index.html

@@ -209,6 +209,11 @@ $(function(){
 		if(myArray.length>=10){
 		if(myArray.length>=10){
 			$("#ten").css("margin-bottom","1rem");
 			$("#ten").css("margin-bottom","1rem");
 		}
 		}
+		if (myArray.length>0){
+			sessionStorage.haskey = true;
+		}else{
+			sessionStorage.haskey = false;
+		}
 		isfocusing = false;
 		isfocusing = false;
 		var thisClass = $(this);
 		var thisClass = $(this);
 		$(".keyword").attr("readonly",false);
 		$(".keyword").attr("readonly",false);