|
@@ -160,13 +160,13 @@ func ExtractByUdp(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
|
}
|
|
|
var j, jf *ju.Job
|
|
|
var isSite bool
|
|
|
- if ext.IsFileField && (v["projectinfo"] != nil ||v["attach_text"] != nil ){
|
|
|
+ if ext.IsFileField && (v["projectinfo"] != nil || v["attach_text"] != nil) {
|
|
|
v["isextFile"] = true
|
|
|
- j, jf,isSite = ext.PreInfo(v)
|
|
|
+ j, jf, isSite = ext.PreInfo(v)
|
|
|
} else {
|
|
|
- j, _,isSite = ext.PreInfo(v)
|
|
|
+ j, _, isSite = ext.PreInfo(v)
|
|
|
}
|
|
|
- go ext.ExtractProcess(j, jf,isSite)
|
|
|
+ go ext.ExtractProcess(j, jf, isSite)
|
|
|
index++
|
|
|
ext.TaskInfo.ProcessPool <- true
|
|
|
}
|
|
@@ -177,13 +177,13 @@ func ExtractByUdp(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
|
}
|
|
|
var j, jf *ju.Job
|
|
|
var isSite bool
|
|
|
- if ext.IsFileField && (v["projectinfo"] != nil ||v["attach_text"] != nil ){
|
|
|
+ if ext.IsFileField && (v["projectinfo"] != nil || v["attach_text"] != nil) {
|
|
|
v["isextFile"] = true
|
|
|
- j, jf,isSite = ext.PreInfo(v)
|
|
|
+ j, jf, isSite = ext.PreInfo(v)
|
|
|
} else {
|
|
|
- j, _,isSite = ext.PreInfo(v)
|
|
|
+ j, _, isSite = ext.PreInfo(v)
|
|
|
}
|
|
|
- go ext.ExtractProcess(j, jf,isSite)
|
|
|
+ go ext.ExtractProcess(j, jf, isSite)
|
|
|
index++
|
|
|
ext.TaskInfo.ProcessPool <- true
|
|
|
}
|
|
@@ -230,18 +230,18 @@ func ExtractByUdp(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
|
_id := qu.BsonIdToSId(v["_id"])
|
|
|
var j, jf *ju.Job
|
|
|
var isSite bool
|
|
|
- if ext.IsFileField && (v["projectinfo"] != nil ||v["attach_text"] != nil ){
|
|
|
+ if ext.IsFileField && (v["projectinfo"] != nil || v["attach_text"] != nil) {
|
|
|
v["isextFile"] = true
|
|
|
- j, jf,isSite = ext.PreInfo(v)
|
|
|
+ j, jf, isSite = ext.PreInfo(v)
|
|
|
} else {
|
|
|
- j, _,isSite = ext.PreInfo(v)
|
|
|
+ j, _, isSite = ext.PreInfo(v)
|
|
|
}
|
|
|
ext.TaskInfo.ProcessPool <- true
|
|
|
wg.Add(1)
|
|
|
go func(wg *sync.WaitGroup, j, jf *ju.Job) {
|
|
|
defer wg.Done()
|
|
|
//log.Debug(index,j.SourceMid,)
|
|
|
- ext.ExtractProcess(j, jf,isSite)
|
|
|
+ ext.ExtractProcess(j, jf, isSite)
|
|
|
}(&wg, j, jf)
|
|
|
index++
|
|
|
if index%1000 == 0 {
|
|
@@ -258,3 +258,66 @@ func ExtractByUdp(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
|
|
|
log.Debug("抽取完成,", "count:", count, ",index:", index, ",bidtotal:", ext.BidTotal, ",eid:", eid)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//中标预测信息抽取,ossid为附件识别后的id
|
|
|
+var exF *ExtractTask
|
|
|
+
|
|
|
+func ExtractByBidForecast(infoid string, ossid ...string) map[string]interface{} {
|
|
|
+ defer qu.Catch()
|
|
|
+ if exF == nil {
|
|
|
+ exF = &ExtractTask{}
|
|
|
+ exF.Id = qu.ObjToString(ju.Config["udptaskid"])
|
|
|
+ exF.InitTaskInfo()
|
|
|
+ exF.TaskInfo.FDB = db.MgoFactory(1, 2, 600, exF.TaskInfo.FromDbAddr, exF.TaskInfo.FromDB)
|
|
|
+ exF.TaskInfo.TDB = db.MgoFactory(1, 2, 600, exF.TaskInfo.ToDbAddr, exF.TaskInfo.ToDB)
|
|
|
+ exF.InitSite()
|
|
|
+ exF.InitRulePres()
|
|
|
+ exF.InitRuleBacks(false)
|
|
|
+ exF.InitRuleBacks(true)
|
|
|
+ exF.InitRuleCore(false)
|
|
|
+ exF.InitRuleCore(true)
|
|
|
+ exF.InitBlockRule()
|
|
|
+ exF.InitPkgCore()
|
|
|
+ exF.InitTag(false)
|
|
|
+ exF.InitTag(true)
|
|
|
+ exF.InitClearFn(false)
|
|
|
+ exF.InitClearFn(true)
|
|
|
+ if exF.IsExtractCity { //版本上控制是否开始城市抽取
|
|
|
+ //初始化城市DFA信息
|
|
|
+ //exF.InitCityDFA()
|
|
|
+ exF.InitCityInfo()
|
|
|
+ exF.InitAreaCode()
|
|
|
+ exF.InitPostCode()
|
|
|
+ }
|
|
|
+ //质量审核
|
|
|
+ exF.InitAuditFields()
|
|
|
+ exF.InitAuditRule()
|
|
|
+ exF.InitAuditClass()
|
|
|
+ exF.InitAuditRecogField()
|
|
|
+
|
|
|
+ //品牌抽取是否开启
|
|
|
+ ju.IsBrandGoods, _ = ju.Config["brandgoods"].(bool)
|
|
|
+
|
|
|
+ exF.ResultSave(true)
|
|
|
+ exF.BidSave(true)
|
|
|
+ exF.IsRun = true
|
|
|
+ exF.InitFile()
|
|
|
+ }
|
|
|
+ tmp, _ := exF.TaskInfo.FDB.FindById(exF.TaskInfo.FromColl, infoid, nil)
|
|
|
+ if exF.IsFileField && ((*tmp)["projectinfo"] != nil || (*tmp)["attach_text"] != nil) {
|
|
|
+ (*tmp)["isextFile"] = true
|
|
|
+ }
|
|
|
+ exF.TaskInfo.ProcessPool <- true
|
|
|
+ j, jf, _ := exF.PreInfo(*tmp)
|
|
|
+ wg := sync.WaitGroup{}
|
|
|
+ wg.Add(1)
|
|
|
+ go func(wg *sync.WaitGroup, j, jf *ju.Job) {
|
|
|
+ defer wg.Done()
|
|
|
+ exF.ExtractProcess(j, jf, false)
|
|
|
+ }(&wg, j, jf)
|
|
|
+ wg.Wait()
|
|
|
+ exF.BidSave(false)
|
|
|
+ fmt.Println(exF.ResultTmp)
|
|
|
+ fmt.Println(exF.ResultFTmp)
|
|
|
+ return nil
|
|
|
+}
|