yuanrf 9 months ago
parent
commit
3024eec4b3

+ 42 - 30
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -741,37 +741,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     tb.Columns.Add("日期", typeof(DateTime));
                     tb.Columns.Add("费用", typeof(decimal));
                     tb.Columns.Add("币种", typeof(string));
-                    var addsTourClientList = new List<Grp_TourClientList>();
                     var carExtraList = carTouristList.Where(x => x.SId == 982 && x.Price != 0).ToList();
                     var mealPriceList = carTouristList.Where(x => (x.SId == 93 || x.SId == 988 || x.SId == 989) && x.Price != 0).GroupBy(x => x.DatePrice).ToList();
                     var tgOvertime = carTouristList.Where(x => x.SId == 1059 && x.Price != 0).ToList();
 
-                    //Dictionary<int,string> enterOverspendArrParam = new Dictionary<int,string>();
-                    //enterOverspendArrParam.Add(0,"");
-                    //enterOverspendArrParam.Add(1, "");
-                    //enterOverspendArrParam.Add(2, "");
-
-                    //List<List<Grp_CarTouristGuideGroundReservationsContent>> enterOverspendArr = new List<List<Grp_CarTouristGuideGroundReservationsContent>>();
-
-                    //foreach (var item in enterOverspendArrParam.Keys)
-                    //{
-                    //    var a = carTouristList.Where(x => x.SId == item).ToList();
-                    //    var b = a.Select(x => new Fin_GroupExtraCost
-                    //    {
-                    //         Coefficient = 1,
-                    //         CreateTime = DateTime.Now,
-                    //           CreateUserId = dto.CreateUserId,
-                    //            DiId = dto.DiId,
-                    //             FilePath = string.Empty,
-                    //              IsDel = 0,
-                    //              PriceCount = 0,
-                    //    }).ToList();
-                    //}
-
-
-
-
-
+                    List<Tuple<int, string, int, decimal>> arr = new List<Tuple<int, string, int, decimal>>();
+                    arr.Add(new Tuple<int, string, int,decimal>(1074, "早餐超支费用", 1077, 1M));  // sid name setdataid 系数
+                    arr.Add(new Tuple<int, string, int,decimal>(1075, "午餐超支费用", 1078, 1M));
+                    arr.Add(new Tuple<int, string, int,decimal>(1076, "晚餐超支费用", 1079, 1M));
 
                     //成本数据
                     List<Grp_GroupCost> _GroupCosts = new List<Grp_GroupCost>();
@@ -853,6 +830,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         return result;
                     }
 
+                    //车超时费
                     if (carExtraList.Count > 0)
                     {
                         foreach (var item in carExtraList)
@@ -862,7 +840,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 Price = item.Price,
                                 CreateTime = DateTime.Now,
                                 CreateUserId = dto.CreateUserId,
-                                Coefficient = 1,
+                                Coefficient = 2M,
                                 DiId = dto.DiId,
                                 PriceCurrency = item.Currency,
                                 PriceName = di.TeamName + "-" + priceCity + "-" + "车超时费(地接导入)",
@@ -886,7 +864,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 Price = item.Price,
                                 CreateTime = DateTime.Now,
                                 CreateUserId = dto.CreateUserId,
-                                Coefficient = 1,
+                                Coefficient = 2M,
                                 DiId = dto.DiId,
                                 PriceCurrency = item.Currency,
                                 PriceName = di.TeamName + "-" + priceCity + "-" + "导游超时费(地接导入)",
@@ -900,6 +878,40 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         }
                     }
 
+                    List<List<Fin_GroupExtraCost>> enterOverspendArr = new List<List<Fin_GroupExtraCost>>();
+
+                    foreach (var item in arr)
+                    {
+
+                        var a = carTouristList.Where(x => x.SId == item.Item1 && x.Price != 0).Select(x => new Fin_GroupExtraCost
+                        {
+                            Coefficient =  item.Item4,
+                            CreateTime = DateTime.Now,
+                            CreateUserId = dto.CreateUserId,
+                            DiId = dto.DiId,
+                            FilePath = string.Empty,
+                            IsDel = 0,
+                            PriceCount = x.Count,
+                            Price = x.Price,
+                            PriceDt = x.DatePrice.ObjToDate(),
+                            PriceCurrency = x.Currency,
+                            PriceSum = x.Count * x.Price,
+                            PriceName = di.TeamName + "-" + priceCity + "-" + $"{item.Item2}(地接导入)",
+                            PriceType = 1028,
+                            PriceDetailType = item.Item3,
+                        }).ToList();
+                        if (a.Count > 0)
+                        {
+                            enterOverspendArr.Add(a);
+                        }
+                    }
+
+                    //数组中的费用
+                    if (enterOverspendArr.Count > 0)
+                    {
+                        groupExtraCostsArr.AddRange(enterOverspendArr.SelectMany(x => x).ToList());
+                    }
+
                     if (_GroupCostParameters != null)
                     {
                         //币种
@@ -1203,7 +1215,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             catch (Exception ex)
             {
                 RollbackTran();
-                return result = new Result() { Code = -2, Msg = "未知错误" };
+                return result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})"};
             }
             return result;
         }