Przeglądaj źródła

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

xuzhiheng 5 lat temu
rodzic
commit
7de342367d

+ 0 - 1
src/jfw/modules/pushsubscribe/src/match/config.json

@@ -10,7 +10,6 @@
 	"filterWords":["项目","中标","公告"],
 	"filterWords":["项目","中标","公告"],
 	"matchPoolSize":60,
 	"matchPoolSize":60,
 	"savePoolSize":5,
 	"savePoolSize":5,
-	"loadBiddingPoolSize":60,
 	"loadUserPoolSize":60,
 	"loadUserPoolSize":60,
 	"matchDuration":60, 
 	"matchDuration":60, 
 	"userBatch":10,
 	"userBatch":10,

+ 15 - 16
src/jfw/modules/pushsubscribe/src/match/config/config.go

@@ -5,22 +5,21 @@ import (
 )
 )
 
 
 type config struct {
 type config struct {
-	ElasticPoolSize     int      `json:"elasticPoolSize"`
-	ElasticSearch       string   `json:"elasticSearch"`
-	RedisServers        string   `json:"redisServers"`
-	MaxPushSize         int      `json:"maxPushSize"`
-	VipMaxPushSize      int      `json:"vipMaxPushSize"`
-	MgoAddr             string   `json:"mgoAddr"`
-	MgoSize             int      `json:"mgoSize"`
-	TestIds             []string `json:"testIds"`
-	FilterWords         []string `json:"filterWords"`
-	MatchPoolSize       int      `json:"matchPoolSize"`
-	SavePoolSize        int      `json:"savePoolSize"`
-	LoadBiddingPoolSize int      `json:"loadBiddingPoolSize"`
-	LoadUserPoolSize    int      `json:"loadUserPoolSize"`
-	MatchDuration       int64    `json:"matchDuration"`
-	UserBatch           int      `json:"userBatch"`
-	PcHelper            string   `json:"pcHelper"`
+	ElasticPoolSize  int      `json:"elasticPoolSize"`
+	ElasticSearch    string   `json:"elasticSearch"`
+	RedisServers     string   `json:"redisServers"`
+	MaxPushSize      int      `json:"maxPushSize"`
+	VipMaxPushSize   int      `json:"vipMaxPushSize"`
+	MgoAddr          string   `json:"mgoAddr"`
+	MgoSize          int      `json:"mgoSize"`
+	TestIds          []string `json:"testIds"`
+	FilterWords      []string `json:"filterWords"`
+	MatchPoolSize    int      `json:"matchPoolSize"`
+	SavePoolSize     int      `json:"savePoolSize"`
+	LoadUserPoolSize int      `json:"loadUserPoolSize"`
+	MatchDuration    int64    `json:"matchDuration"`
+	UserBatch        int      `json:"userBatch"`
+	PcHelper         string   `json:"pcHelper"`
 }
 }
 
 
 type taskConfig struct {
 type taskConfig struct {

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

@@ -135,39 +135,28 @@ func (m *MatchJob) LoadBidding(lastId, newId string, lastTime int64) *[]map[stri
 		"buyerclass":      1,
 		"buyerclass":      1,
 	}).Sort("_id").Iter()
 	}).Sort("_id").Iter()
 	index := 0
 	index := 0
