Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

leiy 11 months ago
parent
commit
d8c48e3b42

+ 47 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -16,11 +16,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
     public class CarTouristGuideGroundRepository:BaseRepository<Grp_CarTouristGuideGroundReservations, Grp_CarTouristGuideGroundReservationsContent>
     {
         private readonly IMapper _mapper;
+        private readonly CheckBoxsRepository _checkRep;
 
-        public CarTouristGuideGroundRepository(SqlSugarClient sqlSugar, IMapper mapper)
+        public CarTouristGuideGroundRepository(SqlSugarClient sqlSugar, IMapper mapper , CheckBoxsRepository checkRep)
             : base(sqlSugar)
         {
             _mapper = mapper;
+            _checkRep = checkRep;
         }
 
         public async Task<Result> OpCarTouristGuideGround(OpCarTouristGuideGroundDto dto)
@@ -228,6 +230,47 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     else _CreditCardPayment.OrbitalPrivateTransferStr = "私转";
                 }
 
+                Dictionary<string, string> soureDic = new Dictionary<string, string>()
+                {
+                    {"车费", "VF"},
+                    {"导游费", "T/G S"},
+                    {"客户午餐费用" , "L"},
+                    {"导游景点费" , "T/G EF"},
+                    {"导游小费" , "T/G T"},
+                      // --
+                     {"司机小费", "DRV T"},
+                     {"司机餐补", "C/F M"},
+                     {"车超时费", "C/F OF"},
+                     {"导游餐补", "T/G M"},
+                     {"导游房补", "T/G A"},
+                     {"导游交通", "T/G TF"},
+                     {"客户早餐费用", "B"},
+                     {"客户晚餐费用", "D"},
+                     {"景点门票费", "EF"},
+                     {"饮料/零食/水果", "B/R/F"},
+                     {"翻译费", "I/F"},
+                };
+
+                //获取成本选中
+                var checkTopArr = _checkRep.GetCheckBoxsByDiid(grpCarOp.DiId);
+                if (checkTopArr.Count > 0)
+                {
+                    var FindTop = checkTopArr.Find(x => x.CbType == "Top");
+                    if (FindTop != null)
+                    {
+                        var selectName = FindTop.CbValues.Split(',').ToList<string>();
+                        foreach (var soureKey in soureDic.Keys)
+                        {
+                            var find =  selectName.Find(x => x == soureDic[soureKey]);
+                            if (find == null)
+                            {
+                                var Lindex =  carTouristGuides.FindIndex(x=>x.SidName == soureKey);
+                                carTouristGuides.RemoveRange(Lindex , day + 1);
+                            }
+                        }
+                    }
+                }
+
                 var data = new
                 {
                     Payment = _Payment,
@@ -482,11 +525,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         }
                     }
                 }
+
                 //修改C表数据
-                List<Grp_CarTouristGuideGroundReservationsContent> carTouristListEnd = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a=>a.DiId==dto.DiId && a.CTGGRId==dto.CTGGRId && a.IsDel==0).ToList();
+                //List<Grp_CarTouristGuideGroundReservationsContent> carTouristListEnd = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a=>a.DiId==dto.DiId && a.CTGGRId==dto.CTGGRId && a.IsDel==0).ToList();
                 Grp_CreditCardPayment c = new Grp_CreditCardPayment();
                 c.PaymentCurrency = dto.Currency;
-                c.PayMoney = carTouristListEnd.Sum(x => x.Price);
+                c.PayMoney = carTouristList.Sum(x => x.Price);
                 c.PayPercentage = dto.PayPercentage;
                 c.ConsumptionDate= DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 c.CTable = 79;