Преглед изворни кода

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

XMLWAN пре 4 година
родитељ
комит
a24f99ae53

+ 9 - 26
controllers/new_mobile_api_controllers/home_api_controller.go Прегледај датотеку

@@ -143,23 +143,6 @@ func (this *HomeController) ChangeOrg() {
143 143
 		appRole = tempRole
144 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 146
 		templateInfo, _ := service.GetOrgInfoTemplate(org.Id)
164 147
 
165 148
 		mobileAdminUserInfo := &mobile_api_controllers.MobileAdminUserInfo{
@@ -224,15 +207,15 @@ func (this *HomeController) CreateOrg() {
224 207
 	adminUserInfo := this.GetMobileAdminUserInfo()
225 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 220
 	name := this.GetString("org_name")
238 221
 	shortName := name

+ 19 - 12
controllers/new_mobile_api_controllers/mobile_regist_controller.go Прегледај датотеку

@@ -125,15 +125,15 @@ func (this *MobileRegistController) CreateOrg() {
125 125
 	}
126 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 138
 	name := this.GetString("org_name")
139 139
 	shortName := name
@@ -602,7 +602,7 @@ func InitPatientAndSchedule(org *models.Org) {
602 602
 
603 603
 	//创建两个虚拟病人本周的排班
604 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 606
 		for index, id := range ids {
607 607
 			if index == 0 {
608 608
 				sch := &models.VMSchedule{
@@ -612,7 +612,7 @@ func InitPatientAndSchedule(org *models.Org) {
612 612
 					PatientId:    id,
613 613
 					ScheduleDate: date,
614 614
 					ScheduleType: 1,
615
-					ScheduleWeek: int64(time.Now().Weekday()),
615
+					ScheduleWeek: int64(week_type + 1),
616 616
 					ModeId:       1,
617 617
 					Status:       1,
618 618
 					CreatedTime:  time.Now().Unix(),
@@ -630,7 +630,7 @@ func InitPatientAndSchedule(org *models.Org) {
630 630
 					PatientId:    id,
631 631
 					ScheduleDate: date,
632 632
 					ScheduleType: 2,
633
-					ScheduleWeek: int64(time.Now().Weekday()),
633
+					ScheduleWeek: int64(week_type + 1),
634 634
 					ModeId:       1,
635 635
 					Status:       1,
636 636
 					CreatedTime:  time.Now().Unix(),
@@ -676,12 +676,19 @@ func InitPatientAndSchedule(org *models.Org) {
676 676
 			item.TemplateId = templaeIdOne.ID
677 677
 			item.DeviceNumberId = vmDeviceNumber1.ID
678 678
 			item.PatientId = ids[0]
679
+			item.Status = 1
680
+			item.Ctime = time.Now().Unix()
681
+			item.Mtime = time.Now().Unix()
679 682
 
680 683
 		} else if item.TimeType == 2 {
681 684
 			item.OrgId = org.Id
682 685
 			item.TemplateId = templaeIdOne.ID
683 686
 			item.DeviceNumberId = vmDeviceNumber2.ID
684 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 694
 		service.CreateVMSchTemplate(item)

+ 7 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go Прегледај датотеку

@@ -33,6 +33,13 @@ func NewMobileAPIControllersRegisterRouters() {
33 33
 	beego.Router("/m/api/changeorg", &HomeController{}, "post:ChangeOrg")
34 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 43
 	beego.Router("/m/api/patient/getbloodpatientinfo", &NewDialysisApiController{}, "Get:GetBloodPatientInfo")
37 44
 	beego.Router("/m/api/patient/getslowpatientinfo", &NewDialysisApiController{}, "Get:GetSlowPatientInfo")
38 45
 	beego.Router("/m/api/patient/getmemberpatientinfo", &NewDialysisApiController{}, "Get:GetMemberpatientInfo")

+ 47 - 11
controllers/new_mobile_api_controllers/new_role_api_controller.go Прегледај датотеку

@@ -16,15 +16,51 @@ func (this *NewRoleApiController) GetAllOrgUser() {
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 Прегледај датотеку

@@ -39,6 +39,19 @@
39 39
       "status": 1,
40 40
       "dialysis_duration_hour": 4,
41 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
 }