-	loadBiddingPool := make(chan bool, Config.LoadBiddingPoolSize)
-	loadBiddingWaitGroup := &sync.WaitGroup{}
-	for data := make(map[string]interface{}); it.Next(&data); {
-		loadBiddingPool <- true
-		loadBiddingWaitGroup.Add(1)
-		go func(temp map[string]interface{}) {
-			defer func() {
-				<-loadBiddingPool
-				loadBiddingWaitGroup.Done()
-			}()
-			_id := util.BsonIdToSId(temp["_id"])
-			temp["_id"] = _id
-			if util.ObjToString(temp["area"]) == "A" {
-				temp["area"] = "全国"
-			}
-			res = append(res, temp)
-			//信息缓存3天
-			info := map[string]interface{}{}
-			for _, v := range SaveFields {
-				if v == "_id" || temp[v] == nil {
-					continue
-				}
-				info[v] = temp[v]
+	for temp := make(map[string]interface{}); it.Next(&temp); {
+		_id := util.BsonIdToSId(temp["_id"])
+		temp["_id"] = _id
+		if util.ObjToString(temp["area"]) == "A" {
+			temp["area"] = "全国"
+		}
+		res = append(res, temp)
+		//信息缓存3天
+		info := map[string]interface{}{}
+		for _, v := range SaveFields {
+			if v == "_id" || temp[v] == nil {
+				continue
 			}
 			}
-			redis.Put(Pushcache_1, "info_"+_id, info, 259200)
-		}(data)
-		data = make(map[string]interface{})
+			info[v] = temp[v]
+		}
+		redis.Put(Pushcache_1, "info_"+_id, info, 259200)
+		temp = make(map[string]interface{})
 		index++
 		index++
 		if index%500 == 0 {
 		if index%500 == 0 {
 			logger.Info("加载", Bidding, "数据:", index)
 			logger.Info("加载", Bidding, "数据:", index)
 		}
 		}
 	}
 	}
-	loadBiddingWaitGroup.Wait()
 	logger.Info(Bidding, "数据已经加载结束。。。", index)
 	logger.Info(Bidding, "数据已经加载结束。。。", index)
 	return &res
 	return &res
 }
 }

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

