Selaa lähdekoodia

11月8日库存管理

XMLWAN 3 vuotta sitten
vanhempi
commit
749ff7c451

+ 39 - 42
controllers/mobile_api_controllers/dialysis_api_controller.go Näytä tiedosto

@@ -191,26 +191,23 @@ func (this *DialysisAPIController) Scheduals() {
191 191
 			//获取今日所有的处方开的耗材
192 192
 			project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
193 193
 
194
-			fmt.Println("orgID00000000000000000000000000000000", date.Unix())
195 194
 			//获取今日透析准备的数据
196
-			goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
195
+			//goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
197 196
 
198
-			list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
197
+			//list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
199 198
 
200
-			autoList, _ := service.GetMobileAutoReduce(orgID, date.Unix())
201
-			for _, item := range goodList {
202
-				for _, it := range list {
203
-					if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
204
-						item.Children = append(item.Children, it)
205
-					}
206
-				}
207
-			}
208
-			fmt.Println("goodlist888888888888888888888", goodList, err)
199
+			//autoList, _ := service.GetMobileAutoReduce(orgID, date.Unix())
200
+			//for _, item := range goodList {
201
+			//	for _, it := range list {
202
+			//		if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
203
+			//			item.Children = append(item.Children, it)
204
+			//		}
205
+			//	}
206
+			//}
207
+			//fmt.Println("goodlist888888888888888888888", goodList, err)
209 208
 			this.ServeSuccessJSON(map[string]interface{}{
210 209
 				"scheduals": scheduals,
211 210
 				"project":   project,
212
-				"goodList":  goodList,
213
-				"autoList":  autoList,
214 211
 			})
215 212
 		}
216 213
 
@@ -226,26 +223,26 @@ func (this *DialysisAPIController) Scheduals() {
226 223
 		project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
227 224
 
228 225
 		//获取今日透析准备的数据
229
-		goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
230
-		fmt.Println("goodlist23323232323233232332233223323233", goodList, err)
231
-
232
-		list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
233
-
234
-		for _, item := range goodList {
235
-			for _, it := range list {
236
-				if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
237
-					item.Children = append(item.Children, it)
238
-				}
239
-			}
240
-		}
241
-		autoList, _ := service.GetMobileAutoReduce(orgID, date.Unix())
226
+		//goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
227
+		//fmt.Println("goodlist23323232323233232332233223323233", goodList, err)
228
+		//
229
+		//list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
230
+		//
231
+		//for _, item := range goodList {
232
+		//	for _, it := range list {
233
+		//		if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
234
+		//			item.Children = append(item.Children, it)
235
+		//		}
236
+		//	}
237
+		//}
238
+		//autoList, _ := service.GetMobileAutoReduce(orgID, date.Unix())
242 239
 		this.ServeSuccessJSON(map[string]interface{}{
243 240
 			"scheduals": dat,
244 241
 			"redis":     "true",
245 242
 			"date":      schedualDate,
246 243
 			"project":   project,
247
-			"goodList":  goodList,
248
-			"autoList":  autoList,
244
+			//"goodList":  goodList,
245
+			//"autoList":  autoList,
249 246
 		})
250 247
 
251 248
 	}
@@ -572,17 +569,17 @@ func (this *DialysisAPIController) DialysisRecord() {
572 569
 	}
573 570
 
574 571
 	//获取今日透析准备的数据
575
-	goodList, _ := service.MobileGetDialysisGoodsSeven(adminInfo.Org.Id, date.Unix())
576
-	list, _ := service.MobileGetDialysisGoodsSix(adminInfo.Org.Id, date.Unix())
577
-
578
-	autoList, _ := service.GetMobileAutoReduce(adminInfo.Org.Id, date.Unix())
579
-	for _, item := range goodList {
580
-		for _, it := range list {
581
-			if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
582
-				item.Children = append(item.Children, it)
583
-			}
584
-		}
585
-	}
572
+	//goodList, _ := service.MobileGetDialysisGoodsSeven(adminInfo.Org.Id, date.Unix())
573
+	//list, _ := service.MobileGetDialysisGoodsSix(adminInfo.Org.Id, date.Unix())
574
+	//
575
+	//autoList, _ := service.GetMobileAutoReduce(adminInfo.Org.Id, date.Unix())
576
+	//for _, item := range goodList {
577
+	//	for _, it := range list {
578
+	//		if item.RecordDate == it.RecordDate && item.PatientId == it.PatientId {
579
+	//			item.Children = append(item.Children, it)
580
+	//		}
581
+	//	}
582
+	//}
586 583
 
587 584
 	returnData := map[string]interface{}{
588 585
 		"patient":                        patient,
@@ -614,8 +611,8 @@ func (this *DialysisAPIController) DialysisRecord() {
614 611
 		"is_project_open_config":         is_project_open_config,
615 612
 		"project":                        projects,
616 613
 		"team_projects":                  team_projects,
617
-		"goodList":                       goodList,
618
-		"autoList":                       autoList,
614
+		//"goodList":                       goodList,
615
+		//"autoList":                       autoList,
619 616
 	}
620 617
 	this.ServeSuccessJSON(returnData)
621 618
 }

+ 6 - 17
service/mobile_dialysis_service.go Näytä tiedosto

@@ -3592,24 +3592,13 @@ func MobileGetPredialysisEvaluationSeven(orgID int64, patientID int64, recordDat
3592 3592
 	return &record, nil
3593 3593
 }
3594 3594
 
3595
-func MobileGetDialysisGoodsSeven(orgID int64, scheduleDate int64) (prepare []*models.DialysisBeforePrepare, err error) {
3596
-
3597
-	db := readDb.Table("dialysis_before_prepare as p").Where("status = 1")
3598
-	if orgID > 0 {
3599
-		db = db.Where("p.user_org_id = ?", orgID)
3600
-	}
3601
-	if scheduleDate > 0 {
3602
-		db = db.Where("p.record_date<= ?", scheduleDate)
3603
-	}
3604
-	err = db.Select("p.patient_id,p.good_id,Max(p.record_date) as record_date").Group("patient_id").Order("id desc").Find(&prepare).Error
3605
-	return prepare, err
3606
-}
3607
-
3608
-func MobileGetDialysisGoodsSix(orgID int64, scheduleDate int64) (prepare []*models.DialysisBeforePrepare, err error) {
3595
+//
3609 3596
 
3610
-	err = readDb.Where("user_org_id = ? AND status=1 AND record_date <= ? AND count > 0", orgID, scheduleDate).Select("patient_id,good_id,record_date").Find(&prepare).Error
3611
-	return prepare, err
3612
-}
3597
+//func MobileGetDialysisGoodsSix(orgID int64, scheduleDate int64) (prepare []*models.DialysisBeforePrepare, err error) {
3598
+//
3599
+//	err = readDb.Where("user_org_id = ? AND status=1 AND record_date = ? AND count > 0", orgID, scheduleDate).Select("patient_id,good_id,record_date").Find(&prepare).Error
3600
+//	return prepare, err
3601
+//}
3613 3602
 
3614 3603
 func GetMobileAutoReduce(orgID int64, scheduleDate int64) (auto []*models.AutomaticReduceDetail, err error) {
3615 3604