Explorar el Código

Merge branch 'master' of https://jygit.jydev.jianyu360.cn/moapp/jypkg

wangchuanjin hace 1 año
padre
commit
55a2d0b98c

+ 2 - 2
common/src/qfw/util/bidsearch/search.go

@@ -124,7 +124,7 @@ func GetPcBidSearchData(searchvalue, area, city, publishtime, subtype, industry,
 	return
 }
 
-var topType = map[string]string{
+var TopType = map[string]string{
 	"招标预告":   "预告",
 	"招标公告":   "招标",
 	"招标结果":   "结果",
@@ -210,7 +210,7 @@ func GetBidSearchQuery(area, city, publishtime, subtype, winner, buyerclass stri
 		var subTypes []string
 
 		for _, v := range strings.Split(subtype, ",") {
-			if v1, ok := topType[v]; ok {
+			if v1, ok := TopType[v]; ok {
 				topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
 			} else {
 				subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))

+ 55 - 44
common/src/qfw/util/dataexport/dataexport.go

@@ -369,12 +369,11 @@ func getDataExportSql(scd *SieveCondition) string {
 								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
 							}
 						}
-					} else if strings.Contains(vv, " ") {
+					} else {
 						for _, vk := range strings.Split(vv, " ") {
 							if len(vk) == 0 {
 								continue
 							}
-
 							//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
 							if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
 								queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
@@ -384,9 +383,6 @@ func getDataExportSql(scd *SieveCondition) string {
 								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
 							}
 						}
-					} else {
-						appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vv+"\""))
-
 					}
 					// 单个关键词分词后都包含
 					shoulds = append(shoulds, fmt.Sprintf(query_bool_must_and, strings.Join(appendedShoulds, ","), ""))
@@ -644,15 +640,17 @@ func GetDataExportSelectReallyCount(bid mg.MongodbSim, biddingName string, ids [
 }
 
 func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
-	sess := bidding.GetMgoConn()
-	defer bidding.DestoryMongoConn(sess)
-	selectMap := map[string]interface{}{
-		"_id": 1, "title": 1, "detail": 1, "area": 1, "city": 1, "publishtime": 1, "projectname": 1, "buyer": 1, "s_winner": 1, "bidamount": 1, "subtype": 1, "toptype": 1, "filetext": 1, "purchasing": 1,
-	}
+	//sess := bidding.GetMgoConn()
+	//defer bidding.DestoryMongoConn(sess)
+	bidField := `"_id", "title", "detail", "area", "city", "publishtime", "projectname", "buyer", "s_winner", "bidamount", "subtype", "toptype", "filetext", "purchasing"`
+	//selectMap := map[string]interface{}{
+	//	"_id": 1, "title": 1, "detail": 1, "area": 1, "city": 1, "publishtime": 1, "projectname": 1, "buyer": 1, "s_winner": 1, "bidamount": 1, "subtype": 1, "toptype": 1, "filetext": 1, "purchasing": 1,
+	//}
 	if dataType == "2" {
-		for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime", "district", "signendtime", "buyeraddr"} {
-			selectMap[key] = 1
-		}
+		bidField = bidField + `", href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime", "district", "signendtime", "buyeraddr"`
+		//for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime", "district", "signendtime", "buyeraddr", "filetext"} {
+		//	selectMap[key] = 1
+		//}
 	}
 	if checkCount == -1 && len(scd.SelectIds) > 500 {
 		scd.SelectIds = scd.SelectIds[:500]
@@ -669,41 +667,54 @@ func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *S
 				wait.Done()
 				<-pool
 			}()
