wangchuanjin 7 månader sedan
förälder
incheckning
534f7c1c74

+ 3 - 1
pushDebrisProductOrder/go.mod

@@ -1,6 +1,8 @@
 module pushDebrisProducOrder
 
-go 1.20
+go 1.21
+
+toolchain go1.23.4
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240626030750-115a3c0929fb

+ 14 - 0
pushDebrisProductOrder/go.sum

@@ -84,8 +84,10 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
 github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE=
+github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
 github.com/alicebob/miniredis/v2 v2.32.1 h1:Bz7CciDnYSaa0mX5xODh6GUITRSx+cVhjNoOR4JssBo=
+github.com/alicebob/miniredis/v2 v2.32.1/go.mod h1:AqkLNAfUm0K07J28hnAyyQKf/x0YkCY/g5DCtuL01Mw=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/antonlindstrom/pgstore v0.0.0-20200229204646-b08ebf1105e0/go.mod h1:2Ti6VUHVxpC0VSmTZzEvpzysnaGAfGBOoMIz5ykPyyw=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
@@ -103,7 +105,9 @@ github.com/bos-hieu/mongostore v0.0.2/go.mod h1:8AbbVmDEb0yqJsBrWxZIAZOxIfv/tsP8
 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI=
 github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
+github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
 github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
+github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
 github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
 github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -227,6 +231,7 @@ github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqw
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
 github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -241,6 +246,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
 github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=
+github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -314,6 +320,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
 github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
+github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -438,6 +445,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
 github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
 github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
 github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -523,6 +531,7 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
 github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
 github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
 github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
+github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
@@ -531,6 +540,7 @@ github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
 github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
 github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
 github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
+github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
@@ -595,6 +605,7 @@ github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfm
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
 github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
 github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
 github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
@@ -671,6 +682,7 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
+github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 github.com/zeromicro/go-zero v1.3.5/go.mod h1:wh4o794b7Ul3W0k35Pw9nc3iB4O0OpaQTMQz/PJc1bc=
@@ -738,6 +750,7 @@ go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnw
 go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
 go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
@@ -1021,6 +1034,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
+golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

+ 2 - 2
pushDebrisProductOrder/orderPush/wxPush.go

