|
@@ -413,13 +413,53 @@ func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
413
|
413
|
RecordDate: startTime,
|
414
|
414
|
CreatedTime: time.Now().Unix(),
|
415
|
415
|
}
|
416
|
|
- service.CreateDialysisPrescription(prescription)
|
|
416
|
+ err := service.CreateDialysisPrescription(&prescription)
|
|
417
|
+ if err != nil {
|
|
418
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
|
419
|
+ return
|
|
420
|
+ }
|
|
421
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
422
|
+ "msg": "保存成功",
|
|
423
|
+ })
|
417
|
424
|
} else if errcode == nil {
|
418
|
425
|
prescription := models.DialysisPrescription{
|
419
|
426
|
DialyzerPerfusionApparatus: dialyzer_perfusion_apparatus,
|
420
|
427
|
DialysisDialyszers: dialyzer_perfusion_apparatus,
|
421
|
428
|
}
|
422
|
|
- service.UpdateDialysisPrescriptionOne(prescription, patient_id, startTime)
|
|
429
|
+ err := service.UpdateDialysisPrescriptionOne(prescription, patient_id, start_time)
|
|
430
|
+ if err != nil {
|
|
431
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
|
432
|
+ return
|
|
433
|
+ }
|
|
434
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
435
|
+ "msg": "保存成功",
|
|
436
|
+ })
|
|
437
|
+ }
|
|
438
|
+}
|
|
439
|
+
|
|
440
|
+func (this *StaffScheduleApiController) UpdateBloodScheduleMode() {
|
|
441
|
+ id, _ := this.GetInt64("id")
|
|
442
|
+ mode_id, _ := this.GetInt64("mode_id")
|
|
443
|
+ schedule := models.XtSchedule{
|
|
444
|
+ ModeId: mode_id,
|
|
445
|
+ }
|
|
446
|
+ service.UpdatedScheduleMode(schedule, id)
|
|
447
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
448
|
+ "msg": "保存成功",
|
|
449
|
+ })
|
|
450
|
+}
|
|
451
|
+
|
|
452
|
+func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
|
453
|
+
|
|
454
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
455
|
+ mode_id, _ := this.GetInt64("mode_id")
|
|
456
|
+ schedule_type, _ := this.GetInt64("schedule_type")
|
|
457
|
+ start_time, _ := this.GetInt64("start_time")
|
|
458
|
+ bed_id, _ := this.GetInt64("bed_id")
|
|
459
|
+ //更改排班
|
|
460
|
+ schedule := models.XtSchedule{
|
|
461
|
+ ScheduleType: schedule_type,
|
|
462
|
+ ModeId: mode_id,
|
423
|
463
|
}
|
424
|
464
|
}
|
425
|
465
|
|