wcj 5 năm trước cách đây
mục cha
commit
65528ffa35

+ 0 - 8
src/jfw/modules/pushentniche/src/match/main.go

@@ -4,12 +4,7 @@ package main
 import (
 	"flag"
 	"log"
-	. "match/config"
 	"match/job"
-	. "match/util"
-	"qfw/util/elastic"
-	"qfw/util/mongodb"
-	"qfw/util/redis"
 
 	"github.com/donnie4w/go-logger/logger"
 )
@@ -19,9 +14,6 @@ func main() {
 	flag.Parse()
 	logger.SetConsole(false)
 	logger.SetRollingDaily("./logs", "match.log")
-	mongodb.InitMongodbPool(Config.MgoSize, Config.MgoAddr, DbName)
-	redis.InitRedis(Config.RedisServers)
-	elastic.InitElasticSize(Config.ElasticSearch, Config.ElasticPoolSize)
 	log.Println("订阅推送-匹配数据程序启动。。。")
 	//job.Jobs.Match.Execute()
 	//return

+ 1 - 1
src/jfw/modules/pushentniche/src/push/config.json

@@ -45,7 +45,7 @@
 	],
 	"maxPushSize":50000,
 	"maxRelationProject":10000,
-	"testQuery":{"entid":4,"userid":1},
+	"testQuery":{"entid":4,"deptid":11111},
 	"appPushServiceRpc":"127.0.0.1:5566",
 	"oncePushTime":"9:00",
 	"otherPushTimes":[

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

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	. "match/config"
 	. "match/matcher"
+	. "match/util"
 	. "public"
 	"qfw/util"
 	"qfw/util/elastic"
@@ -20,7 +21,6 @@ import (
 )
 
 const (
-	DbName       = "qfw"
 	DB           = "bidding"
 	MaxId        = `{"query":{"filtered":{"filter":{"bool":{"must":{"range":{"id":{"gt":"%s"}}}}}}},"_source":["_id","comeintime"],"sort":{"id":"desc"},"from":0,"size":1}`
 	ProjectQuery = `{"query":{"filtered":{"filter":{"term":{"list.infoid":"%s"}}}},"_source":["_id","list.infoid"],"sort":{"id":"desc"},"from":0,"size":1}`

+ 0 - 7
src/jfw/modules/pushsubscribe/src/match/main.go

@@ -4,11 +4,7 @@ package main
 import (
 	"flag"
 	"log"
-	. "match/config"
 	"match/job"
-	"qfw/util/elastic"
-	"qfw/util/mongodb"
-	"qfw/util/redis"
 
 	"github.com/donnie4w/go-logger/logger"
 )
@@ -18,9 +14,6 @@ func main() {
 	flag.Parse()
 	logger.SetConsole(false)
 	logger.SetRollingDaily("./logs", "match.log")
-	mongodb.InitMongodbPool(Config.MgoSize, Config.MgoAddr, job.DbName)
-	redis.InitRedis(Config.RedisServers)
-	elastic.InitElasticSize(Config.ElasticSearch, Config.ElasticPoolSize)
 	log.Println("订阅推送-匹配数据程序启动。。。")
 	if *modle == 1 {
 		job.Jobs.Match.Execute()

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

@@ -51,7 +51,8 @@
 	"testids":["5d81c5a525ef8723ac0036f9"],
 	"weixinRpcServer":"127.0.0.1:8083",
 	"wxColor":"#2cb7ca",
-	"wxGroup":"招标信息",
+	"wxType":"标讯订阅",
+	"vipWxType":"VIP订阅",
 	"wxTitle":"根据你订阅的关键词“%s”,剑鱼标讯为你推送以下信息。如果不想继续收到此类信息,可进入招标订阅的设置页面取消订阅。",
 	"vipWxTitle":"根据你当前订阅,剑鱼标讯为你推送以下信息。如果不想继续收到此类信息,可进入招标订阅的设置页面取消订阅。",
 	"wxDetailColor":"#686868",

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

@@ -28,8 +28,9 @@ type config struct {
 	TestIds                 []string       `json:"testIds"`
 	WeixinRpcServer         string         `json:"weixinRpcServer"`
 	WxColor                 string         `json:"wxColor"`
-	WxGroup                 string         `json:"wxGroup"`
 	WxTitle                 string         `json:"wxTitle"`
+	WxType                  string         `json:"wxType"`
+	VipWxType               string         `json:"vipWxType"`
 	VipWxTitle              string         `json:"vipWxTitle"`
 	WxDetailColor           string         `json:"wxDetailColor"`
 	AppPushServiceRpc       string         `json:"appPushServiceRpc"`
@@ -91,7 +92,6 @@ var (
 	Gmails         []*mail.GmailAuth
 	Config         *config
 	ProjectTask    *projectTask
-	WxGroupLen     int
 	FastigiumStart int
 	FastigiumEnd   int
 )
@@ -104,7 +104,6 @@ func init() {
 		FastigiumStart = util.IntAll(fastigiumTimes[0])
 		FastigiumEnd = util.IntAll(fastigiumTimes[1])
 	}
-	WxGroupLen = len([]rune(Config.WxGroup))
 	Gmails = make([]*mail.GmailAuth, len(Config.Mails))
 	for k, v := range Config.Mails {
 		Gmails[k] = &mail.GmailAuth{

+ 5 - 1
src/jfw/modules/pushsubscribe/src/push/job/pushjob.go

@@ -186,7 +186,11 @@ func (p *PushJob) doPush(pusher Pusher, taskType int, pushWay *putil.PushWay, u
 				wxTitle = fmt.Sprintf(Config.WxTitle, wxTitleKeys)
 			}
 			TitleLen := len([]rune(wxTitle))
-			reLen := 200 - TitleLen - 10 - WxGroupLen - len([]rune(tip))
+			TypeLen := len([]rune(Config.WxType))
+			if IsVipUser(u.VipStatus) {
+				TypeLen = len([]rune(Config.VipWxType))
+			}
+			reLen := 200 - TitleLen - 10 - TypeLen - len([]rune(tip))
 			wxTplTitle := ""
 			bshow := false
 			for n := 1; n < len(pushParam.TitleArray)+1; n++ {

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

@@ -31,11 +31,15 @@ func SendWeixin(k *UserInfo, remark, title string, pushDate int64) bool {
 	if Config.WxSleep > 0 {
 		time.Sleep(time.Duration(Config.WxSleep) * time.Millisecond)
 	}
+	wxTplType := Config.WxType
+	if IsVipUser(k.VipStatus) {
+		wxTplType = Config.VipWxType
+	}
 	p := &qrpc.NotifyMsg{
 		Openid:      k.S_m_openid,
 		Title:       title,
 		Remark:      remark,
-		Detail:      Config.WxGroup,
+		Detail:      wxTplType,
 		Date:        "",
 		Service:     util.NowFormat(util.Date_Short_Layout),
 		Color:       Config.WxColor,