浏览代码

Merge branch 'dev3.4' of http://192.168.3.207:10080/qmx/jy-data-extract into dev3.4

apple 5 年之前
父节点
当前提交
22f307d023
共有 6 个文件被更改,包括 40 次插入33 次删除
  1. 4 4
      src/config.json
  2. 19 15
      src/jy/extract/extract.go
  3. 4 3
      src/jy/extract/score.go
  4. 7 4
      versioncomparison/config.json
  5. 6 7
      versioncomparison/main.go
  6. 二进制
      versioncomparison/template.xlsx

+ 4 - 4
src/config.json

@@ -10,8 +10,8 @@
     "elasticPoolSize": 30,
     "mergetable": "projectset",
     "mergetablealias": "projectset_v1",
-    "saveresult": false,
-    "fieldsfind":false,
+    "saveresult": true,
+    "fieldsfind": false,
     "qualityaudit": false,
     "saveblock": false,
     "filelength": 100000,
@@ -59,9 +59,9 @@
             }
         ]
     },
-	"isSaveTag":false,
+    "isSaveTag": false,
     "tomail": "zhangjinkun@topnet.net.cn,chenmingzhu@topnet.net.cn,zhaolongyue@topnet.net.cn",
     "api": "http://10.171.112.160:19281/_send/_mail",
-    "deleteInstanceTimeHour":1,
+    "deleteInstanceTimeHour": 1,
     "jsondata_extweight": 1
 } 

+ 19 - 15
src/jy/extract/extract.go

@@ -289,6 +289,10 @@ func (e *ExtractTask) PreInfo(doc map[string]interface{}) (j, jf *ju.Job, isSite
 	if subtype == "" {
 		subtype = "all"
 	}
+	if toptype == "其它" || subtype == "其它" || subtype == "其他" || subtype == "结果变更" {
+		toptype = "all"
+		subtype = "all"
+	}
 	toMap := qu.ObjToMap(doc["jsondata"])
 	//log.Debug("toMap", toMap)
 	if (*toMap) != nil {
@@ -1139,9 +1143,9 @@ func extractFromKv(field, fieldname string, blocks []*ju.Block, vc *RuleCore, kv
 						"blocktag":    bl.Classify,
 						"weight":      vv.Weight,
 					})
-					if field != "winnertel" && field != "winnerperson" {
-						break //暂定取第一个
-					}
+					//if field != "winnertel" && field != "winnerperson" {
+					//	//break //暂定取第一个
+					//}
 				}
 			}
 		}
