|
@@ -382,6 +382,7 @@ func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
382
|
382
|
schedule_type, _ := this.GetInt64("schedule_type")
|
383
|
383
|
start_time := this.GetString("start_time")
|
384
|
384
|
dialyzer_perfusion_apparatus := this.GetString("dialyzer_perfusion_apparatus")
|
|
385
|
+ bed_id, _ := this.GetInt64("bed_id")
|
385
|
386
|
var startTime int64
|
386
|
387
|
if len(start_time) > 0 {
|
387
|
388
|
theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
@@ -398,7 +399,16 @@ func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
398
|
399
|
ModeId: mode_id,
|
399
|
400
|
}
|
400
|
401
|
|
401
|
|
- service.UpdatedSchedule(schedule, id)
|
|
402
|
+ //查询该床位该班次是否存在排班
|
|
403
|
+ _, errschedulecode := service.GetPatientScheduleIsExist(patient_id, startTime, schedule_type, bed_id)
|
|
404
|
+ if errschedulecode == gorm.ErrRecordNotFound {
|
|
405
|
+ service.UpdatedSchedule(schedule, id)
|
|
406
|
+ } else if errschedulecode == nil {
|
|
407
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
408
|
+ "msg": "1",
|
|
409
|
+ "msgerr": "排班已存在",
|
|
410
|
+ })
|
|
411
|
+ }
|
402
|
412
|
|
403
|
413
|
//更改透析模式
|
404
|
414
|
_, errcode := service.GetDialyisSolution(patient_id, startTime)
|