see999 3 years ago
parent
commit
2c4236644b

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9529
2
+httpport = 9531
3 3
 runmode = dev
4 4
 
5 5
 #

+ 42 - 2
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -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
 

+ 1 - 1
service/doctor_schedule_service.go View File

@@ -709,7 +709,7 @@ func GetPatientScheduleIsExist(patient_id int64, startime int64, schedule_type i
709 709
 	return &schedule, nil
710 710
 }
711 711
 
712
-func CreateDialysisPrescription(prescription models.DialysisPrescription) error {
712
+func CreateDialysisPrescription(prescription *models.DialysisPrescription) error {
713 713
 
714 714
 	err := XTReadDB().Create(&prescription).Error
715 715