Przeglądaj źródła

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

XMLWAN 5 lat temu
rodzic
commit
a24f99ae53

+ 9 - 26
controllers/new_mobile_api_controllers/home_api_controller.go Wyświetl plik

143
 		appRole = tempRole
143
 		appRole = tempRole
144
 		app = tempApp
144
 		app = tempApp
145
 
145
 
146
-		if org != nil && appRole != nil {
147
-			// 插入一条登录记录
148
-			ip := this.GetString("ip")
149
-			loginLog := &models.AdminUserLoginLog{
150
-				AdminUserId: adminUser.Id,
151
-				OrgId:       org.Id,
152
-				AppId:       appRole.AppId,
153
-				IP:          ip,
154
-				OperateType: 3,
155
-				AppType:     int8(3),
156
-				CreateTime:  time.Now().Unix(),
157
-			}
158
-			if insertErr := service.InsertLoginLog(loginLog); insertErr != nil {
159
-				utils.ErrorLog("为手机号为%v的用户插入一条登录记录失败:%v", mobile, insertErr)
160
-			}
161
-		}
162
-
163
 		templateInfo, _ := service.GetOrgInfoTemplate(org.Id)
146
 		templateInfo, _ := service.GetOrgInfoTemplate(org.Id)
164
 
147
 
165
 		mobileAdminUserInfo := &mobile_api_controllers.MobileAdminUserInfo{
148
 		mobileAdminUserInfo := &mobile_api_controllers.MobileAdminUserInfo{
224
 	adminUserInfo := this.GetMobileAdminUserInfo()
207
 	adminUserInfo := this.GetMobileAdminUserInfo()
225
 	adminUser := adminUserInfo.AdminUser
208
 	adminUser := adminUserInfo.AdminUser
226
 
209
 
227
-	if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
228
-		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
229
-		this.ServeJSON()
230
-		return
231
-	} else if didCreateOrg {
232
-		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
233
-		this.ServeJSON()
234
-		return
235
-	}
210
+	//if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
211
+	//	this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
212
+	//	this.ServeJSON()
213
+	//	return
214
+	//} else if didCreateOrg {
215
+	//	this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
216
+	//	this.ServeJSON()
217
+	//	return
218
+	//}
236
 
219
 
237
 	name := this.GetString("org_name")
220
 	name := this.GetString("org_name")
238
 	shortName := name
221
 	shortName := name

+ 19 - 12
controllers/new_mobile_api_controllers/mobile_regist_controller.go Wyświetl plik

125
 	}
125
 	}
126
 	adminUser := adminUserObj.(*models.AdminUser)
126
 	adminUser := adminUserObj.(*models.AdminUser)
127
 
127
 
128
-	if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
129
-		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
130
-		this.ServeJSON()
131
-		return
132
-	} else if didCreateOrg {
133
-		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
134
-		this.ServeJSON()
135
-		return
136
-	}
128
+	//if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
129
+	//	this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
130
+	//	this.ServeJSON()
131
+	//	return
132
+	//} else if didCreateOrg {
133
+	//	this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
134
+	//	this.ServeJSON()
135
+	//	return
136
+	//}
137
 
137
 
138
 	name := this.GetString("org_name")
138
 	name := this.GetString("org_name")
139
 	shortName := name
139
 	shortName := name
602
 
602
 
603
 	//创建两个虚拟病人本周的排班
603
 	//创建两个虚拟病人本周的排班
604
 	//stime, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
604
 	//stime, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
