Browse Source

历史排班

28169 1 year ago
parent
commit
503be0d384

+ 11 - 0
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -400,6 +400,17 @@ func (this *StaffScheduleApiController) GetAllZonePb() {
400 400
 		}
401 401
 	}
402 402
 
403
+	//针对百霖和贝尔
404
+	if orgid == 10138 || orgid == 10278 || orgid == 3877 {
405
+		//获取今日的排班数据
406
+		list, _ := service.GetMobileScheduleListByScheduleDate(orgid, startTime)
407
+		for _, item := range list {
408
+			solution, _ := service.GetLongSolutionByModeId(item.PatientId, item.ModeId, item.UserOrgId)
409
+			var str = solution.DialysisDialyszers + "/" + solution.DialysisIrrigation
410
+			service.UpdateScheduleByDialysis(item.PatientId, item.ModeId, item.ScheduleDate, item.UserOrgId, str, item.ScheduleType)
411
+		}
412
+	}
413
+
403 414
 	// stockType, _ := service.GetStockType(orgid)
404 415
 	//zonelist, _ := service.GetPatientScheduleListByZone(startTime, classtype, orgid)
405 416
 	// if err != nil {

+ 0 - 1
controllers/schedule_api_controller.go View File

@@ -216,7 +216,6 @@ func (c *ScheduleApiController) BatchPostSmartSch() {
216 216
 				sch_id := int64(items["sch_id"].(float64))
217 217
 				if sch_id > 0 { //修改排班信息
218 218
 					schedule, _ = service.GetScheduleTwo(adminInfo.CurrentOrgId, sch_id)
219
-					fmt.Println("2222222")
220 219
 
221 220
 					if items["mode_id"] == nil || reflect.TypeOf(items["mode_id"]).String() != "float64" {
222 221
 						utils.ErrorLog("mode_id")

+ 17 - 0
service/doctor_schedule_service.go View File

@@ -801,3 +801,20 @@ func GetPatientScheduleListByZone(schedule_date int64, class_tye int64, orgid in
801 801
 	err = db.Select("partition_id,Count(id) as id,user_org_id").Group("partition_id").Scan(&schedule).Error
802 802
 	return schedule, err
803 803
 }
804
+
805
+func GetMobileScheduleListByScheduleDate(org_id int64, schedule_date int64) (schedule []*models.Search_Schedule, err error) {
806
+
807
+	db := XTReadDB().Model(&schedule).Where("status= 1")
808
+
809
+	if org_id > 0 {
810
+		db = db.Where("user_org_id = ?", org_id)
811
+	}
812
+
813
+	if schedule_date > 0 {
814
+		db = db.Where("schedule_date=?", schedule_date)
815
+	}
816
+
817
+	err = db.Find(&schedule).Error
818
+
819
+	return schedule, err
820
+}