zhengkun 3 роки тому
батько
коміт
8f25ea3dfb

+ 18 - 21
process_ medical/src/main.go

@@ -63,13 +63,13 @@ func init()  {
 	//}
 	//save_mgo.InitPool()
 
-	//MysqlTool = &Mysql{
-	//	Address: "192.168.3.109:4000",
-	//	UserName: "jianyu",
-	//	PassWord: "top@123",
-	//	DBName: "jy_lycp",
-	//}
-	//MysqlTool.Init()
+	MysqlTool = &Mysql{
+		Address: "192.168.3.109:4000",
+		UserName: "jianyu",
+		PassWord: "top@123",
+		DBName: "jy_lycp",
+	}
+	MysqlTool.Init()
 
 	//MysqlTool = &Mysql{
 	//	Address: "127.0.0.1:3306",
@@ -81,14 +81,14 @@ func init()  {
 	//
 
 
-	//save_mgo = &MongodbSim{
-	//	MongodbAddr: "127.0.0.1:27017",
-	//	DbName:      "mixdata",
-	//	Size:        10,
-	//	UserName: "",
-	//	Password: "",
-	//}
-	//save_mgo.InitPool()
+	save_mgo = &MongodbSim{
+		MongodbAddr: "127.0.0.1:27017",
+		DbName:      "mixdata",
+		Size:        10,
+		UserName: "",
+		Password: "",
+	}
+	save_mgo.InitPool()
 
 
 
@@ -102,16 +102,16 @@ func init()  {
 
 func main()  {
 	//exportSource() //导出源数据
-	dealWithSource()  //处理源数据
-
+	//dealWithSource()  //处理源数据-bidding
 
 
+	hospitalSaveMysql() //处理医院数据
 
 
 }
 
 
-
+//处理源数据
 func dealWithSource() {
 	MysqlTool = &Mysql{
 		Address: "192.168.3.109:4000",
@@ -135,9 +135,6 @@ func dealWithSource() {
 	dealWithBiddingSource()
 }
 
-
-
-
 //导出源数据-程序
 func exportSource() {
 	save_mgo = &MongodbSim{

+ 2 - 2
process_ medical/src/medical_bidding.go

@@ -46,10 +46,10 @@ func saveBidMysqlData(tmp map[string]interface{}){
 	}
 	data["buyer_name"] = qu.ObjToString(tmp["buyer"])
 	data["buyer_depart"] = ""
-	if tmp["budget"]!=nil {
+	if tmp["budget"]!=nil && qu.Float64All(tmp["budget"]) < 100000000.0 {
 		data["budget"] = qu.Float64All(tmp["budget"])
 	}
-	if tmp["bidamount"]!=nil {
+	if tmp["bidamount"]!=nil && qu.Float64All(tmp["bidamount"]) < 100000000.0 {
 		data["bidamount"] = qu.Float64All(tmp["bidamount"])
 	}
 	data["agency_name"] = qu.ObjToString(tmp["agency"])

+ 11 - 0
process_ medical/src/medical_hospital.go

@@ -1,9 +1,20 @@
 package main
 
+import log "github.com/donnie4w/go-logger/logger"
 
 func hospitalSaveMysql() {
+	sess := save_mgo.GetMgoConn()
+	defer save_mgo.DestoryMongoConn(sess)
+	q,total:=map[string]interface{}{},0
+	it := sess.DB(save_mgo.DbName).C("zktest_mysql_hospital").Find(&q).Iter()
+	for tmp := make(map[string]interface{}); it.Next(&tmp);total++{
+		if total%10000==0 {
+			log.Debug("curent index ",total)
+		}
 
 
 
 
+		tmp = make(map[string]interface{})
+	}
 }

+ 1 - 1
process_ medical/src/medical_product.go

@@ -181,7 +181,7 @@ func buildInsertData(tmp map[string]interface{}) map[string]interface{}{
 	data["source_channel"] = qu.ObjToString(tmp["jy_class"])
 	class := qu.ObjToString(tmp["class"])
 	if class == "/" {
-		class = "'"
+		class = ""
 	}
 
 	product_name := qu.ObjToString(tmp["product_name"])