jiangjc преди 1 година
родител
ревизия
f6fbc21b19
променени са 1 файла, в които са добавени 62 реда и са изтрити 0 реда
  1. 62 0
      OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

+ 62 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -187,6 +187,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<Grp_CarTouristGuideGroundReservationsContent> grp_CarTouristsContent = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id).ToList();
                 List<CarTouristGuideGroundReservationsContentView> carTouristGuides = _mapper.Map<List<CarTouristGuideGroundReservationsContentView>>(grp_CarTouristsContent);
 
+                TableInitialization.RemoveAll(x => x.Id == 1070 || x.Id == 1071);
+                var weiKuanArr = _TableInitialization.Where(x => x.Id == 1070 || x.Id == 1071).ToList();
+                var weiKuanResultArr = carTouristGuides.Where(x => x.SId == 1070 || x.SId == 1071).ToList();
+                carTouristGuides.RemoveAll(x => x.SId == 1070 || x.SId == 1071);
+
                 foreach (var itemSt in TableInitialization)
                 {
                     var findResult = carTouristGuides.Find(x => x.SId == itemSt.Id);
@@ -320,6 +325,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var checkedItem = new List<string>();
                 var checkedItemId = new List<int>();
 
+                var isSaveCheck = false;
                 if (string.IsNullOrWhiteSpace(grpCarOp.SelectCheck))
                 {
                     //获取成本选中
@@ -354,6 +360,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 else
                 {
+                    isSaveCheck = true;
                     var checkedItemThis = grpCarOp.SelectCheck.Split(",").ToList<string>();
                     int number = 0;
                     foreach (var item in checkedItemThis)
@@ -371,6 +378,61 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
 
+                if (grpCarOp.PriceType == 1062) //尾款id
+                {
+                    if (isSaveCheck)
+                    {
+                        checkedItemId.AddRange(weiKuanArr.Select(x => x.Id).ToList());
+                        checkedItem.AddRange(weiKuanArr.Select(x => x.Name).ToList());
+                        checkedItemId = checkedItemId.Distinct().ToList();
+                        checkedItem = checkedItem.Distinct().ToList();
+                    }
+                    else
+                    {
+                        checkedItemId = weiKuanArr.Select(x => x.Id).ToList();
+                        checkedItem = weiKuanArr.Select(x => x.Name).ToList();
+                    }
+                   
+                    var weiPrice = weiKuanResultArr.Find(x => x.SId == 1070);
+                    if (weiPrice != null)
+                    {
+                        weiPrice.SidName = "尾款金额";
+                    }
+                    var weiOther = weiKuanResultArr.Find(x => x.SId == 1071);
+                    if (weiOther != null)
+                    {
+                        weiOther.SidName = "其他额外费用";
+                    }
+                    carTouristGuides.Add(weiPrice ??= new CarTouristGuideGroundReservationsContentView
+                    {
+                        Count = 1,
+                        DatePrice = DateTime.Now,
+                        Price = 0,
+                        PriceContent = "",
+                        SId = 1070,
+                        SidName = "尾款金额",
+                        Units = 0,
+                    });
+                    carTouristGuides.Add(weiOther ??= new CarTouristGuideGroundReservationsContentView
+                    {
+                        Count = 1,
+                        DatePrice = DateTime.Now,
+                        Price = 0,
+                        PriceContent = "",
+                        SId = 1071,
+                        SidName = "其他额外费用",
+                        Units = 0,
+                    });
+                }
+                else
+                {
+                    _TableInitialization.RemoveAll(x => x.Id == 1070 || x.Id == 1071);
+                }
+
+
+                if (dto.PortType == 1)
+                }
+
                 if (dto.PortType == 1)
                 {
                     var data = new