Browse Source

OP导入超支部分修改

123456 10 months ago
parent
commit
821072fcd9

+ 9 - 6
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -748,9 +748,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     });
 
                     //限制只能选择地区
-                    var opSingle = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(x => x.Id == dto.CTGGRId);
+                    var opSingle = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(x => x.Id == dto.CTGGRId && x.IsDel == 0);
                     var opSingleCityId = 0;
                     Grp_NationalTravelFee cityPrice = null;
+                    string priceCity = string.Empty;
 
                     //三公费用
                     if (int.TryParse(opSingle.Area, out opSingleCityId))
@@ -758,18 +759,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         cityPrice = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(x =>
                          x.Id == opSingleCityId
                         ).First();
+                        priceCity = cityPrice == null ? string.Empty : cityPrice?.City;
                     }
                     else
                     {
                         cityPrice = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(x =>
                             !string.IsNullOrEmpty(x.City) && x.City.Contains(opSingle.Area)
                         ).First();
+                        priceCity = opSingle.Area;
                     }
 
                     //超支费用表(数据添加)  Fin_GroupExtraCost
                     List<Fin_GroupExtraCost> groupExtraCostsArr = new List<Fin_GroupExtraCost>();
 
-                    var di = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x => x.Id == dto.DiId);
+                    var di = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x => x.Id == dto.DiId && x.IsDel == 0);
                     if (di == null)
                     {
                         result.Code = -1;
@@ -789,7 +792,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 Coefficient = 1,
                                 DiId = dto.DiId,
                                 PriceCurrency = item.Currency,
-                                PriceName = di.TeamName + "车超时费(地接导入)",
+                                PriceName = di.TeamName + priceCity + "车超时费(地接导入)",
                                 PriceType = 1028,
                                 PriceDt = item.DatePrice.ObjToDate(),
                                 PriceSum = item.Price * item.Count,
@@ -823,7 +826,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 {
                                     //全部转换为rmb;
                                     item["费用"] = price * currOp;
-                                    cityPrice.FoodCost = (foodCost * cityCurr).ToString("F2");
+                                    foodCost = (foodCost * cityCurr);
 
                                     item["币种"] = "836";
                                     cityPrice.Currency = 836;
@@ -840,7 +843,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                         Coefficient = 1,
                                         DiId = dto.DiId,
                                         PriceCurrency = cityPrice.Currency,
-                                        PriceName = di.TeamName + "餐费(地接导入)",
+                                        PriceName = di.TeamName + priceCity + "餐费(地接导入)",
                                         PriceType = 1028,
                                         PriceDt = Convert.ToDateTime(item["日期"]),
                                         PriceSum = price - foodCost,
@@ -859,7 +862,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     {
                         foreach (var item in groupExtraCostsArr)
                         {
-                            var QuerySgin = _sqlSugar.Queryable<Fin_GroupExtraCost>().Where(x => x.PriceName == item.PriceName && x.DiId == item.DiId && x.IsDel == 0 && item.PriceDt.ToString("yyyy-MM-dd") == item.PriceDt.ToString("yyyy-MM-dd")).First();
+                            var QuerySgin = _sqlSugar.Queryable<Fin_GroupExtraCost>().Where(x => x.PriceName == item.PriceName && x.DiId == item.DiId && x.IsDel == 0 && x.PriceDt.ToString("yyyy-MM-dd") == item.PriceDt.ToString("yyyy-MM-dd")).First();
                             if (QuerySgin == null)
                             {
                                 var resultThis = await PostGroupExtraCost_Operator(new Fin_GroupExtraCostDto_OP