作者 yangfu

当前登录组织修改

@@ -373,6 +373,12 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error @@ -373,6 +373,12 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
373 if err != nil { 373 if err != nil {
374 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 374 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
375 } 375 }
  376 + resultOrg, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
  377 + OrgId: int(operator.OrgId),
  378 + })
  379 + if err != nil {
  380 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  381 + }
376 var user = map[string]interface{}{ 382 var user = map[string]interface{}{
377 "userId": resultUser.UserId, 383 "userId": resultUser.UserId,
378 "userInfo": map[string]interface{}{ 384 "userInfo": map[string]interface{}{
@@ -389,7 +395,13 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error @@ -389,7 +395,13 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
389 "logo": resultUser.Company.Log, 395 "logo": resultUser.Company.Log,
390 }, 396 },
391 "im": resultUser.IM, 397 "im": resultUser.IM,
392 - "org": resultUser.Org, 398 + "org": map[string]interface{}{
  399 + "orgId": resultOrg.OrgID,
  400 + "orgName": resultOrg.OrgName,
  401 + "orgCode": resultOrg.OrgCode,
  402 + "companyId": resultOrg.CompanyID,
  403 + },
  404 + //"currentLoginOrg":resultUser.Org,
393 } 405 }
394 return user, nil 406 return user, nil
395 } 407 }
@@ -66,12 +66,12 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac @@ -66,12 +66,12 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac
66 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 66 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
67 } 67 }
68 data := dto.OrgItem{ 68 data := dto.OrgItem{
69 - OrgId: strconv.Itoa(result.Org.OrgID),  
70 - OrgName: result.Org.OrgName,  
71 - ParentId: strconv.Itoa(result.Org.ParentID),  
72 - IsOrg: result.Org.IsOrg,  
73 - OrgCode: result.Org.OrgCode,  
74 - ParentDepName: result.Org.Ext.ParentDepName, 69 + OrgId: strconv.Itoa(result.OrgID),
  70 + OrgName: result.OrgName,
  71 + ParentId: strconv.Itoa(result.ParentID),
  72 + IsOrg: result.IsOrg,
  73 + OrgCode: result.OrgCode,
  74 + ParentDepName: result.Ext.ParentDepName,
75 } 75 }
76 return data, nil 76 return data, nil
77 } 77 }
@@ -87,7 +87,6 @@ type ( @@ -87,7 +87,6 @@ type (
87 } 87 }
88 88
89 DataOrgGet struct { 89 DataOrgGet struct {
90 - Org struct {  
91 CompanyID int `json:"companyId"` 90 CompanyID int `json:"companyId"`
92 Ext struct { 91 Ext struct {
93 DepName string `json:"depName"` 92 DepName string `json:"depName"`
@@ -103,7 +102,7 @@ type ( @@ -103,7 +102,7 @@ type (
103 OrgStatus int `json:"orgStatus"` 102 OrgStatus int `json:"orgStatus"`
104 ParentID int `json:"parentId"` 103 ParentID int `json:"parentId"`
105 ParentPath string `json:"parentPath"` 104 ParentPath string `json:"parentPath"`
106 - } `json:"org"` 105 + //} `json:"org"`
107 } 106 }
108 ) 107 )
109 108