Przeglądaj źródła

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

wangshan 5 lat temu
rodzic
commit
bcf996d8d0
30 zmienionych plików z 304 dodań i 289 usunięć
  1. 3 2
      src/jfw/modules/app/src/app/front/login.go
  2. 0 27
      src/jfw/modules/app/src/app/jyutil/rpccall.go
  3. 0 1
      src/jfw/modules/app/src/app/pay/wxpay.go
  4. 1 1
      src/jfw/modules/pushent/src/followpush/push.go
  5. 0 27
      src/jfw/modules/pushent/src/rpccall/appPushServiceCall.go
  6. 4 18
      src/jfw/modules/pushent/src/rpccall/weixinrpc.go
  7. BIN
      src/jfw/modules/pushent/src/src
  8. 1 1
      src/jfw/modules/pushproject/src/followpush/push.go
  9. 0 27
      src/jfw/modules/pushproject/src/rpccall/appPushServiceCall.go
  10. 4 18
      src/jfw/modules/pushproject/src/rpccall/weixinrpc.go
  11. BIN
      src/jfw/modules/pushproject/src/src
  12. 3 2
      src/jfw/modules/pushsubscribe/src/match/config.json
  13. 15 14
      src/jfw/modules/pushsubscribe/src/match/config/config.go
  14. 1 4
      src/jfw/modules/pushsubscribe/src/match/job/freeuser.go
  15. 0 13
      src/jfw/modules/pushsubscribe/src/match/job/job.go
  16. 56 20
      src/jfw/modules/pushsubscribe/src/match/job/matchjob.go
  17. 6 3
      src/jfw/modules/pushsubscribe/src/match/job/vipuser.go
  18. 1 1
      src/jfw/modules/pushsubscribe/src/match/task.json
  19. 14 0
      src/jfw/modules/pushsubscribe/src/public/util.go
  20. 3 3
      src/jfw/modules/pushsubscribe/src/push/config.json
  21. 1 1
      src/jfw/modules/pushsubscribe/src/push/config/config.go
  22. 12 8
      src/jfw/modules/pushsubscribe/src/push/job/dopush.go
  23. BIN
      src/jfw/modules/pushsubscribe/src/push/push.exe~
  24. 5 34
      src/jfw/modules/pushsubscribe/src/push/util/rpccall.go
  25. 38 36
      src/jfw/modules/pushsubscribe/src/push/util/util.go
  26. 2 0
      src/jfw/modules/subscribepay/src/main.go
  27. 38 0
      src/jfw/modules/subscribepay/src/timetask/timetask.go
  28. 0 18
      src/jfw/public/rpccall.go
  29. 2 1
      src/jfw/timetask/followtimetask.go
  30. 94 9
      src/web/templates/weixin/vipsubscribe/vip_upgrade.html

+ 3 - 2
src/jfw/modules/app/src/app/front/login.go

@@ -10,6 +10,7 @@ import (
 	"log"
 	"net/http"
 	qutil "qfw/util"
+	"qfw/util/jy"
 	"qfw/util/redis"
 	"regexp"
 	"strings"
@@ -912,7 +913,7 @@ func afterLogin(user map[string]interface{}, session *httpsession.Session, rid,
 				})
 				//
 				log.Println("踢人下线", old_ponetype, userid, old_rid, old_oid)
