浏览代码

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

fengweiqiang 6 年之前
父节点
当前提交
120feeb587

+ 1 - 1
udpprojectset/src/configinc.json

@@ -1,5 +1,5 @@
 {
-    "omitmax": 10,
+    "omitmax": 1000,
     "deviationday": 90,
     "hourinterval": 240
 }

+ 0 - 2
udpprojectset/src/main.go

@@ -144,8 +144,6 @@ func main() {
 		}
 	}
 	log.Println("load data from redis finished.", n)
-	//清理redis
-	//clearedis()
 
 	if taskstock, ok := Sysconfig["taskstock"].(map[string]interface{}); ok { //跑存量数据
 		if b, _ := taskstock["open"].(bool); b {

+ 14 - 5
udpprojectset/src/projectmeger.go

@@ -140,10 +140,19 @@ func noBuyer(p PCBV, thisinfo *Info, tmp map[string]interface{}) {
 			sflag = mergeProject(tmp, thisinfo, scores, pncb)
 		} else { //无项目编号
 			if p.PnameLen > MegerFieldsLen.ProjectNamelen {
-				//三选一打分
-				scores := score3Select1(p, thisinfo, tmp, res, pncb)
-				//项目合并
-				sflag = mergeProject(tmp, thisinfo, scores, pncb)
+				if p.Area && p.City && p.Agency {
+					//三选一打分
+					scores := score3Select1(p, thisinfo, tmp, res, pncb)
+					//项目合并
+					sflag = mergeProject(tmp, thisinfo, scores, pncb)
+				} else {
+					sflag = "alone"
+					mess := map[string]interface{}{
+						"meger_mess":  "无采购单位,不满足三选一",
+						"meger_sflag": sflag,
+					}
+					newProject(tmp, mess, pici, thisinfo)
+				}
 			} else {
 				//生成项目,不参与后续对比
 				sflag = "alone"
@@ -417,7 +426,7 @@ func mergeProject(tmp map[string]interface{}, thisinfo *Info, scores []*CompareO
 		})
 		max := scores[0]
 		if max.Score > 0 {
-			sflag = "repeat"
+			sflag = "normal"
 			max.Parent.Bfind = true
 			tmp["cresult"] = max.Cresult
 			tmp["score"] = max.Score

+ 8 - 2
udpprojectset/src/projectmegerinsert.go

@@ -66,7 +66,7 @@ var StartId string
 func main_inc() {
 	flag.StringVar(&StartId, "StartId", "", "开始_id")
 	flag.Parse()
-	StartId = "5d12fc62a5cb26b9b750337c"
+	//StartId = "56388138af53745d9a000001"
 	log.Println("StartId", StartId)
 	if StartId == "" {
 		return
@@ -104,6 +104,9 @@ func getOmitData(startId string) (list []*MegerInfo) {
 	minfo := &MegerInfo{Lock: &sync.Mutex{}, Minfo: []*Info{}}
 	var lastId string
 	for tmp := make(map[string]interface{}); it.Next(tmp); {
+		if qu.IntAll(tmp["repeat"]) == 1 {
+			continue
+		}
 		if tmp["meger_sflag"] != nil {
 			continue
 		}
@@ -132,6 +135,7 @@ func getOmitData(startId string) (list []*MegerInfo) {
 		} else {
 			minfo.EndPublishtime = this.Publishtime
 		}
+		log.Println(this.Id)
 		lastId = this.Id
 		//分段
 		if (minfo.EndPublishtime-minfo.StartPublishtime)/int64(86400) > DeviationDay*int64(2) || OmitNumMax <= int64(minfo.Num) {
@@ -210,6 +214,8 @@ func compareMeger(minfo *MegerInfo) {
 		})
 		if len(infors) > 0 { //合并项目
 			info := infors[0]
+			info.Info.Data["cresult"] = info.Cresult
+			info.Info.Data["score"] = info.Score
 			id := updateinfoInc(info.Info, info.Info.Data, info.Pinfo)
 			log.Println("合并项目", info.Info.ProjectName, info.Info.ProjectCode, info.Info.Buyer)
 			switch info.Pkey {
@@ -271,7 +277,7 @@ func compareScoreMeger(ktype string, pids []string, info *Info) {
 			if projectInfo == nil {
 				continue
 			}
-			//拼装projectInfod对象
+			//拼装projectInfo对象
 			projectInfo.Id = projectInfo.IdInc
 			projects = append(projects, projectInfo)
 		}