|
@@ -223,14 +223,14 @@ func GetI2bilUserInfo(userId int64, engine *xorm.Engine) (*UserXorm, error) {
|
|
|
return user, nil
|
|
return user, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine) (*transform.GetErpRoleRes, error) {
|
|
|
|
|
|
|
+func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine, ctx context.Context) (*transform.GetErpRoleRes, error) {
|
|
|
|
|
|
|
|
partUser, err := GetPartTimeXormByUserId(userId, engine)
|
|
partUser, err := GetPartTimeXormByUserId(userId, engine)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
|
- return GetErpUser("", partUser.MkId, rpcClient)
|
|
|
|
|
|
|
+ return GetErpUser("", partUser.MkId, rpcClient, ctx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
@@ -238,7 +238,7 @@ func GetAcquirePerm(userId int64, rpcClient transformclient.Transform, engine *x
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return GetErpUser(user.Mobile, "", rpcClient)
|
|
|
|
|
|
|
+ return GetErpUser(user.Mobile, "", rpcClient, ctx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type AcquirePermInfo struct {
|
|
type AcquirePermInfo struct {
|
|
@@ -246,14 +246,14 @@ type AcquirePermInfo struct {
|
|
|
Role int64 // 1 兼职,2mk
|
|
Role int64 // 1 兼职,2mk
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func GetAcquirePermInfo(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine) (*AcquirePermInfo, error) {
|
|
|
|
|
|
|
+func GetAcquirePermInfo(userId int64, rpcClient transformclient.Transform, engine *xorm.Engine, ctx context.Context) (*AcquirePermInfo, error) {
|
|
|
//mk
|
|
//mk
|
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
user, err := GetI2bilUserInfo(userId, engine)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- erpInfo, err := GetErpUser(user.Mobile, "", rpcClient)
|
|
|
|
|
|
|
+ erpInfo, err := GetErpUser(user.Mobile, "", rpcClient, ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
@@ -268,7 +268,7 @@ func GetAcquirePermInfo(userId int64, rpcClient transformclient.Transform, engin
|
|
|
}
|
|
}
|
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
if partUser.Id != 0 && partUser.MkId != "" {
|
|
|
|
|
|
|
|
- erpInfo, err := GetErpUser("", partUser.MkId, rpcClient)
|
|
|
|
|
|
|
+ erpInfo, err := GetErpUser("", partUser.MkId, rpcClient, ctx)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
@@ -279,8 +279,7 @@ func GetAcquirePermInfo(userId int64, rpcClient transformclient.Transform, engin
|
|
|
return nil, nil
|
|
return nil, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func GetErpUser(mobile string, erpUserId string, rpcClient transformclient.Transform) (*transform.GetErpRoleRes, error) {
|
|
|
|
|
- ctx := context.Background()
|
|
|
|
|
|
|
+func GetErpUser(mobile string, erpUserId string, rpcClient transformclient.Transform, ctx context.Context) (*transform.GetErpRoleRes, error) {
|
|
|
in := new(transform.GetErpRoleReq)
|
|
in := new(transform.GetErpRoleReq)
|
|
|
in.Mobile = mobile
|
|
in.Mobile = mobile
|
|
|
in.UserId = erpUserId
|
|
in.UserId = erpUserId
|
|
@@ -301,8 +300,7 @@ func GetErpUser(mobile string, erpUserId string, rpcClient transformclient.Trans
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取校区权限
|
|
//获取校区权限
|
|
|
-func GetUserSchoolPerm(erpUserId string, rpcClient transformclient.Transform, engine *xorm.Engine) ([]*transform.OrganSchool, error) {
|
|
|
|
|
- ctx := context.Background()
|
|
|
|
|
|
|
+func GetUserSchoolPerm(erpUserId string, rpcClient transformclient.Transform, engine *xorm.Engine, ctx context.Context) ([]*transform.OrganSchool, error) {
|
|
|
in := erpUserId
|
|
in := erpUserId
|
|
|
result, err := rpcClient.GetErpOrganSchPerByUserId(ctx, &transform.GetErpOrganSchPerByUserIdReq{UserId: in})
|
|
result, err := rpcClient.GetErpOrganSchPerByUserId(ctx, &transform.GetErpOrganSchPerByUserIdReq{UserId: in})
|
|
|
if err != nil {
|
|
if err != nil {
|