Переглянути джерело

地接费用录入新增只保留提交数据逻辑

yuanrf 8 місяців тому
батько
коміт
72bc9418cf

+ 16 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -728,6 +728,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     DatePrice = item.DatePrice,
                     Count = item.Count,
                 }).ToList();
+                string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm ss");
+
+                var ids = carTouristList.Select(x1 => x1.Id);
+                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
+                {
+                    IsDel = 1,
+                    DeleteTime = time ,
+                    DeleteUserId = dto.CreateUserId,
+                }) .ExecuteCommand();
+
+                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && ids.Contains(x.Id)).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
+                {
+                    IsDel = 0,
+                    DeleteTime = "",
+                    DeleteUserId = null,
+                }).ExecuteCommand();
 
                 if (carTouristList.Count > 0)
                 {