|
@@ -144,7 +144,7 @@ func (this *XcxApiController) GetLoginInfor() {
|
144
|
144
|
|
145
|
145
|
mobile := this.GetString("mobile")
|
146
|
146
|
fmt.Println(mobile)
|
147
|
|
- info, _ := service.GetMobilePatientInfo("18179463966")
|
|
147
|
+ info, _ := service.GetMobilePatientInfo(mobile)
|
148
|
148
|
if info.ID == 0 {
|
149
|
149
|
|
150
|
150
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -152,7 +152,7 @@ func (this *XcxApiController) GetLoginInfor() {
|
152
|
152
|
"info": info,
|
153
|
153
|
})
|
154
|
154
|
} else {
|
155
|
|
- _, errcode := service.GetLoginInfor("18179463966")
|
|
155
|
+ _, errcode := service.GetLoginInfor(mobile)
|
156
|
156
|
if errcode == gorm.ErrRecordNotFound {
|
157
|
157
|
role := models.XcxAdminUserRole{
|
158
|
158
|
PatientName: info.Name,
|
|
@@ -170,6 +170,13 @@ func (this *XcxApiController) GetLoginInfor() {
|
170
|
170
|
}
|
171
|
171
|
err := service.CreateXcxAdminUser(role)
|
172
|
172
|
fmt.Println(err)
|
|
173
|
+ if err == nil {
|
|
174
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
175
|
+ "is_bind": true,
|
|
176
|
+ "info": info,
|
|
177
|
+ })
|
|
178
|
+ }
|
|
179
|
+
|
173
|
180
|
} else {
|
174
|
181
|
this.ServeSuccessJSON(map[string]interface{}{
|
175
|
182
|
"is_bind": true,
|
|
@@ -242,12 +249,19 @@ func (this *XcxApiController) GetScheduleInfo() {
|
242
|
249
|
fmt.Println("startiem", startTime)
|
243
|
250
|
endTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekDay+"00:00:00", loc)
|
244
|
251
|
fmt.Println(startTime.Unix(), endTime.Unix())
|
245
|
|
- schedule, err := service.GetScheduleInfo(startTime.Unix(), endTime.Unix(), 1)
|
|
252
|
+ schedule, err := service.GetScheduleInfo(startTime.Unix(), endTime.Unix(), patient_id)
|
246
|
253
|
|
247
|
254
|
//获取当前今日的排班日期
|
248
|
255
|
time_now := time.Now().Format("2006-01-02")
|
249
|
256
|
fmt.Println("time_now", time_now)
|
|
257
|
+ timeNowUnix, _ := time.ParseInLocation(timeLayout+"15:04:05", time_now+"00:00:00", loc)
|
|
258
|
+ fmt.Println("timeNowUnix", timeNowUnix.Unix())
|
|
259
|
+
|
|
260
|
+ //获取今日下机日期
|
|
261
|
+ order, _ := service.GetTodayDialysis(timeNowUnix.Unix(), patient_id)
|
250
|
262
|
|
|
263
|
+ //获取下一次排班信息
|
|
264
|
+ patientSchedule, _ := service.GetNextPatientSchedule(1, timeNowUnix.Unix())
|
251
|
265
|
if err != nil {
|
252
|
266
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
253
|
267
|
return
|
|
@@ -347,8 +361,10 @@ func (this *XcxApiController) GetScheduleInfo() {
|
347
|
361
|
map[string]string{"schedule_type": "3", "schedule_date": strconv.FormatInt(lastseven, 10), "schedule_week": "7", "mode_id": "", "name": ""},
|
348
|
362
|
}
|
349
|
363
|
this.ServeSuccessJSON(map[string]interface{}{
|
350
|
|
- "list": schedule,
|
351
|
|
- "array": array,
|
|
364
|
+ "list": schedule,
|
|
365
|
+ "array": array,
|
|
366
|
+ "order": order,
|
|
367
|
+ "patientSchedule": patientSchedule,
|
352
|
368
|
})
|
353
|
369
|
}
|
354
|
370
|
|