瀏覽代碼

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

XMLWAN 5 年之前
父節點
當前提交
fb614518f7

+ 14 - 1
controllers/new_mobile_api_controllers/home_api_controller.go 查看文件

17
 
17
 
18
 func (this *HomeController) GetHomeData() {
18
 func (this *HomeController) GetHomeData() {
19
 	adminUserInfo := this.GetMobileAdminUserInfo()
19
 	adminUserInfo := this.GetMobileAdminUserInfo()
20
-	if adminUserInfo.Org != nil {
20
+	if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
21
 		//获取该管理员所有机构列表
21
 		//获取该管理员所有机构列表
22
 		var orgs []*models.Org
22
 		var orgs []*models.Org
23
 		adminUser, err := service.GetHomeData(adminUserInfo.AdminUser.Id)
23
 		adminUser, err := service.GetHomeData(adminUserInfo.AdminUser.Id)
54
 			"isCreateOrg": true,
54
 			"isCreateOrg": true,
55
 		})
55
 		})
56
 	} else {
56
 	} else {
57
+		apps, err := service.GetAllApp(0)
58
+		if err != nil {
59
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
60
+			return
61
+		}
62
+		banners, err := service.GetSystemBanner()
63
+		if err != nil {
64
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
65
+			return
66
+		}
67
+
57
 		this.ServeSuccessJSON(map[string]interface{}{
68
 		this.ServeSuccessJSON(map[string]interface{}{
58
 			"isCreateOrg": false,
69
 			"isCreateOrg": false,
70
+			"apps":        apps,
71
+			"banners":     banners,
59
 		})
72
 		})
60
 	}
73
 	}
61
 
74
 

+ 3 - 3
controllers/new_mobile_api_controllers/mobile_regist_controller.go 查看文件

234
 		//初始化透析方案
234
 		//初始化透析方案
235
 		InitSystemPrescrption(org)
235
 		InitSystemPrescrption(org)
236
 		//初始化医嘱模版
236
 		//初始化医嘱模版
237
-		InitAdviceTemplate(org)
237
+		//InitAdviceTemplate(org)
238
 		//初始化角色和权限
238
 		//初始化角色和权限
239
 
239
 
240
 		//初始化设备管理
240
 		//初始化设备管理
669
 	}
669
 	}
670
 	service.CreateVMSchTemplateId(templaeIdTwo)
670
 	service.CreateVMSchTemplateId(templaeIdTwo)
671
 	//3.创建单周排班模版
671
 	//3.创建单周排班模版
