Browse Source

调整~医疗项目~适配线上环境

zhengkun 2 years ago
parent
commit
6702d4c56d

+ 24 - 26
fieldproject_medical/data_preparation/src/class/initdata.go

@@ -13,11 +13,12 @@ const (
 	V_Institution_Alias      = "institution_alias"
 	V_Institution_Departtags = "institution_departtags"
 	V_Institution_Typetags   = "institution_typetags"
-	V_Code_Level             = "code_level"
-	V_Code_Department        = "code_department"
-	V_Code_Productclass      = "code_productclass"
-	V_Code_Type              = "code_type "
-	V_Code_Sdleveltypeequip  = "code_sdleveltypeequip"
+
+	V_Code_Level            = "code_level"
+	V_Code_Department       = "code_department"
+	V_Code_Productclass     = "code_productclass"
+	V_Code_Type             = "code_type "
+	V_Code_Sdleveltypeequip = "code_sdleveltypeequip"
 
 	V_Code_Bidfield      = "code_bidfield"
 	V_Code_Bidscope      = "code_bidscope"
@@ -29,7 +30,6 @@ const (
 
 	S_Product_Coll = "zktest_mysql_product_info"
 	S_Company_Coll = "zktest_mysql_company_info"
-	S_Region_Coll  = "zktest_mysql_area_new"
 )
 
 var (
@@ -49,22 +49,22 @@ var (
 	AreaCode     = map[string]string{}
 	CityCode     = map[string]string{}
 	DistrictCode = map[string]string{}
-	isLocal      bool
+	IsLocal      bool
 	TimeLayout   = "2006-01-02 15:04:05"
 	TimeTmeplate = "2006-01-02"
 )
 
 func InitClass() {
-	isLocal = true //本地
+	//IsLocal = true //本地
 	initMgo()
-	initLocalData()
 	initMysql()
+	initLocalData() //医院相关使用
 	initVCode()
 }
 
 //初始化mgo
 func initMgo() {
-	if isLocal {
+	if IsLocal {
 		Save_Mgo = &MongodbSim{
 			MongodbAddr: "127.0.0.1:27017",
 			DbName:      "zhengkun",
@@ -74,15 +74,6 @@ func initMgo() {
 		}
 		Save_Mgo.InitPool()
 
-		//Save_Mgo = &MongodbSim{
-		//	MongodbAddr: "192.168.3.207:27092",
-		//	DbName:      "zhengkun",
-		//	Size:        10,
-		//	UserName:    "",
-		//	Password:    "",
-		//}
-		//Save_Mgo.InitPool()
-
 		Spi_Mgo = &MongodbSim{
 			MongodbAddr: "127.0.0.1:27017",
 			DbName:      "zhengkun",
@@ -113,18 +104,25 @@ func initMgo() {
 }
 
 func initMysql() {
+	username, password := "root", "=PDT49#80Z!RVv52_z"
+	address := "192.168.3.217:4000"
+	if !IsLocal {
+		username = "zhengkun"
+		password = "Zk#20220824"
+		address = "172.17.4.242:4000"
+	}
 	MysqlMedicalTool = &Mysql{
-		Address:  "192.168.3.217:4000",
-		UserName: "root",
-		PassWord: "=PDT49#80Z!RVv52_z",
-		DBName:   "medical_fileld_data",
+		Address:  address,
+		UserName: username,
+		PassWord: password,
+		DBName:   "medical_field_data",
 	}
 	MysqlMedicalTool.Init()
 
 	MysqlGlobalTool = &Mysql{
-		Address:  "192.168.3.217:4000",
-		UserName: "root",
-		PassWord: "=PDT49#80Z!RVv52_z",
+		Address:  address,
+		UserName: username,
+		PassWord: password,
 		DBName:   "global_common_data",
 	}
 	MysqlGlobalTool.Init()

+ 1 - 0
fieldproject_medical/data_preparation/src/company/company.go

@@ -14,6 +14,7 @@ var companylock sync.Mutex
 func RunCompanyProductInfo() {
 	log.Debug("处理~企业~产品信息~")
 	dealWithCompanyProductInfo()
+	time.Sleep(10 * time.Second)
 }
 
 //处理企业产品信息

+ 34 - 5
fieldproject_medical/data_preparation/src/hospital/hospital.go

@@ -1,7 +1,9 @@
 package hospital
 
 import (
+	"class"
 	log "github.com/donnie4w/go-logger/logger"
+	"gopkg.in/mgo.v2"
 	"time"
 )
 
@@ -16,13 +18,14 @@ func RunHospital() {
 	RunBuildHospitalInfo()
 	RunCleanHospitalInfo()
 	RunResetHospitalInfo(save_hospital_coll)
+	//增加索引 repeat_id
+	createMgoIndex(save_hospital_coll, []string{"repeat_id"})
 	RunMergeHospitalInfo(save_hospital_coll, merge_hospital_coll_1)
-}
-func RunHospitalOnline() {
 	RunRepairHospitalInfo()
 	RunResetHospitalInfo(merge_hospital_coll_1)
+	//增加索引 repeat_id
+	createMgoIndex(merge_hospital_coll_1, []string{"repeat_id", "name"})
 	RunMergeHospitalInfo(merge_hospital_coll_1, merge_hospital_coll_2)
-	//彻底结束~是否删除~中间关联表?
 }
 
 //开始执行医院数据
@@ -55,8 +58,34 @@ func RunMergeHospitalInfo(source_coll string, output_coll string) {
 
 //修复信息~历史别名校验
 func RunRepairHospitalInfo() {
-	repairHospital()
-	time.Sleep(10 * time.Second)
+	//repairHospital()
+	//time.Sleep(10 * time.Second)
 	compareHospital()
 	time.Sleep(10 * time.Second)
+	//updateMarkIdHospital()
+	//time.Sleep(10 * time.Second)
+}
+
+//创建mgo索引
+func createMgoIndex(table string, indexArr []string) {
+	addr, dbname := "127.0.0.1:27017", "zhengkun"
+	if !class.IsLocal {
+		addr = "172.17.4.87:27080"
+		dbname = "py_theme"
+	}
+	mongoDBDialInfo := &mgo.DialInfo{
+		Addrs:    []string{addr},
+		Timeout:  30 * time.Second,
+		Database: dbname,
+	}
+	session, err := mgo.DialWithInfo(mongoDBDialInfo)
+	if err != nil {
+		log.Debug("CreateSession failed:%\n", err)
+	}
+	coll := session.DB(dbname).C(table)
+	for _, v := range indexArr {
+		err = coll.EnsureIndexKey(v)
+		log.Debug("创建索引~", v, "~", table, err)
+	}
+
 }

+ 1 - 1
fieldproject_medical/data_preparation/src/hospital/hospital_extra.go

@@ -26,7 +26,7 @@ func compareHospital() {
 		name := qu.ObjToString(tmp["name"])
 		alias := qu.ObjToString(tmp["alias"])
 		if name != "" {
-			dataArr, _ := class.Spi_Mgo.Find(history_hospital_coll, map[string]interface{}{
+			dataArr, _ := class.Save_Mgo.Find(history_hospital_coll, map[string]interface{}{
 				"search_name": name,
 			}, nil, map[string]interface{}{
 				"hospital_name": 1,

+ 1 - 1
fieldproject_medical/data_preparation/src/hospital/hospital_merge.go

@@ -27,7 +27,7 @@ func mergeRepeatHospital(source_coll string, output_coll string) {
 	it := sess.DB(class.Save_Mgo.DbName).C(source_coll).Find(&q).Sort("_id").Iter()
 	total, isok := 0, 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
-		if total%1000 == 0 {
+		if total%5000 == 0 {
 			log.Debug("cur index ", total, "~", isok)
 		}
 		dataArr, _ := class.Save_Mgo.Find(source_coll, map[string]interface{}{

+ 32 - 1
fieldproject_medical/data_preparation/src/hospital/hospital_repair.go

@@ -3,7 +3,9 @@ package hospital
 import (
 	"class"
 	log "github.com/donnie4w/go-logger/logger"
+	"github.com/uuid"
 	qu "qfw/util"
+	"strings"
 	"sync"
 )
 
@@ -18,7 +20,7 @@ func repairHospital() {
 	wg := &sync.WaitGroup{}
 	total := 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
-		if total%1000 == 0 {
+		if total%5000 == 0 {
 			log.Debug("cur index ", total)
 		}
 		pool <- true
@@ -63,3 +65,32 @@ func repairHospital() {
 	log.Debug("补充信息信息~~over~~ ", total)
 
 }
+
+//补充自生id未校验数据
+func updateMarkIdHospital() {
+	sess := class.Save_Mgo.GetMgoConn()
+	defer class.Save_Mgo.DestoryMongoConn(sess)
+	q := map[string]interface{}{}
+	it := sess.DB(class.Save_Mgo.DbName).C(merge_hospital_coll_2).Find(&q).Sort("_id").Iter()
+	total, isok := 0, 0
+	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
+		if total%1000 == 0 {
+			log.Debug("cur index ", total, isok)
+		}
+		tmpid := class.BsonTOStringId(tmp["_id"])
+		company_id := qu.ObjToString(tmp["company_id"])
+		mark_id := qu.IntAll(tmp["mark_id"])
+		if mark_id == 0 && company_id == "" {
+			c_id := uuid.New().String()
+			c_id = strings.ReplaceAll(c_id, "-", "")
+			class.Save_Mgo.UpdateById(merge_hospital_coll_1, tmpid, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"company_id": c_id,
+					"mark_id":    0,
+				},
+			})
+		}
+		tmp = make(map[string]interface{})
+	}
+	log.Debug("更新机构~自生id~~over~~ ", total)
+}

+ 3 - 9
fieldproject_medical/data_preparation/src/hospital/hospital_sql.go

@@ -21,16 +21,11 @@ func ExportHospitalInfoToMysql() {
 	it := sess.DB(class.Save_Mgo.DbName).C(merge_hospital_coll_2).Find(&q).Sort("_id").Iter()
 	pool := make(chan bool, 1)
 	wg := &sync.WaitGroup{}
-	total, isok := 0, 0
+	total := 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
 		if total%1000 == 0 {
-			log.Debug("cur index ", total, "~", isok)
+			log.Debug("cur index ", total, "~")
 		}
-		if qu.IntAll(tmp["mark_id"]) == 0 {
-			tmp = make(map[string]interface{})
-			continue
-		}
-		isok++
 		pool <- true
 		wg.Add(1)
 		go func(tmp map[string]interface{}) {
@@ -50,7 +45,7 @@ func ExportHospitalInfoToMysql() {
 	}
 	wg.Wait()
 
-	log.Debug("is cur over ", total, "~", isok)
+	log.Debug("is cur over ", total)
 
 }
 
@@ -149,7 +144,6 @@ func createDepartsInfo(tmp map[string]interface{}, level string) {
 		}
 		data := map[string]interface{}{}
 		data["company_id"] = qu.ObjToString(tmp["company_id"])
-
 		data["departname_code"] = depart_code
 		data["departname_class1"] = qu.ObjToString(v["departclass1"])
 		data["departname_class2"] = qu.ObjToString(v["departclass2"])

+ 4 - 1
fieldproject_medical/data_preparation/src/hospital/hospital_ways.go

@@ -38,7 +38,7 @@ func inquirBaseInfoid(name string) string {
 
 //补充~地域区划
 func supplementRegionally(area *string, city *string, district *string, name string, address string) {
-	return
+
 	//查询其他表~
 	if *area == "" || *area == "全国" {
 		*area = "全国"
@@ -69,6 +69,9 @@ func supplementRegionally(area *string, city *string, district *string, name str
 		return
 	}
 
+	if class.IsLocal { //测试数据~不请求 api
+		return
+	}
 	//地址截取至~XXX市
 	address = addressReg.ReplaceAllString(address, "${1}")
 	//地址字段抽取~请求接口

+ 7 - 5
fieldproject_medical/data_preparation/src/main.go

@@ -4,6 +4,7 @@ import (
 	"class"
 	"flag"
 	log "github.com/donnie4w/go-logger/logger"
+	"hospital"
 	"net/http"
 	"time"
 )
@@ -14,20 +15,21 @@ func init() {
 func main() {
 	log.Debug("run main ... ")
 	//处理医院
-	//hospital.RunHospital()
-	//暂时需要线上补充~数据
-	//hospital.RunHospitalOnline()
+	hospital.RunHospital()
 	//导入信息~医疗关联sql表
 	//hospital.ExportHospitalInfoToMysql()
 
+	//代码表构建
+	//vcode.RunVCodeData()
+
 	//产品基本信息
 	//product.RunMedicalProductInfo()
 
 	//企业生产经营产品~信息
 	//company.RunCompanyProductInfo()
 
-	//代码表构建
-	//vcode.RunVCodeData()
+	//修复数据
+	//repair.RepairUnClassProduct()
 
 	time.Sleep(999 * time.Hour)
 }

+ 1 - 0
fieldproject_medical/data_preparation/src/product/product.go

@@ -15,6 +15,7 @@ var productlock sync.Mutex
 func RunMedicalProductInfo() {
 	log.Debug("开始构建~产品信息~")
 	dealWithMedicalProductInfo()
+	time.Sleep(10 * time.Second)
 }
 
 //处理产品信息~ medical_equipment_productinfo

+ 84 - 17
fieldproject_medical/data_preparation/src/repair/repairclass.go

@@ -9,28 +9,60 @@ import (
 
 var (
 	NameLevelPcode = map[string]map[string]string{}
+	CodeClassData  = map[string]map[string]string{}
+	NameClassData  = map[string]string{}
 )
 
-//修复全量表数 新版本分类目录
-func RpairProductAllCodeName() {
-	//构建分类目录
-	datas := *class.MysqlMedicalTool.Find(class.V_Code_Productclass, nil, "", "", -1, -1)
-	for _, v := range datas {
-		name := qu.ObjToString(v["name"])
-		level := fmt.Sprintf("%d", v["level"])
-		pcode := qu.ObjToString(v["pcode"])
-		code := qu.ObjToString(v["code"])
-
-		key := name + "~" + level + "~" + pcode
-		if NameLevelPcode[key] == nil {
-			NameLevelPcode[key] = map[string]string{
-				"name": name,
-				"code": code,
+//修复未分类产品信息
+func RepairUnClassProduct() {
+	initRepairVCodeData()
+	sess := class.Save_Mgo.GetMgoConn()
+	defer class.Save_Mgo.DestoryMongoConn(sess)
+	q := map[string]interface{}{
+		"product_code": "",
+	}
+	it := sess.DB(class.Save_Mgo.DbName).C(class.S_Product_Coll).Find(&q).Select(map[string]interface{}{
+		"product_name": 1,
+		"make_country": 1,
+	}).Sort("_id").Iter()
+	total, isok := 0, 0
+	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
+		if total%10000 == 0 {
+			log.Debug("cur index ", total, "~", isok)
+		}
+		product_name := qu.ObjToString(tmp["product_name"])
+		make_country := qu.ObjToString(tmp["make_country"])
+		code := NameClassData[product_name]
+		tmpid := class.BsonTOStringId(tmp["_id"])
+		if code != "" {
+			isok++
+			update := CodeClassData[code]
+			update["product_code"] = code
+			class.Save_Mgo.UpdateById(class.S_Product_Coll, tmpid, map[string]interface{}{
+				"$set": update,
+			})
+		} else {
+			//是否进口
+			if make_country == "2" {
+				isok++
+				update := map[string]interface{}{}
+				update["product_class1"] = "进口器械"
+				update["product_code"] = "99"
+				class.Save_Mgo.UpdateById(class.S_Product_Coll, tmpid, map[string]interface{}{
+					"$set": update,
+				})
 			}
 		}
+
+		tmp = make(map[string]interface{})
 	}
-	log.Debug("分类目录准备~", len(NameLevelPcode))
 
+	log.Debug("is over ", total, "~", isok)
+}
+
+//修复全量表数 新版本分类目录
+func RepairProductAllCodeName() {
+	initRepairVCodeData()
 	sess := class.Save_Mgo.GetMgoConn()
 	defer class.Save_Mgo.DestoryMongoConn(sess)
 	q := map[string]interface{}{}
@@ -106,7 +138,6 @@ func RpairProductAllCodeName() {
 
 	log.Debug("is over ", total, "~", is_err)
 }
-
 func acquireMedicalClassData(name string, level string, pcode string) (string, string) {
 	new_name, new_code := "", ""
 	key := name + "~" + level + "~" + pcode
@@ -117,3 +148,39 @@ func acquireMedicalClassData(name string, level string, pcode string) (string, s
 	}
 	return new_name, new_code
 }
+func initRepairVCodeData() {
+	//构建分类目录
+	datas := *class.MysqlMedicalTool.Find(class.V_Code_Productclass, nil, "", "", -1, -1)
+	for _, v := range datas {
+		name := qu.ObjToString(v["name"])
+		level := fmt.Sprintf("%d", v["level"])
+		pcode := qu.ObjToString(v["pcode"])
+		code := qu.ObjToString(v["code"])
+		key := name + "~" + level + "~" + pcode
+		if NameLevelPcode[key] == nil {
+			NameLevelPcode[key] = map[string]string{
+				"name": name,
+				"code": code,
+			}
+		}
+
+		dict := CodeClassData[code]
+		if pcode != "" {
+			dict = CodeClassData[pcode]
+			if dict == nil {
+				log.Debug("顺序错误~")
+			}
+		}
+		new_dict := map[string]string{}
+		for k, v := range dict {
+			new_dict[k] = v
+		}
+		new_key := "product_class" + level
+		new_dict[new_key] = name
+		CodeClassData[code] = new_dict
+
+		NameClassData[name] = code
+
+	}
+	log.Debug("分类目录准备~", len(NameLevelPcode), len(CodeClassData), len(NameClassData))
+}

File diff suppressed because it is too large
+ 13474 - 22
fieldproject_medical/data_preparation/src/vcode/vcode.go


+ 10 - 9
fieldproject_medical/data_service/src/bidding/bidding.go

@@ -26,11 +26,11 @@ func RunPurchasingInfo(gtid string, lteid string) {
 		},
 	}
 	it := sess.DB(ul.Mgo.DbName).C(ul.S_Bidding_Coll).Find(&q).Sort("_id").Select(fields).Iter()
-	pool := make(chan bool, 8)
+	pool := make(chan bool, 6)
 	wg := &sync.WaitGroup{}
 	total, isok := 0, 0
 	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
-		if total%100 == 0 {
+		if total%1000 == 0 {
 			log.Debug("cur index ", total, "~", isok)
 		}
 		if qu.IntAll(tmp["extracttype"]) != 1 {
@@ -49,6 +49,11 @@ func RunPurchasingInfo(gtid string, lteid string) {
 			if b {
 				numlock.Lock()
 				isok++
+				ul.Mgo.UpdateById(ul.S_Bidding_Coll, class.BsonTOStringId(tmp["_id"]), map[string]interface{}{
+					"$set": map[string]interface{}{
+						"bid_field": "0101",
+					},
+				})
 				numlock.Unlock()
 			}
 		}(tmp)
@@ -68,14 +73,11 @@ func createBaseInfo(tmp map[string]interface{}) bool {
 	b, industry_code, new_plist := checkWhetherValidInfo(p_list, sub_list)
 	if b {
 		//标的物基本信息~记录标签
-		//insertBaseInfo(new_plist, infoid, bid_topsubtype_code)
+		insertBaseInfo(new_plist, infoid, bid_topsubtype_code)
 		//招标信息领域标签
-		//insertFiledTag(infoid)
+		insertFiledTag(infoid)
 		//招标信息行业标签
-		//insertIndustryTag(industry_code, infoid)
-	}
-	if industry_code != "" && len(new_plist) > 0 && bid_topsubtype_code != "" && infoid != "" {
-
+		insertIndustryTag(industry_code, infoid)
 	}
 	return b
 }
@@ -97,7 +99,6 @@ func createNewPurchasingInfo(p_list []map[string]interface{}) (bool, []map[strin
 	new_plist := []map[string]interface{}{}
 	for _, v := range p_list {
 		//去重处理~名称~品牌~型号~暂无重复
-
 		data := map[string]interface{}{}
 		itemname := qu.ObjToString(v["itemname"])
 		if itemname == "" {

+ 0 - 1
fieldproject_medical/data_service/src/bidding/bidsql.go

@@ -25,7 +25,6 @@ func insertBaseInfo(p_list []map[string]interface{}, infoid string, bid_topsubty
 				ul.InsertGlobalMysqlData(ul.V_Bid_Purchasing_Field_Record, info_tag, infoid)
 			}
 		}
-
 	}
 }
 

+ 1 - 1
fieldproject_medical/data_service/src/bidding/clean.go

@@ -9,7 +9,7 @@ import (
 var arcReg = regexp.MustCompile("[((].*[))]")
 
 //异常词
-var abnormalReg = regexp.MustCompile("^((医疗|普通|医用)设备|[一二三四五六七八九A-Za-z1-9]包)$")
+var abnormalReg = regexp.MustCompile("^((医疗|普通|医用)设备|[一二三四五六七八九A-Za-z1-9]包|其他[::])$")
 
 var dataLock sync.Mutex
 

+ 15 - 15
fieldproject_medical/data_service/src/bidding/purchasing.go

@@ -51,7 +51,7 @@ func calculateSimilarityScore(indexDocs map[int][]string, itemArr []string) stri
 		dice_score := strsim.Compare(v_str, itemName, strsim.DiceCoefficient())
 		//优化空间~高分选取阈值~低分过滤阈值~综合阈值
 		finally_score := (base_score + dice_score) / 2
-		if finally_score > 0.55 && dice_score > 0.0 {
+		if finally_score >= 0.55 && dice_score > 0.0 {
 			scoreDocs[k] = qu.FloatFormat(finally_score, 2)
 			//临时记录一下分数
 			scoreDocs_1[k] = qu.FloatFormat(base_score, 2)
@@ -62,23 +62,23 @@ func calculateSimilarityScore(indexDocs map[int][]string, itemArr []string) stri
 		return ""
 	}
 	//取出最高有效分~数据
-	index, score := getMaxScore(scoreDocs)
+	index, _ := getMaxScore(scoreDocs)
 	match_str := strings.Join(ul.NgrmDocIndex[index], "")
 	med_code := ul.ProductDocText[match_str]
 	//临时~测试保存数据
-	catalog := ul.CodeCatalog[med_code]
-	ul.Mgo.Save("zzzzzz", map[string]interface{}{
-		"name":       strings.Join(itemArr, ""),
-		"match_name": match_str,
-		"score":      score,
-		"score_1":    scoreDocs_1[index],
-		"score_2":    scoreDocs_2[index],
-		"code":       med_code,
-		"class_1":    catalog["class_1"],
-		"class_2":    catalog["class_2"],
-		"class_3":    catalog["class_3"],
-		"class_4":    catalog["class_4"],
-	})
+	//catalog := ul.CodeCatalog[med_code]
+	//ul.Mgo.Save("zzzzzz", map[string]interface{}{
+	//	"name":       strings.Join(itemArr, ""),
+	//	"match_name": match_str,
+	//	"score":      score,
+	//	"score_1":    scoreDocs_1[index],
+	//	"score_2":    scoreDocs_2[index],
+	//	"code":       med_code,
+	//	"class_1":    catalog["class_1"],
+	//	"class_2":    catalog["class_2"],
+	//	"class_3":    catalog["class_3"],
+	//	"class_4":    catalog["class_4"],
+	//})
 	return med_code
 }
 

+ 3 - 1
fieldproject_medical/data_service/src/main.go

@@ -15,8 +15,10 @@ func init() {
 }
 
 func main() {
-	log.Debug("run main ... ")
+
+	log.Debug("run main ... bidpur_class_test")
 	bidding.RunPurchasingInfo("100000000000000000000000", "900000000000000000000000")
+	time.Sleep(999 * time.Hour)
 	return
 	//测试相似度计算
 	http.ListenAndServe(":9991", nil)

+ 29 - 13
fieldproject_medical/data_service/src/util/initcfg.go

@@ -16,7 +16,8 @@ const (
 	V_Code_Productclass  = "code_productclass"
 	V_Product_Baseinfo   = "product_baseinfo"
 
-	S_Bidding_Coll = "zktest_mysql_bidding_test"
+	//S_Bidding_Coll = "zktest_mysql_bidding_test"
+	S_Bidding_Coll = "bidding"
 )
 
 var (
@@ -57,12 +58,21 @@ func initMgo() {
 		//}
 		//Mgo.InitPool()
 
+		//Mgo = &MongodbSim{
+		//	MongodbAddr: "192.168.3.207:27092",
+		//	DbName:      "zhengkun",
+		//	Size:        10,
+		//	UserName:    "",
+		//	Password:    "",
+		//}
+		//Mgo.InitPool()
+
 		Mgo = &MongodbSim{
-			MongodbAddr: "192.168.3.207:27092",
-			DbName:      "zhengkun",
+			MongodbAddr: "192.168.3.207:27001",
+			DbName:      "qfw_data",
 			Size:        10,
-			UserName:    "",
-			Password:    "",
+			UserName:    "root",
+			Password:    "root",
 		}
 		Mgo.InitPool()
 	} else {
@@ -78,22 +88,28 @@ func initMgo() {
 }
 
 func initMysql() {
+	username, password := "root", "=PDT49#80Z!RVv52_z"
+	address := "192.168.3.217:4000"
+	if !isLocal {
+		username = "zhengkun"
+		password = "Zk#20220824"
+		address = "172.17.4.242:4000"
+	}
 	MysqlMedicalTool = &Mysql{
-		Address:  "192.168.3.217:4000",
-		UserName: "root",
-		PassWord: "=PDT49#80Z!RVv52_z",
-		DBName:   "medical_fileld_data",
+		Address:  address,
+		UserName: username,
+		PassWord: password,
+		DBName:   "medical_field_data",
 	}
 	MysqlMedicalTool.Init()
 
 	MysqlGlobalTool = &Mysql{
-		Address:  "192.168.3.217:4000",
-		UserName: "root",
-		PassWord: "=PDT49#80Z!RVv52_z",
+		Address:  address,
+		UserName: username,
+		PassWord: password,
 		DBName:   "global_common_data",
 	}
 	MysqlGlobalTool.Init()
-
 }
 
 //加载代码表~

+ 6 - 0
fieldproject_medical/data_service/src/util/initmed.go

@@ -32,6 +32,9 @@ func loadNgrmProductData(datasArr []map[string]interface{}) {
 	for k, data := range datasArr {
 		ngrm_index := cur_index + k
 		name := qu.ObjToString(data["product_name"])
+		if name == "其他" {
+			continue
+		}
 		code := qu.ObjToString(data["medical_equipment_code"])
 		arr := GSE.Cut(name, true)
 		NgrmDocIndex[ngrm_index] = arr
@@ -59,6 +62,9 @@ func loadNgrmProductData(datasArr []map[string]interface{}) {
 func loadNgrmCatalogData(datasArr []map[string]interface{}) {
 	for ngrm_index, data := range datasArr {
 		name := qu.ObjToString(data["name"])
+		if name == "其他" {
+			continue
+		}
 		code := qu.ObjToString(data["code"])
 		arr := GSE.Cut(name, true)
 		NgrmDocIndex[ngrm_index] = arr

Some files were not shown because too many files changed in this diff