浏览代码

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

zhangxinlei1996 5 年之前
父节点
当前提交
7c40856419
共有 26 个文件被更改,包括 232 次插入225 次删除
  1. 0 1
      README.md
  2. 14 14
      src/jfw/front/laboratory.go
  3. 1 1
      src/jfw/modules/app/src/app/filter/filter.go
  4. 2 2
      src/jfw/modules/app/src/app/pay/dataexport_pay.go
  5. 0 1
      src/jfw/modules/app/src/web/staticres/jyapp/js/common.js
  6. 6 6
      src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html
  7. 0 7
      src/jfw/modules/entsesearch/src/search/entsesearch.go
  8. 二进制
      src/jfw/modules/followent/src/src
  9. 1 10
      src/jfw/modules/followent/src/web/templates/_error.html
  10. 11 11
      src/jfw/modules/pushent/src/followpush/push.go
  11. 11 11
      src/jfw/modules/pushproject/src/followpush/push.go
  12. 4 4
      src/jfw/modules/pushsubscribe/src/match/config.json
  13. 1 2
      src/jfw/modules/pushsubscribe/src/match/main.go
  14. 3 1
      src/jfw/modules/pushsubscribe/src/push/config.json
  15. 2 0
      src/jfw/modules/pushsubscribe/src/push/config/config.go
  16. 9 9
      src/jfw/modules/pushsubscribe/src/push/job/dopush.go
  17. 9 3
      src/jfw/modules/pushsubscribe/src/push/job/job.go
  18. 139 104
      src/jfw/modules/pushsubscribe/src/push/job/pushjob.go
  19. 二进制
      src/jfw/modules/pushsubscribe/src/push/push
  20. 二进制
      src/jfw/modules/pushsubscribe/src/statistics/statistics
  21. 1 1
      src/jfw/modules/weixin/src/wx/wx.go
  22. 3 0
      src/jfw/public/dataexport.go
  23. 1 10
      src/web/templates/_error.html
  24. 1 10
      src/web/templates/common/pcbottom.html
  25. 4 0
      src/web/templates/weixin/jylab/lab-close.html
  26. 9 17
      src/web/templates/weixin/search/mainSearch.html

+ 0 - 1
README.md

@@ -7,4 +7,3 @@ v2.8
 1.移动端数据导出
 2.微信、app搜索结果只显示500条
 3.剑鱼所有页面(pc、微信、app端)增加百度统计代码
-

+ 14 - 14
src/jfw/front/laboratory.go

@@ -29,17 +29,17 @@ func init() {
 
 //剑鱼标讯实验室首页
 func (l *Lab) Index() error {
-	return l.Render("/weixin/jylab/lab-close.html")
-	//defer util.Catch()
-	// userid := util.ObjToString(l.GetSession("userId"))
-	// openid := util.ObjToString(l.GetSession("s_m_openid"))
-	// if userid == "" {
-	// 	return l.Redirect("/swordfish/about")
-	// }
-	// l.T["signature"] = wx.SignJSSDK(l.Site() + l.Url())
-	// l.T["nickname"] = l.Session().Get("s_nickname").(string)
-	// l.T["avatar"] = l.Session().Get("s_avatar").(string)
-	// l.T["s_m_openid"] = se.EncodeString(openid)
+	defer util.Catch()
+	userid := util.ObjToString(l.GetSession("userId"))
+	openid := util.ObjToString(l.GetSession("s_m_openid"))
+	if userid == "" {
+		return l.Redirect("/swordfish/about")
+	}
+	l.T["signature"] = wx.SignJSSDK(l.Site() + l.Url())
+	l.T["nickname"] = l.Session().Get("s_nickname").(string)
+	l.T["avatar"] = l.Session().Get("s_avatar").(string)
+	l.T["s_m_openid"] = se.EncodeString(openid)
+	return l.Render("/weixin/jylab/lab-close.html", &l.T)
 	// return l.Render("/weixin/jylab/lab-index.html", &l.T)
 }
 
@@ -64,7 +64,7 @@ func (l *Lab) LabMode(mode string) error {
 
 //pc端扫码进入实验室
 func (l *Lab) QrToLab(t string) error {
-	return l.Redirect("/jylab/indexClosed")
+	return l.Redirect("/jylab/index")
 }
 
 //pc端扫码进入实验室子页面
@@ -77,7 +77,7 @@ func (l *Lab) QrToLabSubpage(t string) error {
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				FindUserAndCreateSess(openid, l.Session())
-				return l.Redirect("/jylab/indexClosed")
+				return l.Redirect("/jylab/index")
 			} else {
 				return nil
 			}
@@ -90,6 +90,6 @@ func (l *Lab) QrToLabSubpage(t string) error {
 			}
 		}
 	} else {
-		return l.Redirect("/jylab/indexClosed")
+		return l.Redirect("/jylab/index")
 	}
 }

+ 1 - 1
src/jfw/modules/app/src/app/filter/filter.go

