Sfoglia il codice sorgente

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

csx 4 anni fa
parent
commit
0f7dc3d52c

+ 13 - 17
controllers/new_mobile_api_controllers/mobile_regist_controller.go Vedi File

@@ -160,14 +160,14 @@ func (this *MobileRegistController) CreateOrg() {
160 160
 		return
161 161
 	}
162 162
 	orgPhone := this.GetString("telephone")
163
-
164
-	if len(orgPhone) > 0 {
165
-		if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
-			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodePhone)
167
-			this.ServeJSON()
168
-			return
169
-		}
170
-	}
163
+	//
164
+	//if len(orgPhone) > 0 {
165
+	//	if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
+	//		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodePhone)
167
+	//		this.ServeJSON()
168
+	//		return
169
+	//	}
170
+	//}
171 171
 
172 172
 	provinceID := 0
173 173
 	cityID := 0
@@ -221,7 +221,9 @@ func (this *MobileRegistController) CreateOrg() {
221 221
 		ModifyTime:   time.Now().Unix(),
222 222
 	}
223 223
 
224
-	createErr := service.CreateOrg(org, adminUser.Mobile, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
224
+	adminUsers, _ := service.GetAdminUserByUserID(adminUser.Id)
225
+
226
+	createErr := service.CreateOrg(org, adminUsers.Name, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
225 227
 
226 228
 	if createErr != nil {
227 229
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
@@ -515,7 +517,7 @@ func InitPatientAndSchedule(org *models.Org) {
515 517
 
516 518
 	//创建两个血透的虚拟病人到新表
517 519
 	fmt.Print("patients", patients)
518
-	for index, it := range patients {
520
+	for _, it := range patients {
519 521
 		patientsNew := models.XtPatientsNew{
520 522
 			UserOrgId:               org.Id,
521 523
 			CreatedTime:             time.Now().Unix(),
@@ -555,13 +557,7 @@ func InitPatientAndSchedule(org *models.Org) {
555 557
 			TellPhone:               it.TellPhone,
556 558
 			FirstTreatmentDate:      it.FirstTreatmentDate,
557 559
 			ContactName:             it.ContactName,
558
-		}
559
-		if index == 1 {
560
-			patientsNew.IsInfectious = 1
561
-
562
-		} else {
563
-			patientsNew.IsInfectious = 2
564
-
560
+			IsInfectious:            it.IsInfectious,
565 561
 		}
566 562
 
567 563
 		service.CreateVMOrgNewPatient(&patientsNew)

+ 4 - 4
controllers/new_mobile_api_controllers/patient.json Vedi File

@@ -45,7 +45,7 @@
45 45
       "hospital_first_dialysis_date": 1511366400,
46 46
       "induction_period": 0,
47 47
       "initial_dialysis": 0,
48
-      "total_dialysis": 14,
48
+      "total_dialysis": 0,
49 49
       "attending_doctor_id": 0,
50 50
       "head_nurse_id": 0,
51 51
       "evaluate": "",
@@ -78,7 +78,7 @@
78 78
       "tell_phone": "21212",
79 79
       "first_treatment_date": 1582560000,
80 80
       "contact_name": "21221",
81
-      " is_infectious":1
81
+      "is_infectious":1
82 82
     },
83 83
     {
84 84
       "avatar": "https://images.shengws.com/201809182128111.png",
@@ -125,7 +125,7 @@
125 125
       "hospital_first_dialysis_date": 1511366400,
126 126
       "induction_period": 0,
127 127
       "initial_dialysis": 0,
128
-      "total_dialysis": 14,
128
+      "total_dialysis": 0,
129 129
       "attending_doctor_id": 0,
130 130
       "head_nurse_id": 0,
131 131
       "evaluate": "",
@@ -158,7 +158,7 @@
158 158
       "tell_phone": "21212",
159 159
       "first_treatment_date": 1582560000,
160 160
       "contact_name": "21221",
161
-      " is_infectious":2
161
+      "is_infectious":2
162 162
 
163 163
     }
164 164
   ]