|
@@ -11,17 +11,15 @@ type InitInfoService struct {
|
|
|
PositionType int64
|
|
|
MgoUserId string
|
|
|
EntId int64
|
|
|
- NewUserId int64
|
|
|
- AccountId int64
|
|
|
- PositionId int64
|
|
|
EntUserId int64
|
|
|
+ EntRole int64
|
|
|
+ PositionId int64
|
|
|
}
|
|
|
|
|
|
func (t *InitInfoService) UpdateInitInfo(company, business string) bool {
|
|
|
fool := false
|
|
|
if t.PositionType == 1 {
|
|
|
//企业
|
|
|
- userInfo := Middleground.PowerCheckCenter.Check("10000", t.MgoUserId, t.NewUserId, gconv.Int64(t.AccountId), t.EntId, t.PositionType, gconv.Int64(t.PositionId))
|
|
|
fool = Mgo.Update("ent_user", map[string]interface{}{
|
|
|
"i_entid": t.EntId,
|
|
|
"i_userid": t.EntUserId,
|
|
@@ -30,7 +28,7 @@ func (t *InitInfoService) UpdateInitInfo(company, business string) bool {
|
|
|
"is_init": true,
|
|
|
},
|
|
|
}, false, false)
|
|
|
- if userInfo.Ent.EntRoleId == 1 {
|
|
|
+ if t.EntRole == 1 {
|
|
|
//企业管理员
|
|
|
info, _ := json.Marshal(map[string]interface{}{
|
|
|
"company": company,
|
|
@@ -63,9 +61,8 @@ func (t *InitInfoService) FindInitInfo() map[string]interface{} {
|
|
|
}
|
|
|
if t.PositionType == 1 {
|
|
|
isInit := false
|
|
|
- userInfo := Middleground.PowerCheckCenter.Check("10000", t.MgoUserId, t.NewUserId, gconv.Int64(t.AccountId), t.EntId, t.PositionType, gconv.Int64(t.PositionId))
|
|
|
entUserInfo, _ := Mgo.FindOne("ent_user", map[string]interface{}{"i_entid": t.EntId, "i_userid": t.EntUserId})
|
|
|
- if userInfo != nil && len(*entUserInfo) > 0 {
|
|
|
+ if len(*entUserInfo) > 0 {
|
|
|
isInit = gconv.Bool((*entUserInfo)["is_init"])
|
|
|
returnJson["isInit"] = isInit
|
|
|
}
|
|
@@ -79,7 +76,7 @@ func (t *InitInfoService) FindInitInfo() map[string]interface{} {
|
|
|
returnJson["business"] = entMap["business"]
|
|
|
}
|
|
|
}
|
|
|
- if userInfo.Ent.EntRoleId == 1 {
|
|
|
+ if t.EntRole == 1 {
|
|
|
//企业管理员
|
|
|
returnJson["isUpdate"] = true
|
|
|
if !isInit {
|