Browse Source

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

apple 4 years ago
parent
commit
39943569af

+ 17 - 14
fullproject/src_v1/init.go

@@ -17,6 +17,7 @@ var (
 	Sysconfig                                      map[string]interface{} //读取配置文件
 	MongoTool, MgoBidding                          *MongodbSim            //mongodb连接
 	ExtractColl, ProjectColl, BackupColl, SiteColl string                 //抽取表、项目表、项目快照表、站点表
+	ExtractColl1                                   string
 	Thread                                         int                    //配置项线程数
 	BlackList                                      []interface{}
 	BlaskListMap                                   map[string]bool
@@ -66,6 +67,7 @@ func init() {
 	MgoBidding.InitPool()
 
 	ExtractColl = Sysconfig["extractColl"].(string)
+	ExtractColl1 = Sysconfig["extractColl1"].(string)
 	ProjectColl = Sysconfig["projectColl"].(string)
 	BackupColl = Sysconfig["projectColl"].(string) + "_back"
 	SiteColl = Sysconfig["siteColl"].(string)
@@ -265,22 +267,22 @@ type Info struct {
 	ContractGuarantee   bool                     `json:"contract_guarantee"`
 	BidGuarantee        bool                     `json:"bid_guarantee"`
 	Qualifies           []map[string]interface{} `json:"qualifies"`
+	EntIdList           []string                 `json:"entidlist"`
 	HasPackage          bool                     // `json:"haspackage"`
 	Package             map[string]interface{}   `json:"package"`
-	//PNum          string                 `json:"pnum"`
-	Topscopeclass []string `json:"topscopeclass"`
-	Subscopeclass []string `json:"subscopeclass"`
-	Buyerclass    string   `json:"buyerclass"`
-	Bidopentime   int64    `json:"bidopentime"`
-	Budget        float64  `json:"budget"`
-	Bidamount     float64  `json:"bidamount"`
-	Winners       []string
-	dealtype      int
-	PTC           string //从标题中抽的项目编号
-	pnbval        int    //项目名称、编号、采购单位存在的个数
-	LenPC         int    //项目编号长度
-	LenPN         int    //项目名称长度
-	LenPTC        int    //标题抽的项目编号长度
+	Topscopeclass       []string                 `json:"topscopeclass"`
+	Subscopeclass       []string                 `json:"subscopeclass"`
+	Buyerclass          string                   `json:"buyerclass"`
+	Bidopentime         int64                    `json:"bidopentime"`
+	Budget              float64                  `json:"budget"`
+	Bidamount           float64                  `json:"bidamount"`
+	Winners             []string
+	dealtype            int
+	PTC                 string //从标题中抽的项目编号
+	pnbval              int    //项目名称、编号、采购单位存在的个数
+	LenPC               int    //项目编号长度
+	LenPN               int    //项目名称长度
+	LenPTC              int    //标题抽的项目编号长度
 	//以下三个元素做对比,计算包含时候使用
 	PNBH  int //0初始,+包含,-被包含
 	PCBH  int
@@ -329,6 +331,7 @@ type ProjectInfo struct {
 	ContractGuarantee  bool                   `json:"contract_guarantee"`      //履约保证金 是否支持包含
 	BidGuarantee       bool                   `json:"bid_guarantee"`           //投标保证金 是否支持包含
 	Qualifies          string                 `json:"qualifies"`               //资质条件
+	EntIdList          []string               `json:"entidlist"`               //企业id
 	score              int
 	comStr             string
 	resVal, pjVal      int

+ 9 - 2
fullproject/src_v1/mgotool.go

@@ -123,6 +123,13 @@ func (ms *MgoSess) Iter() *MgoIter {
 	return it
 }
 
+func (ms *MgoSess) Count() (int64, error) {
+	if ms.Query != nil {
+		return ms.M.C.Database(ms.Db).Collection(ms.Coll).CountDocuments(ms.M.Ctx, ms.Query)
+	}
+	return ms.M.C.Database(ms.Db).Collection(ms.Coll).EstimatedDocumentCount(ms.M.Ctx)
+}
+
 type MongodbSim struct {
 	MongodbAddr string
 	Size        int
@@ -185,9 +192,9 @@ func (m *MongodbSim) UpSertBulk(c string, doc ...[]map[string]interface{}) bool
 		write.SetUpsert(true)
 		writes = append(writes, write)
 	}
-	_, e := coll.BulkWrite(m.Ctx, writes)
+	r, e := coll.BulkWrite(m.Ctx, writes)
 	if e != nil {
-		log.Println("mgo upsert error:", e.Error())
+		log.Println("mgo upsert error:", e.Error(), r)
 		return false
 	}
 	return true

+ 14 - 0
fullproject/src_v1/project.go

@@ -226,6 +226,7 @@ func (p *ProjectTask) startProjectMerge(info *Info, tmp map[string]interface{})
 
 	if !bFindProject {
 		if !IsCreatePro(info) {
+			qu.Debug("舍弃数据---", info.Id)
 			return
 		}
 		id, p1 := p.NewProject(tmp, info)
@@ -600,6 +601,9 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
 			set["qualifies"] = strings.Join(str, ",")
 		}
 	}
+	if len(p1.EntIdList) > 0 {
+		set["entidlist"] = p1.EntIdList
+	}
 	p1.InfoFiled = make(map[string]InfoField)
 	infofield := InfoField{
 		Budget:       thisinfo.Budget,
@@ -693,6 +697,7 @@ var INFOFIELDS = []string{
 	"contract_guarantee",
 	"bid_guarantee",
 	"qualifies",
+	"entidlist",
 }
 
 //项目中list的信息
@@ -736,6 +741,7 @@ func (p *ProjectTask) NewCachePinfo(id primitive.ObjectID, thisinfo *Info, bidty
 		Bidstatus:     bidstatus,
 		Bidtype:       bidtype,
 		Winners:       thisinfo.Winners,
+		EntIdList:     thisinfo.EntIdList,
 	}
 	if thisinfo.LenPTC > 5 {
 		p1.MPC = append(p1.MPC, thisinfo.PTC)
@@ -1069,6 +1075,14 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
 			set["qualifies"] = strings.Join(str, ",")
 		}
 	}
+	if len(thisinfo.EntIdList) > 0 {
+		for _, v := range thisinfo.EntIdList{
+			if BinarySearch(pInfo.EntIdList, v) == -1 {
+				pInfo.EntIdList = append(pInfo.EntIdList, v)
+			}
+		}
+		set["entidlist"] = pInfo.EntIdList
+	}
 
 	if thisinfo.HasPackage { //多包处理
 		set["multipackage"] = 1

+ 9 - 6
fullproject/src_v1/task.go

@@ -422,7 +422,7 @@ func (p *ProjectTask) delInfoPro(udpInfo map[string]interface{}) {
 	}
 	client := Es.GetEsConn()
 	defer Es.DestoryEsConn(client)
-	esquery := `{"query": {"bool": {"must": [{"match": {"ids": "`+infoid+`"}}]}}}`
+	esquery := `{"query": {"bool": {"must": [{"term": {"ids": "`+infoid+`"}}]}}}`
 	data := Es.Get(Index, Itype, esquery)
 	if len(*data) > 0 {
 		pid := util.ObjToString(((*data)[0])["_id"])
@@ -457,7 +457,7 @@ func (p *ProjectTask) enter(db, coll string, q map[string]interface{}) {
 		p.Brun = false
 	}()
 	p.Brun = true
-	count, taskcount := 0, 0
+	count := 0
 	countRepeat := 0
 
 	pool := make(chan bool, p.thread)
@@ -472,7 +472,6 @@ func (p *ProjectTask) enter(db, coll string, q map[string]interface{}) {
 			select {
 			case tmp := <-infoPool:
 				pool <- true
-				taskcount++
 				go func(tmp map[string]interface{}) {
 					defer func() {
 						<-pool
@@ -481,7 +480,6 @@ func (p *ProjectTask) enter(db, coll string, q map[string]interface{}) {
 						if P_QL.currentType == "project" && util.IntAll(tmp["dataging"]) == 1 {
 							//增量	dataging为1不参与合并
 							util.Debug("增量   dataging == 1 ", tmp["_id"])
-							countRepeat++
 							return
 						}
 
@@ -492,7 +490,9 @@ func (p *ProjectTask) enter(db, coll string, q map[string]interface{}) {
 						p.CommonMerge(tmp, info)
 					} else {
 						//信息错误,进行更新
+						p.mapBidLock.Lock()
 						countRepeat++
+						p.mapBidLock.Unlock()
 					}
 				}(tmp)
 			case <-over:
@@ -504,12 +504,15 @@ func (p *ProjectTask) enter(db, coll string, q map[string]interface{}) {
 	//	"projectcode": 1, "buyerclass": 1, "winner": 1, "buyer": 1, "buyerperson": 1, "buyertel": 1, "infoformat": 1, "toptype": 1, "subtype": 1, "spidercode": 1, "projectscope": 1, "contractcode": 1,
 	//	"site": 1, "topscopeclass": 1, "subscopeclass": 1, "bidamount": 1, "budget": 1, "agency": 1, "package": 1, "jsondata": 1, "review_experts": 1, "purchasing": 1, "winnerorder": 1}
 	fields := map[string]interface{}{"kvtext": 0, "repeat_reason": 0}
+	if p.currentType == "project" {
+		c, _ := sess.DB(db).C(coll).Find(q).Count()
+		util.Debug("共查询:", c, "条")
+	}
 	ms := sess.DB(db).C(coll).Find(q).Select(fields).Sort("publishtime")
 	if Sysconfig["hints"] != nil {
 		ms.Hint(Sysconfig["hints"])
 	}
 	query := ms.Iter()
-	//query := sess.DB(db).C(coll).Find(q).Sort("publishtime").Iter()
 	var lastid interface{}
 L:
 	for {
@@ -539,7 +542,7 @@ L:
 	for n := 0; n < p.thread; n++ {
 		pool <- true
 	}
-	log.Println("所有线程执行完成...", count, taskcount, countRepeat)
+	log.Println("所有线程执行完成...", count, countRepeat)
 
 }
 

+ 31 - 3
fullproject/src_v1/update.go

@@ -88,6 +88,13 @@ func (p *ProjectTask) mergeAndModify(pInfoId string, index, position int, tmp ma
 			for _, v := range proList{
 				v1 := v.(map[string]interface{})
 				temp := MongoTool.FindById(ExtractColl, qu.ObjToString(v1["infoid"]))
+				if len(temp) == 0 {
+					temp = MongoTool.FindById(ExtractColl1, qu.ObjToString(v1["infoid"]))
+					if len(temp) == 0 {
+						qu.Debug("extract not find id...", v1["infoid"])
+						continue
+					}
+				}
 				tempInfo := ParseInfo(temp)
 				if flag {
 					merge := p.ReMerge(tempInfo, temp, tmpPro)
@@ -197,9 +204,9 @@ func (p *ProjectTask) delJudge(infoid, pid string) {
 		backupPro(tmpPro)
 		c := MongoTool.Delete(ProjectColl, pid)
 		if c > 0 {
-			//client := Es.GetEsConn()
-			//defer Es.DestoryEsConn(client)
-			//Es.DelById(Itype, Index, pid)
+			client := Es.GetEsConn()
+			defer Es.DestoryEsConn(client)
+			Es.DelById(Itype, Index, pid)
 		}
 		return
 	}
@@ -225,6 +232,13 @@ func (p *ProjectTask) delJudge(infoid, pid string) {
 		for _, v := range proList{
 			v1 := v.(map[string]interface{})
 			temp := MongoTool.FindById(ExtractColl, qu.ObjToString(v1["infoid"]))
+			if len(temp) == 0 {
+				temp = MongoTool.FindById(ExtractColl1, qu.ObjToString(v1["infoid"]))
+				if len(temp) == 0 {
+					qu.Debug("extract not find id...", v1["infoid"])
+					continue
+				}
+			}
 			tempInfo := ParseInfo(temp)
 			if flag {
 				merge := p.ReMerge(tempInfo, temp, tmpPro)
@@ -447,6 +461,13 @@ func (p *ProjectTask) innerMerge(infoList []interface{}, tmpPro map[string]inter
 	for k, m := range infoList{
 		m1 := m.(map[string]interface{})
 		temp := MongoTool.FindById(ExtractColl, qu.ObjToString(m1["infoid"]))
+		if len(temp) == 0 {
+			temp = MongoTool.FindById(ExtractColl1, qu.ObjToString(m1["infoid"]))
+			if len(temp) == 0 {
+				qu.Debug("extract not find id...", m1["infoid"])
+				continue
+			}
+		}
 		tempInfo := ParseInfo(temp)
 		if k == 0 {
 			p1 = p.newPro(temp, newP, tempInfo)
@@ -467,6 +488,13 @@ func (p *ProjectTask) innerMerge1(infoList []interface{}, infoid string, tmpPro
 			continue
 		}
 		temp := MongoTool.FindById(ExtractColl, qu.ObjToString(m1["infoid"]))
+		if len(temp) == 0 {
+			temp = MongoTool.FindById(ExtractColl1, qu.ObjToString(m1["infoid"]))
+			if len(temp) == 0 {
+				qu.Debug("extract not find id...", m1["infoid"])
+				continue
+			}
+		}
 		tempInfo := ParseInfo(temp)
 		if k == 0 {
 			p1 = p.newPro(temp, newP, tempInfo)

+ 3 - 2
qyxy/src/main.go

@@ -70,8 +70,9 @@ func init() {
 }
 
 func main() {
-	//go TimeTask()
-	QyxyStandard()
+	go TimeTask()
+	//QyxyStandard()
+	//HistoryQyxyStandard()
 	ch := make(chan bool, 1)
 	<-ch
 }

+ 136 - 40
qyxy/src/task.go

@@ -97,6 +97,9 @@ func QyxyStandard() bool {
 	wg := &sync.WaitGroup{}
 	lock := &sync.Mutex{} //控制读写
 	arr := [][]map[string]interface{}{}
+	//q := map[string]interface{}{
+	//	"company_name" : "北京教培师训网络科技股份有限公司",
+	//}
 	count, _ := sess.DB(Dbname).C(Dbcoll).Find(nil).Count()
 	log.Println("共查询:", count, "条")
 	if count == 0 {
@@ -210,16 +213,6 @@ func QyxyStandard() bool {
 							esMap[field] = "其他"
 						}
 					}
-				} else if field == "history_name" {
-					var nameArr []string
-					for _, v := range strings.Split(qu.ObjToString(tmp[field]), ";") {
-						if v != "" {
-							nameArr = append(nameArr, v)
-						}
-					}
-					if len(nameArr) > 0 {
-						esMap[field] = nameArr
-					}
 				} else if strings.Contains(field, "date") || strings.Contains(field, "time") { //时间处理
 					if tmp[field] != nil {
 						if timeTmp, ok := tmp[field].(primitive.DateTime); ok {
@@ -384,35 +377,44 @@ func QyxyStandard() bool {
 					continue
 				}
 				mgoMap[k] = v
-
 			}
 			//es数据过滤
 			EsSaveFlag := true
-			company_name := qu.ObjToString(esMap["company_name"])
-			if len([]rune(company_name)) < 8 {
-				EsSaveFlag = false
-			}
-			if EsSaveFlag {
-				company_type := qu.ObjToString(esMap["company_type"])
-				if company_type == "" || company_type == "个体工商户" {
+			company_type := qu.ObjToString(esMap["company_type"])
+			if company_type == "个体工商户" {
+				esMap["company_type_int"] = 1
+				company_name := qu.ObjToString(esMap["company_name"])
+				if len([]rune(company_name)) < 5 {
 					EsSaveFlag = false
 				}
-			}
-			if EsSaveFlag {
+			}else if company_type == "" {
+				EsSaveFlag = false
+			}else {
+				esMap["company_type_int"] = 0
 				credit_no := strings.TrimSpace(qu.ObjToString(esMap["credit_no"]))
 				company_code := strings.TrimSpace(qu.ObjToString(esMap["company_code"]))
 				if credit_no == "" && company_code == "" {
 					EsSaveFlag = false
 				}
 			}
-			// qu.Debug("mgoMap---", mgoMap)
-			// return
 			lock.Lock()
 			if EsSaveFlag {
+				if esMap["history_name"] != nil {
+						var nameArr []string
+						for _, v := range strings.Split(qu.ObjToString(esMap["history_name"]), ";") {
+							if v != "" {
+								nameArr = append(nameArr, v)
+							}
+						}
+						if len(nameArr) > 0 {
+							esMap["history_name"] = nameArr
+						}
+				}
 				EsSaveCache <- esMap //过滤后数据保存
 			}
 			EsSaveAllCache <- esMap //所有数据保存
 			update = append(update, map[string]interface{}{"$set": mgoMap})
+			SaveHistoryName(tmp)		//保存曾用名
 			if len(update) == 2 {
 				arr = append(arr, update)
 			}
@@ -436,7 +438,7 @@ func QyxyStandard() bool {
 }
 
 //所有企业数据标准化
-func HistoryQyxyStandard() bool {
+func HistoryQyxyStandard() {
 	qu.Debug("--------History--------")
 	defer qu.Catch()
 	sess := Mgo.GetMgoConn()
@@ -445,16 +447,13 @@ func HistoryQyxyStandard() bool {
 	pool := make(chan bool, 20) //控制线程数
 	wg := &sync.WaitGroup{}
 	lock := &sync.Mutex{} //控制读写
-	//	arr := [][]map[string]interface{}{}
-	// count, _ := sess.DB(Dbname).C(Dbcoll).Find(nil).Count()
-	// log.Println("共查询:", count, "条")
-	// if count == 0 {
-	// 	return false
-	// }
+	arr := [][]map[string]interface{}{}
+	//count, _ := sess.DB(Dbname).C(Dbcoll).Find(nil).Count()
+	//log.Println("共查询:", count, "条")
 	it := sess.DB(Dbname).C(Dbcoll).Find(nil).Iter()
 	sum := 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); sum++ {
-		if sum%10000 == 0 {
+		if sum%100 == 0 {
 			log.Println("current:", sum)
 		}
 		pool <- true
@@ -657,8 +656,8 @@ func HistoryQyxyStandard() bool {
 			tmpArrMgo := []map[string]interface{}{}
 			if annual_reports, ok := tmp["annual_reports"].([]interface{}); ok && len(annual_reports) > 0 {
 				for _, annual_report := range annual_reports {
-					tmpMapMgo := map[string]interface{}{}
-					tmpMap := map[string]interface{}{}
+					tmpMapMgo := map[string]interface{}{} //记录每个年报信息标准化到mgo的数据
+					tmpMap := map[string]interface{}{}    //只记录每个年报信息的company_email和company_phone
 					report_year := ""
 					m := annual_report.(map[string]interface{})
 					for i, tmpArr := range AnnualReportsArr {
@@ -717,15 +716,76 @@ func HistoryQyxyStandard() bool {
 					esMap[k] = v
 				}
 			}
+			//合并
+			for k, v := range esMap {
+				if k == "partners" {
+					continue
+				}
+				mgoMap[k] = v
+			}
+			//es数据过滤
+			EsSaveFlag := true
+			company_type := qu.ObjToString(esMap["company_type"])
+			if company_type == "个体工商户" {
+				esMap["company_type_int"] = 1
+				company_name := qu.ObjToString(esMap["company_name"])
+				if len([]rune(company_name)) < 5 {
+					EsSaveFlag = false
+				}
+			}else if company_type == "" {
+				EsSaveFlag = false
+			}else {
+				esMap["company_type_int"] = 0
+				credit_no := strings.TrimSpace(qu.ObjToString(esMap["credit_no"]))
+				company_code := strings.TrimSpace(qu.ObjToString(esMap["company_code"]))
+				if credit_no == "" && company_code == "" {
+					EsSaveFlag = false
+				}
+			}
+			if EsSaveFlag {
+				credit_no := strings.TrimSpace(qu.ObjToString(esMap["credit_no"]))
+				company_code := strings.TrimSpace(qu.ObjToString(esMap["company_code"]))
+				if credit_no == "" && company_code == "" {
+					EsSaveFlag = false
+				}
+			}
 			lock.Lock()
-			EsSaveCache <- esMap
+			if EsSaveFlag {
+				if esMap["history_name"] != nil {
+					var nameArr []string
+					for _, v := range strings.Split(qu.ObjToString(esMap["history_name"]), ";") {
+						if v != "" {
+							nameArr = append(nameArr, v)
+						}
+					}
+					if len(nameArr) > 0 {
+						esMap["history_name"] = nameArr
+					}
+				}
+				EsSaveCache <- esMap //过滤后数据保存
+			}
+			//EsSaveAllCache <- esMap //所有数据保存
+			//SaveHistoryName(tmp)
+			//update = append(update, map[string]interface{}{"$set": mgoMap})
+			if len(update) == 2 {
+				arr = append(arr, update)
+			}
+			if len(arr) > 500 {
+				tmps := arr
+				Mgo.UpSertBulk(Savecoll, tmps...)
+				arr = [][]map[string]interface{}{}
+			}
 			lock.Unlock()
 		}(tmp)
 		tmp = make(map[string]interface{})
 	}
 	wg.Wait()
+	lock.Lock()
+	if len(arr) > 0 {
+		Mgo.UpSertBulk(Savecoll, arr...)
+	}
+	lock.Unlock()
 	log.Println("Run Over...Count:", sum)
-	return true
 }
 
 //过滤后数据存库
@@ -765,6 +825,34 @@ func SaveEs() {
 	}
 }
 
+func SaveHistoryName(tmp map[string]interface{}) {
+	if qu.ObjToString(tmp["company_name"]) != "" {
+		set := make(map[string]interface{})
+		set["company_name"] = qu.ObjToString(tmp["company_name"])
+		set["credit_no"] = tmp["credit_no"]
+		set["org_code"] = tmp["org_code"]
+		set["company_id"] = tmp["company_id"]
+		set["company_type"] = tmp["company_type"]
+		set["company_status"] = tmp["company_status"]
+		set["company_code"] = tmp["company_code"]
+		Mgo.Update("qyxy_historyname", map[string]interface{}{"company_name": qu.ObjToString(tmp["company_name"])}, map[string]interface{}{"$set": set}, true, false)
+		if qu.ObjToString(tmp["history_name"]) != "" {
+			for _, v := range strings.Split(qu.ObjToString(tmp["history_name"]), ";") {
+				if v != "" {
+					set["company_name"] = v
+					set["credit_no"] = tmp["credit_no"]
+					set["org_code"] = tmp["org_code"]
+					set["company_id"] = tmp["company_id"]
+					set["company_type"] = tmp["company_type"]
+					set["company_status"] = tmp["company_status"]
+					set["company_code"] = tmp["company_code"]
+					Mgo.Update("qyxy_historyname", map[string]interface{}{"company_name": v}, map[string]interface{}{"$set": set}, true, false)
+				}
+			}
+		}
+	}
+}
+
 //所有数据存库
 func SaveAllEs() {
 	log.Println("Es SaveAll...")
@@ -806,13 +894,20 @@ func InitAddress() {
 	log.Println("Init Address...")
 	AddressMap = map[string]*City{}
 	AddressOldMap = map[string]*City{}
-	address, _ := Mgo.Find("address", nil, nil, nil, false, -1, -1)
-	for _, tmp := range *address {
+
+	sess := Mgo.GetMgoConn()
+	defer Mgo.DestoryMongoConn(sess)
+	result := sess.DB(Dbname).C("address_new_2020").Find(nil).Iter()
+	count := 0
+	for tmp := make(map[string]interface{}); result.Next(&tmp); count++ {
 		code := qu.ObjToString(tmp["code"])
-		// codeLen := len(code)
-		// if t_code := CodeMap[codeLen]; t_code != "" { //新的address表补齐code
-		// 	code = code + t_code
-		// }
+		codeLen := len(code)
+		if codeLen > 6 {
+			continue
+		}
+		if t_code := CodeMap[codeLen]; t_code != "" { //新的address表补齐code
+			code = code + t_code
+		}
 		remark := fmt.Sprint(tmp["Remarks"])
 		city := &City{}
 		tmpjson, err := json.Marshal(tmp)
@@ -825,6 +920,7 @@ func InitAddress() {
 			AddressMap[code] = city
 		}
 	}
+	qu.Debug("Init Address end...", len(AddressMap), len(AddressOldMap))
 }
 
 func InitQyStype() {

+ 18 - 19
standardata/src/standaragency.go

@@ -100,7 +100,7 @@ func agencyStandarData(db string, query map[string]interface{}) {
 				data := winMegerIndustry(entid, v)
 				MongoTo.UpdateById(agencyent, entid,
 					map[string]interface{}{
-						"$set":  data,
+						"$set": data,
 						//"$push": map[string]interface{}{"contact": v},
 					},
 				)
@@ -170,28 +170,27 @@ func historyagency(db, fromcoll string) {
 								bs, _ := json.Marshal(ps)
 								redis.PutRedis("agency", agencybd, agency, bs, -1)
 							}
-						} else {
-							log.Println("jsonErr", err)
 						}
 					}
-				} else {
-					val := []map[string]interface{}{}
-					if agencytel != "" {
-						tmp := map[string]interface{}{
-							"contact_person": agencyperson,
-							"phone":          agencytel,
-							"topscopeclass":  comRepTopscopeclass(topscopeclass),
-							"infoid":         _id,
-						}
-						val = append(val, tmp)
+					return
+				}
+				val := []map[string]interface{}{}
+				if agencytel != "" {
+					tmp := map[string]interface{}{
+						"contact_person": agencyperson,
+						"phone":          agencytel,
+						"topscopeclass":  comRepTopscopeclass(topscopeclass),
+						"infoid":         _id,
 					}
-					bs, _ := json.Marshal(val)
-					redis.PutRedis("agency", agencybd, agency, bs, -1)
-					MongoTo.Save(agencyerr, map[string]interface{}{
-						"name":       agency,
-						"updatetime": time.Now().Unix(),
-					})
+					val = append(val, tmp)
 				}
+				bs, _ := json.Marshal(val)
+				redis.PutRedis("agency", agencybd, agency, bs, -1)
+				MongoTo.Save(agencyerr, map[string]interface{}{
+					"name":       agency,
+					"updatetime": time.Now().Unix(),
+				})
+
 			}
 		}(tmp)
 		tmp = map[string]interface{}{}

+ 38 - 34
standardata/src/standarbuyer.go

@@ -103,7 +103,7 @@ func buyerStandarData(db string, query map[string]interface{}) {
 				data := buyerMegerBuyerclass(entid, v)
 				MongoTo.UpdateById(buyerent, entid,
 					map[string]interface{}{
-						"$set":  data,
+						"$set": data,
 						//"$push": map[string]interface{}{"contact": v},
 					},
 				)
@@ -136,7 +136,16 @@ func historybuyer(db, fromcoll string) {
 				<-buyerchanbool
 			}()
 			buyer := qu.ObjToString(tmp["buyer"])
-			buyerclass := qu.ObjToString(tmp["buyerclass"])
+			buyerclass :=""
+			if tb ,ok := tmp["buyerclass"].(primitive.A);ok{
+				tbn := len(tb)
+				if tbn>0{
+					buyerclass = qu.ObjToString(tb[tbn-1])
+				}
+			}else if tbs ,ok :=tmp["buyerclass"].(string);ok{
+				buyerclass = tbs
+
+			}
 			topscopeclass, _ := tmp["topscopeclass"].(primitive.A)
 			if buyer != "" && utf8.RuneCountInString(buyer) > 4 {
 				buyerperson := qu.ObjToString(tmp["buyerperson"])
@@ -158,30 +167,29 @@ func historybuyer(db, fromcoll string) {
 							ps = append(ps, v)
 							bs, _ := json.Marshal(ps)
 							redis.PutRedis("buyer", buyerbd, buyer, bs, -1)
-						} else {
-							log.Println("jsonErr", err)
 						}
 					}
-				} else {
-					val := []map[string]interface{}{}
-					if buyerperson != "" || buyertel != "" {
-						tmp := map[string]interface{}{
-							"contact_person": buyerperson,
-							"phone":          buyertel,
-							"buyerclass":     buyerclass,
-							"topscopeclass":  comRepTopscopeclass(topscopeclass),
-							"infoid":         _id,
-						}
-						val = append(val, tmp)
+					return
+				}
+				val := []map[string]interface{}{}
+				if buyerperson != "" || buyertel != "" {
+					tmp := map[string]interface{}{
+						"contact_person": buyerperson,
+						"phone":          buyertel,
+						"buyerclass":     buyerclass,
+						"topscopeclass":  comRepTopscopeclass(topscopeclass),
+						"infoid":         _id,
 					}
-					bs, _ := json.Marshal(val)
-					redis.PutRedis("buyer", buyerbd, buyer, bs, -1)
-					MongoTo.Save(buyererr, map[string]interface{}{
-						"name":       buyer,
-						"buyerclass": buyerclass,
-						"updatetime": time.Now().Unix(),
-					})
+					val = append(val, tmp)
 				}
+				bs, _ := json.Marshal(val)
+				redis.PutRedis("buyer", buyerbd, buyer, bs, -1)
+				MongoTo.Save(buyererr, map[string]interface{}{
+					"name":       buyer,
+					"buyerclass": buyerclass,
+					"updatetime": time.Now().Unix(),
+				})
+
 			}
 		}(tmp)
 		tmp = map[string]interface{}{}
@@ -246,24 +254,20 @@ func buyerMegerBuyerclass(id string, ps map[string]interface{}) map[string]inter
 		return nil
 	}
 	data := map[string]interface{}{}
-	buyerclass := tmp["buyerclass"].(primitive.A)
-	tmpbuyerclass := map[string]bool{}
-	for _, v := range buyerclass {
-		tt := qu.ObjToString(v)
-		tmpbuyerclass[tt] = true
-	}
-	tmpbuyerclass[qu.ObjToString(ps["buyerclass"])] = true
-	newbuyerclass := []interface{}{}
-	for k, _ := range tmpbuyerclass {
-		newbuyerclass = append(newbuyerclass, k)
+	if buyerclass, ok := tmp["buyerclass"].(primitive.A); ok {
+		bn := len(buyerclass)
+		if bn > 0 {
+			data["buyerclass"] = qu.ObjToString(buyerclass[bn-1])
+		}
+	} else if sb, ok := tmp["buyerclass"].(string); ok {
+		data["buyerclass"] = sb
 	}
-	data["buyerclass"] = newbuyerclass
 	data["updatetime"] = time.Now().Unix()
 	//contact
 	contact := tmp["contact"].(primitive.A)
 	contact = append(contact, ps)
 	//bid_contact
-	bid_contacts,contacts := bid_contact(contact)
+	bid_contacts, contacts := bid_contact(contact)
 	if len(bid_contacts) > 0 {
 		data["bid_contact"] = bid_contacts
 	}

+ 31 - 36
standardata/src/standarwinner.go

@@ -50,7 +50,7 @@ func winnerStandarData(db string, query map[string]interface{}) {
 					province = qu.ObjToString(data["province"])
 					if province == "" { //省份为空,buyer优先提取区域信息再company_address
 						province, city, district = GetProvinceCityDistrict([]string{winner}) //先buyer
-						if province == "" {                                                 //再address
+						if province == "" {                                                  //再address
 							if address := qu.ObjToString(data["company_address"]); address != "" {
 								province, city, district = GetProvinceCityDistrict([]string{address})
 							}
@@ -82,9 +82,9 @@ func winnerStandarData(db string, query map[string]interface{}) {
 						"topscopeclass": comRepTopscopeclass(topscopeclass),
 						"check":         comMarkdata(winner, "winner"),
 						"updatetime":    time.Now().Unix(),
-						"province":   province,
-						"city":       city,
-						"district":   district,
+						"province":      province,
+						"city":          city,
+						"district":      district,
 					})
 				}
 			}
@@ -99,7 +99,7 @@ func winnerStandarData(db string, query map[string]interface{}) {
 				data := winMegerIndustry(entid, v)
 				MongoTo.UpdateById(winnerent, entid,
 					map[string]interface{}{
-						"$set":  data,
+						"$set": data,
 						//"$push": map[string]interface{}{"contact": v},
 					},
 				)
@@ -141,7 +141,8 @@ func historywinner(db, fromcoll string) {
 	log.Println("history  start")
 	sess := MongoFrom.GetMgoConn()
 	defer MongoFrom.Close()
-	it := sess.DB(db).C(fromcoll).Find(map[string]interface{}{}).Select(bson.M{"repeat": 1, "winner": 1, "winnertel": 1, "winnerperson": 1, "topscopeclass": 1}).Sort("_id").Iter()
+	it := sess.DB(db).C(fromcoll).Find(map[string]interface{}{}).Select(bson.M{
+		"repeat": 1, "winner": 1, "winnertel": 1, "winnerperson": 1, "topscopeclass": 1}).Sort("_id").Iter()
 	index := 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); index++ {
 		if qu.IntAll(tmp["repeat"]) > 0 { //重复数据跳过
@@ -175,29 +176,28 @@ func historywinner(db, fromcoll string) {
 							bs, _ := json.Marshal(ps)
 							redis.PutRedis("winner", winnerbd, winner, bs, -1)
 							//log.Println(_id, index, winner)
-						} else {
-							log.Println("jsonErr", err)
 						}
 					}
-				} else {
-					val := []map[string]interface{}{}
-					if winnerperson != "" || winnertel != "" {
-						tmp := map[string]interface{}{
-							"contact_person": winnerperson,
-							"phone":          winnertel,
-							"topscopeclass":  comRepTopscopeclass(topscopeclass),
-							"infoid":         _id,
-						}
-						val = append(val, tmp)
+					return
+				}
+				val := []map[string]interface{}{}
+				if winnerperson != "" || winnertel != "" {
+					tmp := map[string]interface{}{
+						"contact_person": winnerperson,
+						"phone":          winnertel,
+						"topscopeclass":  comRepTopscopeclass(topscopeclass),
+						"infoid":         _id,
 					}
-					bs, _ := json.Marshal(val)
-					redis.PutRedis("winner", winnerbd, winner, bs, -1)
-					MongoTo.Save(winnererr, map[string]interface{}{
-						"name":          winner,
-						"topscopeclass": comRepTopscopeclass(topscopeclass),
-						"updatetime":    time.Now().Unix(),
-					})
+					val = append(val, tmp)
 				}
+				bs, _ := json.Marshal(val)
+				redis.PutRedis("winner", winnerbd, winner, bs, -1)
+				MongoTo.Save(winnererr, map[string]interface{}{
+					"name":          winner,
+					"topscopeclass": comRepTopscopeclass(topscopeclass),
+					"updatetime":    time.Now().Unix(),
+				})
+
 			}
 		}(tmp)
 		tmp = map[string]interface{}{}
@@ -262,8 +262,8 @@ func winMegerIndustry(id string, ps map[string]interface{}) map[string]interface
 		return nil
 	}
 	data := map[string]interface{}{}
-	industry,ok := tmp["industry"].(primitive.A)
-	if ok{
+	industry, ok := tmp["industry"].(primitive.A)
+	if ok {
 		tmpindustry := map[string]bool{}
 		for _, v := range industry {
 			tt := qu.ObjToString(v)
@@ -286,7 +286,7 @@ func winMegerIndustry(id string, ps map[string]interface{}) map[string]interface
 	contact := tmp["contact"].(primitive.A)
 	contact = append(contact, ps)
 	//bid_contact
-	bid_contacts,contacts := bid_contact(contact)
+	bid_contacts, contacts := bid_contact(contact)
 	if len(bid_contacts) > 0 {
 		data["bid_contact"] = bid_contacts
 	}
@@ -437,15 +437,10 @@ func comHisMegerNewData(name, datatype string, ps []map[string]interface{}) map[
 		data["industry"] = industry
 	} else if datatype == "buyer" {
 		data["buyer_name"] = name
-		tmpbuyerclass := map[string]bool{}
-		for _, p := range ps {
-			tmpbuyerclass[qu.ObjToString(p["buyerclass"])] = true
-		}
-		buyerclass := []interface{}{}
-		for k, _ := range tmpbuyerclass {
-			buyerclass = append(buyerclass, k)
+		lennum := len(ps)
+		if lennum > 1 {
+			data["buyerclass"] = qu.ObjToString(ps[lennum-1]["buyerclass"])
 		}
-		data["buyerclass"] = buyerclass
 		data["ranks"] = ""
 		data["type"] = ""
 		data["address"] = ""

+ 16 - 75
udpcreateindex/src/biddingall.go

@@ -1,6 +1,7 @@
 package main
 
 import (
+	"regexp"
 	"time"
 	//"fmt"
 	"log"
@@ -20,6 +21,9 @@ import (
 	1、biddingall任务跑历史数据生成索引并更新bidding表
 	2、调用biddingall任务时config.json中indexfields配置要有purchasing、purchasinglist、filetext
 */
+
+var RegSpace = regexp.MustCompile("[\\s\u3000\u2003\u00a0]+")
+
 func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 	defer qutil.Catch()
 	thread := 40
@@ -86,6 +90,13 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 		// 	tmp = make(map[string]interface{})
 		// 	continue
 		// }
+		//if qutil.IntAll(tmp["repeat"]) != 0 {
+		//	esQ := `{"query": {"bool": {"must": [{"term": {"id": "`+ mongodb.BsonIdToSId(tmp["_id"]) +`"}}]}}}`
+		//	esData := elastic.Get(index, itype, esQ)
+		//	if len(*esData) > 0 {
+		//		elastic.DelById(index, itype, mongodb.BsonIdToSId(tmp["_id"]))
+		//	}
+		//}
 
 		// if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive != "" { //bidding中有敏感词,不生索引
 		// 	tmp = make(map[string]interface{})
@@ -227,7 +238,7 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 				var cid []string
 				for _, w := range sWinnerarr {
 					if w != "" {
-						ent, _ := mgostandard.FindOne("", map[string]interface{}{"compnay_name": w})
+						ent, _ := mgostandard.FindOne("qyxy_historyname", map[string]interface{}{"company_name": w})
 						if len(*ent) > 0 {
 							cid = append(cid, qutil.ObjToString((*ent)["company_id"]))
 						}
@@ -235,6 +246,7 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 				}
 				if len(cid) > 0 {
 					tmp["entidlist"] = cid
+					update["entidlist"] = cid
 					tmp_up := []map[string]interface{}{}
 					tmp_up = append(tmp_up, map[string]interface{}{"_id": tmp["_id"]})
 					tmp_up = append(tmp_up, map[string]interface{}{"$set": map[string]interface{}{"entidlist": cid}})
@@ -355,12 +367,10 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 							}
 						} else if field == "detail" { //过滤
 							detail, _ := tmp[field].(string)
-							if isUtf8([]byte(detail)) || isGBK([]byte(detail)) {
-								if len([]rune(detail)) > detailLength {
-									detail = detail[:detailLength]
-								}
-								newTmp[field] = FilterDetail(detail)
+							if len([]rune(detail)) > detailLength {
+								detail = detail[:detailLength]
 							}
+							newTmp[field] = FilterDetail(detail)
 						} else if field == "_id" || field == "topscopeclass" { //不做处理
 							newTmp[field] = tmp[field]
 						} else if field == "publishtime" || field == "comeintime" {
@@ -480,75 +490,6 @@ func biddingAllTask(data []byte, mapInfo map[string]interface{}) {
 	UpdatesLock.Unlock()
 	log.Println(mapInfo, "create bidding index...over", n)
 }
-func preNUm(data byte) int {
-	var mask byte = 0x80
-	var num int = 0
-	//8bit中首个0bit前有多少个1bits
-	for i := 0; i < 8; i++ {
-		if (data & mask) == mask {
-			num++
-			mask = mask >> 1
-		} else {
-			break
-		}
-	}
-	return num
-}
-
-func isGBK(data []byte) bool {
-	length := len(data)
-	var i int = 0
-	for i < length {
-		if data[i] <= 0x7f {
-			//编码0~127,只有一个字节的编码,兼容ASCII码
-			i++
-			continue
-		} else {
-			//大于127的使用双字节编码,落在gbk编码范围内的字符
-			if data[i] >= 0x81 &&
-				data[i] <= 0xfe &&
-				data[i+1] >= 0x40 &&
-				data[i+1] <= 0xfe &&
-				data[i+1] != 0xf7 {
-				i += 2
-				continue
-			} else {
-				return false
-			}
-		}
-	}
-	return true
-}
-
-func isUtf8(data []byte) bool {
-	i := 0
-	for i < len(data) {
-		if (data[i] & 0x80) == 0x00 {
-			// 0XXX_XXXX
-			i++
-			continue
-		} else if num := preNUm(data[i]); num > 2 {
-			// 110X_XXXX 10XX_XXXX
-			// 1110_XXXX 10XX_XXXX 10XX_XXXX
-			// 1111_0XXX 10XX_XXXX 10XX_XXXX 10XX_XXXX
-			// 1111_10XX 10XX_XXXX 10XX_XXXX 10XX_XXXX 10XX_XXXX
-			// 1111_110X 10XX_XXXX 10XX_XXXX 10XX_XXXX 10XX_XXXX 10XX_XXXX
-			// preNUm() 返回首个字节的8个bits中首个0bit前面1bit的个数,该数量也是该字符所使用的字节数
-			i++
-			for j := 0; j < num-1; j++ {
-				//判断后面的 num - 1 个字节是不是都是10开头
-				if (data[i] & 0xc0) != 0x80 {
-					return false
-				}
-				i++
-			}
-		} else {
-			//其他情况说明不是utf-8
-			return false
-		}
-	}
-	return true
-}
 
 //更新extract表
 func UpdateExtract() {

+ 20 - 1
udpcreateindex/src/biddingindex.go

@@ -257,6 +257,26 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
 		for tk, tv := range update {
 			tmp[tk] = tv
 		}
+		if tmp["s_winner"] != "" {
+			sWinnerarr := strings.Split(qutil.ObjToString(tmp["s_winner"]), ",")
+			var cid []string
+			for _, w := range sWinnerarr {
+				if w != "" {
+					ent, _ := mgostandard.FindOne("qyxy_historyname", map[string]interface{}{"company_name": w})
+					if len(*ent) > 0 {
+						cid = append(cid, qutil.ObjToString((*ent)["company_id"]))
+					}
+				}
+			}
+			if len(cid) > 0 {
+				tmp["entidlist"] = cid
+				update["entidlist"] = cid
+				tmp_up := []map[string]interface{}{}
+				tmp_up = append(tmp_up, map[string]interface{}{"_id": tmp["_id"]})
+				tmp_up = append(tmp_up, map[string]interface{}{"$set": map[string]interface{}{"entidlist": cid}})
+				UpdataMgoCache <- tmp_up
+			}
+		}
 		//对projectscope字段的索引处理
 		ps, _ := tmp["projectscope"].(string)
 		if len(ps) > ESLEN {
@@ -365,7 +385,6 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
 						}
 					} else if field == "detail" { //过滤
 						detail, _ := tmp[field].(string)
-
 						if len([]rune(detail)) > detailLength {
 							detail = detail[:detailLength]
 						}

+ 5 - 5
udpcreateindex/src/config.json

@@ -38,14 +38,14 @@
     "collect": "bidding",
     "index": "bidding",
     "type": "bidding",
-    "extractdb": "mxs",
+    "extractdb": "wjh",
     "extractcollect": "extract",
     "indexfields": [
       "buyerzipcode", "winnertel", "winnerperson", "contractcode", "winneraddr", "agencyaddr", "buyeraddr", "signaturedate", "projectperiod", "projectaddr", "agencytel", "agencyperson",
       "buyerperson", "agency", "projectscope", "projectcode", "bidopentime", "supervisorrate", "buyertel", "bidamount", "winner", "buyer", "budget", "projectname", "bidstatus", "buyerclass",
       "topscopeclass", "s_topscopeclass", "s_subscopeclass", "area", "city", "district", "s_winner", "_id", "title", "detail", "site", "comeintime", "href", "infoformat", "publishtime",
       "s_sha", "spidercode", "subtype", "toptype", "projectinfo", "purchasing", "purchasinglist", "filetext", "channel", "winnerorder", "project_scale", "project_duration", "project_timeunit",
-      "project_startdate", "project_completedate", "payway", "contract_guarantee", "bid_guarantee", "qualifies"
+      "project_startdate", "project_completedate", "payway", "contract_guarantee", "bid_guarantee", "qualifies", "entidlist"
     ],
     "indexfieldsmap": {
       "buyerzipcode": "string", "winnertel": "string", "winnerperson": "string", "contractcode": "string", "winneraddr": "string", "agencyaddr": "string", "buyeraddr": "string", "signaturedate": "int64",
@@ -54,14 +54,14 @@
       "buyerclass": "string", "topscopeclass": "", "s_topscopeclass": "string", "s_subscopeclass": "string", "area": "string", "city": "string", "district": "string", "s_winner": "string", "_id": "", "title": "string",
       "detail": "string", "site": "string", "comeintime": "int64", "href": "string", "infoformat": "int", "publishtime": "int64", "s_sha": "string", "spidercode": "string", "subtype": "string", "toptype": "string",
       "projectinfo": "", "purchasing": "string", "purchasinglist": "", "filetext": "string", "channel": "string", "winnerorder": "", "project_scale": "string", "project_duration": "float64", "project_timeunit": "string",
-      "project_startdate": "int64", "project_completedate": "int64", "payway": "string", "contract_guarantee": "bool", "bid_guarantee": "bool", "qualifies": ""
+      "project_startdate": "int64", "project_completedate": "int64", "payway": "string", "contract_guarantee": "bool", "bid_guarantee": "bool", "qualifies": "", "entidlist": "[]string"
     },
-    "fields": "buyerzipcode,winnertel,winnerperson,contractcode,winneraddr,agencyaddr,buyeraddr,signaturedate,projectperiod,projectaddr,agencytel,agencyperson,buyerperson,agency,projectscope,projectcode,bidopentime,supervisorrate,buyertel,bidamount,winner,buyer,budget,projectname,buyerclass,topscopeclass,s_topscopeclass,area,city,district,s_winner,toptype,subtype,subscopeclass,s_subscopeclass,dataging,winnerorder",
+    "fields": "buyerzipcode,winnertel,winnerperson,contractcode,winneraddr,agencyaddr,buyeraddr,signaturedate,projectperiod,projectaddr,agencytel,agencyperson,buyerperson,agency,projectscope,projectcode,bidopentime,supervisorrate,buyertel,bidamount,winner,buyer,budget,projectname,buyerclass,topscopeclass,s_topscopeclass,area,city,district,s_winner,toptype,subtype,subscopeclass,s_subscopeclass,dataging,winnerorder,project_scale,project_duration,project_timeunit,project_startdate,project_completedate, payway,contract_guarantee,bid_guarantee,qualifies",
     "projectinfo": "approvecode,approvecontent,approvestatus,approvetime,approvedept,approvenumber,projecttype,approvecity",
     "projectinfomap": {
       "approvecode": "string", "approvecontent": "string", "approvestatus": "string", "approvetime": "string", "approvedept": "string", "approvenumber": "string", "projecttype": "string", "approvecity": "string"
     },
-    "purchasinglist": "itemname,brandname,model,unitname,number",
+    "purchasinglist": "itemname,brandname,model,unitname,number,unitprice,totalprice",
     "purchasinglistmap": {
       "itemname": "string", "brandname": "string", "model": "string", "unitname": "string", "number": "float64", "unitprice": "float64", "totalprice": "float64"
     },

+ 4 - 4
udpcreateindex/src/main.go

@@ -48,8 +48,8 @@ var SP = make(chan bool, 5)
 
 func init() {
 	util.ReadConfig(&Sysconfig)
-	//inits()
-	//go checkMapJob()
+	inits()
+	go checkMapJob()
 	detailLength = util.IntAllDef(Sysconfig["detaillength"], 50000)
 	fileLength = util.IntAllDef(Sysconfig["filelength"], 50000)
 	updport, _ = Sysconfig["updport"].(string)
@@ -67,7 +67,7 @@ func init() {
 		MongodbAddr: mconf["addr"].(string),
 		Size:        util.IntAllDef(mconf["pool"], 5),
 		DbName:      mconf["db"].(string),
-		//ReplSet:     "bidding",
+		ReplSet:     "bidding",
 	}
 	mgo.InitPool()
 	project2db = &mongodb.MongodbSim{
@@ -102,7 +102,7 @@ func init() {
 	}
 	mgostandard = &mongodb.MongodbSim{
 		MongodbAddr: standard["addr"].(string),
-		//ReplSet:     "bidding",
+		ReplSet:     "bidding",
 		Size:        util.IntAllDef(standard["pool"], 5),
 		DbName:      standard["db"].(string),
 	}

+ 1 - 1
udpcreateindex/src/util/ossclient.go

@@ -11,7 +11,7 @@ import (
 )
 
 var (
-	ossEndpoint        = "http://oss-cn-beijing-internal.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
+	ossEndpoint        = "oss-cn-beijing-internal.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
 	ossAccessKeyId     = "LTAI4G5x9aoZx8dDamQ7vfZi"
 	ossAccessKeySecret = "Bk98FsbPYXcJe72n1bG3Ssf73acuNh"
 	ossBucketName      = "topjy"

+ 3 - 3
udps/main.go

@@ -18,12 +18,12 @@ func main() {
 	ip, p, tmptime, tmpkey, id1, id2, stype, q, bkey, param, ids := "", 0, 0, "", "", "", "", "", "", "", ""
 	flag.StringVar(&startDate, "start", "", "开始日期2006-01-02")
 	flag.StringVar(&endDate, "end", "", "结束日期2006-01-02")
-	flag.StringVar(&ip, "ip", "192.168.3.205", "ip")
+	flag.StringVar(&ip, "ip", "127.0.0.1", "ip")
 	flag.IntVar(&p, "p", 1484, "端口")
 	flag.IntVar(&tmptime, "tmptime", 0, "时间查询")
 	flag.StringVar(&tmpkey, "tmpkey", "", "时间字段")
-	flag.StringVar(&id1, "gtid", "5a86328a40d2d9bbe88e4138", "gtid")
-	flag.StringVar(&id2, "lteid", "5a8f8cd340d2d9bbe8a21400", "lteid")
+	flag.StringVar(&id1, "gtid", "5e8fae3485a9271abf2b8330", "gtid")
+	flag.StringVar(&id2, "lteid", "5fe50860f0f9d716c17d1b99", "lteid")
 	flag.StringVar(&ids, "ids", "", "id1,id2")
 	flag.StringVar(&stype, "stype", "biddingall", "stype,传递类型")
 	flag.StringVar(&bkey, "bkey", "", "bkey,加上此参数表示不生关键词和摘要")