605
-	for _, date := range dates {
605
+	for week_type, date := range dates {
606
 		for index, id := range ids {
606
 		for index, id := range ids {
607
 			if index == 0 {
607
 			if index == 0 {
608
 				sch := &models.VMSchedule{
608
 				sch := &models.VMSchedule{
612
 					PatientId:    id,
612
 					PatientId:    id,
613
 					ScheduleDate: date,
613
 					ScheduleDate: date,
614
 					ScheduleType: 1,
614
 					ScheduleType: 1,
615
-					ScheduleWeek: int64(time.Now().Weekday()),
615
+					ScheduleWeek: int64(week_type + 1),
616
 					ModeId:       1,
616
 					ModeId:       1,
617
 					Status:       1,
617
 					Status:       1,
618
 					CreatedTime:  time.Now().Unix(),
618
 					CreatedTime:  time.Now().Unix(),
630
 					PatientId:    id,
630
 					PatientId:    id,
631
 					ScheduleDate: date,
631
 					ScheduleDate: date,
632
 					ScheduleType: 2,
632
 					ScheduleType: 2,
633
-					ScheduleWeek: int64(time.Now().Weekday()),
633
+					ScheduleWeek: int64(week_type + 1),
634
 					ModeId:       1,
634
 					ModeId:       1,
635
 					Status:       1,
635
 					Status:       1,
636
 					CreatedTime:  time.Now().Unix(),
636
 					CreatedTime:  time.Now().Unix(),
676
 			item.TemplateId = templaeIdOne.ID
676
 			item.TemplateId = templaeIdOne.ID
677
 			item.DeviceNumberId = vmDeviceNumber1.ID
677
 			item.DeviceNumberId = vmDeviceNumber1.ID
678
 			item.PatientId = ids[0]
678
 			item.PatientId = ids[0]
679
+			item.Status = 1
680
+			item.Ctime = time.Now().Unix()
681
+			item.Mtime = time.Now().Unix()
679
 
682
 
680
 		} else if item.TimeType == 2 {
683
 		} else if item.TimeType == 2 {
681
 			item.OrgId = org.Id
684
 			item.OrgId = org.Id
682
 			item.TemplateId = templaeIdOne.ID
685
 			item.TemplateId = templaeIdOne.ID
683
 			item.DeviceNumberId = vmDeviceNumber2.ID
686
 			item.DeviceNumberId = vmDeviceNumber2.ID
684
 			item.PatientId = ids[1]
687
 			item.PatientId = ids[1]
688
+			item.Status = 1
689
+			item.Ctime = time.Now().Unix()
690
+			item.Mtime = time.Now().Unix()
691
+
685
 		}
692
 		}
686
 
693
 
687
 		service.CreateVMSchTemplate(item)
694
 		service.CreateVMSchTemplate(item)

+ 7 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go Wyświetl plik

33
 	beego.Router("/m/api/changeorg", &HomeController{}, "post:ChangeOrg")
33
 	beego.Router("/m/api/changeorg", &HomeController{}, "post:ChangeOrg")
34
 	beego.Router("/m/api/createOrg", &HomeController{}, "post:CreateOrg")
34
 	beego.Router("/m/api/createOrg", &HomeController{}, "post:CreateOrg")
35
 
35
 
36
+	beego.Router("/m/api/staff", &NewRoleApiController{}, "get:GetAllOrgUser")
37
+	//beego.Router("/m/api/staff/edit", &NewRoleApiController{}, "post:EditAdmin")
38
+	//beego.Router("/m/api/staff/init", &NewRoleApiController{}, "get:GetEditAdminInitData")
39
+	//beego.Router("/m/api/staff/get", &NewRoleApiController{}, "get:GetAdminUserInfo")
40
+	//beego.Router("/m/api/staff/stop", &NewRoleApiController{}, "post:StopAdminUser")
41
+	//beego.Router("/m/api/staff/create", &NewRoleApiController{}, "post:CreateAdminUser")
42
+
36
 	beego.Router("/m/api/patient/getbloodpatientinfo", &NewDialysisApiController{}, "Get:GetBloodPatientInfo")
43
 	beego.Router("/m/api/patient/getbloodpatientinfo", &NewDialysisApiController{}, "Get:GetBloodPatientInfo")
37
 	beego.Router("/m/api/patient/getslowpatientinfo", &NewDialysisApiController{}, "Get:GetSlowPatientInfo")
44
 	beego.Router("/m/api/patient/getslowpatientinfo", &NewDialysisApiController{}, "Get:GetSlowPatientInfo")
38
 	beego.Router("/m/api/patient/getmemberpatientinfo", &NewDialysisApiController{}, "Get:GetMemberpatientInfo")
45
 	beego.Router("/m/api/patient/getmemberpatientinfo", &NewDialysisApiController{}, "Get:GetMemberpatientInfo")

+ 47 - 11
controllers/new_mobile_api_controllers/new_role_api_controller.go Wyświetl plik

16
 	})
16
 	})
17
 
17
 
18
 }
18
 }
19
-func (this *NewRoleApiController) CreateOrgUser() {
20
 
19
 
21
-}
22
-func (this *NewRoleApiController) ModifyOrgUser() {
23
-
24
-}
25
-func (this *NewRoleApiController) GetOrgRole() {
26
-
27
-}
28
-func (this *NewRoleApiController) CreateOrgRole() {
29
-
30
-}
20
+//func (this *NewRoleApiController) EditAdmin() {
21
+//	adminUserInfo := this.GetMobileAdminUserInfo()
22
+//	adminUserId, _ := this.GetInt64("uid")
23
+//	name := this.GetString("name")
24
+//	userTitle := this.GetString("title")
25
+//	roleIds  := this.GetString("role_ids")
26
+//
27
+//	if adminUserId <= 0 || len(name) == 0   || len(roleIds) <= 0 {
28
+//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
29
+//		return
30
+//	}
31
+//
32
+//	appRole, getAppRoleErr := service.GetAppRole(adminUserInfo.Org.Id, adminUserInfo.App.Id, adminUserId)
33
+//	if getAppRoleErr != nil {
34
+//		//beego.Error("查询管理员信息时失败:", getAppRoleErr)
35
+//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
36
+//		return
37
+//	}
38
+//
39
+//	if appRole == nil {
40
+//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdminUserNotExist)
41
+//		return
42
+//	}
43
+//
44
+//	appRole.UserName = name
45
+//	appRole.UserType = int8(userType)
46
+//	appRole.UserTitle = int8(userTitle)
47
+//	appRole.RoleId = roleId
48
+//	appRole.Intro = intro
49
+//	appRole.ModifyTime = time.Now().Unix()
50
+//	saveErr := service.SaveAppRole(appRole)
51
+//	if saveErr != nil {
52
+//		//beego.Error("修改App_Role失败:", saveErr)
53
+//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
54
+//
55
+//	} else {
56
+//		this.ServeSuccessJSON(nil)
57
+//	}
58
+//
59
+//
60
+//
61
+//
62
+//
63
+//
64
+//
65
+//
66
+//}

+ 13 - 0
controllers/new_mobile_api_controllers/system_dialysis_prescription.json Wyświetl plik

39
       "status": 1,
39
       "status": 1,
40
       "dialysis_duration_hour": 4,
40
       "dialysis_duration_hour": 4,
41
       "dialysis_duration_minute": 0
41
       "dialysis_duration_minute": 0
42
+    },{
43
+      "anticoagulant": 3,
44
+      "anticoagulant_shouji": 4000,
45
+      "anticoagulant_weichi": 0,
46
+      "anticoagulant_zongliang": 4000,
47
+      "mode_id": 12,
48
+      "blood_flow_volume": 200,
49
+      "kalium": 2,
50
+      "sodium": 135,
51
+      "calcium": 1.5,
52
+      "status": 1,
53
+      "dialysis_duration_hour": 4,
54
+      "dialysis_duration_minute": 0
42
     }
55
     }
43
   ]
56
   ]
44
 }
57
 }