@@ -15,7 +15,7 @@ func init() {
 		AskLoginUrls:  make([]*regexp.Regexp, 0),
 		Redirect:      "/jyapp/free/login?back=index&to=back",
 	}
-	sessionfiletr.AddAnonymousUrls("^/jyapp/(dataReport|dataExport)/(wxpay|alipay)/callback$", "^/jyapp/free/.*", "^/jyapp/jylab/mainSearch$", "^/jyapp/swordfish/searchlist/paging$", "^/jyapp/jylab/supsearch/getstatus$")
+	sessionfiletr.AddAnonymousUrls("^/jyapp/(dataReport|dataExport)/(wxpay|alipay)/callback$", "^/jyapp/free/.*", "^/jyapp/jylab/mainSearch$", "^/jyapp/swordfish/searchlist/paging$", "^/jyapp/jylab/supsearch/getstatus$", "^/jyapp/followent/recList$")
 	xweb.AddFilter(sessionfiletr)
 	go func() {
 		time.Sleep(1 * time.Minute)

+ 2 - 2
src/jfw/modules/app/src/app/pay/dataexport_pay.go

@@ -323,7 +323,7 @@ func (p *AppDataExportPay) WxPayCallback() {
 			pay_time := util.FormatDate(&now, util.Date_Full_Layout)
 			if orderdata != nil {
 				filename := fmt.Sprintf("%s.xlsx", fmt.Sprintf("%s_%s_%s", time.Now().Format("20060102150405"), util.ObjToString((*orderdata)["order_code"]), util.GetLetterRandom(5)))
-				download_url := fmt.Sprintf("/res/dataexport/%s", filename)
+				download_url := fmt.Sprintf("/jyapp/res/dataexport/%s", filename)
 				order_status := util.IntAll((*orderdata)["order_status"])
 				if order_status == 0 {
 					changeOrderStatus = public.Mysql.Update("dataexport_order", map[string]interface{}{
@@ -415,7 +415,7 @@ func (a *AppDataExportPay) AliPayCallback() {
 	if orderdata != nil {
 		pay_time := util.FormatDate(&now, util.Date_Full_Layout)
 		filename := fmt.Sprintf("%s.xlsx", fmt.Sprintf("%s_%s_%s", time.Now().Format("20060102150405"), util.ObjToString((*orderdata)["order_code"]), util.GetLetterRandom(5)))
-		download_url := fmt.Sprintf("/res/dataexport/%s", filename)
+		download_url := fmt.Sprintf("/jyapp/res/dataexport/%s", filename)
 		order_status := util.IntAll((*orderdata)["order_status"])
 		if order_status == 0 {
 			changeOrderStatus = public.Mysql.Update("dataexport_order", map[string]interface{}{

+ 0 - 1
src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

@@ -31,7 +31,6 @@ $(function(){
 		$target.trigger("tap",e);
     });
 	$(".app-layout-header .app-back").unbind("tap").on("tap",function(){
-		$(".app-layout-header .app-back").unbind("tap");
 		if(typeof(clickBack)=="function"){
 			clickBack();
 		}else{

+ 6 - 6
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -4,7 +4,7 @@
 <link href="/jyapp/css/bootstrap.min.css" rel="stylesheet">
 <link href="/jyapp/css/jy.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 <link href="/jyapp/css/common.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-<link href="/jyapp/css/wxsearch.css?v={{Msg "seo" "version"}}" rel="stylesheet" type="text/css" >
+<link href="/jyapp/css/wxsearch.css?v={{Msg "seo" "version"}}1" rel="stylesheet" type="text/css" >
 <link href="/jyapp/mobiscroll/mobiscroll.min.css" rel="stylesheet">
 <link href="/jyapp/css/dropload.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 <link href="/jyapp/css/wxlist.css?v={{Msg "seo" "version"}}" rel="stylesheet">
@@ -16,7 +16,7 @@
 <script type="text/javascript" src="/jyapp/js/wxEntsesearch.js?v={{Msg "seo" "version"}}"></script>
 <script type="text/javascript" src="/jyapp/js/wxSupersearch.js?v={{Msg "seo" "version"}}22"></script>
 <script type="text/javascript" src="/jyapp/js/bootstrap.min.js?v={{Msg "seo" "version"}}"></script>
-<script type="text/javascript" src="/jyapp/js/popup/tap.js?v={{Msg "seo" "version"}}"></script>
+<script type="text/javascript" src="/jyapp/js/popup/tap.js?v={{Msg "seo" "version"}}1"></script>
 <!--2.8-->
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/css/myorder/base.css?v={{Msg "seo" "version"}}">
 <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/css/myorder/iconfont.css?v={{Msg "seo" "version"}}">
@@ -807,7 +807,7 @@
 		checkIsOpen();
 		backThisPage();
 		//历史数据导出
-	    $(".content ul li a:eq(2)").unbind("tap").on("tap",function(event){
+	    $(".content ul li a:eq(1)").unbind("tap").on("tap",function(event){
 			event.stopPropagation();
 			setTimeout(function(){
 				if(userId==""){
@@ -825,9 +825,9 @@
 	    });
 		//查询是否开通超级搜索和中标企业搜索
 	    $.post("/jyapp/jylab/supsearch/getstatus?t="+new Date().getTime(),function(result){
-			  $("#searchIndex .inp-search").unbind("touchend").on("touchend",function () {
-	        SuperSearch.init(true,true,true);
-	      });
+			$("#searchIndex .inp-search").unbind("touchend").on("touchend",function () {
+		        SuperSearch.init(true,true,true);
+		    });
 			if(result.userId==""){
 				userId = "";
 				//中标企业搜索跳转

+ 0 - 7
src/jfw/modules/entsesearch/src/search/entsesearch.go

@@ -70,13 +70,6 @@ func (e *EntSeSearch) ProList() {
 	defer util.Catch()
 	proList := make([]map[string]interface{}, 0)
 	userid := util.ObjToString(e.GetSession("userId"))
-	if userid == "" {
-		e.ServeJson(map[string]interface{}{
-			"proList":     proList,
-			"hasNextPage": false,
-		})
-		return
-	}
 	var searchname = e.GetString("searchname")
 	var scope = e.GetString("scope")
 	var money_from = e.GetString("money_from")

二进制
src/jfw/modules/followent/src/src


+ 1 - 10
src/jfw/modules/followent/src/web/templates/_error.html

@@ -560,16 +560,7 @@ function infoListCss(){
 	}else{
 		$("#cpinfo").html("©2015-2016 jianyu360.com 版权所有 | 豫ICP备15016539号-2")
 	}
-    var bp = document.createElement('script');
-    var curProtocol = window.location.protocol.split(':')[0];
-    if (curProtocol === 'https') {
-        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
-    }
-    else {
-        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
-    }
-    var s = document.getElementsByTagName("script")[0];
-    s.parentNode.insertBefore(bp, s);
+	
 	$(".j-bottom .jy_province font").click(function(){
 		var scope = $(this).text();
 		areasearch(scope);

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

@@ -397,21 +397,21 @@ func push(fid, sname, userId string, res *[]map[string]interface{}) {
 				log.Println("微信推送", isPushOk, userId, s_m_openid, pushnum, sname)
 			}
 			if jpushid != "" || opushid != "" {
+				descriptAppend := ""
 				jpushtitle := strings.Replace((*((*pushArray)[0]))["s_title"].(string), "\n", "", -1)
-				if len([]rune(jpushtitle)) > 80 {
-					jpushtitle = string([]rune(jpushtitle)[:80]) + "..."
-				}
 				if pushnum > 1 {
-					jpushtitle = fmt.Sprintf("1. %s\n...(共%d条)", jpushtitle, pushnum)
+					descriptAppend = fmt.Sprintf("\n...(共%d条)", pushnum)
+					jpushtitle = fmt.Sprintf("1. %s", jpushtitle)
 				}
 				isPushOk := rpccall.AppPushServiceCall(map[string]interface{}{
-					"phoneType":   phoneType,
-					"otherPushId": opushid,
-					"jgPushId":    jpushid,
-					"descript":    jpushtitle,
-					"type":        "entname",
-					"userId":      userId,
-					"url":         "/jyapp/free/sess/" + se.EncodeString(userId+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",followEntDetail") + "__" + util.EncodeArticleId2ByCheck(fid),
+					"phoneType":      phoneType,
+					"otherPushId":    opushid,
+					"jgPushId":       jpushid,
+					"descript":       jpushtitle,
+					"descriptAppend": descriptAppend,
+					"type":           "entname",
+					"userId":         userId,
+					"url":            "/jyapp/free/sess/" + se.EncodeString(userId+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",followEntDetail") + "__" + util.EncodeArticleId2ByCheck(fid),
 				})
 				log.Println("app推送", isPushOk, userId, s_m_openid, a_m_openid, s_phone, phoneType, jpushid, opushid, pushnum, sname)
 			}

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

@@ -505,21 +505,21 @@ func push(fid interface{}, sname, scode, title, userId string, res *[]map[string
 						log.Println("微信推送", isPushOk, userId, s_m_openid, pushnum, tit)
 					}
 					if jpushid != "" || opushid != "" { //极光推送
+						descriptAppend := ""
 						jpushtitle := strings.Replace((*((*pushArray)[0]))["s_title"].(string), "\n", "", -1)
-						if len([]rune(jpushtitle)) > 80 {
-							jpushtitle = string([]rune(jpushtitle)[:80]) + "..."
-						}
 						if pushnum > 1 {
-							jpushtitle = fmt.Sprintf("1. %s\n...(共%d条)", jpushtitle, pushnum)
+							descriptAppend = fmt.Sprintf("\n...(共%d条)", pushnum)
+							jpushtitle = fmt.Sprintf("1. %s", jpushtitle)
 						}
 						isPushOk := rpccall.AppPushServiceCall(map[string]interface{}{
-							"phoneType":   phoneType,
-							"otherPushId": opushid,
-							"jgPushId":    jpushid,
-							"descript":    jpushtitle,
-							"type":        "project",
-							"userId":      userId,
-							"url":         "/jyapp/free/sess/" + se.EncodeString(userId+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushfollowlist") + "__" + tmpid + "__" + followid,
+							"phoneType":      phoneType,
+							"otherPushId":    opushid,
+							"jgPushId":       jpushid,
+							"descript":       jpushtitle,
+							"descriptAppend": descriptAppend,
+							"type":           "project",
+							"userId":         userId,
+							"url":            "/jyapp/free/sess/" + se.EncodeString(userId+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushfollowlist") + "__" + tmpid + "__" + followid,
 						})
 						log.Println("app推送", userId, s_m_openid, a_m_openid, s_phone, phoneType, jpushid, opushid, isPushOk, pushnum, tit)
 					}

+ 4 - 4
src/jfw/modules/pushsubscribe/src/match/config.json

@@ -1,12 +1,12 @@
 {
 	"elasticPoolSize": 1,
-	"elasticSearch": "http://192.168.3.18:9800",
-	"redisServers": "pushcache_1=192.168.3.18:2001",
+	"elasticSearch": "http://192.168.3.128:9800",
+	"redisServers": "pushcache_1=192.168.3.128:5000",
 	"maxPushSize": 50,
 	"maxSearch": 5000,
-	"mgoAddr": "192.168.3.18:27080",
+	"mgoAddr": "192.168.3.128:27080",
 	"mgoSize": 10,
-	"testids": ["5ca5a56e25ef8723d82b8cb5"],
+	"testids": [],
 	"filterWords":["项目","中标","公告"],
 	"matchPoolSize": 60,
 	"matchDuration": 1, 

+ 1 - 2
src/jfw/modules/pushsubscribe/src/match/main.go

@@ -26,7 +26,6 @@ func main() {
 		job.Jobs.Match.Execute()
 	} else {
 		go job.Task.Match.Execute()
-		flag := make(chan bool)
-		<-flag
+		<-chan bool(nil)
 	}
 }

+ 3 - 1
src/jfw/modules/pushsubscribe/src/push/config.json

@@ -33,7 +33,7 @@
 	"maxPushSize": 50,
 	"mgoAddr": "192.168.3.128:27080",
 	"mgoSize": 10,
-	"testids": ["5c8f4f4325ef8723d0bc1082"],
+	"testids": ["5d6e142a25ef871f08a72662"],
 	"weixinRpcServer": "127.0.0.1:8083",
 	"wxColor": "#2cb7ca",
 	"wxContent": "剑鱼标讯推送",
@@ -50,6 +50,8 @@
 	],
 	"cassandraPollSize":10,
 	"pushPoolSize": 60,
+	"mergePoolSize": 40,
+	"movePoolSize": 40,
 	"minutePushSize": 300,
 	"fastigiumMinutePushSize": 100,
 	"fastigiumTime":"9-11",

+ 2 - 0
src/jfw/modules/pushsubscribe/src/push/config/config.go

@@ -11,6 +11,8 @@ type sysConfig struct {
 	Cassandra               *cassandra  `json:"cassandra"`
 	RedisServers            string      `json:"redisServers"`
 	PushPoolSize            int         `json:"pushPoolSize"`
+	MergePoolSize           int         `json:"mergePoolSize"`
+	MovePoolSize            int         `json:"movePoolSize"`
 	Mail_content            string      `json:"mail_content"`
 	Mail_html               string      `json:"mail_html"`
 	Mail_title              string      `json:"mail_title"`

+ 9 - 9
src/jfw/modules/pushsubscribe/src/push/job/dopush.go

@@ -278,11 +278,10 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 	}
 	if appPush == 1 {
 		logger.Info("推送任务", taskType, "开始app推送", k.Id)
-		if len([]rune(jpushtitle)) > 80 {
-			jpushtitle = string([]rune(jpushtitle)[:80]) + "..."
-		}
+		descriptAppend := ""
 		if i > 1 {
-			jpushtitle = fmt.Sprintf("1. %s\n...(共%d条)", jpushtitle, i)
+			descriptAppend = fmt.Sprintf("\n...(共%d条)", i)
+			jpushtitle = fmt.Sprintf("1. %s", jpushtitle)
 		}
 		go mongodb.Update("user", map[string]interface{}{
 			"_id": bson.ObjectIdHex(k.Id),
@@ -292,11 +291,12 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 			},
 		}, false, false)
 		isPushOk := putil.SendApp(map[string]interface{}{
-			"phoneType": k.AppPhoneType,
-			"descript":  jpushtitle,
-			"type":      "bid",
-			"userId":    k.Id,
-			"url":       "/jyapp/free/sess/" + Se.EncodeString(k.Id+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",historypush"),
+			"phoneType":      k.AppPhoneType,
+			"descript":       jpushtitle,
+			"descriptAppend": descriptAppend,
+			"type":           "bid",
+			"userId":         k.Id,
+			"url":            "/jyapp/free/sess/" + Se.EncodeString(k.Id+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",historypush"),
 			//"url":       "/jyapp/free/sess/" + Se.EncodeString(sess_openid+",_id,"+strconv.Itoa(int(time.Now().Unix()))+",historypush"),
 			//"url":         "/jyapp/free/sess/" + push.Se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "__" + pushid,
 			"otherPushId": k.Opushid,

+ 9 - 3
src/jfw/modules/pushsubscribe/src/push/job/job.go

@@ -17,9 +17,15 @@ var Jobs = struct {
 	Repair *repairJob
 }{
 	Push: &pushJob{
-		pool: make(chan bool, config.SysConfig.PushPoolSize),
-		wait: &sync.WaitGroup{},
-		lock: &sync.Mutex{},
+		pool:      make(chan bool, config.SysConfig.PushPoolSize),
+		wait:      &sync.WaitGroup{},
+		lock:      &sync.Mutex{},
+		moveLock:  &sync.Mutex{},
+		moveWait:  &sync.WaitGroup{},
+		movePool:  make(chan bool, config.SysConfig.MovePoolSize),
+		mergeLock: &sync.Mutex{},
+		mergeWait: &sync.WaitGroup{},
+		mergePool: make(chan bool, config.SysConfig.MergePoolSize),
 	},
 	Repair: &repairJob{
 		pool: make(chan bool, config.SysConfig.PushPoolSize),

+ 139 - 104
src/jfw/modules/pushsubscribe/src/push/job/pushjob.go

@@ -26,12 +26,18 @@ type Move struct {
 }
 
 type pushJob struct {
-	taskType int
-	pool     chan bool
-	wait     *sync.WaitGroup
-	lock     *sync.Mutex
-	lastId   string
-	users    *[]map[string]interface{}
+	taskType  int
+	pool      chan bool
+	wait      *sync.WaitGroup
+	lock      *sync.Mutex
+	moveLock  *sync.Mutex
+	moveWait  *sync.WaitGroup
+	movePool  chan bool
+	mergeLock *sync.Mutex
+	mergeWait *sync.WaitGroup
+	mergePool chan bool
+	lastId    string
+	users     *[]map[string]interface{}
 }
 
 //taskType 1--实时推送 2--实时推送+一天三次的8点推送 3--一天三次推送 4--九点推送
@@ -46,6 +52,7 @@ func (p *pushJob) Execute(taskType int, isMoveDatas bool) {
 	p.Push()
 }
 func (p *pushJob) Move() {
+	defer util.Catch()
 	logger.Info("推送任务", p.taskType, "开始迁移数据。。。")
 	nowUnix := time.Now().Unix()
 	sess := mongodb.GetMgoConn()
@@ -58,53 +65,65 @@ func (p *pushJob) Move() {
 	moves := map[string]*Move{}
 	logger.Info("推送任务", p.taskType, "开始遍历pushspace_temp")
 	index, number, length := 0, 0, 0
-	for temp := make(map[string]interface{}); it.Next(&temp); {
-		userId := util.ObjToString(temp["userid"])
-		move := moves[userId]
-		if move != nil {
-			list, _ := move.Info["list"].(SortList)
-			idMap := map[string]bool{}
-			for _, v := range list {
-				idMap[util.ObjToString((*v.Info)["_id"])] = true
-			}
-			newList := putil.ToSortList(temp["list"])
-			for _, v := range newList {
-				if idMap[util.ObjToString((*v.Info)["_id"])] {
-					continue
+	for data := make(map[string]interface{}); it.Next(&data); {
+		p.movePool <- true
+		p.moveWait.Add(1)
+		index++
+		go func(temp map[string]interface{}) {
+			defer func() {
+				<-p.movePool
+				p.moveWait.Done()
+				p.moveLock.Unlock()
+			}()
+			userId := util.ObjToString(temp["userid"])
+			p.moveLock.Lock()
+			move := moves[userId]
+			if move != nil {
+				list, _ := move.Info["list"].(SortList)
+				idMap := map[string]bool{}
+				for _, v := range list {
+					idMap[util.ObjToString((*v.Info)["_id"])] = true
+				}
+				newList := putil.ToSortList(temp["list"])
+				for _, v := range newList {
+					if idMap[util.ObjToString((*v.Info)["_id"])] {
+						continue
+					}
+					list = append(list, v)
+				}
+				sort.Sort(list)
+				if len(list) > SysConfig.MaxPushSize {
+					list = list[:SysConfig.MaxPushSize]
+				}
+				temp["list"] = list
+				move.Info = temp
+				move.Ids = append(move.Ids, temp["_id"])
+			} else {
+				temp["list"] = putil.ToSortList(temp["list"])
+				move = &Move{
+					Info: temp,
+					Ids:  []interface{}{temp["_id"]},
 				}
-				list = append(list, v)
-			}
-			sort.Sort(list)
-			if len(list) > SysConfig.MaxPushSize {
-				list = list[:SysConfig.MaxPushSize]
 			}
-			temp["list"] = list
-			move.Info = temp
-			move.Ids = append(move.Ids, temp["_id"])
-		} else {
-			temp["list"] = putil.ToSortList(temp["list"])
-			move = &Move{
-				Info: temp,
-				Ids:  []interface{}{temp["_id"]},
+			moves[userId] = move
+			length++
+			if length == SysConfig.MoveBatch {
+				p.Merge(&number, nowUnix, moves)
+				length = 0
+				moves = map[string]*Move{}
 			}
-		}
-		moves[userId] = move
-		temp = make(map[string]interface{})
-		index++
-		length++
+		}(data)
+		data = make(map[string]interface{})
 		if index%500 == 0 {
 			logger.Info("推送任务", p.taskType, "pushspace_temp加载到内存:", index)
 		}
-		if length == SysConfig.MoveBatch {
-			length = 0
-			p.Merge(&number, nowUnix, moves)
-			moves = map[string]*Move{}
-		}
 	}
+	p.moveWait.Wait()
 	if length > 0 {
 		p.Merge(&number, nowUnix, moves)
+		length = 0
+		moves = map[string]*Move{}
 	}
-	moves = nil
 	logger.Info("推送任务", p.taskType, "迁移数据结束。。。", index)
 }
 func (p *pushJob) Merge(number *int, nowUnix int64, moves map[string]*Move) {
@@ -116,81 +135,96 @@ func (p *pushJob) Merge(number *int, nowUnix int64, moves map[string]*Move) {
 	updateArray_query := []map[string]interface{}{}
 	updateArray_set := []map[string]interface{}{}
 	updateArray_delete := []interface{}{}
-	sess := mongodb.GetMgoConn()
-	defer mongodb.DestoryMongoConn(sess)
-	for userId, move := range moves {
-		var data map[string]interface{}
-		sess.DB(DbName).C("pushspace").Find(map[string]interface{}{"userid": userId}).Select(map[string]interface{}{"list": 1, "templist": 1}).One(&data)
-		if data == nil { //批量新增
-			saveArray = append(saveArray, move.Info)
-			saveArray_delete = append(saveArray_delete, move.Ids...)
-			if len(saveArray) == BulkSize {
-				p.SaveBulk(sess, &saveArray, &saveArray_delete)
-			}
-		} else { //批量更新
-			setMap := map[string]interface{}{}
-			for _, field := range MoveFields {
-				if move.Info[field] == nil {
-					continue
+	for u, m := range moves {
+		p.mergePool <- true
+		p.mergeWait.Add(1)
+		go func(userId string, move *Move) {
+			defer func() {
+				<-p.mergePool
+				p.mergeWait.Done()
+			}()
+			sess := mongodb.GetMgoConn()
+			defer mongodb.DestoryMongoConn(sess)
+			var data map[string]interface{}
+			sess.DB(DbName).C("pushspace").Find(map[string]interface{}{"userid": userId}).Select(map[string]interface{}{"list": 1, "templist": 1}).One(&data)
+			if data == nil { //批量新增
+				p.mergeLock.Lock()
+				saveArray = append(saveArray, move.Info)
+				saveArray_delete = append(saveArray_delete, move.Ids...)
+				if len(saveArray) == BulkSize {
+					p.SaveBulk(sess, &saveArray, &saveArray_delete)
 				}
-				setMap[field] = move.Info[field]
-			}
-			//
-			newListOrig, _ := move.Info["list"].(SortList)
-			if newListOrig == nil || len(newListOrig) == 0 {
-				continue
-			}
-			pushAll := make(map[string]interface{})
-			for _, v := range []string{"", "temp"} {
-				oldList := putil.ToSortList(data[v+"list"])
-				if v == "temp" && oldList == nil {
-					continue
+				p.mergeLock.Unlock()
+			} else { //批量更新
+				setMap := map[string]interface{}{}
+				for _, field := range MoveFields {
+					if move.Info[field] == nil {
+						continue
+					}
+					setMap[field] = move.Info[field]
 				}
-				idMap := map[string]bool{}
-				for _, vv := range oldList {
-					idMap[util.ObjToString((*vv.Info)["_id"])] = true
+				//
+				newListOrig, _ := move.Info["list"].(SortList)
+				if newListOrig == nil || len(newListOrig) == 0 {
+					return
 				}
-				newList := make(SortList, 0)
-				//去重
-				for _, vv := range newListOrig {
-					if idMap[util.ObjToString((*vv.Info)["_id"])] {
+				pushAll := make(map[string]interface{})
+				for _, v := range []string{"", "temp"} {
+					oldList := putil.ToSortList(data[v+"list"])
+					if v == "temp" && oldList == nil {
+						continue
+					}
+					idMap := map[string]bool{}
+					for _, vv := range oldList {
+						idMap[util.ObjToString((*vv.Info)["_id"])] = true
+					}
+					newList := make(SortList, 0)
+					//去重
+					for _, vv := range newListOrig {
+						if idMap[util.ObjToString((*vv.Info)["_id"])] {
+							continue
+						}
+						newList = append(newList, vv)
+					}
+					pLength := len(newList)
+					if pLength == 0 {
 						continue
 					}
-					newList = append(newList, vv)
+					rLength := len(oldList)
+					if rLength+pLength > SysConfig.MaxPushSize {
+						newList = append(newList, oldList...)
+						sort.Sort(newList)
+						setMap[v+"list"] = newList[:SysConfig.MaxPushSize]
+						setMap[v+"size"] = SysConfig.MaxPushSize
+					} else { //追加
+						setMap[v+"size"] = rLength + pLength
+						pushAll[v+"list"] = newList
+					}
 				}
-				pLength := len(newList)
-				if pLength == 0 {
-					continue
+				upSet := map[string]interface{}{
+					"$set": setMap,
 				}
-				rLength := len(oldList)
-				if rLength+pLength > SysConfig.MaxPushSize {
-					newList = append(newList, oldList...)
-					sort.Sort(newList)
-					setMap[v+"list"] = newList[:SysConfig.MaxPushSize]
-					setMap[v+"size"] = SysConfig.MaxPushSize
-				} else { //追加
-					setMap[v+"size"] = rLength + pLength
-					pushAll[v+"list"] = newList
+				if len(pushAll) > 0 {
+					upSet["$pushAll"] = pushAll
 				}
+				p.mergeLock.Lock()
+				updateArray_delete = append(updateArray_delete, move.Ids...)
+				updateArray_query = append(updateArray_query, map[string]interface{}{"_id": data["_id"]})
+				updateArray_set = append(updateArray_set, upSet)
+				if len(updateArray_query) == BulkSize {
+					p.UpdateBulk(sess, &updateArray_query, &updateArray_set, &updateArray_delete)
+				}
+				p.mergeLock.Unlock()
 			}
-			upSet := map[string]interface{}{
-				"$set": setMap,
-			}
-			if len(pushAll) > 0 {
-				upSet["$pushAll"] = pushAll
-			}
-			updateArray_delete = append(updateArray_delete, move.Ids...)
-			updateArray_query = append(updateArray_query, map[string]interface{}{"_id": data["_id"]})
-			updateArray_set = append(updateArray_set, upSet)
-			if len(updateArray_query) == BulkSize {
-				p.UpdateBulk(sess, &updateArray_query, &updateArray_set, &updateArray_delete)
-			}
-		}
+		}(u, m)
 		index++
 		if index%500 == 0 {
 			logger.Info("推送任务", p.taskType, "第", *number, "次合并数据:", index)
 		}
 	}
+	p.mergeWait.Wait()
+	sess := mongodb.GetMgoConn()
+	defer mongodb.DestoryMongoConn(sess)
 	if len(saveArray) > 0 {
 		p.SaveBulk(sess, &saveArray, &saveArray_delete)
 	}
@@ -255,6 +289,7 @@ func (p *pushJob) DelBulk(sess *mgo.Session, array *[]interface{}) {
 	*array = []interface{}{}
 }
 func (p *pushJob) Push() {
+	defer util.Catch()
 	logger.Info("推送任务", p.taskType, "开始推送。。。")
 	batch_index := 0
 	for {

二进制
src/jfw/modules/pushsubscribe/src/match/match → src/jfw/modules/pushsubscribe/src/push/push


二进制
src/jfw/modules/pushsubscribe/src/statistics/statistics


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

@@ -1197,7 +1197,7 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	menu.Buttons[2].Name = "发现"
 	menu.Buttons[2].SubButtons = make([]MenuButton, 5)
 
-	menu.Buttons[2].SubButtons[0].Name = string(0x1F4A1) + "剑鱼标讯实验室!"
+	menu.Buttons[2].SubButtons[0].Name = string(0x1F4A1) + "实验室!"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeUrl
 	menu.Buttons[2].SubButtons[0].Url = fmt.Sprintf(urlstr, "labindex")
 

+ 3 - 0
src/jfw/public/dataexport.go

@@ -488,6 +488,9 @@ func SendMailToPayUser(order *map[string]interface{}, order_money float64, pay_t
 		log.Println(user_mail, "数据导出邮件没有获取到数据!")
 	}
 	dir := "./web/staticres/res/dataexport"
+	if strings.Contains(download_url, "jyapp") {
+		dir = "./web/staticres/jyapp/res/dataexport"
+	}
 	_, path_error := os.Stat(dir)
 	if path_error != nil && os.IsNotExist(path_error) {
 		// 创建文件夹

+ 1 - 10
src/web/templates/_error.html

@@ -563,16 +563,7 @@ function infoListCss(){
 <img src="/images/pc_6.png" class="backTop" id="backTop">
 <script type="text/javascript">
 (function(){
-    var bp = document.createElement('script');
-    var curProtocol = window.location.protocol.split(':')[0];
-    if (curProtocol === 'https') {
-        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
-    }
-    else {
-        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
-    }
-    var s = document.getElementsByTagName("script")[0];
-    s.parentNode.insertBefore(bp, s);
+	//
 	$(".j-bottom .jy_province font").click(function(){
 		var scope = $(this).text();
 		areasearch(scope);

+ 1 - 10
src/web/templates/common/pcbottom.html

@@ -130,16 +130,7 @@
 <img src="{{Msg "seo" "cdn"}}/images/pc_6.png" class="backTop" id="backTop">
 <script type="text/javascript">
 (function(){
-    var bp = document.createElement('script');
-    var curProtocol = window.location.protocol.split(':')[0];
-    if (curProtocol === 'https') {
-        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
-    }
-    else {
-        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
-    }
-    var s = document.getElementsByTagName("script")[0];
-    s.parentNode.insertBefore(bp, s);
+	//
 	$(".j-bottom .jy_province font").click(function(){
 		var scope = $(this).text();
 		areasearch(scope);

+ 4 - 0
src/web/templates/weixin/jylab/lab-close.html

@@ -6,6 +6,7 @@
 		<script src="{{Msg "seo" "cdn"}}/js/rem.js?v={{Msg "seo" "version"}}"></script>
 		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}" />
 		<script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
+    <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
 		{{include "/common/weixin.html"}}
 		<title>剑鱼标讯实验室</title>
     <style>
@@ -68,4 +69,7 @@
       </div>
     </section>
   </body>
+  <script>
+		initShare({{.T.signature}},{{.T.s_m_openid}},2,"jy_extend",{{.T.nickname}},{{.T.avatar}});
+	</script>
 </html>  

+ 9 - 17
src/web/templates/weixin/search/mainSearch.html

@@ -165,23 +165,15 @@
 			background: url("{{Msg "seo" "cdn"}}/applysub/img/enterprise.png") 0.3rem 0.32rem no-repeat;
 			background-size: 0.57rem 0.57rem,1.39rem 1.39rem;
 		}
-<<<<<<< HEAD
-		#searchIndex .content li:nth-of-type(3) a {
+		#searchIndex .content li:nth-of-type(2) a {
 			background: url("{{Msg "seo" "cdn"}}/applysub/img/dataExport.png") 0.3rem 0.32rem no-repeat;
 			background-size: 0.57rem 0.57rem,1.39rem 1.39rem;
 		}
-		#searchIndex .content li:nth-of-type(4) a {
-			background: url("{{Msg "seo" "cdn"}}/applysub/img/app.png") 0.3rem 0.32rem no-repeat;
-			background-size: 0.57rem 0.57rem,1.39rem 1.39rem;
-		}
-		#searchIndex .content li:nth-of-type(5) a {
-=======
-		#searchIndex .content li:nth-of-type(2) a {
+		#searchIndex .content li:nth-of-type(3) a {
 			background: url("{{Msg "seo" "cdn"}}/applysub/img/app.png") 0.3rem 0.32rem no-repeat;
 			background-size: 0.57rem 0.57rem,1.39rem 1.39rem;
 		}
-		#searchIndex .content li:nth-of-type(3) a {
->>>>>>> dev2.8.4
+		#searchIndex .content li:nth-of-type(4) a {
 			background: url("{{Msg "seo" "cdn"}}/images/pullnew.png") 0.3rem 0.32rem no-repeat;
 			background-size: 0.57rem 0.57rem,1.39rem 1.39rem;
 		}
@@ -957,20 +949,20 @@
 	    $(".rightHref").click(function(){
 	        window.open("http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=2&sn=379fc869080a36d9d0798a3d4fb9a63a#wechat_redirect");
 			event.stopPropagation();
-	    });
-		//APP下载跳转到关于剑鱼标讯
-	    $(".content ul li a:eq(4)").on('click', function () {
-			window.location.href='https://mp.weixin.qq.com/s/ACvQRxKeLYl_DuPuvvqIXQ';
 	    });
 	    //数据导出页面
-	    $(".content ul li a:eq(2)").on('tap', function () {
+	    $(".content ul li a:eq(1)").on('tap', function () {
 			window.location.href='/front/wx_dataExport/toSieve';
 	    });
 	    //APP下载跳转到关于剑鱼标讯
-	    $(".content ul li a:eq(3)").on('tap', function () {
+	    $(".content ul li a:eq(2)").on('tap', function () {
 			// window.location.href='https://www.jianyu360.com/jyapp/free/download/normal?source=weixinAutoRpl';
 			window.location.href='/swordfish/about?flag=1&come=1';
 	    });
+		//拉新
+	    $(".content ul li a:eq(3)").on('click', function () {
+			window.location.href='https://mp.weixin.qq.com/s/ACvQRxKeLYl_DuPuvvqIXQ';
+	    });
 	//});
 	function checkIsOpen(){
 		$(".content ul li a:eq(0)").unbind("tap");