ソースを参照

匹配金额标签

fengweiqiang 4 年 前
コミット
5c2d6d77b8
5 ファイル変更74 行追加39 行削除
  1. 1 1
      src/config.json
  2. 1 1
      src/jy/clear/tonumber.go
  3. 68 33
      src/jy/extract/extract.go
  4. 2 2
      src/jy/pretreated/analytable.go
  5. 2 2
      udps/main.go

+ 1 - 1
src/config.json

@@ -32,7 +32,7 @@
     "iscltlog": false,
     "brandgoods": false,
     "pricenumber":true,
-    "udptaskid": "5fceec1c92b4ee1025b7d091",
+    "udptaskid": "6061980a5743176a571695a1",
     "udpport": "1484",
     "nextNode": [
         {

+ 1 - 1
src/jy/clear/tonumber.go

@@ -397,7 +397,7 @@ func ClearMaxAmount(data []interface{}, spidercode ...string) []interface{} {
 			
 		}
 	}
-	if value >= 500000000000 {
+	if value >= 50000000000 {
 		data[0] = float64(0)
 		//data[1] = false
 		data[1] = true

+ 68 - 33
src/jy/extract/extract.go

@@ -34,32 +34,48 @@ var (
 	Fields        = `{"title":1,"summary":1,"detail":1,"contenthtml":1,"site":1,"spidercode":1,"toptype":1,"subtype":1,"bidstatus":1,"area":1,"city":1,"comeintime":1,"publishtime":1,"sensitive":1,"projectinfo":1,"jsondata":1,"href":1,"infoformat":1,"attach_text":1,"dataging":1,"review_experts":1,"purchasing":1}`
 	//Fields        = `{"title":1,"summary":1,"detail":1,"contenthtml":1,"site":1,"spidercode":1,"toptype":1,"subtype":1,"bidstatus":1,"area":1,"city":1,"comeintime":1,"publishtime":1,"sensitive":1,"projectinfo":1,"jsondata":1,"href":1,"infoformat":1,"attach_text":1,"dataging":1,"new_attach_text":1,"createtime":1,"currency":1,"id":1,"company_email":1,"buyerclass":1,"tagname":1,"company_phone":1,"appid":1,"industry":1,"projectscope":1,"item":1,"s_subscopeclass":1,"matchkey":1,"jybxhref":1,"legal_person":1,"matchtype":1,"review_experts":1,"purchasing":1}`
 	Fields2 = `{"budget":1,"bidamount":1,"title":1,"projectname":1,"winner":1}`
+	/*f       = map[string]bool{
+		"T":                true,
+		"_d":               true,
+		"area":             true,
+		"channel":          true,
+		"comeintime":       true,
+		"competehref":      true,
+		"href":             true,
+		"l_np_publishtime": true,
+		"publishtime":      true,
+		"sendflag":         true,
+		"site":             true,
+		"spidercode":       true,
+		"title":            true,
+		"projectname":      true,
+	}*/
 	spidercode = map[string]bool{
-		"gd_zhsggzyjyzx_jsgc_fjczbgg":true,
-		"js_szgyyqggzyjyzx_jsgc_zjfbgs":true,
-		"zj_tzsyhggzyjyzx_jsgc_kbqk":true,
-		"hb_tmsggzyjyxxw_jsgc_kbqk":true,
-		"zj_nbsyyggzyjyw_jsgc_kbqk":true,
-		"zj_zjsggzyjyzx_jyxx_kbjg":true,
-		"zj_zjzdgcjyw_ztbjglxx_kbjg":true,
-		"zj_lssggzyjyw_jsgc_kbsk":true,
-		"zj_qzslyxggzyjyzx_gggs_xkbjl":true,
-		"sc_mssggzydzjypt_jsgc_kbjl":true,
-		"sc_pzhsggzyjyfwzx_jsgc_kbylb":true,
-		"a_zgzbtbggfwpt_wasjgf_ss_kbjl":true,
-		"a_hbszbtbggfwpt_kbjl":true,
-		"a_szsjsgcjyfwzxbafzx_kbqkgs":true,
-		"a_szldzbyxgs_kbxx":true,
-		"zj_zssssxggzyjyw_gcjs_kbjggs":true,
-		"gd_szszfhjsj_kbqkgs":true,
-		"a_gjggzyjypt_gcjs_kbjl":true,
-		"a_gjggzyjypt_gcjs_kbjl_new":true,
-		"zj_tzsyhggzyjyzx_kbjggg":true,
-		"a_zgzbtbggfwpy_wasjgf_kbjl_lsbl":true,
-		"ah_czsggzyjyw_jsgc_kbjl":true,
-		"ah_czsggzyjyw_zfcg_kbxx":true,
-		"ah_whsggzyjyfww_kbxx_cgxm":true,
-		"ah_whsggzyjyfww_kbxx_gcxm":true,
+		"gd_zhsggzyjyzx_jsgc_fjczbgg":     true,
+		"js_szgyyqggzyjyzx_jsgc_zjfbgs":   true,
+		"zj_tzsyhggzyjyzx_jsgc_kbqk":      true,
+		"hb_tmsggzyjyxxw_jsgc_kbqk":       true,
+		"zj_nbsyyggzyjyw_jsgc_kbqk":       true,
+		"zj_zjsggzyjyzx_jyxx_kbjg":        true,
+		"zj_zjzdgcjyw_ztbjglxx_kbjg":      true,
+		"zj_lssggzyjyw_jsgc_kbsk":         true,
+		"zj_qzslyxggzyjyzx_gggs_xkbjl":    true,
+		"sc_mssggzydzjypt_jsgc_kbjl":      true,
+		"sc_pzhsggzyjyfwzx_jsgc_kbylb":    true,
+		"a_zgzbtbggfwpt_wasjgf_ss_kbjl":   true,
+		"a_hbszbtbggfwpt_kbjl":            true,
+		"a_szsjsgcjyfwzxbafzx_kbqkgs":     true,
+		"a_szldzbyxgs_kbxx":               true,
+		"zj_zssssxggzyjyw_gcjs_kbjggs":    true,
+		"gd_szszfhjsj_kbqkgs":             true,
+		"a_gjggzyjypt_gcjs_kbjl":          true,
+		"a_gjggzyjypt_gcjs_kbjl_new":      true,
+		"zj_tzsyhggzyjyzx_kbjggg":         true,
+		"a_zgzbtbggfwpy_wasjgf_kbjl_lsbl": true,
+		"ah_czsggzyjyw_jsgc_kbjl":         true,
+		"ah_czsggzyjyw_zfcg_kbxx":         true,
+		"ah_whsggzyjyfww_kbxx_cgxm":       true,
+		"ah_whsggzyjyfww_kbxx_gcxm":       true,
 	}
 )
 
@@ -2117,7 +2133,16 @@ func AnalysisSaveResult(j, jf *ju.Job, e *ExtractTask) {
 			}
 		}
 		tmp["dataging"] = j.Dataging
-
+		/*for k, v := range *j.Data {
+			if f[k] {
+				tmp[k] = v
+			}
+		}
+		for k := range tmp {
+			if !f[k]{
+				delete(tmp,k)
+			}
+		}*/
 		//检查字段
 		tmp = checkFields(tmp)
 		if tmp["projectname"] == nil || tmp["projectname"] == "" {
@@ -2235,13 +2260,23 @@ func checkFields(tmp map[string]interface{}) map[string]interface{} {
 		}
 	}
 	//budget bidamount
-	if bg, ok := tmp["budget"].(float64); ok && bg >= 500000000000 {
-		tmp["big_budget_err"] = bg
-		delete(tmp, "budget")
-	}
-	if bg, ok := tmp["bidamount"].(float64); ok && bg >= 500000000000 {
-		tmp["big_bidamount_err"] = bg
-		delete(tmp, "bidamount")
+	if bg, ok := tmp["budget"].(float64); ok {
+		if bg >= 50000000000 {
+			tmp["budget_max_err"] = bg
+			delete(tmp, "budget")
+		} else if bg > 0 && bg < 1000 {
+			tmp["budget_min_err"] = bg
+			delete(tmp, "budget")
+		}
+	}
+	if bg, ok := tmp["bidamount"].(float64); ok && bg >= 50000000000 {
+		if bg >= 50000000000 {
+			tmp["bidamount_max_err"] = bg
+			delete(tmp, "bidamount")
+		} else if bg > 0 && bg < 1000 {
+			tmp["bidamount_min_err"] = bg
+			delete(tmp, "bidamount")
+		}
 	}
 	return tmp
 }

+ 2 - 2
src/jy/pretreated/analytable.go

@@ -185,7 +185,7 @@ func CommonDataAnaly(k, tabletag, tabledesc string, v interface{}, isSite bool,
 		}
 		res[0].IsInvalid = true
 		//k1 = res[0].Value
-	} else {
+	} /*else {
 		kvTags[k] = append(kvTags[k], &u.Tag{Key: k, Value: v1, IsInvalid: true})
 		//没有取到标准化key时,对中标金额和中标单位的逻辑处理
 		if filter_zbje_k.MatchString(k) && !filter_zbje_kn.MatchString(k) && filter_zbje_v.MatchString(v1) && utf8.RuneCountInString(v1) < 20 {
@@ -213,7 +213,7 @@ func CommonDataAnaly(k, tabletag, tabledesc string, v interface{}, isSite bool,
 				}
 			}
 		}
-	}
+	}*/
 	return
 }
 

+ 2 - 2
udps/main.go

@@ -22,8 +22,8 @@ func main() {
 	flag.IntVar(&p, "p", 1484, "端口")
 	flag.IntVar(&tmptime, "tmptime", 0, "时间查询")
 	flag.StringVar(&tmpkey, "tmpkey", "", "时间字段")
-	flag.StringVar(&id1, "gtid", "", "gtid")
-	flag.StringVar(&id2, "lteid", "", "lteid")
+	flag.StringVar(&id1, "gtid", "6075ea3162ad7d3e568c7590", "gtid")
+	flag.StringVar(&id2, "lteid", "6076546d27cdc4cf2bc60fde", "lteid")
 	flag.StringVar(&ids, "ids", "", "id1,id2")
 	flag.StringVar(&stype, "stype", "biddingall", "stype,传递类型")
 	flag.StringVar(&bkey, "bkey", "", "bkey,加上此参数表示不生关键词和摘要")