Browse Source

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

csx 4 years ago
parent
commit
5167c8e971

+ 3 - 2
controllers/mobile_api_controllers/mobile_api_base_controller.go View File

66
 	//		this.StopRun()
66
 	//		this.StopRun()
67
 	//	}
67
 	//	}
68
 	//}
68
 	//}
69
-	if !adminUserInfo.AdminUser.IsSuperAdmin || adminUserInfo.AdminUser.Id != adminUserInfo.Org.Creator {
70
 
69
 
71
-		if this.Ctx.Request.Header.Get("Permission") == "1" {
70
+	if this.Ctx.Request.Header.Get("Permission") == "1" {
71
+		if !adminUserInfo.AdminUser.IsSuperAdmin || adminUserInfo.AdminUser.Id != adminUserInfo.Org.Creator {
72
+
72
 			isPermission := false
73
 			isPermission := false
73
 			adminUserInfo := this.GetMobileAdminUserInfo()
74
 			adminUserInfo := this.GetMobileAdminUserInfo()
74
 			//该机构下该用户有多少个
75
 			//该机构下该用户有多少个

+ 2 - 2
controllers/new_mobile_api_controllers/home_api_controller.go View File

335
 		ModifyTime:   time.Now().Unix(),
335
 		ModifyTime:   time.Now().Unix(),
336
 	}
336
 	}
337
 
337
 
338
-	createErr := service.CreateOrg(org, adminUser.Mobile, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
338
+	createErr := service.CreateOrg(org, adminUser.Name, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
339
 
339
 
340
 	if createErr != nil {
340
 	if createErr != nil {
341
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
341
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
348
 		//初始化透析方案
348
 		//初始化透析方案
349
 		InitSystemPrescrption(org)
349
 		InitSystemPrescrption(org)
350
 		//初始化医嘱模版
350
 		//初始化医嘱模版
351
-		InitAdviceTemplate(org)
351
+		//InitAdviceTemplate(org)
352
 		//初始化角色和权限
352
 		//初始化角色和权限
353
 		InitRoleAndPurviews(org)
353
 		InitRoleAndPurviews(org)
354
 		//初始化设备管理
354
 		//初始化设备管理

+ 2 - 2
service/orginfo_service.go View File

31
 	return
31
 	return
32
 }
32
 }
33
 
33
 
34
-func CreateOrg(org *models.Org, mobile string, openXT bool, openCDM bool, openSCRM bool, openMall bool) error {
34
+func CreateOrg(org *models.Org, name string, openXT bool, openCDM bool, openSCRM bool, openMall bool) error {
35
 	now := time.Now()
35
 	now := time.Now()
36
 	tx_admin := writeUserDb.Begin()
36
 	tx_admin := writeUserDb.Begin()
37
 	if err := tx_admin.Create(org).Error; err != nil {
37
 	if err := tx_admin.Create(org).Error; err != nil {
55
 	}
55
 	}
56
 
56
 
57
 	// app 的创建顺序也决定了登录后前往 app 的优先级
57
 	// app 的创建顺序也决定了登录后前往 app 的优先级
58
-	if err := createOrgApp(tx_admin, &role, mobile, 3, openXT); err != nil {
58
+	if err := createOrgApp(tx_admin, &role, name, 3, openXT); err != nil {
59
 		tx_admin.Rollback()
59
 		tx_admin.Rollback()
60
 		return err
60
 		return err
61
 	}
61
 	}