yuanrf 3 months ago
parent
commit
694ed274f9

+ 41 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/GroupCostParameterRepository.cs

@@ -103,6 +103,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     List<Grp_DayAndCost> dac3 = (from item in _sqlSugar.Queryable<Grp_DayAndCost>() //公杂费用
                                                  where item.DiId == diid && item.Type == 3 && item.NationalTravelFeeId > 0 && item.IsDel == 0
                                                  select item).ToList();
+                    var dac4 = _sqlSugar.Queryable<Grp_DayOtherPrice>()
+                                .InnerJoin<Sys_SetData>((a,b)=> b.IsDel == 0 && b.Id == a.Currency)
+                                .InnerJoin<Sys_SetData>((a, b, c) => c.IsDel == 0 && c.Id == a.SetDataId)
+                                .Where((a, b, c)  => a.Diid == diid && a.IsDel == 0)
+                                .Select((a, b, c) => new
+                                {
+                                    a.Cost,
+                                    CurrencyStr = b.Name,
+                                    SetDataType = c.Name,
+                                    a.SubTotal,
+                                })
+                                .ToList(); //其他费用
 
                     if (dac1.Count == 0)
                     {
@@ -120,6 +132,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     decimal SumHotel = 0;
                     decimal SumMeals = 0;
                     decimal SumGongZa = 0;
+                    decimal sumOtherPrice = 0;
 
                     List<dynamic> hotelList = new List<dynamic>();
                     List<string> checkString = new List<string>();
@@ -168,8 +181,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         }
                     }
                     hotelList = hotelList.Distinct().ToList();
-                    List<dynamic> MealsList = new List<dynamic>();
 
+                    List<dynamic> MealsList = new List<dynamic>();
                     if (dac2.Count != 0) //餐费用
                     {
                         for (int i = 0; i < dac2.Count; i++)
@@ -208,8 +221,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     }
                     MealsList = MealsList.Distinct().ToList();
-                    List<dynamic> GongZaList = new List<dynamic>();
 
+                    List<dynamic> GongZaList = new List<dynamic>();
                     if (dac3.Count != 0) //公杂费用
                     {
                         for (int i = 0; i < dac3.Count; i++)
@@ -244,6 +257,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                     GongZaList = GongZaList.Distinct().ToList();
 
+                    List<object> otherList = new List<object>();
+                    if (dac4.Any())
+                    {
+                        foreach (var item in dac4)
+                        {
+                            otherList.Add(item);
+                            sumOtherPrice += item.SubTotal;
+                        }
+                    }
+
                     //签证
                     var Visa = new
                     {
@@ -293,6 +316,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     };
                     dynamics.Add(GongZa);
 
+                    //其他费用
+                    var other = new
+                    {
+                        Type = "Other",
+                        Content = otherList
+                    };
+                    dynamics.Add(other);
+
                     decimal AirJJCTotal = 0;
                     decimal AirGWCTotal = 0;
                     decimal AirTDCTotal = 0;
@@ -342,6 +373,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         AirTDCTotal += Math.Round(SumGongZa, 2);
                     }
 
+                    //其他费用选择框
+                    if (eec.OtherExpenses_Checked == 1)
+                    {
+                        AirJJCTotal += Math.Round(sumOtherPrice, 2);
+                        AirGWCTotal += Math.Round(sumOtherPrice, 2);
+                        AirTDCTotal += Math.Round(sumOtherPrice, 2);
+                    }
+
                     // 报批总报价 - 经济舱
                     if (eec.SumJJC == 0)
                     {