ソースを参照

Merge branch 'develop' of http://132.232.92.186:3000/jiangjc/OASystemAPI into develop

Lyyyi 1 週間 前
コミット
f53b088f03

+ 19 - 6
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -1408,8 +1408,10 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
 
         // 3. 机票全量信息集合(同时包含正常票与退票 records)
         var dbAirTicketList = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
-            .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && x.DIId == y.DIId && y.CTable == 85)
-            .Where((x, y) => x.IsDel == 0 && y.IsDel == 0 && x.DIId == groupId && x.RecordType == 0)
+            //.InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && x.DIId == y.DIId && y.CTable == 85)
+            //.Where((x, y) => x.IsDel == 0 && y.IsDel == 0 && x.DIId == groupId && x.RecordType == 0)
+            .LeftJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && x.DIId == y.DIId && y.CTable == 85)     
+            .Where((x, y) => x.IsDel == 0 && x.DIId == groupId && x.RecordType == 0)
             .Select((x, y) => new
             {
                 Air = x,
@@ -1756,7 +1758,16 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
                         ));
                     }
                 }
-            }
+                else {
+                    expandedList.Add((
+                           FlightsDescription: item.FlightsDescription,
+                           CleanFlightsDesc: item.FlightsDescription?.Replace(" ", "").Replace("\n", "").Replace("\r", "").Trim().ToUpper() ?? "",
+                           TicketNumber: "",
+                           RecordType: item.RecordType,
+                           OriginalItem: item
+                       ));
+                }
+        }
 
             // 再去重
             var distinctSaveList = expandedList
@@ -1863,7 +1874,7 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
                     airEntity.ArrivedTime = string.Join("/", item.OriginalItem?.AirTicketBasicInfos.Select(x => x.ArrivedTime));
                     airEntity.TicketNumber = item.TicketNumber;
                     airEntity.TicketCode = item.OriginalItem?.CustTicketInfos.FirstOrDefault(x => x.TicketNumber == item.TicketNumber)?.TicketCode ?? string.Empty;
-                    airEntity.PriceDescription = tempCardSource.PriceDescription ?? string.Empty;
+                    airEntity.PriceDescription = tempCardSource?.PriceDescription ?? string.Empty;
 
                     var airId = await _sqlSugar.Insertable(airEntity).ExecuteReturnIdentityAsync(); //Grp_AirTicketReservations.Id
 
@@ -1874,6 +1885,7 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
                             newCreatedNormalAirMap.Add(normalLookupKey, airId);
                         }
                     }
+                    if (tempCardSource == null) { continue; }
                     var cardEntity = _mapper.Map<Grp_CreditCardPayment>(tempCardSource);
                     cardEntity.DIId = groupId;
                     cardEntity.CId = airId;
@@ -1942,10 +1954,11 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
                 // -------------------- 分支 B:编辑覆盖 --------------------
                 else
                 {
+
                     //添加附加服务费用表数据,以及C表对应费用审核数据
                     //需要预检查数据库中是否存在附加服务数据,如果存在则更新,不存在则新增
                     List<CustTicketInfo> custList = item.OriginalItem?.CustTicketInfos.ToList();
-
+                    if(custList.Count == 0) { continue; }
                     foreach (var custItem in custList)
                     {
                         List<AdditionalService> addList = custItem.AdditionalServices;
@@ -2317,7 +2330,7 @@ public class AirTicketResRepository : BaseRepository<Grp_AirTicketReservations,
                     .Select(g => g.First())
                     .ToList() ?? new List<CustTicketInfo>();
 
-                if (ticketCustomers.Count < 1) { continue; }
+                //if (ticketCustomers.Count < 1) { continue; }
 
                 // 1. 【正常票过滤】:非退票,或者虽然标记了 IsRefund 但 RefundRecord 类根本不存在的归入正常票
                 var normalCustomers = ticketCustomers;