Selaa lähdekoodia

团组报表 --> 地接相关处理以前数据

LEIYI 6 kuukautta sitten
vanhempi
commit
7f4d80a706
1 muutettua tiedostoa jossa 32 lisäystä ja 5 poistoa
  1. 32 5
      OASystem/OASystem.Api/Controllers/StatisticsController.cs

+ 32 - 5
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -178,7 +178,11 @@ namespace OASystem.API.Controllers
                 #region 费用类型 币种,转账,客户信息
 
                 List<Sys_SetData> _setDatas = await _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToListAsync();
-                var _clientDatas = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0).ToListAsync();
+                var _clientDatas = await _sqlSugar.Queryable<Crm_DeleClient>()
+                    .Where(it => it.IsDel == 0)
+                    .Select(x => new Crm_DeleClient { Id = x.Id, FirstName = x.FirstName, LastName = x.LastName, Sex = x.Sex })
+                    .ToListAsync();
+                foreach (var item in _clientDatas) EncryptionProcessor.DecryptProperties(item);
 
                 #endregion
 
@@ -484,8 +488,8 @@ ORDER BY
                 groupHotelFeeViews = await _sqlSugar.SqlQueryable<GroupHotelFeeView>(hotelFeeSql).ToListAsync();
 
                 List<int> hotelSubIds = groupHotelFeeViews.Select(it => it.HrId).ToList();
-                List<Grp_HotelReservationsContent> groupHotelContentFeeViews = new List<Grp_HotelReservationsContent>();
-                groupHotelContentFeeViews = await _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => hotelSubIds.Contains(it.HrId)).ToListAsync();
+
+                var groupHotelContentFeeViews = await _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => hotelSubIds.Contains(it.HrId)).ToListAsync();
 
                 decimal HotelCNYTotalPrice = 0.00M;
 
@@ -606,8 +610,10 @@ ORDER BY
                 #region 地接费用
 
                 List<GroupCTGGRFeeView> groupCTGGRFeeViews = new List<GroupCTGGRFeeView>();
-
-                string CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.PriceName As Area,ctggrc.*,ctggrc.Price As PayMoney,
+                string CTGGRFeeSql = string.Empty;
+                if (_dto.DiId > 2352)
+                {
+                    CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.PriceName As Area,ctggrc.*,ctggrc.Price As PayMoney,
                                                      sd2.name As PaymentCurrency,ccp.PayPercentage,
                                                      (ctggrc.Price * (ccp.PayPercentage / 100)) As AmountPaid,
                                                      (ctggrc.Price - ctggrc.Price * (ccp.PayPercentage / 100)) As BalancePayment,
@@ -627,6 +633,26 @@ ORDER BY
                                                      Left Join Sys_Users u On ccp.CreateUserId = u.Id
                                                      Where ctggr.IsDel = 0 {1} And ctggr.DiId = {0}
                                                      Order By CreateTime", _dto.DiId, _dto.isAudit ? "And (ccp.IsAuditGM = 1 OR ccp.IsAuditGM = 3)" : " ");
+                }
+                else
+                {
+                    CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.PriceName As Area,
+													 ccp.PayMoney,sd2.name As PaymentCurrency,ccp.PayPercentage,
+													 (ccp.PayMoney * (ccp.PayPercentage / 100)) As AmountPaid,
+													 (ccp.PayMoney -ccp.PayMoney * (ccp.PayPercentage / 100)) As BalancePayment,
+                                                     ccp.DayRate,(ccp.PayMoney * (ccp.PayPercentage / 100) * ccp.DayRate) As CNYPrice,
+													 ccp.Payee,ccp.AuditGMDate,
+                                                     ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ctggr.CreateTime
+                                                     From Grp_CarTouristGuideGroundReservations ctggr
+                                                     Left Join Grp_CreditCardPayment ccp On ccp.IsDel = 0  And ccp.CTable = 79 And ctggr.Id = ccp.CId
+                                                     Left Join Sys_SetData sd1 On ccp.PayDId = sd1.Id
+                                                     Left Join Sys_SetData sd2 On ccp.PaymentCurrency = sd2.Id
+                                                     Left Join Sys_Users u On ccp.CreateUserId = u.Id
+                                                     Where ctggr.IsDel = 0 {1} And ctggr.DiId = {0}
+                                                     Order By CreateTime", _dto.DiId, _dto.isAudit ? "And (ccp.IsAuditGM = 1 OR ccp.IsAuditGM = 3)" : " ");
+                }
+
+
 
                 groupCTGGRFeeViews = await _sqlSugar.SqlQueryable<GroupCTGGRFeeView>(CTGGRFeeSql).ToListAsync();
 
@@ -781,6 +807,7 @@ ORDER BY
                                 int clienIndex = 1;
                                 foreach (var client in clients)
                                 {
+
                                     airClientPris.Add(new
                                     {
                                         CnName = client.LastName + client.FirstName,