Browse Source

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

csx 5 years ago
parent
commit
ab4ef9c598

+ 1 - 1
conf/app.conf View File

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

+ 14 - 1
controllers/new_mobile_api_controllers/home_api_controller.go View File

@@ -17,7 +17,7 @@ type HomeController struct {
17 17
 
18 18
 func (this *HomeController) GetHomeData() {
19 19
 	adminUserInfo := this.GetMobileAdminUserInfo()
20
-	if adminUserInfo.Org != nil {
20
+	if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
21 21
 		//获取该管理员所有机构列表
22 22
 		var orgs []*models.Org
23 23
 		adminUser, err := service.GetHomeData(adminUserInfo.AdminUser.Id)
@@ -54,8 +54,21 @@ func (this *HomeController) GetHomeData() {
54 54
 			"isCreateOrg": true,
55 55
 		})
56 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 68
 		this.ServeSuccessJSON(map[string]interface{}{
58 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 View File

@@ -234,7 +234,7 @@ func (this *MobileRegistController) CreateOrg() {
234 234
 		//初始化透析方案
235 235
 		InitSystemPrescrption(org)
236 236
 		//初始化医嘱模版
237
-		InitAdviceTemplate(org)
237
+		//InitAdviceTemplate(org)
238 238
 		//初始化角色和权限
239 239
 
240 240
 		//初始化设备管理
@@ -655,7 +655,7 @@ func InitPatientAndSchedule(org *models.Org) {
655 655
 	}
656 656
 	service.CreateVMSchTemplateId(templaeIdTwo)
657 657
 	//3.创建单周排班模版
658
-	items := LoadSchTemplateConfig("./schedule_template.json").ScheduleTemplateItem
658
+	items := LoadSchTemplateConfig("./schedule_template.json").Item
659 659
 	for _, item := range items {
660 660
 		if item.TimeType == 1 {
661 661
 			item.OrgId = org.Id
@@ -739,7 +739,7 @@ type PatientConfig struct {
739 739
 }
740 740
 
741 741
 type SchTemplateConfig struct {
742
-	ScheduleTemplateItem []*models.VMPatientScheduleTemplateItem "json:item"
742
+	Item []*models.VMPatientScheduleTemplateItem "json:item"
743 743
 }
744 744
 
745 745
 type PrescriptionConfig struct {

+ 11 - 6
controllers/new_mobile_api_controllers/new_login_api_controller.go View File

@@ -22,7 +22,6 @@ type NewLoginApiController struct {
22 22
 }
23 23
 
24 24
 func (this *NewLoginApiController) GetLogin() {
25
-
26 25
 	token_cookie := this.Ctx.GetCookie("token_cookie")
27 26
 	if len(token_cookie) == 0 {
28 27
 		this.ServeSuccessJSON(map[string]interface{}{
@@ -316,6 +315,7 @@ func (this *NewLoginApiController) LoginByCs() {
316 315
 					"city":           org.City,
317 316
 					"district":       org.District,
318 317
 					"address":        org.Address,
318
+					"creator":        org.Creator,
319 319
 				},
320 320
 				"subscibe": map[string]interface{}{
321 321
 					"id":           subscibe.ID,
@@ -487,6 +487,7 @@ func (this *NewLoginApiController) LoginByCs() {
487 487
 							"city":           org.City,
488 488
 							"district":       org.District,
489 489
 							"address":        org.Address,
490
+							"creator":        org.Creator,
490 491
 						},
491 492
 						"subscibe": map[string]interface{}{
492 493
 							"id":           subscibe.ID,
@@ -511,6 +512,8 @@ func (this *NewLoginApiController) LoginByCs() {
511 512
 func (this *NewLoginApiController) GetCode() {
512 513
 	mobile := this.GetString("phone")
513 514
 	aespass := this.GetString("aespass")
515
+	types, _ := this.GetInt("type", 0)
516
+
514 517
 	utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
515 518
 	if utils.CellPhoneRegexp().MatchString(mobile) == false {
516 519
 		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
@@ -518,11 +521,13 @@ func (this *NewLoginApiController) GetCode() {
518 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 532
 	//this.Data["json"] = enums.MakeSuccessResponseJSON(map[string]interface{}{
528 533
 	//	"msg": "短信发送成功,有效期为10分钟",

+ 2 - 2
models/vm_models.go View File

@@ -215,7 +215,7 @@ type VMPatientScheduleTemplateItem struct {
215 215
 }
216 216
 
217 217
 func (VMPatientScheduleTemplateItem) TableName() string {
218
-	return "xt_patient_schedule_template_id"
218
+	return "xt_patient_schedule_template_item"
219 219
 }
220 220
 
221 221
 type VMPatientScheduleTemplateMode struct {
@@ -229,5 +229,5 @@ type VMPatientScheduleTemplateMode struct {
229 229
 }
230 230
 
231 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 View File

@@ -115,7 +115,7 @@ func createOrgApp(tx *gorm.DB, superAdminRole *models.Role, userName string, app
115 115
 			ModifyTime: now,
116 116
 			Name:       item.Name,
117 117
 			Url:        item.Url,
118
-			Order:      item.Order,
118
+			Number:     item.Number,
119 119
 			Pid:        0,
120 120
 		}
121 121
 		writeUserDb.Create(&app)
@@ -135,7 +135,7 @@ func createOrgApp(tx *gorm.DB, superAdminRole *models.Role, userName string, app
135 135
 				ModifyTime: now,
136 136
 				Name:       subItem.Name,
137 137
 				Url:        subItem.Url,
138
-				Order:      subItem.Order,
138
+				Number:     subItem.Number,
139 139
 				Pid:        app.ID,
140 140
 			}
141 141
 			writeUserDb.Create(&app)
@@ -179,7 +179,7 @@ type VMOrgApp struct {
179 179
 	Name       string      `gorm:"column:name" json:"name" form:"name"`
180 180
 	Url        string      `gorm:"column:url" json:"url" form:"url"`
181 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 183
 	VMOrgApp   []*VMOrgApp `gorm:"ForeignKey:Pid;AssociationForeignKey:Id" `
184 184
 }
185 185