wangchuanjin 5 жил өмнө
parent
commit
97272b1d02

+ 7 - 5
src/jfw/front/follow.go

@@ -864,17 +864,19 @@ func (m *Follow) Notice(id, followId string) error {
 	var query map[string]interface{}
 	if len(id) == 19 {
 		query = map[string]interface{}{
-			"date":   util.Int64All(id) / 1000000000,
-			"userid": userid,
-			"fid":    followId,
+			"l_date":     util.Int64All(id) / 1000000000,
+			"s_userid":   userid,
+			"s_followid": followId,
 		}
 	} else {
 		query = map[string]interface{}{
-			"_id":    StringTOBsonId(id),
-			"userid": userid,
+			"_id":      StringTOBsonId(id),
+			"s_userid": userid,
 		}
 	}
+	log.Println(query)
 	data, ok := public.MQFW.FindOneByField("jy_pushproject", query, `{"s_followid":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"a_relationinfo":1,"a_visited":1}`)
+	log.Println(data)
 	if ok && data != nil && len(*data) > 0 {
 		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
 			relationinfo := a_relationinfo.([]interface{})

+ 5 - 5
src/jfw/modules/app/src/app/front/follow.go

@@ -731,14 +731,14 @@ func (m *Follow) Notice(id, followId string) error {
 	var query map[string]interface{}
 	if len(id) == 19 {
 		query = map[string]interface{}{
-			"date":   util.Int64All(id) / 1000000000,
-			"userid": userid,
-			"fid":    followId,
+			"l_date":     util.Int64All(id) / 1000000000,
+			"s_userid":   userid,
+			"s_followid": followId,
 		}
 	} else {
 		query = map[string]interface{}{
-			"_id":    StringTOBsonId(id),
-			"userid": userid,
+			"_id":      StringTOBsonId(id),
+			"s_userid": userid,
 		}
 	}
 	data, ok := public.MQFW.FindOneByField("jy_pushproject", query, `{"s_followid":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"a_relationinfo":1,"a_visited":1}`)

+ 7 - 5
src/jfw/modules/app/src/web/templates/weixin/follow/notice.html

@@ -109,11 +109,13 @@ $(function(){
 });
 function isVisited(sid){
 	var a_visited = {{.T.data.a_visited}};
-	for(var i=0;i<a_visited.length;i++){
-		if(a_visited[i] == sid){
-			return true;
-		}
-	}
+  if(a_visited != null){
+  	for(var i=0;i<a_visited.length;i++){
+  		if(a_visited[i] == sid){
+  			return true;
+  		}
+  	}
+  }
 	return false;
 }
 function beforeRedirect(obj,sid,link){

+ 3 - 3
src/jfw/modules/pushent/src/config.json

@@ -3,11 +3,11 @@
     "elasticPoolSize": 30,
     "elasticsearch": "http://192.168.3.128:9800",
     "lastid": "",
-    "maxSearch": 40000,
+    "maxSearch": 5000,
     "mongodbName": "qfw",
     "mongodbPoolSize": "20",
     "mongodbServers": "192.168.3.128:27080",
-    "redisServers": "push=192.168.3.128:5001",
+    "redisServers": "push=192.168.3.128:5002",
     "viewDomain": "https://web-jydev-wcj.jianyu360.cn",
     "weixinRpcServer": "127.0.0.1:8083",
     "wxcolor": "#25c78c",
@@ -16,7 +16,7 @@
     "wxtitle": "您关注的企业“%s”有新的公告信息!如果不想继续收到此类信息,可进入发现-我关注的企业进行取消。",
 	"wxdetailcolor":"#686868",
 	"appPushServiceRpc":"127.0.0.1:5566",
-	"testids":["5d81c5a525ef8723ac0036f9"],
+	"testids":["5d6378301c298a5aac7b5402"],
 	"pushPool": 30,
 	"eachPool": 30
 }

+ 5 - 5
src/jfw/modules/pushent/src/followpush/push.go

@@ -322,11 +322,11 @@ func push(fid, sname, userId string, res *[]map[string]interface{}) {
 			applystatus := util.IntAll((*userdata)["i_applystatus"])
 			//进入推送逻辑
 			isSaveOk := tools.MQFW.Save("jy_pushent", bson.M{
-				"userid":  userId,
-				"date":    time.Now(),
-				"info":    pushArray,
-				"entname": sname,
-				"fid":     fid,
+				"s_userid":       userId,
+				"l_date":         time.Now().Unix(),
+				"a_relationinfo": pushArray,
+				"s_entname":      sname,
+				"s_followid":     fid,
 			})
 			if isSaveOk == "" {
 				log.Println("保存到mongodb出错!", userId)

BIN
src/jfw/modules/pushent/src/src.exe~


+ 4 - 4
src/jfw/modules/pushproject/src/config.json

@@ -1,13 +1,13 @@
 {
-	"durationMinutes": "3",
+	"durationMinutes": "30",
 	"elasticPoolSize": 30,
 	"elasticsearch": "http://192.168.3.128:9800",
 	"lastid": "",
-	"maxSearch": 50000,
+	"maxSearch": 5000,
 	"mongodbName": "qfw",
 	"mongodbPoolSize": "20",
 	"mongodbServers": "192.168.3.128:27080",
-	"redisServers": "push=192.168.3.128:5001",
+	"redisServers": "push=192.168.3.128:5002",
 	"rpcPort": "8759",
 	"viewDomain": "http://web-jydev-wcj.jianyu360.cn",
 	"weixinRpcServer": "127.0.0.1:8083",
@@ -17,7 +17,7 @@
 	"wxtitle": "您关注的项目《%s》有新的公告信息!如果不想继续收到此类信息,可进入发现-我关注的项目进行取消。",
 	"wxdetailcolor":"#686868",
 	"appPushServiceRpc":"127.0.0.1:5566",
-	"testids":["5d81c5a525ef8723ac0036f9"],
+	"testids":["5d6378301c298a5aac7b5402"],
 	"pushPool": 30,
 	"eachPool": 30
 }

+ 7 - 7
src/jfw/modules/pushproject/src/followpush/push.go

@@ -431,13 +431,13 @@ func push(fid interface{}, sname, scode, title, userId string, res *[]map[string
 				if tit != "" {
 					followid := BsonIdToSId(fid)
 					saveId := tools.MQFW.Save("jy_pushproject", bson.M{
-						"userid": userId,
-						"date":   time.Now().Unix(),
-						"info":   pushArray,
-						"title":  title,
-						"pcode":  scode,
-						"pname":  sname,
-						"fid":    followid,
+						"s_userid":       userId,
+						"l_date":         time.Now().Unix(),
+						"a_relationinfo": pushArray,
+						"s_title":        title,
+						"s_projectcode":  scode,
+						"s_projectname":  sname,
+						"s_followid":     followid,
 					})
 					if saveId == "" {
 						log.Println("保存到mongodb出错!", userId)

+ 13 - 13
src/jfw/modules/subscribepay/src/report/report.go

@@ -157,31 +157,31 @@ func (r *Report) Detail() {
 	result["subscribe"] = subscribe
 	//关注项目
 	res, _ := util.MQFW.Find("jy_pushproject", map[string]interface{}{
-		"date": map[string]interface{}{
+		"l_date": map[string]interface{}{
 			"$gte": start,
 			"$lt":  end + 86400,
 		},
-		"userid": userId,
-	}, nil, `{"pcode":1,"pname":1,"info":1}`, false, -1, 100)
+		"s_userid": userId,
+	}, nil, `{"s_projectcode":1,"s_projectname":1,"a_relationinfo":1}`, false, -1, 100)
 	follow_project := *res
 	if follow_project != nil {
 		indexMap := map[string]int{}
 		projects := []map[string]interface{}{}
 		for _, v := range follow_project {
-			projectname := qutil.ObjToString(v["pname"])
+			projectname := qutil.ObjToString(v["s_projectname"])
 			if projectname == "" {
-				projectname = qutil.ObjToString(v["pcode"])
+				projectname = qutil.ObjToString(v["s_projectcode"])
 			}
 			index, ok := indexMap[projectname]
 			//合并
 			if ok {
 				infos, _ := projects[index]["infos"].([]map[string]interface{})
-				infos = append(infos, formatInfo(v["info"])...)
+				infos = append(infos, formatInfo(v["a_relationinfo"])...)
 				projects[index]["infos"] = infos
 			} else {
 				projects = append(projects, map[string]interface{}{
 					"projectname": projectname,
-					"infos":       formatInfo(v["info"]),
+					"infos":       formatInfo(v["a_relationinfo"]),
 				})
 				indexMap[projectname] = len(projects) - 1
 			}
@@ -190,28 +190,28 @@ func (r *Report) Detail() {
 	}
 	//关注企业
 	res_ent, _ := util.MQFW.Find("jy_pushent", map[string]interface{}{
-		"date": map[string]interface{}{
+		"l_date": map[string]interface{}{
 			"$gte": start,
 			"$lt":  end + 86400,
 		},
-		"userid": userId,
-	}, nil, `{"entname":1,"info":1}`, false, -1, 100)
+		"s_userid": userId,
+	}, nil, `{"s_entname":1,"a_relationinfo":1}`, false, -1, 100)
 	follow_ent := *res_ent
 	if follow_ent != nil {
 		indexMap := map[string]int{}
 		ents := []map[string]interface{}{}
 		for _, v := range follow_ent {
-			entname := qutil.ObjToString(v["entname"])
+			entname := qutil.ObjToString(v["s_entname"])
 			index, ok := indexMap[entname]
 			//合并
 			if ok {
 				infos, _ := ents[index]["infos"].([]map[string]interface{})
-				infos = append(infos, formatInfo(v["info"])...)
+				infos = append(infos, formatInfo(v["a_relationinfo"])...)
 				ents[index]["infos"] = infos
 			} else {
 				ents = append(ents, map[string]interface{}{
 					"entname": entname,
-					"infos":   formatInfo(v["info"]),
+					"infos":   formatInfo(v["a_relationinfo"]),
 				})
 				indexMap[entname] = len(ents) - 1
 			}

+ 7 - 5
src/web/templates/weixin/follow/notice.html

@@ -122,11 +122,13 @@ $(function(){
 });
 function isVisited(sid){
 	var a_visited = {{.T.data.a_visited}};
-	for(var i=0;i<a_visited.length;i++){
-		if(a_visited[i] == sid){
-			return true;
-		}
-	}
+  if(a_visited != null){
+  	for(var i=0;i<a_visited.length;i++){
+  		if(a_visited[i] == sid){
+  			return true;
+  		}
+  	}
+  }
 	return false;
 }
 function beforeRedirect(obj,sid,link){