Browse Source

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

csx 4 years ago
parent
commit
0f7dc3d52c

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

160
 		return
160
 		return
161
 	}
161
 	}
162
 	orgPhone := this.GetString("telephone")
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
 	provinceID := 0
172
 	provinceID := 0
173
 	cityID := 0
173
 	cityID := 0
221
 		ModifyTime:   time.Now().Unix(),
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
 	if createErr != nil {
228
 	if createErr != nil {
227
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
229
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
515
 
517
 
516
 	//创建两个血透的虚拟病人到新表
518
 	//创建两个血透的虚拟病人到新表
517
 	fmt.Print("patients", patients)
519
 	fmt.Print("patients", patients)
518
-	for index, it := range patients {
520
+	for _, it := range patients {
519
 		patientsNew := models.XtPatientsNew{
521
 		patientsNew := models.XtPatientsNew{
520
 			UserOrgId:               org.Id,
522
 			UserOrgId:               org.Id,
521
 			CreatedTime:             time.Now().Unix(),
523
 			CreatedTime:             time.Now().Unix(),
555
 			TellPhone:               it.TellPhone,
557
 			TellPhone:               it.TellPhone,
556
 			FirstTreatmentDate:      it.FirstTreatmentDate,
558
 			FirstTreatmentDate:      it.FirstTreatmentDate,
557
 			ContactName:             it.ContactName,
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
 		service.CreateVMOrgNewPatient(&patientsNew)
563
 		service.CreateVMOrgNewPatient(&patientsNew)

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

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