Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 2 years ago
parent
commit
7f62e7d030

+ 1 - 0
controllers/dialysis_api_controller.go View File

3441
 
3441
 
3442
 	//透析单
3442
 	//透析单
3443
 	dialysisOrder, _ := service.MobileGetSchedualDialysisRecordTen(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
3443
 	dialysisOrder, _ := service.MobileGetSchedualDialysisRecordTen(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
3444
+	fmt.Println("dialysisOrder----------------", dialysisOrder)
3444
 	if dialysisOrder != nil {
3445
 	if dialysisOrder != nil {
3445
 		if dialysisOrder.FinishNurse > 0 {
3446
 		if dialysisOrder.FinishNurse > 0 {
3446
 			operatorIDs = append(operatorIDs, dialysisOrder.FinishNurse)
3447
 			operatorIDs = append(operatorIDs, dialysisOrder.FinishNurse)

+ 14 - 1
controllers/schedule_api_controller.go View File

4337
 	ids := strings.Split(patitionIdStr, ",")
4337
 	ids := strings.Split(patitionIdStr, ",")
4338
 	fmt.Println("patitonStr", ids)
4338
 	fmt.Println("patitonStr", ids)
4339
 	schedule_type, _ := c.GetInt64("schedule_type")
4339
 	schedule_type, _ := c.GetInt64("schedule_type")
4340
+	is_before, _ := c.GetInt64("is_before")
4341
+	start_time := c.GetString("start_time")
4342
+	end_time := c.GetString("end_time")
4343
+
4340
 	adminInfo := c.GetAdminUserInfo()
4344
 	adminInfo := c.GetAdminUserInfo()
4341
 
4345
 
4342
 	thisTime := time.Now()
4346
 	thisTime := time.Now()
4347
+
4343
 	today := thisTime.Format("2006-01-02")
4348
 	today := thisTime.Format("2006-01-02")
4344
 	if week < 1 || week > 4 {
4349
 	if week < 1 || week > 4 {
4345
 		week = 2
4350
 		week = 2
4378
 	loc, _ := time.LoadLocation("Local")
4383
 	loc, _ := time.LoadLocation("Local")
4379
 	theStarTime, _ := time.ParseInLocation(timeLayout, weekStartTime, loc)
4384
 	theStarTime, _ := time.ParseInLocation(timeLayout, weekStartTime, loc)
4380
 	theEndTime, _ := time.ParseInLocation(timeLayout, weekEndTime, loc)
4385
 	theEndTime, _ := time.ParseInLocation(timeLayout, weekEndTime, loc)
4386
+
4381
 	weekStartPoint := theStarTime.Unix()
4387
 	weekStartPoint := theStarTime.Unix()
4382
 	weekEndPoint := theEndTime.Unix()
4388
 	weekEndPoint := theEndTime.Unix()
4383
-
4389
+	if is_before > 0 {
4390
+		timeLayout := "2006-01-02 15:04:05"
4391
+		loc, _ := time.LoadLocation("Local")
4392
+		theStarTime, _ := time.ParseInLocation(timeLayout, start_time, loc)
4393
+		theEndTime, _ := time.ParseInLocation(timeLayout, end_time, loc)
4394
+		weekStartPoint = theStarTime.Unix()
4395
+		weekEndPoint = theEndTime.Unix()
4396
+	}
4384
 	schdules, _ := service.GetWeekScheduleTwo(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4397
 	schdules, _ := service.GetWeekScheduleTwo(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4385
 	schedulesGroup, _ := service.GetScheduleTotalCount(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4398
 	schedulesGroup, _ := service.GetScheduleTotalCount(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4386
 	c.ServeSuccessJSON(map[string]interface{}{
4399
 	c.ServeSuccessJSON(map[string]interface{}{

+ 1 - 1
service/patient_service.go View File

605
 		return db.Preload("DeviceNumber", "org_id = ?", orgID).
605
 		return db.Preload("DeviceNumber", "org_id = ?", orgID).
606
 			Preload("DeviceZone", "org_id = ?", orgID).
606
 			Preload("DeviceZone", "org_id = ?", orgID).
607
 			Where("user_org_id = ? AND schedule_date = ? ", orgID, time)
607
 			Where("user_org_id = ? AND schedule_date = ? ", orgID, time)
608
-	}).Preload("InfectiousDiseases", "status = 1").Where("user_org_id=? and dialysis_no = ? and status = 1", orgID, no).First(&patient).Error
608
+	}).Preload("InfectiousDiseases", "status = 1").Where("user_org_id=? and dialysis_no = ? and status = 1 ", orgID, no).First(&patient).Error
609
 	return
609
 	return
610
 }
610
 }
611
 
611