Эх сурвалжийг харах

11.23 相关字段变更(bidstatus、jgtime、buyer、buyerclass)

Jianghan 5 жил өмнө
parent
commit
9cd9d7e700

+ 38 - 7
fullproject/src_v1/project.go

@@ -416,12 +416,19 @@ var bidtype = map[string]string{
 	"竞价": "竞价",
 }
 
+//var bidstatus = map[string]string{
+//	"中标": "中标",
+//	"成交": "成交",
+//	"废标": "废标",
+//	"流标": "流标",
+//	"合同": "合同",
+//}
 var bidstatus = map[string]string{
+	"预告": "预告",
 	"中标": "中标",
 	"成交": "成交",
 	"废标": "废标",
 	"流标": "流标",
-	"合同": "合同",
 }
 
 //招标时间zbtime、中标时间jgtime、项目状态bidstatus、招标类型bidtype、最后发布时间lasttime、首次发布时间firsttime
@@ -600,11 +607,26 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
 		if bt != "" {
 			set["bidtype"] = bt
 		}
-		if thisinfo.TopType == "结果" {
+		//if thisinfo.TopType == "结果" {
+		//	set["bidstatus"] = thisinfo.SubType
+		//	set["jgtime"] = tmp["publishtime"]
+		//}
+		bs, _ := tmp["bidstatus"].(string)
+		if bidstatus[bs] != "" {
+			set["bidstatus"] = thisinfo.SubType
+			if bidstatus[bs] != "预告" {
+				set["jgtime"] = tmp["publishtime"]
+			}
+		}else if tmp["infoformat"] == 2 {
+			set["bidstatus"] = "拟建"
+		}else if tmp["bidstatus"] == "招标" {
+			set["bidstatus"] = thisinfo.TopType
+		}else {
 			set["bidstatus"] = thisinfo.SubType
-			set["jgtime"] = tmp["publishtime"]
 		}
+
 	}
+
 	//3\4\5--省、市、县
 	if thisinfo.Area != "全国" {
 		//xt := true
@@ -643,7 +665,20 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
 	if (pInfo.Buyer == "" && thisinfo.Buyer != "") || (len([]rune(pInfo.Buyer)) < 5 && len([]rune(thisinfo.Buyer)) > 5) {
 		pInfo.Buyer = thisinfo.Buyer
 		set["buyer"] = thisinfo.Buyer
+
+		pInfo.Buyerclass = thisinfo.Buyerclass
+		set["buyerclass"] = thisinfo.Buyerclass
 	}
+
+	if pInfo.Buyer == "" {
+		set["buyerclass"] = ""
+	}
+	//if thisinfo.Buyerclass != "" && pInfo.Buyerclass == "" {
+	//	pInfo.Buyerclass = thisinfo.Buyerclass
+	//	set["buyerclass"] = pInfo.Buyerclass
+	//}
+
+
 	//8--代理机构
 	if (pInfo.Agency == "" && thisinfo.Agency != "") || (len([]rune(pInfo.Agency)) < 5 && len([]rune(thisinfo.Agency)) > 5) {
 		pInfo.Agency = thisinfo.Agency
@@ -660,10 +695,6 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
 		set["buyertel"] = pInfo.Buyertel
 	}
 
-	if thisinfo.Buyerclass != "" && pInfo.Buyerclass == "" {
-		pInfo.Buyerclass = thisinfo.Buyerclass
-		set["buyerclass"] = pInfo.Buyerclass
-	}
 	if thisinfo.Bidopentime > pInfo.Bidopentime {
 		pInfo.Bidopentime = thisinfo.Bidopentime
 		set["bidopentime"] = pInfo.Bidopentime