ソースを参照

Merge branch 'master' of http://git.shengws.com/csx/XT_New

csx 4 年 前
コミット
2691699a8e

+ 1 - 1
conf/app.conf ファイルの表示

1
 appname = 血透
1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3
 runmode = dev
3
 runmode = dev
4
 
4
 
5
 
5
 

+ 20 - 1
controllers/new_mobile_api_controllers/home_api_controller.go ファイルの表示

21
 }
21
 }
22
 
22
 
23
 func (this *HomeController) GetHomeData() {
23
 func (this *HomeController) GetHomeData() {
24
+
24
 	adminUserInfo := this.GetMobileAdminUserInfo()
25
 	adminUserInfo := this.GetMobileAdminUserInfo()
25
 	if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
26
 	if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
26
 		//获取该管理员所有机构列表
27
 		//获取该管理员所有机构列表
72
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
73
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
73
 			return
74
 			return
74
 		}
75
 		}
75
-
76
+		cretor := adminUserInfo.AdminUser.Id
76
 		this.ServeSuccessJSON(map[string]interface{}{
77
 		this.ServeSuccessJSON(map[string]interface{}{
77
 			"orgs":            orgs,
78
 			"orgs":            orgs,
78
 			"apps":            apps,
79
 			"apps":            apps,
79
 			"banners":         banners,
80
 			"banners":         banners,
80
 			"isCreateOrg":     true,
81
 			"isCreateOrg":     true,
81
 			"isSubSuperAdmin": isSubSuperAdmin,
82
 			"isSubSuperAdmin": isSubSuperAdmin,
83
+			"cretor":          cretor,
82
 		})
84
 		})
83
 	} else {
85
 	} else {
84
 		apps, err := service.GetAllApp(0)
86
 		apps, err := service.GetAllApp(0)
713
 	}
715
 	}
714
 	return
716
 	return
715
 }
717
 }
718
+
719
+func RemoveRepeatedOrgElementTwo(orgs []*models.SgjUserOrg) (newOrgs []*models.SgjUserOrg) {
720
+	newOrgs = make([]*models.SgjUserOrg, 0)
721
+	for i := 0; i < len(orgs); i++ {
722
+		repeat := false
723
+		for j := i + 1; j < len(orgs); j++ {
724
+			if orgs[i].ID == orgs[j].ID {
725
+				repeat = true
726
+				break
727
+			}
728
+		}
729
+		if !repeat {
730
+			newOrgs = append(newOrgs, orgs[i])
731
+		}
732
+	}
733
+	return
734
+}

+ 15 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go ファイルの表示

2501
 		return
2501
 		return
2502
 	}
2502
 	}
2503
 }
2503
 }
2504
+
2505
+func (this *NewDialysisApiController) GetRolePosition() {
2506
+
2507
+	adminInfo := this.GetAdminUserInfo()
2508
+	cretor := adminInfo.AdminUser.Id
2509
+	cretorPosition, err := service.GetRolePosition(cretor)
2510
+	fmt.Println("cretorPosition", cretorPosition.RoleName)
2511
+	if err != nil {
2512
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2513
+		return
2514
+	}
2515
+	this.ServeSuccessJSON(map[string]interface{}{
2516
+		"cretorPosition": cretorPosition,
2517
+	})
2518
+}

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go ファイルの表示

151
 	beego.Router("/m/api/patient/getmyinformationfour", &NewDialysisApiController{}, "Get:GetMyInformationFour")
151
 	beego.Router("/m/api/patient/getmyinformationfour", &NewDialysisApiController{}, "Get:GetMyInformationFour")
152
 	beego.Router("/m/api/org/getMyMobile", &NewDialysisApiController{}, "Get:GetMyMobile")
152
 	beego.Router("/m/api/org/getMyMobile", &NewDialysisApiController{}, "Get:GetMyMobile")
153
 	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
153
 	beego.Router("/m/api/patient/sumitform", &NewDialysisApiController{}, "Get:SumitForm")
154
+	beego.Router("/m/api/patient/getroleposition", &NewDialysisApiController{}, "Get:GetRolePosition")
154
 }
155
 }

+ 20 - 0
models/patient_models.go ファイルの表示

839
 
839
 
840
 	return "ky_activity_table"
840
 	return "ky_activity_table"
841
 }
841
 }
842
+
843
+type SgjUserRole struct {
844
+	ID               int64  `gorm:"column:id" json:"id" form:"id"`
845
+	RoleName         string `gorm:"column:role_name" json:"role_name" form:"role_name"`
846
+	RoleIntroduction string `gorm:"column:role_introduction" json:"role_introduction" form:"role_introduction"`
847
+	Creator          int64  `gorm:"column:creator" json:"creator" form:"creator"`
848
+	OrgId            int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
849
+	AppId            int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
850
+	IsSuperAdmin     int64  `gorm:"column:is_super_admin" json:"is_super_admin" form:"is_super_admin"`
851
+	Status           int64  `gorm:"column:status" json:"status" form:"status"`
852
+	Ctime            int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
853
+	Mtime            int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
854
+	Number           int64  `gorm:"column:number" json:"number" form:"number"`
855
+	IsSystem         int64  `gorm:"column:is_system" json:"is_system" form:"is_system"`
856
+}
857
+
858
+func (SgjUserRole) TableName() string {
859
+
860
+	return "sgj_user_role"
861
+}

+ 6 - 0
service/manage_service.go ファイルの表示

1086
 	err := UserWriteDB().Model(&table).Create(&table).Error
1086
 	err := UserWriteDB().Model(&table).Create(&table).Error
1087
 	return err
1087
 	return err
1088
 }
1088
 }
1089
+
1090
+func GetRolePosition(id int64) (models.SgjUserRole, error) {
1091
+	role := models.SgjUserRole{}
1092
+	err := UserReadDB().Where("id = ? And status =1", id).Find(&role).Error
1093
+	return role, err
1094
+}