672
-	items := LoadSchTemplateConfig("./schedule_template.json").ScheduleTemplateItem
672
+	items := LoadSchTemplateConfig("./schedule_template.json").Item
673
 	for _, item := range items {
673
 	for _, item := range items {
674
 		if item.TimeType == 1 {
674
 		if item.TimeType == 1 {
675
 			item.OrgId = org.Id
675
 			item.OrgId = org.Id
753
 }
753
 }
754
 
754
 
755
 type SchTemplateConfig struct {
755
 type SchTemplateConfig struct {
756
-	ScheduleTemplateItem []*models.VMPatientScheduleTemplateItem "json:item"
756
+	Item []*models.VMPatientScheduleTemplateItem "json:item"
757
 }
757
 }
758
 
758
 
759
 type PrescriptionConfig struct {
759
 type PrescriptionConfig struct {

+ 11 - 6
controllers/new_mobile_api_controllers/new_login_api_controller.go 查看文件

22
 }
22
 }
23
 
23
 
24
 func (this *NewLoginApiController) GetLogin() {
24
 func (this *NewLoginApiController) GetLogin() {
25
-
26
 	token_cookie := this.Ctx.GetCookie("token_cookie")
25
 	token_cookie := this.Ctx.GetCookie("token_cookie")
27
 	if len(token_cookie) == 0 {
26
 	if len(token_cookie) == 0 {
28
 		this.ServeSuccessJSON(map[string]interface{}{
27
 		this.ServeSuccessJSON(map[string]interface{}{
316
 					"city":           org.City,
315
 					"city":           org.City,
317
 					"district":       org.District,
316
 					"district":       org.District,
318
 					"address":        org.Address,
317
 					"address":        org.Address,
318
+					"creator":        org.Creator,
319
 				},
319
 				},
320
 				"subscibe": map[string]interface{}{
320
 				"subscibe": map[string]interface{}{
321
 					"id":           subscibe.ID,
321
 					"id":           subscibe.ID,
487
 							"city":           org.City,
487
 							"city":           org.City,
488
 							"district":       org.District,
488
 							"district":       org.District,
489
 							"address":        org.Address,
489
 							"address":        org.Address,
490
+							"creator":        org.Creator,
490
 						},
491
 						},
491
 						"subscibe": map[string]interface{}{
492
 						"subscibe": map[string]interface{}{
492
 							"id":           subscibe.ID,
493
 							"id":           subscibe.ID,
511
 func (this *NewLoginApiController) GetCode() {
512
 func (this *NewLoginApiController) GetCode() {
512
 	mobile := this.GetString("phone")
513
 	mobile := this.GetString("phone")
513
 	aespass := this.GetString("aespass")
514
 	aespass := this.GetString("aespass")
515
+	types, _ := this.GetInt("type", 0)
516
+
514
 	utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
517
 	utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
515
 	if utils.CellPhoneRegexp().MatchString(mobile) == false {
518
 	if utils.CellPhoneRegexp().MatchString(mobile) == false {
516
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
519
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
518
 		return
521
 		return
519
 	}
522
 	}
520
 
523
 
521
-	adminUser, _ := service.GetValidAdminUserByMobileReturnErr(mobile)
522
-	if adminUser != nil {
523
-		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRegisterExist)
524
-		this.ServeJSON()
525
-		return
524
+	if types == 1 {
525
+		adminUser, _ := service.GetValidAdminUserByMobileReturnErr(mobile)
526
+		if adminUser != nil {
527
+			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRegisterExist)
528
+			this.ServeJSON()
529
+			return
530
+		}
526
 	}
531
 	}
527
 	//this.Data["json"] = enums.MakeSuccessResponseJSON(map[string]interface{}{
532
 	//this.Data["json"] = enums.MakeSuccessResponseJSON(map[string]interface{}{
528
 	//	"msg": "短信发送成功,有效期为10分钟",
533
 	//	"msg": "短信发送成功,有效期为10分钟",

+ 2 - 2
models/vm_models.go 查看文件

215
 }
215
 }
216
 
216
 
217
 func (VMPatientScheduleTemplateItem) TableName() string {
217
 func (VMPatientScheduleTemplateItem) TableName() string {
218
-	return "xt_patient_schedule_template_id"
218
+	return "xt_patient_schedule_template_item"
219
 }
219
 }
220
 
220
 
221
 type VMPatientScheduleTemplateMode struct {
221
 type VMPatientScheduleTemplateMode struct {
229
 }
229
 }
230
 
230
 
231
 func (VMPatientScheduleTemplateMode) TableName() string {
231
 func (VMPatientScheduleTemplateMode) TableName() string {
232
-	return "xt_patient_schedule_template_id"
232
+	return "xt_patient_schedule_template_mode"
233
 }
233
 }

+ 3 - 3
service/orginfo_service.go 查看文件

115
 			ModifyTime: now,
115
 			ModifyTime: now,
116
 			Name:       item.Name,
116
 			Name:       item.Name,
117
 			Url:        item.Url,
117
 			Url:        item.Url,
118
-			Order:      item.Order,
118
+			Number:     item.Number,
119
 			Pid:        0,
119
 			Pid:        0,
120
 		}
120
 		}
121
 		writeUserDb.Create(&app)
121
 		writeUserDb.Create(&app)
135
 				ModifyTime: now,
135
 				ModifyTime: now,
136
 				Name:       subItem.Name,
136
 				Name:       subItem.Name,
137
 				Url:        subItem.Url,
137
 				Url:        subItem.Url,
138
-				Order:      subItem.Order,
138
+				Number:     subItem.Number,
139
 				Pid:        app.ID,
139
 				Pid:        app.ID,
140
 			}
140
 			}
141
 			writeUserDb.Create(&app)
141
 			writeUserDb.Create(&app)
179
 	Name       string      `gorm:"column:name" json:"name" form:"name"`
179
 	Name       string      `gorm:"column:name" json:"name" form:"name"`
180
 	Url        string      `gorm:"column:url" json:"url" form:"url"`
180
 	Url        string      `gorm:"column:url" json:"url" form:"url"`
181
 	Pid        int64       `gorm:"column:pid" json:"pid" form:"pid"`
181
 	Pid        int64       `gorm:"column:pid" json:"pid" form:"pid"`
182
-	Order      int64       `gorm:"column:order" json:"order" form:"order"`
182
+	Number     int64       `gorm:"column:number" json:"order" form:"number"`
183
 	VMOrgApp   []*VMOrgApp `gorm:"ForeignKey:Pid;AssociationForeignKey:Id" `
183
 	VMOrgApp   []*VMOrgApp `gorm:"ForeignKey:Pid;AssociationForeignKey:Id" `
184
 }
184
 }
185
 
185