|
@@ -428,8 +428,7 @@ func (this *StaffScheduleApiController) GetSchedulePatient() {
|
428
|
428
|
schedule, _ := this.GetInt64("schedule", 0) //1已2未
|
429
|
429
|
contagion, _ := this.GetInt64("contagion", 0)
|
430
|
430
|
keywords := this.GetString("keywords", "")
|
431
|
|
- adminInfo := this.GetAdminUserInfo()
|
432
|
|
-
|
|
431
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
433
|
432
|
thisTime := time.Now()
|
434
|
433
|
weekDay := int(thisTime.Weekday())
|
435
|
434
|
if weekDay == 0 {
|
|
@@ -453,7 +452,7 @@ func (this *StaffScheduleApiController) GetSchedulePatient() {
|
453
|
452
|
weekStart := theStarTime.Unix()
|
454
|
453
|
weekEnd := theEndTime.Unix()
|
455
|
454
|
|
456
|
|
- patients, _ := service.GetPatientWithScheduleAndSolution(adminInfo.CurrentOrgId, keywords, weekStart, weekEnd, schedule, contagion)
|
|
455
|
+ patients, _ := service.GetPatientWithScheduleAndSolution(adminInfo.Org.Id, keywords, weekStart, weekEnd, schedule, contagion)
|
457
|
456
|
|
458
|
457
|
this.ServeSuccessJSON(map[string]interface{}{
|
459
|
458
|
"patients": patients,
|
|
@@ -469,8 +468,8 @@ func (c *StaffScheduleApiController) CreateMobileSchedulePatient() {
|
469
|
468
|
return
|
470
|
469
|
}
|
471
|
470
|
|
472
|
|
- adminUserInfo := c.GetAdminUserInfo()
|
473
|
|
- patientInfo, _ := service.FindPatientById(adminUserInfo.CurrentOrgId, patientID)
|
|
471
|
+ adminUserInfo := c.GetMobileAdminUserInfo()
|
|
472
|
+ patientInfo, _ := service.FindPatientById(adminUserInfo.Org.Id, patientID)
|
474
|
473
|
if patientInfo.ID == 0 {
|
475
|
474
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
|
476
|
475
|
return
|
|
@@ -582,9 +581,9 @@ func (c *StaffScheduleApiController) CreateMobileSchedulePatient() {
|
582
|
581
|
schedule.CreatedTime = time.Now().Unix()
|
583
|
582
|
schedule.UpdatedTime = time.Now().Unix()
|
584
|
583
|
schedule.Status = 1
|
585
|
|
- schedule.UserOrgId = adminUserInfo.CurrentOrgId
|
|
584
|
+ schedule.UserOrgId = adminUserInfo.Org.Id
|
586
|
585
|
|
587
|
|
- bed, _ := service.GetDeviceNumberByID(adminUserInfo.CurrentOrgId, schedule.BedId)
|
|
586
|
+ bed, _ := service.GetDeviceNumberByID(adminUserInfo.Org.Id, schedule.BedId)
|
588
|
587
|
if bed == nil {
|
589
|
588
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDeviceNumberNotExist)
|
590
|
589
|
return
|
|
@@ -603,14 +602,14 @@ func (c *StaffScheduleApiController) CreateMobileSchedulePatient() {
|
603
|
602
|
endTime := theEndTime.Unix()
|
604
|
603
|
|
605
|
604
|
//一天只有排班一次
|
606
|
|
- daySchedule, err := service.GetDaySchedule(adminUserInfo.CurrentOrgId, startTime, endTime, patientID)
|
|
605
|
+ daySchedule, err := service.GetDaySchedule(adminUserInfo.Org.Id, startTime, endTime, patientID)
|
607
|
606
|
if daySchedule.ID > 0 {
|
608
|
607
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCantSetScheduleAgainOneDay)
|
609
|
608
|
return
|
610
|
609
|
}
|
611
|
610
|
|
612
|
611
|
//同天同位置只能排一个
|
613
|
|
- pointSchedule, err := service.GetPointSchedule(adminUserInfo.CurrentOrgId, schedule.ScheduleDate, schedule.ScheduleWeek, schedule.ScheduleType, schedule.BedId)
|
|
612
|
+ pointSchedule, err := service.GetPointSchedule(adminUserInfo.Org.Id, schedule.ScheduleDate, schedule.ScheduleWeek, schedule.ScheduleType, schedule.BedId)
|
614
|
613
|
if err != nil {
|
615
|
614
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
616
|
615
|
return
|
|
@@ -624,7 +623,7 @@ func (c *StaffScheduleApiController) CreateMobileSchedulePatient() {
|
624
|
623
|
defer redis.Close()
|
625
|
624
|
err = service.CreateSchedule(&schedule)
|
626
|
625
|
|
627
|
|
- key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
|
|
626
|
+ key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
628
|
627
|
redis.Set(key, "", time.Second)
|
629
|
628
|
|
630
|
629
|
fmt.Println(err)
|