csx преди 3 години
родител
ревизия
4f5bac3861
променени са 1 файла, в които са добавени 22 реда и са изтрити 5 реда
  1. 22 5
      controllers/mobile_api_controllers/dialysis_api_controller.go

+ 22 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go Целия файл

@@ -546,7 +546,7 @@ func (this *DialysisAPIController) DialysisRecord() {
546 546
 	temp_team_projects, _ := service.GetHisPrescriptionTeamProjects(adminInfo.Org.Id, patientID, date.Unix())
547 547
 
548 548
 	var team_projects []*models.HisPrescriptionProject
549
-	var index int64 = 0
549
+	//var index int64 = 0
550 550
 	for _, item := range temp_team_projects {
551 551
 		//组套里面非检验项目的
552 552
 		if item.HisProject.CostClassify != 3 {
@@ -554,13 +554,12 @@ func (this *DialysisAPIController) DialysisRecord() {
554 554
 		}
555 555
 		//组套里面检验项目的
556 556
 		if item.HisProject.CostClassify == 3 {
557
-			index = index + 1
558
-			if index == 1 {
559
-				team_projects = append(team_projects, item)
560
-			}
557
+			team_projects = append(team_projects, item)
561 558
 		}
562 559
 	}
563 560
 
561
+	team_projects = RemoveRepeatedCheckRecod(team_projects)
562
+
564 563
 	stockType, _ = service.GetStockType(adminInfo.Org.Id)
565 564
 
566 565
 	prepare, _ = service.GetDialyStockOut(adminInfo.Org.Id, date.Unix(), patientID)
@@ -5492,6 +5491,7 @@ func ConsumablesDeliveryDeleteThree(orgID int64, record_time int64, good_yc *mod
5492 5491
 
5493 5492
 		// 删除出库完成后,要改变流水库存
5494 5493
 		errOne = service.UpDateWarehouStockFlowByStockDelete(ware.WarehouseInfotId, record_time, good_yc.GoodId, delete_count, good_yc.PatientId)
5494
+
5495 5495
 		fmt.Println("erron2332323232323232232323", errOne)
5496 5496
 		errThree := service.UpDateWarehouseInfoByStockDelete(ware.WarehouseInfotId, delete_count)
5497 5497
 
@@ -5518,3 +5518,20 @@ func (this *DialysisAPIController) GetMobileScheduleList() {
5518 5518
 	zone_options_visible, _ := this.GetInt64("zone_options_visible")
5519 5519
 	fmt.Println(limit, page, type_options_visible, sch_type_options_visible, zone_options_visible)
5520 5520
 }
5521
+
5522
+func RemoveRepeatedCheckRecod(arr []*models.HisPrescriptionProject) (newArr []*models.HisPrescriptionProject) {
5523
+	newArr = make([]*models.HisPrescriptionProject, 0)
5524
+	for i := 0; i < len(arr); i++ {
5525
+		repeat := false
5526
+		for j := i + 1; j < len(arr); j++ {
5527
+			if arr[i].TeamId == arr[j].TeamId {
5528
+				repeat = true
5529
+				break
5530
+			}
5531
+		}
5532
+		if !repeat {
5533
+			newArr = append(newArr, arr[i])
5534
+		}
5535
+	}
5536
+	return
5537
+}