Browse Source

库存流水展示

XMLWAN 1 year ago
parent
commit
b4c595bd22

+ 1 - 0
controllers/dialysis_api_controller.go View File

@@ -3442,6 +3442,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
3442 3442
 
3443 3443
 	//透析单
3444 3444
 	dialysisOrder, _ := service.MobileGetSchedualDialysisRecordTen(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
3445
+	fmt.Println("dialysisOrder----------------", dialysisOrder)
3445 3446
 	if dialysisOrder != nil {
3446 3447
 		if dialysisOrder.FinishNurse > 0 {
3447 3448
 			operatorIDs = append(operatorIDs, dialysisOrder.FinishNurse)

+ 14 - 1
controllers/schedule_api_controller.go View File

@@ -4337,9 +4337,14 @@ func (c *ScheduleApiController) GetScheduleOne() {
4337 4337
 	ids := strings.Split(patitionIdStr, ",")
4338 4338
 	fmt.Println("patitonStr", ids)
4339 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 4344
 	adminInfo := c.GetAdminUserInfo()
4341 4345
 
4342 4346
 	thisTime := time.Now()
4347
+
4343 4348
 	today := thisTime.Format("2006-01-02")
4344 4349
 	if week < 1 || week > 4 {
4345 4350
 		week = 2
@@ -4378,9 +4383,17 @@ func (c *ScheduleApiController) GetScheduleOne() {
4378 4383
 	loc, _ := time.LoadLocation("Local")
4379 4384
 	theStarTime, _ := time.ParseInLocation(timeLayout, weekStartTime, loc)
4380 4385
 	theEndTime, _ := time.ParseInLocation(timeLayout, weekEndTime, loc)
4386
+
4381 4387
 	weekStartPoint := theStarTime.Unix()
4382 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 4397
 	schdules, _ := service.GetWeekScheduleTwo(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4385 4398
 	schedulesGroup, _ := service.GetScheduleTotalCount(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
4386 4399
 	c.ServeSuccessJSON(map[string]interface{}{

+ 1 - 1
service/patient_service.go View File

@@ -605,7 +605,7 @@ func FindPatientWithDeviceByNo(orgID int64, no string, time int64) (patient mode
605 605
 		return db.Preload("DeviceNumber", "org_id = ?", orgID).
606 606
 			Preload("DeviceZone", "org_id = ?", orgID).
607 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 609
 	return
610 610
 }
611 611