-			var queryIds []interface{}
-			for _, idStr := range arr {
-				queryIds = append(queryIds, mg.StringTOBsonId(idStr))
-			}
-			iter := sess.DB(biddingName).C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
-				"$in": queryIds,
-			}}).Iter()
-			for m := make(map[string]interface{}); iter.Next(&m); {
-				m["_id"] = mg.BsonIdToSId(m["_id"])
-				detail, _ := m["detail"].(string)
-				if detail != "" {
-					m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
-				}
-				lock.Lock()
-				returnLsit = append(returnLsit, m)
-				lock.Unlock()
-				m = make(map[string]interface{})
-			}
-			iter_back := sess.DB(biddingName).C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
-				"$in": queryIds,
-			}}).Iter()
-			for m := make(map[string]interface{}); iter_back.Next(&m); {
-				m["_id"] = mg.BsonIdToSId(m["_id"])
-				detail, _ := m["detail"].(string)
-				if detail != "" {
-					m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+			//var queryIds []interface{}
+			//for _, idStr := range arr {
+			//	queryIds = append(queryIds, mg.StringTOBsonId(idStr))
+			//}
+			query := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"id":["%s"]}}]}},"_source": [%s],"size":%d}`, strings.Join(arr, "\",\""), bidField, len(arr))
+			data := *elastic.Get(INDEX, TYPE, query)
+			if data != nil && len(data) > 0 {
+				for _, bv := range data {
+					bv["_id"] = mg.BsonIdToSId(bv["_id"])
+					detail, _ := bv["detail"].(string)
+					if detail != "" {
+						bv["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+					}
+					lock.Lock()
+					returnLsit = append(returnLsit, bv)
+					lock.Unlock()
 				}
-				lock.Lock()
-				returnLsit = append(returnLsit, m)
-				lock.Unlock()
-				m = make(map[string]interface{})
 			}
+			//iter := sess.DB(biddingName).C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+			//	"$in": queryIds,
+			//}}).Iter()
+			//for m := make(map[string]interface{}); iter.Next(&m); {
+			//	m["_id"] = mg.BsonIdToSId(m["_id"])
+			//	detail, _ := m["detail"].(string)
+			//	if detail != "" {
+			//		m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+			//	}
+			//	lock.Lock()
+			//	returnLsit = append(returnLsit, m)
+			//	lock.Unlock()
+			//	m = make(map[string]interface{})
+			//}
+			//iter_back := sess.DB(biddingName).C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+			//	"$in": queryIds,
+			//}}).Iter()
+			//for m := make(map[string]interface{}); iter_back.Next(&m); {
+			//	m["_id"] = mg.BsonIdToSId(m["_id"])
+			//	detail, _ := m["detail"].(string)
+			//	if detail != "" {
+			//		m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+			//	}
+			//	lock.Lock()
+			//	returnLsit = append(returnLsit, m)
+			//	lock.Unlock()
+			//	m = make(map[string]interface{})
+			//}
 			return nil
 		}(v)
-
 	}
 	wait.Wait()
 	if len(returnLsit) == checkCount || checkCount == -1 {

+ 2 - 0
common/src/qfw/util/jy/jySession.go

@@ -64,12 +64,14 @@ func JyAppCreateSession(mdb mongodb.MongodbSim, s *httpsession.Session, loginId
 	if qutil.ObjToString(person["s_phone"]) != "" {
 		phone := person["s_phone"].(string)
 		sessVal["s_phone"] = phone
+		sessVal["phone"] = phone
 		phone = string(phone[0:3]) + "****" + string(phone[len(phone)-4:])
 		sessVal["s_nickname"] = phone
 	}
 	if qutil.ObjToString(person["s_m_phone"]) != "" {
 		s_m_phone := person["s_m_phone"].(string)
 		sessVal["s_m_phone"] = s_m_phone
+		sessVal["phone"] = s_m_phone
 	}
 	if qutil.ObjToString(person["s_nickname"]) != "" {
 		sessVal["app_name"] = person["s_nickname"]

+ 19 - 11
common/src/qfw/util/jy/userCenter.go

@@ -8,20 +8,28 @@ import (
 
 //获取base-user相关参数
 func AddUser(mgo mongodb.MongodbSim, userid string, req pb.UserAddReq, middleground middleground.Middleground) bool {
-	if resp := middleground.UserCenter.UserAdd(req); resp != nil {
-		//获取到baseid
+	retry := 3 // 设置重试次数
+	for i := 0; i < retry; i++ {
+		resp := middleground.UserCenter.UserAdd(req)
+		if resp == nil || resp.Data.Status != 1 {
+			continue // 如果调用失败或返回结果不是成功,则进行重试
+		}
+		// 获取到baseid
 		baseId := resp.Data.Id
-		if baseId > 0 {
-			//user表记录映射关系
-			ok := mgo.UpdateById("user", userid, map[string]interface{}{
-				"$set": map[string]interface{}{
-					"base_user_id": baseId,
-				},
-			})
-			return resp.Data.Status == 1 && ok
+		if baseId <= 0 {
+			continue // 如果获取到的baseid不合法,则进行重试
+		}
+		// user表记录映射关系
+		ok := mgo.UpdateById("user", userid, map[string]interface{}{
+			"$set": map[string]interface{}{
+				"base_user_id": baseId,
+			},
+		})
+		if ok {
+			return true // 如果MongoDB更新成功,则返回true
 		}
 	}
-	return false
+	return false // 如果重试多次后仍然失败,则返回false
 }
 
 //修改base-user相关参数

+ 4 - 1
common/src/qfw/util/jy/userPhoneUtil.go

@@ -184,7 +184,7 @@ return exists:是否存在
 
 rule 1.不存在手机号,2.存在手机号用户,但此手机号未绑定微信 3.存在手机号用户,或绑定微信和当前账户绑定微信一致
 */
-func (this *PhoneUtil) BindPhoneIsOccupy(unionId, phone string) (exists bool, relationPhoneId string) {
+func (this *PhoneUtil) BindPhoneIsOccupy(userId, unionId, phone string) (exists bool, relationPhoneId string) {
 	//已经有微信账户绑定过
 	if this.UserMgoDB.Count("user", map[string]interface{}{"i_appid": 2, "s_m_phone": phone, "s_phone": map[string]interface{}{"$exists": 0}}) > 0 {
 		return true, ""
@@ -207,6 +207,9 @@ func (this *PhoneUtil) BindPhoneIsOccupy(unionId, phone string) (exists bool, re
 		}
 	}
 	//但此手机号未绑定微信
+	if userId == relationPhoneId {
+		return true, ""
+	}
 	return false, relationPhoneId
 }
 

BIN
common/src/src.exe


+ 17 - 17
ent/entity/entity.go

@@ -182,7 +182,7 @@ func (c *CurrentUser) PhoneIsOccupy(userId, phone string) (bool, int, string) {
 		if unionId == "" {
 			return true, 2, ""
 		}
-		exists, relationPhoneId := jy.NewPhoneUtil(MQFW).BindPhoneIsOccupy(unionId, phone)
+		exists, relationPhoneId := jy.NewPhoneUtil(MQFW).BindPhoneIsOccupy(userId, unionId, phone)
 		if !exists {
 			return false, 2, relationPhoneId
 		}
@@ -194,22 +194,22 @@ func (c *CurrentUser) PhoneIsOccupy(userId, phone string) (bool, int, string) {
 
 //绑定手机号
 func (c *CurrentUser) BindPhone(userId, phone, email string) (bool, int) {
-        isOccupy, appid, _ := c.PhoneIsOccupy(userId, phone)
-        if isOccupy {
-	      return false, appid
-        }
-        if appid == 2 {
-	      //商机管理绑定手机号需要和剑鱼保持一致,建立双向绑定关系
-	      //err := jy.NewPhoneUtil(MQFW).BindPhone(userId, relationPhoneId, phone, email, nil)\
-                var err error
-	      if err == nil {
-		    return true, appid
-	      }
-	      return false, appid
-        }
-        return MQFW.UpdateById("user", userId, map[string]interface{}{
-	      "$set": map[string]interface{}{"s_m_phone": phone},
-        }), appid
+	isOccupy, appid, _ := c.PhoneIsOccupy(userId, phone)
+	if isOccupy {
+		return false, appid
+	}
+	if appid == 2 {
+		//商机管理绑定手机号需要和剑鱼保持一致,建立双向绑定关系
+		//err := jy.NewPhoneUtil(MQFW).BindPhone(userId, relationPhoneId, phone, email, nil)\
+		var err error
+		if err == nil {
+			return true, appid
+		}
+		return false, appid
+	}
+	return MQFW.UpdateById("user", userId, map[string]interface{}{
+		"$set": map[string]interface{}{"s_m_phone": phone},
+	}), appid
 }
 
 //更换手机号

+ 1 - 1
ent/entity/user.go

@@ -188,7 +188,7 @@ func (u *User) Add(tx *sql.Tx, entId int, user *User, paymentAddress, source, ns
 func (u *User) Update(mail string, userId, deptId, entId int) bool {
 	return Mysql.ExecTx("修改员工", func(tx *sql.Tx) bool {
 		ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, `update entniche_user set mail=?,timestamp=? where id=? and ent_id=?`, mail, NowFormat(Date_Full_Layout), userId, entId)
-		Mgo_Bidding.Update("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": userId}, map[string]interface{}{
+		MQFW.Update("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": userId}, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"o_pushset.s_email": mail,
 			},

+ 1 - 1
go.mod

@@ -16,7 +16,7 @@ require (
 	github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed
 	github.com/zeromicro/go-zero v1.5.3
 	go.mongodb.org/mongo-driver v1.11.6
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230630032508-eefb06a4588e
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1
 )
 
 require (

+ 2 - 2
go.sum

@@ -1323,8 +1323,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230630032508-eefb06a4588e h1:1O11hFuKvLD3Ls+9wxssUpMV3fG9qD4EfeeAy92dsWY=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230630032508-eefb06a4588e/go.mod h1:wBxeFODhYtGenkxXJGThN/VrFaxPvvHMxzpS09pxApM=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

+ 2 - 2
identity/identity.go

@@ -38,7 +38,7 @@ func NewIdentityInfo(i *pb.Identity) *IdentityInfo {
 	}
 }
 
-//切换身份
+// 切换身份
 func (i *IdentityInfo) Switch(sess *httpsession.Session, mgo *MongodbSim) bool {
 	ok := false
 	m := map[string]interface{}{
@@ -74,7 +74,7 @@ func (i *IdentityInfo) Switch(sess *httpsession.Session, mgo *MongodbSim) bool {
 	return ok
 }
 
-//切换到最优身份
+// 切换到最优身份
 func SwitchToBest(userId int64, sess *httpsession.Session, mgd *Middleground, mgo *MongodbSim, isSelectLast bool) (int64, bool) {
 	list := mgd.UserCenter.IdentityList(userId)
 	if list == nil || len(list) == 0 {

+ 36 - 11
middleground/usercenter.go

@@ -1,13 +1,12 @@
 package middleground
 
 import (
-	"context"
-	"log"
-
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
+	"context"
 	"github.com/zeromicro/go-zero/core/discov"
 	"github.com/zeromicro/go-zero/zrpc"
+	"log"
 )
 
 type userCenter struct {
@@ -43,7 +42,7 @@ func (u *userCenter) NewClient() zrpc.Client {
 	return client
 }
 
-//获取身份列表
+// 获取身份列表
 func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
 	client := u.NewClient()
 	if client == nil {
@@ -60,7 +59,7 @@ func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
 	return resp.Identitys
 }
 
-//获取账号id获取个人身份信息
+// 获取账号id获取个人身份信息
 func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
 	client := u.NewClient()
 	if client == nil {
@@ -77,7 +76,7 @@ func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
 	return resp
 }
 
-//根据职位id获取身份信息
+// 根据职位id获取身份信息
 func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
 	client := u.NewClient()
 	if client == nil {
@@ -94,7 +93,7 @@ func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
 	return resp
 }
 
-//根据企业员工id获取身份信息
+// 根据企业员工id获取身份信息
 func (u *userCenter) IdentityByEntUserId(entUserId int64) *pb.Identity {
 	client := u.NewClient()
 	if client == nil {
@@ -111,7 +110,7 @@ func (u *userCenter) IdentityByEntUserId(entUserId int64) *pb.Identity {
 	return resp
 }
 
-//添加用户
+// 添加用户
 func (u *userCenter) UserAdd(req pb.UserAddReq) *pb.UserAddResp {
 	client := u.NewClient()
 	//defer client.Conn().Close()
@@ -137,7 +136,7 @@ func (u *userCenter) UserAdd(req pb.UserAddReq) *pb.UserAddResp {
 	return resp
 }
 
-//修改用户
+// 修改用户
 func (u *userCenter) UserUpdate(req pb.UserIdReq) *pb.ExamineResp {
 	client := u.NewClient()
 	//defer client.Conn().Close()
@@ -161,7 +160,7 @@ func (u *userCenter) UserUpdate(req pb.UserIdReq) *pb.ExamineResp {
 	return resp
 }
 
-//删除用户
+// 删除用户
 func (u *userCenter) UserDel(req pb.UserIdReq) *pb.ExamineResp {
 	client := u.NewClient()
 	//defer client.Conn().Close()
@@ -176,7 +175,7 @@ func (u *userCenter) UserDel(req pb.UserIdReq) *pb.ExamineResp {
 	return resp
 }
 
-//清用户缓存
+// 清用户缓存
 func (u *userCenter) WorkDesktopClearUserInfo(req pb.WorkDesktopClearUserInfoReq) *pb.WorkDesktopClearUserInfoResp {
 	client := u.NewClient()
 	//defer client.Conn().Close()
@@ -190,3 +189,29 @@ func (u *userCenter) WorkDesktopClearUserInfo(req pb.WorkDesktopClearUserInfoReq
 	}
 	return resp
 }
+
+// 用户菜单获取
+func (u *userCenter) WorkDesktopMenuInfo(req pb.WorkDesktopMenuInfoReq) *pb.WorkDesktopMenuInfoResp {
+	client := u.NewClient()
+	//defer client.Conn().Close()
+	resp, err := usercenter.NewUserCenter(client).WorkDesktopMenuInfo(context.Background(), &pb.WorkDesktopMenuInfoReq{
+		AppId:        req.AppId,
+		UserId:       req.UserId,
+		Phone:        req.Phone,
+		Platform:     req.Platform,
+		NewUserId:    req.NewUserId,
+		EntId:        req.EntId,
+		EntUserId:    req.EntUserId,
+		WorkStatus:   req.WorkStatus,
+		AccountId:    req.AccountId,
+		EntAccountId: req.EntAccountId,
+		PositionId:   req.PositionId,
+		PositionType: req.PositionType,
+		MgoUserId:    req.MgoUserId,
+	})
+	if err != nil {
+		log.Println(err)
+		return nil
+	}
+	return resp
+}

+ 26 - 12
public/db.go

@@ -12,15 +12,16 @@ import (
 )
 
 var (
-	DbConf      *dbConf
-	Mysql       *mysql.Mysql
-	BaseMysql   *mysql.Mysql
-	PushMysql   *mysql.Mysql
-	BaseService *mysql.Mysql
-	MQFW        m.MongodbSim
-	Mgo_Ent     m.MongodbSim
-	Mgo_Log     m.MongodbSim
-	Mgo_Bidding m.MongodbSim
+	DbConf            *dbConf
+	Mysql             *mysql.Mysql
+	BaseMysql         *mysql.Mysql
+	PushMysql         *mysql.Mysql
+	BaseService       *mysql.Mysql
+	GlobalCommonMysql *mysql.Mysql
+	MQFW              m.MongodbSim
+	Mgo_Ent           m.MongodbSim
+	Mgo_Log           m.MongodbSim
+	Mgo_Bidding       m.MongodbSim
 	//Mgo_Qyfw    m.MongodbSim
 )
 
@@ -42,9 +43,10 @@ type dbConf struct {
 		Login *redisConf
 	}
 	Mysql struct {
-		Main *mysqlConf
-		Push *mysqlConf
-		Base *mysqlConf
+		Main         *mysqlConf
+		Push         *mysqlConf
+		Base         *mysqlConf
+		GlobalCommon *mysqlConf
 	}
 }
 type mgoConf struct {
@@ -177,5 +179,17 @@ func init() {
 			}
 			BaseMysql.Init()
 		}
+		if DbConf.Mysql.GlobalCommon != nil {
+			log.Println("初始化 GlobalCommonMysql")
+			GlobalCommonMysql = &mysql.Mysql{
+				Address:      DbConf.Mysql.GlobalCommon.Address,
+				UserName:     DbConf.Mysql.GlobalCommon.UserName,
+				PassWord:     DbConf.Mysql.GlobalCommon.PassWord,
+				DBName:       DbConf.Mysql.GlobalCommon.DbName,
+				MaxOpenConns: DbConf.Mysql.GlobalCommon.MaxOpenConns,
+				MaxIdleConns: DbConf.Mysql.GlobalCommon.MaxIdleConns,
+			}
+			GlobalCommonMysql.Init()
+		}
 	}
 }