-				jyutil.AppPushServiceCall(map[string]interface{}{
+				jy.AppPush(config.Sysconfig["appPushServiceRpc"].(string), map[string]interface{}{
 					"type":        "signOut",
 					"descript":    kickedTip,
 					"jgPushId":    old_rid,
@@ -1086,7 +1087,7 @@ func checkRepeatLogin(user *map[string]interface{}, rid, oid string) {
 		//
 		go func() {
 			log.Println("踢人下线", ponetype, userid, jpushid, opushid)
-			jyutil.AppPushServiceCall(map[string]interface{}{
+			jy.AppPush(config.Sysconfig["appPushServiceRpc"].(string), map[string]interface{}{
 				"type":        "signOut",
 				"descript":    kickedTip,
 				"jgPushId":    jpushid,

+ 0 - 27
src/jfw/modules/app/src/app/jyutil/rpccall.go

@@ -1,27 +0,0 @@
-package jyutil
-
-import (
-	"encoding/json"
-	"jfw/config"
-	"log"
-	"net/rpc"
-	"qfw/util"
-)
-
-func AppPushServiceCall(m map[string]interface{}) bool {
-	defer util.Catch()
-	var repl string
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["appPushServiceRpc"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	b, _ := json.Marshal(m)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	return repl == "y"
-}

+ 0 - 1
src/jfw/modules/app/src/app/pay/wxpay.go

@@ -3,7 +3,6 @@ package pay
 import (
 	"jfw/config"
 	"jfw/public"
-	"log"
 	"qfw/util"
 )
 

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

@@ -403,7 +403,7 @@ func push(fid, sname, userId string, res *[]map[string]interface{}) {
 					descriptAppend = fmt.Sprintf("\n...(共%d条)", pushnum)
 					jpushtitle = fmt.Sprintf("1. %s", jpushtitle)
 				}
-				isPushOk := rpccall.AppPushServiceCall(map[string]interface{}{
+				isPushOk := jy.AppPush(Sysconfig["appPushServiceRpc"].(string), map[string]interface{}{
 					"phoneType":      phoneType,
 					"otherPushId":    opushid,
 					"jgPushId":       jpushid,

+ 0 - 27
src/jfw/modules/pushent/src/rpccall/appPushServiceCall.go

@@ -1,27 +0,0 @@
-package rpccall
-
-import (
-	"config"
-	"encoding/json"
-	"log"
-	"net/rpc"
-	"qfw/util"
-)
-
-func AppPushServiceCall(m map[string]interface{}) bool {
-	defer util.Catch()
-	var repl string
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["appPushServiceRpc"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	b, _ := json.Marshal(m)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	return repl == "y"
-}

+ 4 - 18
src/jfw/modules/pushent/src/rpccall/weixinrpc.go

@@ -2,8 +2,7 @@ package rpccall
 
 import (
 	"config"
-	"log"
-	"net/rpc"
+	"qfw/util/jy"
 	qrpc "qfw/util/rpc"
 	"strings"
 	"time"
@@ -13,26 +12,13 @@ import (
 //微信远程调用,实现模板发送消息
 func SendWinXin(p *qrpc.NotifyMsg, userId string) bool {
 	time.Sleep(10 * time.Millisecond)
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	var repl qrpc.RpcResult
-	err = client.Call("WeiXinRpc.SendPushMsg", p, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	res := string(repl)
-	if strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]") {
+	ok, res := jy.WxPush(config.Sysconfig["weixinRpcServer"].(string), "WeiXinRpc.SendPushMsg", p)
+	if !ok && (strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]")) {
 		tools.MQFW.UpdateById("user", userId, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"i_ispush": 0,
 			},
 		})
-		return false
 	}
-	return repl == "Y"
+	return ok
 }

BIN
src/jfw/modules/pushent/src/src


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

@@ -511,7 +511,7 @@ func push(fid interface{}, sname, scode, title, userId string, res *[]map[string
 							descriptAppend = fmt.Sprintf("\n...(共%d条)", pushnum)
 							jpushtitle = fmt.Sprintf("1. %s", jpushtitle)
 						}
-						isPushOk := rpccall.AppPushServiceCall(map[string]interface{}{
+						isPushOk := jy.AppPush(Sysconfig["appPushServiceRpc"].(string), map[string]interface{}{
 							"phoneType":      phoneType,
 							"otherPushId":    opushid,
 							"jgPushId":       jpushid,

+ 0 - 27
src/jfw/modules/pushproject/src/rpccall/appPushServiceCall.go

@@ -1,27 +0,0 @@
-package rpccall
-
-import (
-	"config"
-	"encoding/json"
-	"log"
-	"net/rpc"
-	"qfw/util"
-)
-
-func AppPushServiceCall(m map[string]interface{}) bool {
-	defer util.Catch()
-	var repl string
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["appPushServiceRpc"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	b, _ := json.Marshal(m)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	return repl == "y"
-}

+ 4 - 18
src/jfw/modules/pushproject/src/rpccall/weixinrpc.go

@@ -2,8 +2,7 @@ package rpccall
 
 import (
 	"config"
-	"log"
-	"net/rpc"
+	"qfw/util/jy"
 	qrpc "qfw/util/rpc"
 	"strings"
 	"time"
@@ -13,26 +12,13 @@ import (
 //微信远程调用,实现模板发送消息
 func SendWinXin(p *qrpc.NotifyMsg, userId string) bool {
 	time.Sleep(10 * time.Millisecond)
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	var repl qrpc.RpcResult
-	err = client.Call("WeiXinRpc.SendPushMsg", p, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	res := string(repl)
-	if strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]") {
+	ok, res := jy.WxPush(config.Sysconfig["weixinRpcServer"].(string), "WeiXinRpc.SendPushMsg", p)
+	if !ok && (strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]")) {
 		tools.MQFW.UpdateById("user", userId, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"i_ispush": 0,
 			},
 		})
-		return false
 	}
-	return repl == "Y"
+	return ok
 }

BIN
src/jfw/modules/pushproject/src/src


+ 3 - 2
src/jfw/modules/pushsubscribe/src/match/config.json

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

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

@@ -5,20 +5,21 @@ import (
 )
 
 type sysConfig struct {
-	ElasticPoolSize int      `json:"elasticPoolSize"`
-	ElasticSearch   string   `json:"elasticSearch"`
-	RedisServers    string   `json:"redisServers"`
-	MaxPushSize     int      `json:"maxPushSize"`
-	MaxSearch       int      `json:"maxSearch"`
-	MgoAddr         string   `json:"mgoAddr"`
-	MgoSize         int      `json:"mgoSize"`
-	TestIds         []string `json:"testIds"`
-	FilterWords     []string `json:"filterWords"`
-	MatchPoolSize   int      `json:"matchPoolSize"`
-	MatchDuration   int64    `json:"matchDuration"`
-	UserBatch       int      `json:"userBatch"`
-	PcHelper        string   `json:"pcHelper"`
-	MailReg         string   `json:"mailReg"`
+	ElasticPoolSize      int      `json:"elasticPoolSize"`
+	ElasticSearch        string   `json:"elasticSearch"`
+	RedisServers         string   `json:"redisServers"`
+	MaxPushSize          int      `json:"maxPushSize"`
+	VipOneDayMaxPushSize int      `json:"vipOneDayMaxPushSize"`
+	MaxSearch            int      `json:"maxSearch"`
+	MgoAddr              string   `json:"mgoAddr"`
+	MgoSize              int      `json:"mgoSize"`
+	TestIds              []string `json:"testIds"`
+	FilterWords          []string `json:"filterWords"`
+	MatchPoolSize        int      `json:"matchPoolSize"`
+	MatchDuration        int64    `json:"matchDuration"`
+	UserBatch            int      `json:"userBatch"`
+	PcHelper             string   `json:"pcHelper"`
+	MailReg              string   `json:"mailReg"`
 }
 
 type taskConfig struct {

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

@@ -7,14 +7,11 @@ import (
 
 //免费用户
 type FreeUser struct {
-	Users      map[*UserInfo]bool
 	Title_Pjob *Pjob
 }
 
 func NewFreeUser() *FreeUser {
-	return &FreeUser{
-		Users: map[*UserInfo]bool{},
-	}
+	return &FreeUser{}
 }
 func (f *FreeUser) Match(info *map[string]interface{}) *map[*UserInfo]*MatchUser {
 	title, _ := (*info)["title"].(string)

+ 0 - 13
src/jfw/modules/pushsubscribe/src/match/job/job.go

@@ -5,19 +5,6 @@ import (
 	"sync"
 )
 
-const (
-	BulkSize  = 200
-	ShowField = `"_id","title","detail","projectscope","publishtime","toptype","subtype","type","area","href","areaval","infoformat",` +
-		`"projectname","buyer","winner","budget","bidamount","bidopentime","s_subscopeclass"`
-	SortQuery         = `{"publishtime":"desc"}`
-	DB                = "bidding"
-	IDRange           = `{"range":{"id":{"gt":"%s","lte":"%s"}}},{"range":{"publishtime":{"gt": %d}}}`
-	TimeRange         = `{"range":{"comeintime":{"gte":%d,"lte":%d}}}`
-	MaxId             = `{"query":{"filtered":{"filter":{"bool":{"must":{"range":{"id":{"gt":"%s"}}}}}}},"_source":["_id","comeintime"],"sort":{"id":"desc"},"from":0,"size":1}`
-	Mongodb_ShowField = `{"title":1,"detail":1,"projectscope":1,"publishtime":1,"toptype":1,"subtype":1,"type":1,"area":1,"href":1,"areaval":1,"infoformat":1,"projectname":1,"buyer":1,"winner":1,"budget":1,"bidamount":1,"bidopentime":1,"s_subscopeclass":1}`
-	DbName            = "qfw"
-)
-
 type Job interface {
 	Execute()
 }

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

@@ -23,10 +23,22 @@ import (
 )
 
 var (
-	SaveFields = []string{"_id", "area", "city", "bidamount", "bidopentime", "budget", "buyer", "buyerclass", "projectname", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type", "winner"}
+	SaveFields = []string{"_id", "area", "city", "buyerclass", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "type"}
 	MailReg    = regexp.MustCompile(SysConfig.MailReg)
 )
 
+const (
+	BulkSize  = 200
+	ShowField = `"_id","title","detail","projectscope","publishtime","toptype","subtype","type","area","href","areaval","infoformat",` +
+		`"projectname","buyer","winner","budget","bidamount","bidopentime","s_subscopeclass"`
+	SortQuery = `{"publishtime":"desc"}`
+	DB        = "bidding"
+	IDRange   = `{"range":{"id":{"gt":"%s","lte":"%s"}}},{"range":{"publishtime":{"gt": %d}}}`
+	TimeRange = `{"range":{"comeintime":{"gte":%d,"lte":%d}}}`
+	MaxId     = `{"query":{"filtered":{"filter":{"bool":{"must":{"range":{"id":{"gt":"%s"}}}}}}},"_source":["_id","comeintime"],"sort":{"id":"desc"},"from":0,"size":1}`
+	DbName    = "qfw"
+)
+
 type Pjob struct {
 	InterestDfa    *dfa.DFA
 	NotInterestDfa *dfa.DFA
@@ -222,7 +234,19 @@ func (m *MatchJob) LoadBidding(lastId, newId string, lastTime int64) bool {
 	var res []map[string]interface{}
 	sess := mongodb.GetMgoConn()
 	defer mongodb.DestoryMongoConn(sess)
-	it := sess.DB(DbName).C("bidding").Find(c_query).Select(mongodb.ObjToOth(Mongodb_ShowField)).Sort("_id").Iter()
+	it := sess.DB(DbName).C("bidding").Find(c_query).Select(map[string]interface{}{
+		"title":           1,
+		"detail":          1,
+		"projectscope":    1,
+		"publishtime":     1,
+		"toptype":         1,
+		"subtype":         1,
+		"type":            1,
+		"area":            1,
+		"s_subscopeclass": 1,
+		"city":            1,
+		"buyerclass":      1,
+	}).Sort("_id").Iter()
 	index := 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); {
 		index++
@@ -275,7 +299,7 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 		"_id":             1,
 		"o_jy":            1,
 		"o_vipjy":         1,
-		"i_vipstatus":     1,
+		"i_vip_status":    1,
 		"s_m_openid":      1,
 		"a_m_openid":      1,
 		"s_phone":         1,
@@ -302,7 +326,9 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 	//免费用户
 	title_key_user := make(map[string]*[]*UserInfo)
 	title_notkey_user := make(map[string]*[]*UserInfo)
+	nowymd := util.NowFormat(util.Date_yyyyMMdd)
 	for temp := make(map[string]interface{}); query.Next(temp); {
+		userId := fmt.Sprintf("%x", string(temp["_id"].(bson.ObjectId)))
 		s_m_openid := util.ObjToString(temp["s_m_openid"])
 		a_m_openid := util.ObjToString(temp["a_m_openid"])
 		s_phone := util.ObjToString(temp["s_phone"])
@@ -314,23 +340,27 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 		pchelperPush := 0
 		//公众号取关用户
 		if userType == 0 && isPush == 0 {
+			logger.Info("过滤掉,公众号取关用户", userId)
 			continue
 		} else if userType == 2 && jpushid == "" && (opushid == "" || appPhoneType == "") {
+			logger.Info("过滤掉,app用户没有登录", userId)
 			continue
 		} else if (userType == 1 || (userType == 5 && isPush == 0)) && jpushid == "" && (opushid == "" || appPhoneType == "") {
 			if s_phone == "" || !mutil.PcHelperIsOnLine(s_phone) {
+				logger.Info("过滤掉,s_phone为空或者pc助手s_phone不在线", userId)
 				continue
 			} else {
 				pchelperPush = 1
 			}
 		}
 		applystatus := util.IntAll(temp["i_applystatus"])
-		vipStatus := util.IntAll(temp["i_vipstatus"])
+		vipStatus := util.IntAll(temp["i_vip_status"])
+		isVipUser := IsVipUser(vipStatus)
 		var o_msgset map[string]interface{}
-		if !IsVipUser(vipStatus) {
-			o_msgset, _ = temp["o_jy"].(map[string]interface{})
-		} else {
+		if isVipUser {
 			o_msgset, _ = temp["o_vipjy"].(map[string]interface{})
+		} else {
+			o_msgset, _ = temp["o_jy"].(map[string]interface{})
 		}
 		wxpush, apppush, mailpush := mutil.ModeTransform(userType, o_msgset)
 		email := strings.TrimSpace(util.ObjToString(o_msgset["s_email"]))
@@ -338,14 +368,16 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 			mailpush = 0
 		}
 		if wxpush != 1 && apppush != 1 && mailpush != 1 {
+			logger.Info("过滤掉,wxpush apppush mailpush 都不是1", userId, wxpush, apppush, mailpush)
 			continue
 		}
-		userId := fmt.Sprintf("%x", string(temp["_id"].(bson.ObjectId)))
 		var allKeySet []*KeySet
 		var err error
-		if !IsVipUser(vipStatus) {
-			allKeySet, err = m.GetKeySet(o_msgset["a_key"])
-		} else {
+		if isVipUser {
+			if dayCount := redis.GetInt("pushcache_2_a", DayCountKey(nowymd, userId)); dayCount >= SysConfig.VipOneDayMaxPushSize {
+				logger.Info("vip用户达到一天最大推送数量", userId, dayCount)
+				continue
+			}
 			vip_items, _ := o_msgset["a_items"].([]interface{})
 			for _, v := range vip_items {
 				vip_item, _ := v.(map[string]interface{})
@@ -356,6 +388,8 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 				}
 				allKeySet = append(allKeySet, vip_keySet...)
 			}
+		} else {
+			allKeySet, err = m.GetKeySet(o_msgset["a_key"])
 		}
 		if err != nil {
 			logger.Error("获取用户关键词错误!", userId, err)
@@ -427,7 +461,8 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 				key_infotype[upperKey][infotype] = true
 			}
 		}
-		if !IsVipUser(vipStatus) && len(originalKeys) == 0 {
+		if !isVipUser && len(originalKeys) == 0 {
+			logger.Info("过滤掉,没有关键词", userId)
 			continue
 		}
 		modifydate := ""
@@ -465,14 +500,7 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 			VipStatus:    vipStatus,
 		}
 		/***************start*****************/
-		if !IsVipUser(vipStatus) {
-			user.O_jy = &O_jy{
-				Area:     key_area,
-				Infotype: key_infotype,
-			}
-			m.MakeKeyUser(keys, user, &title_key_user)
-			m.MakeKeyUser(notkeys, user, &title_notkey_user)
-		} else {
+		if isVipUser {
 			//vip付费-采购单位行业
 			vip_buyerclass, _ := o_msgset["a_buyerclass"].([]interface{})
 			if len(vip_buyerclass) == 0 {
@@ -528,6 +556,14 @@ func (m *MatchJob) OnceUserBatch(user_batch_index int) (int, *VipUser, *FreeUser
 				m.MakeKeyUser(keys, user, &vip_detail_key_user)
 				m.MakeKeyUser(notkeys, user, &vip_detail_notkey_user)
 			}
+			vipUser.Users[user] = true
+		} else {
+			user.O_jy = &O_jy{
+				Area:     key_area,
+				Infotype: key_infotype,
+			}
+			m.MakeKeyUser(keys, user, &title_key_user)
+			m.MakeKeyUser(notkeys, user, &title_notkey_user)
 		}
 		/***************end*****************/
 		m.lastUserId = user.Id

+ 6 - 3
src/jfw/modules/pushsubscribe/src/match/job/vipuser.go

@@ -38,6 +38,9 @@ func NewVipUser() *VipUser {
 func (v *VipUser) Match(info *map[string]interface{}) *map[*UserInfo]*MatchUser {
 	buyerclass, _ := (*info)["buyerclass"].(string)
 	area, _ := (*info)["area"].(string)
+	if area == "全国" {
+		area = ""
+	}
 	city, _ := (*info)["city"].(string)
 	toptype, _ := (*info)["toptype"].(string)
 	title, _ := (*info)["title"].(string)
@@ -70,12 +73,12 @@ func (v *VipUser) Match(info *map[string]interface{}) *map[*UserInfo]*MatchUser
 	users := map[*UserInfo]*MatchUser{}
 	for k, _ := range v.Users {
 		if (!v.BuyerclassUsers[""][k] && !v.BuyerclassUsers[buyerclass][k]) ||
-			(!v.AreaUsers[""][k] || !v.AreaUsers[area][k] || !v.AreaUsers[city][k]) ||
-			(!v.InfoTypeUsers[""][k] || !v.InfoTypeUsers[toptype][k]) {
+			(!v.AreaUsers[""][k] && !v.AreaUsers[area][k] && !v.AreaUsers[city][k]) ||
+			(!v.InfoTypeUsers[""][k] && !v.InfoTypeUsers[toptype][k]) {
 			continue
 		}
 		var matchUser *MatchUser
-		if len(k.OriginalKeys) > 0 {
+		if len(k.Keys) > 0 {
 			matchUser = (*title_users)[k]
 			if matchUser == nil {
 				matchUser = (*detail_users)[k]

+ 1 - 1
src/jfw/modules/pushsubscribe/src/match/task.json

@@ -1 +1 @@
-{"startTime":"","lastId":"4c754b91a5cb26b9b79a0ce8"}
+{"startTime":"","lastId":"5da69c3fa5cb26b9b77bec0d"}

+ 14 - 0
src/jfw/modules/pushsubscribe/src/public/util.go

@@ -1,8 +1,22 @@
 package public
 
+import (
+	"fmt"
+)
+
 func IsVipUser(vipStatus int) bool {
 	if vipStatus == 1 || vipStatus == 2 {
 		return true
 	}
 	return false
 }
+
+//一天的推送总数
+func DayCountKey(nowymd, id string) string {
+	return fmt.Sprintf("daycount_%s_%s", nowymd, id)
+}
+
+//今天最后一次的推送总数
+func OnceCountKey(nowymd, id string) string {
+	return fmt.Sprintf("oncecount_%s_%s", nowymd, id)
+}

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

@@ -8,7 +8,7 @@
 		"size": 5,
 		"timeout": 20
 	},
-	"redisServers": "pushcache_2_a=192.168.3.128:5000,pushcache_2_b=192.168.3.128:5000,other=192.168.3.128:5000",
+	"redisServers": "pushcache_2_a=192.168.3.128:5001,pushcache_2_b=192.168.3.128:5002",
 	"mail_content": "<tr><td><num>%d</num></td><td><div class='tit'><a style='color: #000;text-decoration: none;' href='%s?mail' >%s</a></div></td><td style='float: right;' class='infos' ><span class='%s'>%s</span><span class='%s'>%s</span><span class='%s'>%s</span><span class='time'>%s</span></td></tr>",
 	"mail_html": "<body><style> *,body,html{margin:0;padding:0;font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;font-size:16px; }#all{margin:0 auto;width:1024px;overflow:hidden;}.head{margin:5x;margin-top:20px;}.des{padding-bottom:15px;border-bottom:1px solid #e8ecee;color: #686868;}td a:hover {color: #fe7379;text-decoration: underline;} .tit{width:560px;overflow: hidden;    white-space: nowrap;text-overflow: ellipsis;}.area {background-color: #2cb7ca;border-radius: 3px;color: #fff;padding: 1px 2px;}.type {background-color: #ffba00;border-radius: 3px;color: #fff;padding: 1px 2px;margin-left:5px;}.industry {background-color: #25c78c;border-radius: 3px;color: #fff;padding: 1px 2px;margin-left:5px;}.infos span{display:inline-block;margin-left:5px;}td{padding-top:8px;padding-bottom:8px;height:20px;line-height:20px;}num{padding:0 5px 0 0; font-size:16px;color:#2cb7ca;font-weight:bolder;}.keys{color:blue;} </style><div id='all'><div class='head'><IMG width='100px' src=http://www.zhaobiao.info/images/swordfish/sf_01.png /></div><div class='head des'>根据您设置的关键词 :<span class='keys'>%s</span>,剑鱼标讯为您推送30天之内的信息。点击标题可查看详情信息</div><table cellpadding='0' cellspacing='0'>%s</table></div> </body>",
 	"mail_title": "您有新的%s信息-剑鱼标讯",
@@ -34,8 +34,8 @@
 	"vipOneDayMaxPushSize": 2000,
 	"mgoAddr": "192.168.3.128:27080",
 	"mgoSize": 10,
-	"testids": ["5d6e142a25ef871f08a72662"],
-	"weixinRpcServer": "127.0.0.1:8083",
+	"testids": ["5cee3e2a61fd002c800e2569"],
+	"weixinRpcServer": "192.168.20.111:8083",
 	"wxColor": "#2cb7ca",
 	"wxGroup": "招标信息",
 	"wxTitle": "根据你订阅的关键词“%s”,剑鱼标讯为你推送以下信息。如果不想继续收到此类信息,可进入招标订阅的设置页面取消订阅。",

+ 1 - 1
src/jfw/modules/pushsubscribe/src/push/config/config.go

@@ -33,7 +33,7 @@ type sysConfig struct {
 	OncePushTime            string      `json:"oncePushTime"`
 	OtherPushTimes          []string    `json:"otherPushTimes"`
 	WxPollSize              int         `json:"wxPollSize"`
-	VipOneDayMaxPushSize    int64       `json:"vipOneDayMaxPushSize"`
+	VipOneDayMaxPushSize    int         `json:"vipOneDayMaxPushSize"`
 	AppPollSize             int         `json:"appPollSize"`
 	MailSleep               int         `json:"mailSleep"`
 	CassandraSleep          int         `json:"cassandraSleep"`

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

@@ -55,11 +55,13 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 	jpushtitle := ""
 	lastInfoDate := int64(0)
 	TitleArray := []string{}
-	infos := []map[string]interface{}{}
+	infos := []*MatchInfo{}
 	publishTitle := map[string]bool{}
-	pushIds := []string{}
-	nowymd := util.NowFormat(util.Date_yyyyMMdd)
-	//邮件附件
+	dateymd := util.NowFormat(util.Date_yyyyMMdd)
+	dayCountKey := DayCountKey(dateymd, k.Id)
+	onceCountKey := DayCountKey(dateymd, k.Id)
+	dayCount := redis.GetInt("pushcache_2_a", dayCountKey)
+	isVipUser := IsVipUser(k.VipStatus)
 	for _, ks := range *sl {
 		k2 := *ks.Info
 		title := strings.Replace(k2["title"].(string), "\n", "", -1)
@@ -74,8 +76,7 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 		}
 		publishTitle[newTitle] = true
 		i++
-		infos = append(infos, k2)
-		pushIds = append(pushIds, util.ObjToString(k2["_id"]))
+		infos = append(infos, ks)
 		TitleArray = append(TitleArray, newTitle)
 		if i == 1 {
 			jpushtitle = title
@@ -139,8 +140,8 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 			}
 			mailContent += fmt.Sprintf(SysConfig.Mail_content, i, url, otitle, classArea, area, classType, infotype, industryclass, industry, dates)
 		}
-		if IsVipUser(k.VipStatus) {
-			if redis.Incr("other", fmt.Sprintf("daycount_%s_%s", nowymd, k.Id)) >= SysConfig.VipOneDayMaxPushSize {
+		if isVipUser {
+			if dayCount >= SysConfig.VipOneDayMaxPushSize {
 				break
 			}
 		} else {
@@ -149,11 +150,14 @@ func (d *doPush) Do(taskType int, isSave bool, wxPush, appPush, mailPush int, k
 				break
 			}
 		}
+		dayCount++
 	}
 	if i == 0 {
 		logger.Info("推送任务", taskType, "没有要推送的数据!", k.Id)
 		return
 	}
+	redis.Put("pushcache_2_a", dayCountKey, dayCount, 86400)
+	redis.Put("pushcache_2_a", onceCountKey, i, 86400)
 	//限制一分钟最大的推送数量
 	if d.fastigiumMinutePushPool != nil {
 		if hour := time.Now().Hour(); hour >= FastigiumStart && hour <= FastigiumEnd {

BIN
src/jfw/modules/pushsubscribe/src/push/push.exe~


+ 5 - 34
src/jfw/modules/pushsubscribe/src/push/util/rpccall.go

@@ -6,6 +6,7 @@ import (
 	. "public"
 	. "push/config"
 	"qfw/util"
+	"qfw/util/jy"
 	"qfw/util/mongodb"
 	qrpc "qfw/util/rpc"
 	"strconv"
@@ -25,13 +26,11 @@ var (
 func SendWeixin(k *UserInfo, remark, title string) bool {
 	wxPushPool <- true
 	defer func() {
-		util.Catch()
 		<-wxPushPool
 	}()
 	if SysConfig.WxSleep > 0 {
 		time.Sleep(time.Duration(SysConfig.WxSleep) * time.Millisecond)
 	}
-	var repl qrpc.RpcResult
 	now := time.Now()
 	p := &qrpc.NotifyMsg{
 		Openid:      k.S_m_openid,
@@ -44,53 +43,25 @@ func SendWeixin(k *UserInfo, remark, title string) bool {
 		DetailColor: SysConfig.WxDetailColor,
 		Url:         SysConfig.JianyuDomain + "/front/sess/" + Se.EncodeString(k.S_m_openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",rssset"),
 	}
-	client, err := rpc.DialHTTP("tcp", SysConfig.WeixinRpcServer)
-	if err != nil {
-		logger.Error(err.Error())
-		return false
-	}
-	defer client.Close()
-	err = client.Call("WeiXinRpc.SubscribePush", p, &repl)
-	if err != nil {
-		logger.Error(err.Error())
-	}
-	res := string(repl)
-	if strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]") {
+	ok, res := jy.WxPush(SysConfig.WeixinRpcServer, "WeiXinRpc.SubscribePush", p)
+	if !ok && (strings.Contains(res, "[46004]") || strings.Contains(res, "[65302]") || strings.Contains(res, "[43004]") || strings.Contains(res, "[40003]")) {
 		mongodb.Update("user", map[string]interface{}{"_id": bson.ObjectIdHex(k.Id)}, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"i_ispush": 0,
 			},
 		}, false, false)
-		return true
-	}
-	if repl == "Y" {
-		return true
 	}
-	return false
+	return ok
 }
 func SendApp(m map[string]interface{}) bool {
 	appPushPool <- true
 	defer func() {
-		util.Catch()
 		<-appPushPool
 	}()
 	if SysConfig.AppSleep > 0 {
 		time.Sleep(time.Duration(SysConfig.AppSleep) * time.Millisecond)
 	}
-	var repl string
-	client, err := rpc.DialHTTP("tcp", SysConfig.AppPushServiceRpc)
-	if err != nil {
-		logger.Error(err.Error())
-		return false
-	}
-	defer client.Close()
-	b, _ := json.Marshal(m)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		logger.Error(err.Error())
-		return false
-	}
-	return repl == "y"
+	return jy.AppPush(SysConfig.AppPushServiceRpc, m)
 }
 
 //

+ 38 - 36
src/jfw/modules/pushsubscribe/src/push/util/util.go

@@ -106,7 +106,7 @@ func ModeTransform(userType int, o_msgset map[string]interface{}) (int, int, int
 }
 
 //保存发送信息
-func SaveSendInfo(k *UserInfo, infos []map[string]interface{}) string {
+func SaveSendInfo(k *UserInfo, infos []*MatchInfo) string {
 	cassandraPoll <- true
 	defer func() {
 		<-cassandraPoll
@@ -123,30 +123,32 @@ func SaveSendInfo(k *UserInfo, infos []map[string]interface{}) string {
 	}
 	date := now.Unix()
 	dateymd := now.Format(util.Date_yyyyMMdd)
-	var saves []map[string]interface{}
-	for _, info := range infos {
+	var saves []*map[string]interface{}
+	for _, v := range infos {
 		wxpush := map[string]interface{}{
 			"dateymd":    dateymd,
 			"uid":        k.Id,
 			"date":       date,
-			"pushinfo":   fmt.Sprint(info["_id"]),
-			"keys":       k.Keys,
-			"area":       util.ObjToString(info["area"]),
-			"city":       util.ObjToString(info["city"]),
-			"buyerclass": util.ObjToString(info["buyerclass"]),
+			"pushinfo":   fmt.Sprint((*v.Info)["_id"]),
+			"keys":       v.Keys,
+			"area":       util.ObjToString((*v.Info)["area"]),
+			"city":       util.ObjToString((*v.Info)["city"]),
+			"buyerclass": util.ObjToString((*v.Info)["buyerclass"]),
 		}
-		if ca.Save("jy_pushsubscribe", wxpush) {
-			saves = append(saves, info)
+		time.Sleep(200 * time.Millisecond)
+		if ca.Save("jy_pushhistory", wxpush) {
+			(*v.Info)["matchkeys"] = v.Keys
+			saves = append(saves, v.Info)
 		}
 	}
 	if len(saves) > 0 {
-		updateRedis(date, k, infos)
+		updateRedis(date, k, &saves)
 		return fmt.Sprint(date)
 	}
 	return ""
 }
 
-func updateRedis(date int64, k *UserInfo, infos []map[string]interface{}) {
+func updateRedis(date int64, k *UserInfo, infos *[]*map[string]interface{}) {
 	pc_a, pc_a_err := jy.HistoryPush.GetPushCache_A(k.Id)
 	pc_b, pc_b_err := jy.HistoryPush.GetPushCache_B(k.Id)
 	if pc_a_err != nil {
@@ -158,12 +160,12 @@ func updateRedis(date int64, k *UserInfo, infos []map[string]interface{}) {
 	}
 	list_a := []map[string]interface{}{}
 	list_b := []map[string]interface{}{}
-	for k, info := range infos {
+	for k, info := range *infos {
 		newInfo := jy.HistoryPush.InfoFormat(&jy.PushCa{
 			Date:   date,
-			InfoId: util.ObjToString(info["_id"]),
+			InfoId: util.ObjToString((*info)["_id"]),
 			Index:  k + 1,
-		}, &info)
+		}, info)
 		list_a = append(list_a, newInfo)
 	}
 	length_a := len(list_a) + len(pc_a.Infos)
@@ -171,13 +173,13 @@ func updateRedis(date int64, k *UserInfo, infos []map[string]interface{}) {
 	case 0, 1:
 		pc_a.Type = 1
 		list_a = append(list_a, pc_a.Infos...)
-		if length_a > 250 {
+		if length_a > 500 {
 			if pc_b != nil {
-				list_b = append(list_b, list_a[250:]...)
+				list_b = append(list_b, list_a[500:]...)
 			}
-			list_a = list_a[:250]
-			pc_a.Count = 250
-		} else if length_a == 250 {
+			list_a = list_a[:500]
+			pc_a.Count = 500
+		} else if length_a == 500 {
 			pc_a.Count = 0
 		} else {
 			pc_a.Count = length_a
@@ -186,38 +188,38 @@ func updateRedis(date int64, k *UserInfo, infos []map[string]interface{}) {
 	case 2:
 		list_a = append(list_a, pc_a.Infos...)
 		pc_a.Type = 3
-		if length_a > 250 {
+		if length_a > 500 {
 			if pc_b != nil {
-				list_b = append(list_b, list_a[250:]...)
+				list_b = append(list_b, list_a[500:]...)
 			}
-			list_a = list_a[:250]
-			pc_a.Count = 250 - len(infos)
-		} else if length_a == 250 {
+			list_a = list_a[:500]
+			pc_a.Count = 500 - len(*infos)
+		} else if length_a == 500 {
 			pc_a.Count = len(pc_a.Infos)
 		}
 		break
 	case 3:
-		if length_a > 250 {
+		if length_a > 500 {
 			if pc_a.Count > 0 && pc_a.Count < len(pc_a.Infos) {
-				pc_a_a := pc_a.Infos[:250-pc_a.Count]
-				pc_a_b := pc_a.Infos[250-pc_a.Count:]
+				pc_a_a := pc_a.Infos[:500-pc_a.Count]
+				pc_a_b := pc_a.Infos[500-pc_a.Count:]
 				list_a = append(list_a, pc_a_a...)
-				if len(list_a) > 250 {
+				if len(list_a) > 500 {
 					pc_a.Type = 1
-					pc_a.Count = 250
+					pc_a.Count = 500
 					if pc_b != nil {
-						list_b = append(list_b, list_a[250:]...)
+						list_b = append(list_b, list_a[500:]...)
 						list_b = append(list_b, pc_a_b...)
 					}
-					list_a = list_a[:250]
-				} else if len(list_a) == 250 {
+					list_a = list_a[:500]
+				} else if len(list_a) == 500 {
 					pc_a.Type = 1
 					pc_a.Count = 0
 					if pc_b != nil {
 						list_b = append(list_b, pc_a_b...)
 					}
 				} else {
-					needLength := 250 - len(list_a)
+					needLength := 500 - len(list_a)
 					if needLength > len(pc_a_b) {
 						list_a = append(list_a, pc_a_b...)
 						pc_a.Count = len(pc_a_b)
@@ -242,8 +244,8 @@ func updateRedis(date int64, k *UserInfo, infos []map[string]interface{}) {
 	jy.HistoryPush.PutPushCache_A(k.Id, pc_a)
 	if pc_b != nil {
 		list_b = append(list_b, pc_b...)
-		if len(list_b) > 750 {
-			list_b = list_b[:750]
+		if len(list_b) > 3500 {
+			list_b = list_b[:3500]
 		}
 		jy.HistoryPush.PutPushCache_B(k.Id, list_b)
 	}

+ 2 - 0
src/jfw/modules/subscribepay/src/main.go

@@ -6,12 +6,14 @@ import (
 	_ "filter"
 	"net/http"
 	_ "service"
+	"timetask"
 	_ "util"
 
 	"github.com/go-xweb/xweb"
 )
 
 func main() {
+	go timetask.Run()
 	mux1 := http.NewServeMux()
 	xweb.RunBase(":"+Config.Webport, mux1)
 }

+ 38 - 0
src/jfw/modules/subscribepay/src/timetask/timetask.go

@@ -0,0 +1,38 @@
+package timetask
+
+import (
+	"time"
+)
+
+func Run() {
+	checkIsExpire()
+	expireRemind()
+}
+
+//每天0点 检查试用、vip服务是否到期
+func checkIsExpire() {
+	crontab(0, func() {
+
+	})
+}
+
+//即将到期或者已到期发推送消息
+func expireRemind() {
+	crontab(10, func() {
+
+	})
+}
+
+func crontab(hour int, f func()) {
+	go f()
+	now := time.Now()
+	t := time.Date(now.Year(), now.Month(), now.Day()+1, hour, 0, 0, 0, time.Local)
+	timer := time.NewTimer(t.Sub(now))
+	for {
+		select {
+		case <-timer.C:
+			go f()
+			timer.Reset(24 * time.Hour)
+		}
+	}
+}

+ 0 - 18
src/jfw/public/rpccall.go

@@ -166,21 +166,3 @@ func GetShareQRStr(url string) string {
 	}, func(e interface{}) {})
 	return ret
 }
-
-func AppPushServiceCall(m map[string]interface{}) bool {
-	defer util.Catch()
-	var repl string
-	client, err := rpc.DialHTTP("tcp", config.Sysconfig["appPushServiceRpc"].(string))
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	defer client.Close()
-	b, _ := json.Marshal(m)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return false
-	}
-	return repl == "y"
-}

+ 2 - 1
src/jfw/timetask/followtimetask.go

@@ -7,6 +7,7 @@ import (
 	public "jfw/public"
 	"log"
 	"qfw/util"
+	"qfw/util/jy"
 	"qfw/util/redis"
 	rpc "qfw/util/rpc"
 	"strconv"
@@ -132,7 +133,7 @@ func tip() {
 		}
 		if jpushid != "" || opushid != "" {
 			phoneType, _ := (*userdata)["s_appponetype"].(string)
-			isPushOk := public.AppPushServiceCall(map[string]interface{}{
+			isPushOk := jy.AppPush(config.Sysconfig["appPushServiceRpc"].(string), map[string]interface{}{
 				"phoneType":   phoneType,
 				"otherPushId": opushid,
 				"jgPushId":    jpushid,

+ 94 - 9
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -23,20 +23,20 @@
             <p class="update_tip">提示:订阅升级可在已购买的服务基础上,增加区域、行业、以及延长订阅周期!</p>
             <ul class="chooseList">
                 <li class="choose_item">
-                    <a href="/front/vipsubscribe/toChooseArea/upgrade">
+                    <a href="/front/vipsubscribe/toChooseArea">
                         <span class="label">区域</span>
                         <input type="text" disabled value="" placeholder="选择全国、省份、地市" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <p class="add_tips">已新增 1 个省级区域、4 个地市</p>
+                    <p class="add_tips area-list">已新增 1 个省级区域、4 个地市</p>
                 </li>
                 <li class="choose_item">
-                    <a href="/front/vipsubscribe/toChooseIndustry/upgrade">
+                    <a href="/front/vipsubscribe/toChooseIndustry">
                         <span class="label">行业</span>
                         <input type="text" disabled value="" placeholder="选择采购单位行业" class="info">
                         <i class="iconfont icon-arrow"></i>
                     </a>
-                    <p class="add_tips">已新增 2 个行业</p>
+                    <p class="add_tips industry-list">已新增 2 个行业</p>
                 </li>
                 <!-- <li class="choose_item select_cycle">
                     <a href="javascript:;">
@@ -57,7 +57,7 @@
                 <div class="select_payment choose_item">
                     <a href="javascript:;">
                         <span class="label">支付方式</span>
-                        <span class="info choose_way">微信支付</span>
+                        <span class="info choose_way" id="payType">微信支付</span>
                         <i class="iconfont icon-arrow choose_way"></i>
                     </a>
                 </div>
@@ -128,8 +128,8 @@
             <div class="price">
                 <label>需补差价:</label>
                 <p>
-                    <span>&yen;610.80</span>
-                    <strong>&yen;0.00</strong>
+                    <span id="oldPrice">&yen;610.80</span>
+                    <strong id="newPrice">&yen;0.00</strong>
                 </p> 
             </div>
             <div class="form-btn">
@@ -289,9 +289,15 @@
         // 对支付方式选择的input绑定点击事件
         $('#pay_way input:radio[name="way"]').click(function () {
             var checkValue = $('input:radio[name="way"]:checked').val();
-            console.log(checkValue);
             $('.pay_way').hide(200);
             $('.pay_mode .select_payment .choose_way.info').html(checkValue);
+            var payType = "";
+            if(checkValue === "微信支付"){
+            	payType = "wx";
+            }else if(checkValue === "支付宝支付"){
+            	payType = "alipy";
+            }
+            sessionStorage.payType = payType
         });
          // 选择生效日期
         $('.choose_effect_date > a').click(function () {
@@ -300,9 +306,15 @@
         // 对生效日期方式选择的input绑定点击事件
         $('#effective_date input:radio[name="date"]').click(function () {
             var checkValue = $('input:radio[name="date"]:checked').val();
-            console.log(checkValue);
             $('#effective_date').hide(200);
             $('#effect_date_name').html(checkValue);
+            var effective = "";
+            if(checkValue === "立即生效,需支付本月费用"){
+            	effective = "now";
+            }else if(checkValue === "9月1日生效"){
+            	effective = "notnow";
+            }
+            sessionStorage.effectiveDate = effective;
         });
         
 
@@ -408,6 +420,79 @@
                 }
             })
         })*/
+        //新增区域
+	    if(sessionStorage.vipSubSelectArea!==""&&sessionStorage.vipSubSelectArea!==undefined){
+			var vipSubSelectArea = JSON.parse(sessionStorage.vipSubSelectArea);
+			var provinceArr = [];
+			var cityArr = [];
+			var isAll = "";
+			for (var province in vipSubSelectArea){
+				provinceArr.push(province);
+				if(vipSubSelectArea[province].length > 0){
+					var citys = vipSubSelectArea[province];
+					for (var i in citys){
+						var city = citys[i];
+						cityArr.push(city);
+					}
+				}
+				if(province === "全国"){
+					isAll = "all";
+				}
+			}
+			var provinceLen = provinceArr.length;
+			var cityLen = cityArr.length;
+			if(isAll === ""){
+				$(".area-list").text("已新增 "+ provinceLen +" 个省级区域、"+ cityLen +" 个地市");
+			}else{
+				$(".area-list").text("已新增为 : 全国");
+			}
+	    }
+	    //新增行业
+	    if(sessionStorage.vipSubSelectIndustry!==""&&sessionStorage.vipSubSelectIndustry!==undefined){
+	    	var vipSubSelectIndustry = JSON.parse(sessionStorage.vipSubSelectIndustry);
+	    	industryArr = [];
+	    	var isAll = "";
+	    	for(var i in vipSubSelectIndustry){
+	    		var industry = vipSubSelectIndustry[i];
+	    		industryArr.push(industry);
+	    		if(industry === "全部行业"){
+	    			isAll = "all";
+	    		}
+	    	}
+	    	var industryLen = industryArr.length
+	    	if(isAll === ""){
+				$(".industry-list").text("已新增 "+ industryLen +" 个行业");
+			}else{
+				$(".industry-list").text("已新增为 : 全部行业");
+			}
+	    }
+	    //生效时间
+	    if(sessionStorage.effectiveDate !== ""&&sessionStorage.effectiveDate!==undefined){
+	    	var effective = sessionStorage.effectiveDate;
+	    	var effectiveHtml = "";
+	    	if(effective === "now"){
+	    		effectiveHtml = "立即生效,需支付本月费用";
+	    	}else if(effective === "notnow"){
+	    		effectiveHtml = "9月1日生效";
+	    	}
+	    	$('#effective_date input:radio[name="date"]').val(effectiveHtml);
+	    	$('#effective_date input:radio[name="date"]').prop("checked", true);
+	    	$("#effect_date_name").text(effectiveHtml);
+	    }
+	    //支付方式
+	    if(sessionStorage.payType!==""&&sessionStorage.payType!==undefined){
+	    	var payType = sessionStorage.payType;
+	    	var payHtml = "";
+	    	if(payType === "wx"){
+	    		payHtml = "微信支付";
+	    	}else if(payType === "alipy"){
+	    		payHtml = "支付宝支付";
+	    	}
+	    	$('input:radio[name="way"]').val(payHtml);
+	    	$('input:radio[name="way"]').prop("checked", true);
+	    	$("#payType").text(payHtml);
+	    }
+	    
     </script>
 </body>