|
@@ -13,17 +13,18 @@ import (
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
- Sysconfig map[string]interface{} //配置文件
|
|
|
- mgo *mongodb.MongodbSim //mongodb操作对象
|
|
|
- extractmgo *mongodb.MongodbSim //mongodb操作对象
|
|
|
- udpclient mu.UdpClient //udp对象
|
|
|
- updport string
|
|
|
- winner, bidding, biddingback, project, buyer map[string]interface{}
|
|
|
- savesizei = 500
|
|
|
- biddingIndexFields = []string{"_id", "buyerclass", "s_winner", "title", "detail", "detail_bak", "area", "areaval", "site", "type", "amount", "bidopendate", "bidopentime", "buyer", "channel", "city", "comeintime", "contenthtml", "descript", "description", "extracttype", "href", "infoformat", "keywords", "projectcode", "projectname", "publishtime", "s_sha", "spidercode", "subtype", "summary", "toptype", "urltop", "winner", "agency", "budget", "bidamount", "s_subscopeclass", "projectscope", "bidstatus"}
|
|
|
- projectinfoFields []string
|
|
|
- multiIndex []string
|
|
|
- BulkSize = 400
|
|
|
+ Sysconfig map[string]interface{} //配置文件
|
|
|
+ mgo *mongodb.MongodbSim //mongodb操作对象
|
|
|
+ extractmgo *mongodb.MongodbSim //mongodb操作对象
|
|
|
+ winnerentermgo *mongodb.MongodbSim //mongodb操作对象
|
|
|
+ udpclient mu.UdpClient //udp对象
|
|
|
+ updport string
|
|
|
+ winner, winnerenterprise, bidding, biddingback, project, buyer map[string]interface{}
|
|
|
+ savesizei = 500
|
|
|
+ biddingIndexFields = []string{"_id", "buyerclass", "s_winner", "title", "detail", "detail_bak", "area", "areaval", "site", "type", "amount", "bidopendate", "bidopentime", "buyer", "channel", "city", "comeintime", "contenthtml", "descript", "description", "extracttype", "href", "infoformat", "keywords", "projectcode", "projectname", "publishtime", "s_sha", "spidercode", "subtype", "summary", "toptype", "urltop", "winner", "agency", "budget", "bidamount", "s_subscopeclass", "projectscope", "bidstatus"}
|
|
|
+ projectinfoFields []string
|
|
|
+ multiIndex []string
|
|
|
+ BulkSize = 400
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
@@ -32,6 +33,7 @@ func init() {
|
|
|
go checkMapJob()
|
|
|
updport, _ = Sysconfig["updport"].(string)
|
|
|
winner, _ = Sysconfig["winner"].(map[string]interface{})
|
|
|
+ winnerenterprise, _ = Sysconfig["winnerenterprise"].(map[string]interface{})
|
|
|
buyer, _ = Sysconfig["buyer"].(map[string]interface{})
|
|
|
bidding, _ = Sysconfig["bidding"].(map[string]interface{})
|
|
|
biddingback, _ = Sysconfig["biddingback"].(map[string]interface{})
|
|
@@ -60,6 +62,12 @@ func init() {
|
|
|
extractmgo.InitPool()
|
|
|
}
|
|
|
|
|
|
+ winnerentermgo = &mongodb.MongodbSim{
|
|
|
+ MongodbAddr: winnerenterprise["addr"].(string),
|
|
|
+ Size: util.IntAllDef(winnerenterprise["size"], 5),
|
|
|
+ DbName: winnerenterprise["db"].(string),
|
|
|
+ }
|
|
|
+ winnerentermgo.InitPool()
|
|
|
econf := Sysconfig["elastic"].(map[string]interface{})
|
|
|
elastic.InitElasticSize(econf["addr"].(string), util.IntAllDef(econf["pool"], 5))
|
|
|
if bidding["indexfields"] != nil {
|
|
@@ -116,6 +124,14 @@ func processUdpMsg(act byte, data []byte, ra *net.UDPAddr) {
|
|
|
}()
|
|
|
winnerTask(data, mapInfo)
|
|
|
}()
|
|
|
+ case "winner_enterprise":
|
|
|
+ pool <- true
|
|
|
+ go func() {
|
|
|
+ defer func() {
|
|
|
+ <-pool
|
|
|
+ }()
|
|
|
+ winnerEnterPriseTask(data, mapInfo)
|
|
|
+ }()
|
|
|
case "bidding": //实时+udp调用,可选择是否生成关键词, 一次性最大20万
|
|
|
pool <- true
|
|
|
go func() {
|