Ver código fonte

报批读取修该

123456 10 meses atrás
pai
commit
f727016cbe

+ 60 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/GroupCostParameterRepository.cs

@@ -85,6 +85,19 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                                  where item.DiId == diid && item.Type == 3 && item.NationalTravelFeeId > 0 && item.IsDel == 0
                                                  select item).ToList();
 
+                    if (dac1.Count == 0)
+                    {
+                        dac1 = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.DiId == diid && x.Type == 1 && x.IsDel == 0).ToList();  //酒店费用
+                    }
+                    if (dac2.Count == 0)
+                    {
+                        dac2 = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.DiId == diid && x.Type == 2 && x.IsDel == 0).ToList();  //酒店费用
+                    }
+                    if (dac2.Count == 0)
+                    {
+                        dac3 = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.DiId == diid && x.Type == 3 && x.IsDel == 0).ToList();  //酒店费用
+                    }
+
                     decimal SumHotel = 0;
                     decimal SumMeals = 0;
                     decimal SumGongZa = 0;
@@ -111,6 +124,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             }
                             SumHotel += dac1[i].SubTotal;
                         }
+
+                        if (hotelList.Count == 0)
+                        {
+                            var group = dac1.GroupBy(x => x.NationalTravelFeeId).ToList();
+                            foreach (var hotel in group)
+                            {
+                                var city = _sqlSugar.Queryable<Grp_NationalTravelFee>().First(it => it.IsDel == 0 && it.Id == hotel.Key);
+                                var hotelData = new
+                                {
+                                    CountryOrCity = city?.Country + city?.City,
+                                    Price = hotel.ToList()[0].SubTotal,
+                                };
+                                hotelList.Add(hotelData);
+                                checkString.Add(city?.City ?? "");
+                            }
+                        }
                     }
                     hotelList = hotelList.Distinct().ToList();
                     List<dynamic> MealsList = new List<dynamic>();
@@ -131,6 +160,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             }
                             SumMeals += dac2[i].SubTotal;
                         }
+
+                        if (MealsList.Count == 0)
+                        {
+                            var group = dac3.GroupBy(x => x.NationalTravelFeeId).ToList();
+                            foreach (var hotel in group)
+                            {
+                                var city = _sqlSugar.Queryable<Grp_NationalTravelFee>().First(it => it.IsDel == 0 && it.Id == hotel.Key);
+                                var mealsData = new
+                                {
+                                    CountryOrCity = city?.Country +  city?.City,
+                                    Price = hotel.ToList()[0].SubTotal,
+                                };
+                                MealsList.Add(mealsData);
+                            }
+                        }
+
                     }
                     MealsList = MealsList.Distinct().ToList();
                     List<dynamic> GongZaList = new List<dynamic>();
@@ -151,6 +196,21 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             }
                             SumGongZa += dac3[i].SubTotal;
                         }
+
+                        if (GongZaList.Count == 0)
+                        {
+                            var group = dac3.GroupBy(x => x.NationalTravelFeeId).ToList();
+                            foreach (var hotel in group)
+                            {
+                                var city = _sqlSugar.Queryable<Grp_NationalTravelFee>().First(it => it.IsDel == 0 && it.Id == hotel.Key);
+                                var gongZaData = new
+                                {
+                                    CountryOrCity = city?.Country +  city?.City,
+                                    Price = hotel.ToList()[0].SubTotal,
+                                };
+                                GongZaList.Add(gongZaData);
+                            }
+                        }
                     }
                     GongZaList = GongZaList.Distinct().ToList();