@@ -1687,19 +1691,19 @@ func AnalysisSaveResult(j, jf *ju.Job, e *ExtractTask) {
 		//tmp["extract_content"] = j.Content
 		if e.TaskInfo.TestColl == "" {
 			if len(tmp) > 0 { //保存抽取结果
-				if len(e.SiteFields) <= 0 {
-					for field, _ := range e.Fields {
-						if tmp[field] == nil {
-							tmp[field] = "" //覆盖之前版本数据
-						}
-					}
+			/*	if len(e.SiteFields) <= 0 {
+					//for field, _ := range e.Fields {
+					//	if tmp[field] == nil &&  {
+					//		tmp[field] = "" //覆盖之前版本数据
+					//	}
+					//}
 				} else {
-					for field, _ := range e.SiteFields {
-						if tmp[field] == nil {
-							tmp[field] = "" //覆盖之前版本数据
-						}
-					}
-				}
+					//for field, _ := range e.SiteFields {
+					//	if tmp[field] == nil &&{
+					//		tmp[field] = "" //覆盖之前版本数据
+					//	}
+					//}
+				}*/
 				tmp["repeat"] = 0
 				tmparr := []map[string]interface{}{
 					map[string]interface{}{

+ 4 - 3
src/jy/extract/score.go

@@ -339,9 +339,10 @@ func projectWeightClear(tmps []*ju.ExtField) []*ju.ExtField {
 			tmpWeight = v.Weight
 			tmpIndex = i
 		} else if v.Weight == tmpWeight {
-			if utf8.RuneCountInString(qu.ObjToString(v.Value)) >= 5 && utf8.RuneCountInString(qu.ObjToString(v.Value)) <= 38 && v.Value != tmps[tmpIndex].Value {
-				vmap[qu.ObjToString(v.Value)] = i
-			}
+			//if utf8.RuneCountInString(qu.ObjToString(v.Value)) >= 5 && utf8.RuneCountInString(qu.ObjToString(v.Value)) <= 38 && v.Value != tmps[tmpIndex].Value {
+			//	vmap[qu.ObjToString(v.Value)] = i
+			//}
+			newList = append(newList, v)
 		}
 	}
 	if tmpIndex != -999 {

+ 7 - 4
versioncomparison/config.json

@@ -1,17 +1,20 @@
 {
-    "premgo": "192.168.3.207:27082",
+    "premgo": "192.168.3.207:27092",
     "predb": "extract_kf",
-    "prec": "result_v3",
-    "newmgo": "192.168.3.207:27082",
+    "prec": "datainfo_dev3.2",
+    "newmgo": "192.168.3.207:27092",
     "newdb": "extract_kf",
-    "newc": "result_data",
+    "newc": "datainfo_dev3.4",
     "fields": [
         "projectname",
         "projectcode",
+        "contractcode",
         "buyer",
         "bidamount",
         "budget",
         "winner",
+        "winnertel",
+        "winnerperson",
         "agency",
         "buyerperson",
         "buyertel",

+ 6 - 7
versioncomparison/main.go

@@ -8,7 +8,6 @@ import (
 	"fmt"
 	"jy/mongodbutil"
 	"log"
-	"qfw/common/src/qfw/util"
 	qu "qfw/util"
 	"strings"
 
@@ -41,8 +40,8 @@ type Data struct {
 }
 
 func init() {
-	flag.StringVar(&Sid, "sid", "5cc87219a5cb26b9b719a6be", "开始id")
-	flag.StringVar(&Eid, "eid", "5d0c876aa5cb26b9b7078df8", "结束id")
+	flag.StringVar(&Sid, "sid", "5e17deb150b5ea296ec939d3", "开始id")
+	flag.StringVar(&Eid, "eid", "5e17e1e685a9271abf08616d", "结束id")
 	flag.Parse()
 	qu.ReadConfig(&SysConfig)
 	Premgo = mongodbutil.MgoFactory(1, 3, 120, qu.ObjToString(SysConfig["premgo"]), qu.ObjToString(SysConfig["predb"]))
@@ -83,12 +82,12 @@ func createXlsx() {
 				(*row).Cells[2].SetStyle(style)
 				(*row).Cells[3].SetStyle(style)
 				(*row).Cells[4].SetStyle(style)
-				if Compares[field] == nil{
+				if Compares[field] == nil {
 					(*row).Cells[1].SetInt(0)
 					(*row).Cells[2].SetInt(0)
 					(*row).Cells[3].SetInt(0)
 					(*row).Cells[4].SetInt(0)
-				}else {
+				} else {
 					(*row).Cells[1].SetInt(Compares[field].PreExtNum)
 					(*row).Cells[2].SetInt(Compares[field].NewExtNum)
 					(*row).Cells[3].SetInt(Compares[field].EqNum)
@@ -135,7 +134,7 @@ func getVersionData() {
 			if rd == nil {
 				rd = map[string]*Data{}
 			}
-			if v[key] == nil && strings.TrimSpace(util.ObjToString(v[key])) == ""{
+			if v[key] == nil && strings.TrimSpace(qu.ObjToString(v[key])) == "" {
 				continue
 			}
 			rd[qu.BsonIdToSId(v["_id"])] = &Data{
@@ -154,7 +153,7 @@ func getVersionData() {
 			if rd == nil {
 				rd = map[string]*Data{}
 			}
-			if v[field] == nil && strings.TrimSpace(util.ObjToString(v[field])) == ""{
+			if v[field] == nil && strings.TrimSpace(qu.ObjToString(v[field])) == "" {
 				continue
 			}
 			_id := qu.BsonIdToSId(v["_id"])

二进制
versioncomparison/template.xlsx