@@ -32,11 +32,17 @@ func (m *MoveJob) Execute() {
 	nowUnix := time.Now().Unix()
 	nowUnix := time.Now().Unix()
 	sess := mongodb.GetMgoConn()
 	sess := mongodb.GetMgoConn()
 	defer mongodb.DestoryMongoConn(sess)
 	defer mongodb.DestoryMongoConn(sess)
-	it := sess.DB(DbName).C(Pushspace_temp).Find(map[string]interface{}{
+	query := map[string]interface{}{
 		"timestamp": map[string]interface{}{
 		"timestamp": map[string]interface{}{
 			"$lt": nowUnix,
 			"$lt": nowUnix,
 		},
 		},
-	}).Sort("userid").Iter()
+	}
+	if len(Config.TestIds) > 0 {
+		query["userid"] = map[string]interface{}{
+			"$in": Config.TestIds,
+		}
+	}
+	it := sess.DB(DbName).C(Pushspace_temp).Find(query).Sort("userid").Iter()
 	moveUsers := map[string]*MoveUser{}
 	moveUsers := map[string]*MoveUser{}
 	index, number, length := 0, 0, 0
 	index, number, length := 0, 0, 0
 	//
 	//

+ 2 - 0
src/jfw/modules/subscribepay/src/config.json

@@ -5,6 +5,8 @@
     "redisaddrs": "other=192.168.3.128:1712,session=192.168.3.128:1712,push=192.168.3.128:1712,pushcache_1=192.168.3.128:5000,pushcache_2_a=192.168.3.128:5001",
     "redisaddrs": "other=192.168.3.128:1712,session=192.168.3.128:1712,push=192.168.3.128:1712,pushcache_1=192.168.3.128:5000,pushcache_2_a=192.168.3.128:5001",
     "elasticsearch": "http://192.168.3.128:9800",
     "elasticsearch": "http://192.168.3.128:9800",
     "elasticPoolSize": 30,
     "elasticPoolSize": 30,
+    "appid": "wx41a95e706276804d",
+    "appsecret": "1b385c7dd14274c5e0898b9b208580b7",
     "webport": "86",
     "webport": "86",
     "webrpcport": "8600",
     "webrpcport": "8600",
     "weixinrpc": "127.0.0.1:8083",
     "weixinrpc": "127.0.0.1:8083",

+ 9 - 6
src/jfw/modules/subscribepay/src/config/config.go

@@ -13,6 +13,8 @@ type config struct {
 	Elasticsearch   string
 	Elasticsearch   string
 	ElasticPoolSize int
 	ElasticPoolSize int
 	Redisaddrs      string
 	Redisaddrs      string
+	Appid           string
+	Appsecret       string
 	Webport         string
 	Webport         string
 	Webrpcport      string
 	Webrpcport      string
 	Weixinrpc       string
 	Weixinrpc       string
@@ -50,10 +52,11 @@ type config struct {
 	OrderCountdown interface{}
 	OrderCountdown interface{}
 }
 }
 type timeTaskConfig struct {
 type timeTaskConfig struct {
-	ExpireRemind   string   //到期提醒
-	SyncVipUpgrade string   //同步未及时生效的数据
-	CheckIsExpire  string   //定时更新用户vip状态
-	UnpaidRemind   struct { //未支付订单提醒
+	ExpireRemind   string //到期提醒
+	SyncVipUpgrade string //同步未及时生效的数据
+	CheckIsExpire  string //定时更新用户vip状态
+	UnpaidRemind   struct {
+		//未支付订单提醒
 		AfterOrder   int64 //下单后n小时提醒
 		AfterOrder   int64 //下单后n小时提醒
 		BeforeExpire int64 //n小时自动关闭提醒
 		BeforeExpire int64 //n小时自动关闭提醒
 		Duration     int   //定时任务时间间隔
 		Duration     int   //定时任务时间间隔
@@ -111,7 +114,7 @@ func init() {
 	AliPayConf = PayConf["aliPay"].(map[string]interface{})
 	AliPayConf = PayConf["aliPay"].(map[string]interface{})
 	WxPayConf = PayConf["wxPay"].(map[string]interface{})
 	WxPayConf = PayConf["wxPay"].(map[string]interface{})
 	//微信
 	//微信
-	Wxoauth = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=` + qutil.ObjToString(WxPayConf["appid"]) + `&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect`
-	Wxoauthinfo = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=` + qutil.ObjToString(WxPayConf["appid"]) + `&secret=` + qutil.ObjToString(WxPayConf["appsecret"]) + `&code=%s&grant_type=authorization_code`
+	Wxoauth = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=` + Config.Appid + `&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect`
+	Wxoauthinfo = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=` + Config.Appid + `&secret=` + Config.Appsecret + `&code=%s&grant_type=authorization_code`
 
 
 }
 }

+ 1 - 1
src/jfw/modules/subscribepay/src/filter/sessionfilter.go

@@ -15,7 +15,7 @@ type sessionfilter struct {
 //继承过滤器方法
 //继承过滤器方法
 func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	rqu := req.URL.Path
 	rqu := req.URL.Path
-	if strings.HasPrefix(rqu,"/jypay/callback/"){//支付回调
+	if strings.HasPrefix(rqu,"/jypay/callback/")||strings.HasPrefix(rqu,"/jypay/weixin/reward/"){//支付回调||打赏跳转
 		return true
 		return true
 	}
 	}
 	session := l.App.SessionManager.Session(req, w)
 	session := l.App.SessionManager.Session(req, w)

+ 0 - 1
src/jfw/modules/subscribepay/src/pay_config.json

@@ -2,7 +2,6 @@
 	"wxPay": {
 	"wxPay": {
         "appid": "wxd66e9589c9fecff6",
         "appid": "wxd66e9589c9fecff6",
         "appid_app": "wx0e6a5b18f4cfd10d",
         "appid_app": "wx0e6a5b18f4cfd10d",
-		"appsecret": "4d9d4b9ddab59e65fcb7bed125fbd342",
 		"pay": {
 		"pay": {
 			"mchid": "1418321102",
 			"mchid": "1418321102",
 			"key": "topnet2016topnet2016topnet2016ab",
 			"key": "topnet2016topnet2016topnet2016ab",