|
@@ -8,6 +8,7 @@ import (
|
|
"sort"
|
|
"sort"
|
|
"strconv"
|
|
"strconv"
|
|
"strings"
|
|
"strings"
|
|
|
|
+ "sync"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
. "app.yhyue.com/moapp/jybase/common"
|
|
. "app.yhyue.com/moapp/jybase/common"
|
|
@@ -749,10 +750,22 @@ func GetUserInfoByPosition(msl *Mysql, mgo *MongodbSim, id int64) *UserInfo {
|
|
}
|
|
}
|
|
|
|
|
|
//资源中台权益
|
|
//资源中台权益
|
|
|
|
+var rcpLock = &sync.Mutex{}
|
|
|
|
+
|
|
func ResourceCenterPowers(msl *Mysql, positionId int64) map[string]bool {
|
|
func ResourceCenterPowers(msl *Mysql, positionId int64) map[string]bool {
|
|
|
|
+ rcpLock.Lock()
|
|
if rcDb.Mysql_BaseService == nil {
|
|
if rcDb.Mysql_BaseService == nil {
|
|
- rcDb.Mysql_BaseService = msl
|
|
|
|
|
|
+ rcDb.Mysql_BaseService = &Mysql{
|
|
|
|
+ Address: msl.Address,
|
|
|
|
+ UserName: msl.UserName,
|
|
|
|
+ PassWord: msl.PassWord,
|
|
|
|
+ DBName: "base_service",
|
|
|
|
+ MaxOpenConns: msl.MaxOpenConns,
|
|
|
|
+ MaxIdleConns: msl.MaxIdleConns,
|
|
|
|
+ }
|
|
|
|
+ rcDb.Mysql_BaseService.Init()
|
|
}
|
|
}
|
|
|
|
+ rcpLock.Unlock()
|
|
powers := map[string]bool{}
|
|
powers := map[string]bool{}
|
|
if identity := IdentityByPositionId(msl, positionId); identity != nil {
|
|
if identity := IdentityByPositionId(msl, positionId); identity != nil {
|
|
list, _ := rcService.HasPowers("10000", identity.AccountId, identity.EntAccountId, identity.EntId, identity.EntUserId)
|
|
list, _ := rcService.HasPowers("10000", identity.AccountId, identity.EntAccountId, identity.EntId, identity.EntUserId)
|