Quellcode durchsuchen

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

csx vor 4 Jahren
Ursprung
Commit
2691699a8e

+ 1 - 1
conf/app.conf Datei anzeigen

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

+ 20 - 1
controllers/new_mobile_api_controllers/home_api_controller.go Datei anzeigen

@@ -21,6 +21,7 @@ type HomeController struct {
21 21
 }
22 22
 
23 23
 func (this *HomeController) GetHomeData() {
24
+
24 25
 	adminUserInfo := this.GetMobileAdminUserInfo()
25 26
 	if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
26 27
 		//获取该管理员所有机构列表
@@ -72,13 +73,14 @@ func (this *HomeController) GetHomeData() {
72 73
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
73 74
 			return
74 75
 		}
75
-
76
+		cretor := adminUserInfo.AdminUser.Id
76 77
 		this.ServeSuccessJSON(map[string]interface{}{
77 78
 			"orgs":            orgs,
78 79
 			"apps":            apps,
79 80
 			"banners":         banners,
80 81
 			"isCreateOrg":     true,
81 82
 			"isSubSuperAdmin": isSubSuperAdmin,
83
+			"cretor":          cretor,
82 84
 		})
83 85
 	} else {
84 86
 		apps, err := service.GetAllApp(0)
@@ -713,3 +715,20 @@ func RemoveRepeatedPurviewElement2(arr []string) (newArr []string) {
713 715
 	}
714 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 Datei anzeigen

@@ -2501,3 +2501,18 @@ func (this *NewDialysisApiController) SumitForm() {
2501 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 Datei anzeigen

@@ -151,4 +151,5 @@ func NewMobileAPIControllersRegisterRouters() {
151 151
 	beego.Router("/m/api/patient/getmyinformationfour", &NewDialysisApiController{}, "Get:GetMyInformationFour")
152 152
 	beego.Router("/m/api/org/getMyMobile", &NewDialysisApiController{}, "Get:GetMyMobile")
153 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 Datei anzeigen

@@ -839,3 +839,23 @@ func (KyActivityTable) TableName() string {
839 839
 
840 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 Datei anzeigen

@@ -1086,3 +1086,9 @@ func CreateTable(table *models.KyActivityTable) error {
1086 1086
 	err := UserWriteDB().Model(&table).Create(&table).Error
1087 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
+}