@@ -133,10 +133,10 @@ func (m *msgRemind) run() {
 			//isPushWx := util.IntAllDef((*user)["i_ispush"], 1)
 			//s_m_openid, _ := (*user)["s_m_openid"].(string)
 
-			res := JyMysql.SelectBySql(`SELECT a.miniprogram_code,b.openid,b.official_code,IF(c.appid IS NULL,e.appid,c.appid) AS appid FROM debris_product.miniprogram_user a
+			res := JyMysql.SelectBySql(`SELECT a.miniprogram_code,b.openid,b.official_code,IF(c.point_version=0,e.appid,c.appid) AS appid FROM debris_product.miniprogram_user a
 				INNER JOIN debris_product.official_user b ON (a.position_id=? AND a.unionid<>'' AND a.unionid=b.unionid AND b.status=1 AND b.official_code<>'' AND b.openid<>'')
 				INNER JOIN debris_product.miniprogram c ON (a.miniprogram_code=c.code and c.official_code=b.official_code)
-				left join debris_product.miniprogram e ON (c.appid IS NULL AND e.industry_code IS NULL AND c.industry_item_code=e.industry_item_code)
+				left join debris_product.miniprogram e ON (e.industry_code IS NULL AND c.industry_item_code=e.industry_item_code)
 				LIMIT 1`, unpaidOrder.userId)
 			if res == nil || len(*res) == 0 {
 				log.Printf("未支付订单,%s推送消息 异常 %s未查询到数据\n", unpaidOrder.orderCode, unpaidOrder.userId)

+ 12 - 11
pushofficial/match/config/config.go

@@ -5,17 +5,18 @@ import (
 )
 
 type config struct {
-	MaxPushSize      int     `json:"maxPushSize"`
-	TestIds          []int64 `json:"testIds"`
-	MatchPoolSize    int     `json:"matchPoolSize"`
-	SavePoolSize     int     `json:"savePoolSize"`
-	LoadUserPoolSize int     `json:"loadUserPoolSize"`
-	MergePoolSize    int     `json:"mergePoolSize"`
-	MatchDuration    int64   `json:"matchDuration"`
-	MoveBatch        int     `json:"moveBatch"`
-	MoveDuration     int64   `json:"moveDuration"`
-	NotMatchHour     []int   `json:"notMatchHour"`
-	UserBatch        int     `json:"userBatch"`
+	MaxPushSize        int     `json:"maxPushSize"`
+	TestIds            []int64 `json:"testIds"`
+	MatchPoolSize      int     `json:"matchPoolSize"`
+	SavePoolSize       int     `json:"savePoolSize"`
+	LoadUserPoolSize   int     `json:"loadUserPoolSize"`
+	MergePoolSize      int     `json:"mergePoolSize"`
+	MatchDuration      int64   `json:"matchDuration"`
+	MoveBatch          int     `json:"moveBatch"`
+	MoveDuration       int64   `json:"moveDuration"`
+	NotMatchHour       []int   `json:"notMatchHour"`
+	UserBatch          int     `json:"userBatch"`
+	LoadBiddingMaxSize int64   `json:"loadBiddingMaxSize"`
 }
 
 type taskConfig struct {

+ 6 - 6
pushofficial/match/job/matchjob.go

@@ -20,7 +20,7 @@ import (
 type MatchJob struct {
 }
 
-//定时任务,匹配数据,存库
+// 定时任务,匹配数据,存库
 func (m *MatchJob) Execute() {
 	defer util.Catch()
 	logger.Info("开始匹配数据任务。。。", TaskConfig.Pici)
@@ -30,8 +30,8 @@ func (m *MatchJob) Execute() {
 	// 		"$in": ToObjectIds([]string{"6650e73166cf0db42a5ccb28", "6650e42e66cf0db42a5cc6bb"}),
 	// 	},
 	// }
-	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
-	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
 	datas := MergeDiffIndustry(wuyeDatas, otherDatas)
 	if datas == nil || len(*datas) == 0 {
 		logger.Info("加载数据到内存中的时候,未查找到数据!")
@@ -57,10 +57,10 @@ func (m *MatchJob) Execute() {
 	logger.Info("匹配数据任务结束。。。", TaskConfig.Pici)
 }
 
-//加载需要推送的用户
+// 加载需要推送的用户
 func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *int64) (int, *PayUser) {
 	defer util.Catch()
-	q := `select a.*,d.value,if(b.appid is null,c.appid,b.appid) as appid,if(b.code is null,c.code,b.code) as miniprogram_code from (select a.id,a.openid,a.official_code from debris_product.official_user a where `
+	q := `select a.*,d.value,if(b.appid is null,c.appid,b.appid) as appid,if(b.point_version=0,c.code,b.code) as miniprogram_code from (select a.id,a.openid,a.official_code from debris_product.official_user a where `
 	args := []interface{}{}
 	if len(Config.TestIds) > 0 {
 		array := []string{}
@@ -76,7 +76,7 @@ func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *int64) (int, *PayUs
 	q += `a.status=1 and a.openid<>'' and NOT EXISTS (SELECT 1 FROM debris_product.miniprogram_user b inner join debris_product.miniprogram c on (a.unionid=b.unionid and b.miniprogram_code=c.code and a.official_code=c.official_code))) a
  		inner join debris_product.miniprogram b on (b.industry_item_code='zbxm' and a.official_code=b.official_code)
  		inner join debris_product.industry d on (b.industry_code=d.code and d.value<>'')
-		left join debris_product.miniprogram c on (b.appid is null and c.industry_code is null and b.industry_item_code=c.industry_item_code)
+		left join debris_product.miniprogram c on (c.industry_code is null and b.industry_item_code=c.industry_item_code)
  		order by id asc limit ?`
 	args = append(args, Config.UserBatch)
 	logger.Info("开始加载第", batchIndex, "批用户", q, args)

+ 1 - 1
pushofficial/push/config.json

@@ -36,7 +36,7 @@
 			"keyword4":{
 				"value":"time3"
 			},
-			"url":"pages/start/index?code=%s&url=%%2Fpages%%2Ftabbar%%2Fhome%%2Findex%%3Fpushid%%3Dofficial_%s%%26date%%3D%d"
+			"url":"pages/start/index?code=%s&source=pushofficial&url=%%2Fpages%%2Ftabbar%%2Fhome%%2Findex%%3Fpushid%%3Dofficial_%s%%26date%%3D%d"
 		}
 	},
 	"timeoutWarn":"http://172.17.4.195:19281/_send/_mail?program=debrisproduct_official_push&to=wangchuanjin@topnet.net.cn&title=碎片化_公众号推送程序报警&body=放入通道超时"

+ 13 - 12
pushownermonitor/match/config/config.go

@@ -5,18 +5,19 @@ import (
 )
 
 type config struct {
-	MaxPushSize   int   `json:"maxPushSize"`
-	TestIds       []int `json:"testIds"`
-	MatchPoolSize int   `json:"matchPoolSize"`
-	SavePoolSize  int   `json:"savePoolSize"`
-	MergePoolSize int   `json:"mergePoolSize"`
-	MovePoolSize  int   `json:"movePoolSize"`
-	MatchDuration int64 `json:"matchDuration"`
-	MoveBatch     int   `json:"moveBatch"`
-	MoveDuration  int64 `json:"moveDuration"`
-	NotMatchHour  []int `json:"notMatchHour"`
-	UserBatch     int   `json:"userBatch"`
-	FreeMaxFollow int   `json:"freeMaxFollow"`
+	MaxPushSize        int   `json:"maxPushSize"`
+	TestIds            []int `json:"testIds"`
+	MatchPoolSize      int   `json:"matchPoolSize"`
+	SavePoolSize       int   `json:"savePoolSize"`
+	MergePoolSize      int   `json:"mergePoolSize"`
+	MovePoolSize       int   `json:"movePoolSize"`
+	MatchDuration      int64 `json:"matchDuration"`
+	MoveBatch          int   `json:"moveBatch"`
+	MoveDuration       int64 `json:"moveDuration"`
+	NotMatchHour       []int `json:"notMatchHour"`
+	UserBatch          int   `json:"userBatch"`
+	FreeMaxFollow      int   `json:"freeMaxFollow"`
+	LoadBiddingMaxSize int64 `json:"loadBiddingMaxSize"`
 }
 
 type taskConfig struct {

+ 4 - 6
pushownermonitor/match/job/matchjob.go

@@ -20,7 +20,7 @@ import (
 type MatchJob struct {
 }
 
-//定时任务,匹配数据,存库
+// 定时任务,匹配数据,存库
 func (m *MatchJob) Execute() {
 	defer util.Catch()
 	logger.Info("开始匹配数据任务。。。", TaskConfig.Pici)
@@ -30,8 +30,8 @@ func (m *MatchJob) Execute() {
 	// 		"$in": ToObjectIds([]string{"6650e73166cf0db42a5ccb28", "6650e42e66cf0db42a5cc6bb"}),
 	// 	},
 	// }
-	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
-	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
 	datas := MergeDiffIndustry(wuyeDatas, otherDatas)
 	if datas == nil || len(*datas) == 0 {
 		logger.Info("加载数据到内存中的时候,未查找到数据!")
@@ -59,7 +59,6 @@ func (m *MatchJob) Execute() {
 	logger.Info("匹配数据任务结束。。。", TaskConfig.Pici)
 }
 
-//
 func (m *MatchJob) Match(datas map[string]map[string]CSortList, matcher Matcher) {
 	var lastId int64
 	batchIndex := 0
@@ -79,7 +78,6 @@ func (m *MatchJob) Match(datas map[string]map[string]CSortList, matcher Matcher)
 	}
 }
 
-//
 func (m *MatchJob) ToMatch(batchIndex int, followInfos map[int64]*om.OwnerMonitorInfo, datas map[string]map[string]CSortList) {
 	logger.Info("开始匹配第", batchIndex, "批用户。。。")
 	m.EachAllBidInfo(followInfos, datas)
@@ -157,7 +155,7 @@ func (m *MatchJob) ToMatch(batchIndex int, followInfos map[int64]*om.OwnerMonito
 	logger.Info("第", batchIndex, "批保存到", Pushspace_temp, "表结束。。。", index)
 }
 
-//遍历数据
+// 遍历数据
 func (m *MatchJob) EachAllBidInfo(followInfos map[int64]*om.OwnerMonitorInfo, datas map[string]map[string]CSortList) {
 	logger.Info("开始匹配数据。。。")
 	var index int

+ 3 - 3
pushownermonitor/match/matcher/match.go

@@ -12,7 +12,7 @@ import (
 	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
 )
 
-//付费用户
+// 付费用户
 type FMatchUser struct {
 }
 
@@ -21,7 +21,7 @@ func NewFMatchUser() *FMatchUser {
 }
 
 func (m *FMatchUser) OnceUserBatch(batchIndex int, lastId *int64, count *int64) (int, map[int64]*om.OwnerMonitorInfo) {
-	q := `select distinct a.id,a.position_id,a.miniprogram_code,d.value,b.openid,b.official_code,if(c.appid is null,e.appid,c.appid) as appid from debris_product.miniprogram_user a
+	q := `select distinct a.id,a.position_id,a.miniprogram_code,d.value,b.openid,b.official_code,if(c.point_version=0,e.appid,c.appid) as appid from debris_product.miniprogram_user a
 		inner join debris_product.official_user b on (`
 	args := []interface{}{}
 	if len(Config.TestIds) > 0 {
@@ -38,7 +38,7 @@ func (m *FMatchUser) OnceUserBatch(batchIndex int, lastId *int64, count *int64)
 	q += `a.unionid<>'' and a.position_id>0 and a.unionid=b.unionid and b.status=1 and b.official_code<>'' and b.openid<>'')
 		inner join debris_product.miniprogram c on (a.miniprogram_code=c.code and b.official_code=c.official_code and c.industry_item_code='qzcgf')
 		inner join debris_product.industry d on (c.industry_code=d.code and d.value<>'')
-		left join debris_product.miniprogram e on (c.appid is null and e.industry_code is null and c.industry_item_code=e.industry_item_code)
+		left join debris_product.miniprogram e on (e.industry_code is null and c.industry_item_code=e.industry_item_code)
 		order by id asc limit ?`
 	args = append(args, Config.UserBatch)
 	logger.Info("开始加载第", batchIndex, "批用户", q, args)

+ 11 - 1
pushownermonitor/push/config.json

@@ -1,7 +1,17 @@
 {
 	"testIds":[1205592553],
 	"weixinRpcServer":"192.168.3.149:6901",
-	"pushDuration":40,
+	"pushTime":[
+		"9:00",
+		"10:00",
+		"11:00",
+		"12:00",
+		"14:45",
+		"15:45",
+		"16:45",
+		"17:45",
+		"18:45"
+	],
 	"startPushTime":"7:59",
 	"endPushTime":"22:00",
 	"everyDayDuration":15,

+ 1 - 3
pushownermonitor/push/config/config.go

@@ -12,9 +12,7 @@ type config struct {
 	TestIds                 []int                    `json:"testIds"`
 	WeixinRpcServer         string                   `json:"weixinRpcServer"`
 	PushBatch               int                      `json:"pushBatch"`
-	PushDuration            int64                    `json:"pushDuration"`  //app间隔
-	StartPushTime           string                   `json:"startPushTime"` //开始时间
-	EndPushTime             string                   `json:"endPushTime"`   //结束时间
+	PushTime                []string                 `json:"pushTime"`
 	EveryDayDuration        int64                    `json:"everyDayDuration"`
 	WxPoolSize              int                      `json:"wxPoolSize"`
 	SaveSleep               int                      `json:"saveSleep"`

+ 10 - 5
pushownermonitor/push/job/timetask.go

@@ -1,15 +1,20 @@
 package job
 
 import (
+	util "app.yhyue.com/moapp/jybase/common"
 	. "pushownermonitor/push/config"
-
-	. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
+	"sort"
 )
 
 type TimeTask struct{}
 
 func (t *TimeTask) Run() {
-	go VarTimeTask.RunInTimeSection("实时推送", Config.StartPushTime, Config.EndPushTime, Config.PushDuration, func(dayFirst bool) {
-		Jobs.Push.Execute(6, 0)
-	})
+	sort.Strings(Config.PushTime)
+	for _, v := range Config.PushTime {
+		go func(vv string) {
+			util.SimpleCrontab(false, vv, func() {
+				Jobs.Push.Execute(6, 0)
+			})
+		}(v)
+	}
 }

+ 12 - 11
pushsubscribe/match/config/config.go

@@ -5,17 +5,18 @@ import (
 )
 
 type config struct {
-	MaxPushSize      int     `json:"maxPushSize"`
-	TestIds          []int64 `json:"testIds"`
-	MatchPoolSize    int     `json:"matchPoolSize"`
-	SavePoolSize     int     `json:"savePoolSize"`
-	LoadUserPoolSize int     `json:"loadUserPoolSize"`
-	MergePoolSize    int     `json:"mergePoolSize"`
-	MatchDuration    int64   `json:"matchDuration"`
-	MoveBatch        int     `json:"moveBatch"`
-	MoveDuration     int64   `json:"moveDuration"`
-	NotMatchHour     []int   `json:"notMatchHour"`
-	UserBatch        int     `json:"userBatch"`
+	MaxPushSize        int     `json:"maxPushSize"`
+	TestIds            []int64 `json:"testIds"`
+	MatchPoolSize      int     `json:"matchPoolSize"`
+	SavePoolSize       int     `json:"savePoolSize"`
+	LoadUserPoolSize   int     `json:"loadUserPoolSize"`
+	MergePoolSize      int     `json:"mergePoolSize"`
+	MatchDuration      int64   `json:"matchDuration"`
+	MoveBatch          int     `json:"moveBatch"`
+	MoveDuration       int64   `json:"moveDuration"`
+	NotMatchHour       []int   `json:"notMatchHour"`
+	UserBatch          int     `json:"userBatch"`
+	LoadBiddingMaxSize int64   `json:"loadBiddingMaxSize"`
 }
 
 type taskConfig struct {

+ 7 - 7
pushsubscribe/match/job/matchjob.go

@@ -23,7 +23,7 @@ import (
 type MatchJob struct {
 }
 
-//定时任务,匹配数据,存库
+// 定时任务,匹配数据,存库
 func (m *MatchJob) Execute() {
 	defer util.Catch()
 	logger.Info("开始匹配数据任务。。。", TaskConfig.Pici)
@@ -33,8 +33,8 @@ func (m *MatchJob) Execute() {
 	// 		"$in": ToObjectIds([]string{"6650e73166cf0db42a5ccb28", "6650e42e66cf0db42a5cc6bb"}),
 	// 	},
 	// }
-	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
-	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	wuyeDatas, wuyeEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "pici", TaskConfig.Pici, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
+	otherDatas, otherEndTime := LoadBidding(Mgo_Bidding, DbConf.Mongodb.Bidding.DbName, DbConf.Mongodb.Bidding.Collection, "topinformation_time", TaskConfig.TopInformation, Config.LoadBiddingMaxSize, false, query, map[string]interface{}{"detail": 0, "tag_topinformation": 1, "tag_subinformation": 1})
 	qingBaoDatas, qingBaoEndTime := m.LoadQingBao(TaskConfig.QingBao)
 	datas := MergeDiffIndustry(wuyeDatas, otherDatas)
 	if (datas == nil || len(*datas) == 0) && (qingBaoDatas == nil || len(*qingBaoDatas) == 0) {
@@ -65,10 +65,10 @@ func (m *MatchJob) Execute() {
 	logger.Info("匹配数据任务结束。。。", TaskConfig.Pici)
 }
 
-//加载需要推送的用户
+// 加载需要推送的用户
 func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *int64) (int, *PayUser, *PayUser) {
 	defer util.Catch()
-	q := `select distinct a.id,a.miniprogram_code,a.subset_area,a.business_type,d.value,b.openid,b.official_code,if(c.appid is null,e.appid,c.appid) as appid,c.industry_item_code from debris_product.miniprogram_user a
+	q := `select distinct a.id,a.miniprogram_code,a.subset_area,a.business_type,d.value,b.openid,b.official_code,if(c.point_version=0,e.appid,c.appid) as appid,c.industry_item_code from debris_product.miniprogram_user a
 		inner join debris_product.official_user b on (`
 	args := []interface{}{}
 	if len(Config.TestIds) > 0 {
@@ -85,7 +85,7 @@ func (m *MatchJob) OnceUserBatch(batchIndex int, lastUserId *int64) (int, *PayUs
 	q += `a.unionid<>'' and a.unionid=b.unionid and b.status=1 and b.official_code<>'' and b.openid<>'')
 		inner join debris_product.miniprogram c on (a.miniprogram_code=c.code and b.official_code=c.official_code and c.industry_item_code<>'qzcgf')
 		inner join debris_product.industry d on (c.industry_code=d.code and d.value<>'')
-		left join debris_product.miniprogram e on (c.appid is null and e.industry_code is null and c.industry_item_code=e.industry_item_code)
+		left join debris_product.miniprogram e on (e.industry_code is null and c.industry_item_code=e.industry_item_code)
 		order by id asc limit ?`
 	args = append(args, Config.UserBatch)
 	logger.Info("开始加载第", batchIndex, "批用户", q, args)
@@ -278,7 +278,7 @@ func (m *MatchJob) ToMatch(batchIndex int, payUser *PayUser, datas *[]map[string
 	logger.Info("第", batchIndex, "批保存到", Pushspace_temp, "表结束。。。", index)
 }
 
-//情报
+// 情报
 func (m *MatchJob) LoadQingBao(startTime int64) (*[]map[string]interface{}, int64) {
 	datas := []map[string]interface{}{}
 	q := `select id,title,area,city,publishtime,createtime,topclass,subclass,datajson from information.information where `

+ 30 - 4
pushsubscribe/push/config.json

@@ -3,11 +3,37 @@
 	"testIds":[1205592553],
 	"weixinRpcServer":"192.168.3.149:6901",
 	"pushDuration":40,
-	"pushTime":[
-		"10:00",
-		"12:00",
+	"cgyxPushTime":[
+		"8:15",
+		"9:15",
+		"10:15",
+		"11:15",
+		"14:00",
 		"15:00",
-		"17:00"
+		"16:00",
+		"18:00",
+		"19:00"
+	],
+	"zbxmPushTime":[
+		"8:30",
+		"9:30",
+		"11:30",
+		"14:15",
+		"15:15",
+		"16:15",
+		"17:15",
+		"18:15"
+	],
+	"hydqxmPushTime":[
+		"8:45",
+		"9:45",
+		"10:45",
+		"11:45",
+		"14:30",
+		"15:30",
+		"16:30",
+		"17:30",
+		"18:30"
 	],
 	"startPushTime":"7:59",
 	"endPushTime":"22:00",

+ 3 - 1
pushsubscribe/push/config/config.go

@@ -16,7 +16,9 @@ type config struct {
 	StartPushTime           string                   `json:"startPushTime"` //开始时间
 	EndPushTime             string                   `json:"endPushTime"`   //结束时间
 	PushBatch               int                      `json:"pushBatch"`
-	PushTime                []string                 `json:"pushTime"`
+	CgyxPushTime            []string                 `json:"cgyxPushTime"`
+	ZbxmPushTime            []string                 `json:"zbxmPushTime"`
+	HydqxmPushTime          []string                 `json:"hydqxmPushTime"`
 	WxPoolSize              int                      `json:"wxPoolSize"`
 	SaveSleep               int                      `json:"saveSleep"`
 	WxSleep                 int                      `json:"wxSleep"`

+ 12 - 12
pushsubscribe/push/job/pushjob.go

@@ -1,4 +1,4 @@
-//订阅推送
+// 订阅推送
 package job
 
 import (
@@ -32,22 +32,22 @@ type PushJob struct {
 	fastigiumMinutePushPool chan bool
 }
 
-//taskType 1--一天三次推送(取消) 2--九点推送 6--免费用户一天一次 7--微信vip 8--appvip
-func (p *PushJob) Execute(taskType int) {
+// taskType 1--一天三次推送(取消) 2--九点推送 6--免费用户一天一次 7--微信vip 8--appvip
+func (p *PushJob) Execute(taskType int, itemCode string) {
 	defer util.Catch()
 	MyLock.Lock(MyLock.Match)
 	defer MyLock.UnLock()
 	//
-	p.beforePush(taskType)
+	p.beforePush(taskType, itemCode)
 }
 
-//开始推送
-func (p *PushJob) beforePush(taskType int) {
-	p.StartPush(&NormalPush{}, taskType)
+// 开始推送
+func (p *PushJob) beforePush(taskType int, itemCode string) {
+	p.StartPush(&NormalPush{}, taskType, itemCode)
 }
 
-//开始推送
-func (p *PushJob) StartPush(pusher Pusher, taskType int) {
+// 开始推送
+func (p *PushJob) StartPush(pusher Pusher, taskType int, itemCode string) {
 	defer util.Catch()
 	logger.Info("推送任务", taskType, "开始推送。。。")
 	batchIndex := 0
@@ -57,7 +57,7 @@ func (p *PushJob) StartPush(pusher Pusher, taskType int) {
 	pushWait := &sync.WaitGroup{}
 	for {
 		batchIndex++
-		isBreak, users := pusher.OncePushBatch(taskType, batchIndex, &startId)
+		isBreak, users := pusher.OncePushBatch(taskType, batchIndex, &startId, itemCode)
 		for _, temp := range *users {
 			isTake := MonitorTimeOut(pushPool, time.Minute, Config.TimeoutWarn, func() {
 				logger.Error("推送任务", taskType, "推送放入通道超时,", temp.Info["userid"], len(p.minutePushPool), len(p.fastigiumMinutePushPool))
@@ -93,7 +93,7 @@ func (p *PushJob) StartPush(pusher Pusher, taskType int) {
 	logger.Info("推送任务结束。。。", taskType)
 }
 
-//进入具体推送
+// 进入具体推送
 func (p *PushJob) doPush(pusher Pusher, taskType int, u *UserInfo, sl *SortList) (pushResult *PushResult) {
 	defer util.Catch()
 	now := time.Now()
@@ -132,7 +132,7 @@ func (p *PushJob) doPush(pusher Pusher, taskType int, u *UserInfo, sl *SortList)
 	return
 }
 
-//微信远程调用,实现模板发送消息
+// 微信远程调用,实现模板发送消息
 func (p *PushJob) sendWeixin(k *UserInfo, pushParam *PushParam) bool {
 	officialCode, _ := k.Extend.Object["official_code"].(string)
 	if Config.WxTplMsgs[officialCode] == nil {

+ 21 - 3
pushsubscribe/push/job/timetask.go

@@ -10,11 +10,29 @@ import (
 type TimeTask struct{}
 
 func (t *TimeTask) Run() {
-	sort.Strings(Config.PushTime)
-	for _, v := range Config.PushTime {
+	sort.Strings(Config.CgyxPushTime)
+	for _, v := range Config.CgyxPushTime {
 		go func(vv string) {
 			util.SimpleCrontab(false, vv, func() {
-				Jobs.Push.Execute(6)
+				Jobs.Push.Execute(6, "cgyx")
+			})
+		}(v)
+	}
+	//
+	sort.Strings(Config.ZbxmPushTime)
+	for _, v := range Config.ZbxmPushTime {
+		go func(vv string) {
+			util.SimpleCrontab(false, vv, func() {
+				Jobs.Push.Execute(6, "zbxm")
+			})
+		}(v)
+	}
+	//
+	sort.Strings(Config.HydqxmPushTime)
+	for _, v := range Config.HydqxmPushTime {
+		go func(vv string) {
+			util.SimpleCrontab(false, vv, func() {
+				Jobs.Push.Execute(6, "hydqxm")
 			})
 		}(v)
 	}

+ 2 - 2
pushsubscribe/push/main.go

@@ -1,4 +1,4 @@
-//推送服务
+// 推送服务
 package main
 
 import (
@@ -20,7 +20,7 @@ func main() {
 	log.Println("推送程序启动。。。")
 	MyLock.Clear(MyLock.Push)
 	if *mode == 1 {
-		Jobs.Push.Execute(6)
+		Jobs.Push.Execute(6, "")
 		return
 	}
 	(&TimeTask{}).Run()

+ 8 - 6
pushsubscribe/push/pusher/normalpush.go

@@ -19,12 +19,12 @@ func init() {
 	SavePool = make(chan bool, Config.SavePoolSize)
 }
 
-//正常推送,一天推送三次或者一天一次
+// 正常推送,一天推送三次或者一天一次
 type NormalPush struct {
 }
 
-//获取需要推送的用户
-func (n *NormalPush) OncePushBatch(taskType, batchIndex int, startId *string) (bool, *map[string]*PushInfo) {
+// 获取需要推送的用户
+func (n *NormalPush) OncePushBatch(taskType, batchIndex int, startId *string, itemCode string) (bool, *map[string]*PushInfo) {
 	query := map[string]interface{}{}
 	if len(Config.TestIds) > 0 {
 		query["userid"] = map[string]interface{}{
@@ -36,6 +36,9 @@ func (n *NormalPush) OncePushBatch(taskType, batchIndex int, startId *string) (b
 			"$gt": Int64All(*startId),
 		}
 	}
+	if itemCode != "" {
+		query["industry_item_code"] = itemCode
+	}
 	return (&Push{
 		Mgo:      Mgo_Log,
 		DbName:   DbConf.Mongodb.Log.DbName,
@@ -43,12 +46,12 @@ func (n *NormalPush) OncePushBatch(taskType, batchIndex int, startId *string) (b
 	}).GetPushDatas(taskType, batchIndex, Config.PushBatch, startId, "userid", query)
 }
 
-//获取用户缓存信息
+// 获取用户缓存信息
 func (n *NormalPush) GetUserInfo(user map[string]interface{}) *UserInfo {
 	return putil.NewUserInfoByPushSpaceColl(user)
 }
 
-//推送以后处理
+// 推送以后处理
 func (n *NormalPush) AfterPush(pushResult *PushResult, ids []interface{}) {
 	if pushResult == nil || pushResult.PushDate == 0 {
 		return
@@ -72,7 +75,6 @@ func (n *NormalPush) GetPushParam(mailPush bool, u *UserInfo, sl *SortList) *Pus
 	return pushParam
 }
 
-//
 func Save(u *UserInfo, matchInfos *SortList) (int64, string) {
 	SavePool <- true
 	defer func() {

+ 1 - 1
pushsubscribe/push/pusher/pusher.go

@@ -5,7 +5,7 @@ import (
 )
 
 type Pusher interface {
-	OncePushBatch(taskType, batchIndex int, startId *string) (bool, *map[string]*PushInfo)
+	OncePushBatch(taskType, batchIndex int, startId *string, itemCode string) (bool, *map[string]*PushInfo)
 	GetUserInfo(user map[string]interface{}) *UserInfo
 	GetPushParam(mailPush bool, k *UserInfo, sl *SortList) *PushParam
 	AfterPush(pushResult *PushResult, ids []interface{})