|
@@ -1772,14 +1772,24 @@ func (this *NewDialysisApiController) GetOrgName() {
|
1772
|
1772
|
func (this *NewDialysisApiController) GetRoleName() {
|
1773
|
1773
|
id, _ := this.GetInt64("id")
|
1774
|
1774
|
fmt.Println("id", id)
|
1775
|
|
- orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1775
|
+ orgid, _ := this.GetInt64("orgid")
|
1776
|
1776
|
fmt.Println("orgid", orgid)
|
1777
|
|
- appid := this.GetMobileAdminUserInfo().App.Id
|
1778
|
|
- fmt.Println("appid", appid)
|
1779
|
|
- name, err := service.GetRoleName(id, orgid, appid)
|
|
1777
|
+ //跟剧机构ID获取APPID
|
|
1778
|
+ app, _ := service.GetAppId(orgid)
|
|
1779
|
+ name, err := service.GetRoleName(id, orgid, app.Id)
|
1780
|
1780
|
//获取管理员
|
1781
|
1781
|
admin, err := service.GetAdmin(id)
|
1782
|
|
- positionName, err := service.GetPositionName(id, orgid, appid)
|
|
1782
|
+ positionName, err := service.GetPositionName(id, orgid, app.Id)
|
|
1783
|
+ role_ids := strings.Split(positionName.RoleIds, ",")
|
|
1784
|
+ var names = ""
|
|
1785
|
+ for _, item := range role_ids {
|
|
1786
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1787
|
+ role, _ := service.GetRole(id)
|
|
1788
|
+ if len(role.RoleName) != 0 {
|
|
1789
|
+ names = role.RoleName + "," + names
|
|
1790
|
+ }
|
|
1791
|
+ }
|
|
1792
|
+ fmt.Println("role_ids--------------", role_ids)
|
1783
|
1793
|
if err != nil {
|
1784
|
1794
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
1785
|
1795
|
return
|
|
@@ -1788,6 +1798,7 @@ func (this *NewDialysisApiController) GetRoleName() {
|
1788
|
1798
|
"name": name,
|
1789
|
1799
|
"positionName": positionName,
|
1790
|
1800
|
"admin": admin,
|
|
1801
|
+ "names": names,
|
1791
|
1802
|
})
|
1792
|
1803
|
}
|
1793
|
1804
|
|
|
@@ -2382,3 +2393,15 @@ func (this *NewDialysisApiController) GetCurrentOrg() {
|
2382
|
2393
|
"signToken": signToken,
|
2383
|
2394
|
})
|
2384
|
2395
|
}
|
|
2396
|
+
|
|
2397
|
+func (this *NewDialysisApiController) GetMyMobile() {
|
|
2398
|
+ id, _ := this.GetInt64("id")
|
|
2399
|
+ mobile, err := service.GetMyMobile(id)
|
|
2400
|
+ if err != nil {
|
|
2401
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2402
|
+ return
|
|
2403
|
+ }
|
|
2404
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2405
|
+ "mobile": mobile,
|
|
2406
|
+ })
|
|
2407
|
+}
|