|
@@ -1803,6 +1803,7 @@ func (this *NewDialysisApiController) GetRoleName() {
|
1803
|
1803
|
|
1804
|
1804
|
app, _ := service.GetAppId(orgid)
|
1805
|
1805
|
name, err := service.GetRoleName(id, orgid, app.Id)
|
|
1806
|
+
|
1806
|
1807
|
|
1807
|
1808
|
admin, err := service.GetAdmin(id)
|
1808
|
1809
|
positionName, err := service.GetPositionName(id, orgid, app.Id)
|
|
@@ -1815,7 +1816,7 @@ func (this *NewDialysisApiController) GetRoleName() {
|
1815
|
1816
|
names = role.RoleName + "," + names
|
1816
|
1817
|
}
|
1817
|
1818
|
}
|
1818
|
|
- fmt.Println("role_ids--------------", role_ids)
|
|
1819
|
+
|
1819
|
1820
|
if err != nil {
|
1820
|
1821
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
1821
|
1822
|
return
|
|
@@ -2503,7 +2504,6 @@ func (this *NewDialysisApiController) SumitForm() {
|
2503
|
2504
|
}
|
2504
|
2505
|
|
2505
|
2506
|
func (this *NewDialysisApiController) GetMobile() {
|
2506
|
|
- fmt.Println("--------------触发了没有")
|
2507
|
2507
|
adminInfo := this.GetMobileAdminUserInfo()
|
2508
|
2508
|
id := adminInfo.AdminUser.Id
|
2509
|
2509
|
|
|
@@ -2521,13 +2521,38 @@ func (this *NewDialysisApiController) GetRolePosition() {
|
2521
|
2521
|
|
2522
|
2522
|
adminInfo := this.GetMobileAdminUserInfo()
|
2523
|
2523
|
cretor := adminInfo.AdminUser.Id
|
2524
|
|
- cretorPosition, err := service.GetRolePosition(cretor)
|
2525
|
|
- fmt.Println("cretorPosition", cretorPosition.RoleName)
|
|
2524
|
+ orgid := adminInfo.Org.Id
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+ role, err := service.GetAdminUserRole(cretor, orgid)
|
|
2528
|
+ fmt.Println("role----------------", role.RoleIds)
|
|
2529
|
+ role_ids := strings.Split(role.RoleIds, ",")
|
|
2530
|
+ var names = ""
|
|
2531
|
+ for _, item := range role_ids {
|
|
2532
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
2533
|
+ role, _ := service.GetRole(id)
|
|
2534
|
+ if len(role.RoleName) != 0 {
|
|
2535
|
+ names = role.RoleName + "," + names
|
|
2536
|
+ }
|
|
2537
|
+ }
|
|
2538
|
+ if err != nil {
|
|
2539
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2540
|
+ return
|
|
2541
|
+ }
|
|
2542
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2543
|
+ "names": names,
|
|
2544
|
+ })
|
|
2545
|
+}
|
|
2546
|
+
|
|
2547
|
+func (this *NewDialysisApiController) GetOrgs() {
|
|
2548
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
|
2549
|
+ fmt.Println("a---------")
|
|
2550
|
+ orgs, err := service.GetOrgs(adminInfo.AdminUser.Id)
|
2526
|
2551
|
if err != nil {
|
2527
|
2552
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
2528
|
2553
|
return
|
2529
|
2554
|
}
|
2530
|
2555
|
this.ServeSuccessJSON(map[string]interface{}{
|
2531
|
|
- "cretorPosition": cretorPosition,
|
|
2556
|
+ "orgs": orgs,
|
2532
|
2557
|
})
|
2533
|
2558
|
}
|