Browse Source

EnterExitCostMobileSubInfo API+Android 联调 更改返回字段

LEIYI 3 months ago
parent
commit
7700cdd886

+ 12 - 12
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -7586,10 +7586,10 @@ FROM
                     })
                      .ToArray();
 
-                var data = new ChoiceThreeMobileSubInfoView() {
+                var data = new ChoiceMobileSubInfo3To6View() {
                     ParentId = eecInfo.Id,
-                    ChoiceThree = eecInfo.ChoiceThree,
-                    ChoiceThreeTotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+                    Choice = eecInfo.ChoiceThree,
+                    TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
                     Details = dayAndCostDatas
 
                 };
@@ -7616,11 +7616,11 @@ FROM
                     })
                      .ToArray();
 
-                var data = new ChoiceFourMobileSubInfoView()
+                var data = new ChoiceMobileSubInfo3To6View()
                 {
                     ParentId = eecInfo.Id,
-                    ChoiceFour = eecInfo.ChoiceFour,
-                    ChoiceFourTotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+                    Choice = eecInfo.ChoiceFour,
+                    TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
                     Details = dayAndCostDatas
                 };
                 return Ok(JsonView(data));
@@ -7646,11 +7646,11 @@ FROM
                     })
                     .ToArray();
 
-                var data = new ChoiceFiveMobileSubInfoView()
+                var data = new ChoiceMobileSubInfo3To6View()
                 {
                     ParentId = eecInfo.Id,
-                    ChoiceFive = eecInfo.ChoiceFive,
-                    ChoiceFiveTotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+                    Choice = eecInfo.ChoiceFive,
+                    TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
                     Details = dayAndCostDatas
                 };
                 return Ok(JsonView(data));
@@ -7676,11 +7676,11 @@ FROM
                      })
                      .ToArray();
 
-                var data = new ChoiceSixMobileSubInfoView()
+                var data = new ChoiceMobileSubInfo3To6View()
                 {
                     ParentId = eecInfo.Id,
-                    ChoiceSix = eecInfo.ChoiceSix,
-                    ChoiceSixTotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
+                    Choice = eecInfo.ChoiceSix,
+                    TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
                     Details = dayAndCostDatas
                 };
                 return Ok(JsonView(data));

+ 100 - 15
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -1,4 +1,5 @@
 using Aspose.Cells;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
 using NPOI.SS.Formula.Functions;
 using OASystem.API.OAMethodLib;
 using OASystem.Domain.AesEncryption;
@@ -513,7 +514,6 @@ ORDER BY
                                            支付方式:{_setDatas.Find(it => it.Id == roomData?.PayDId)?.Name} <br/>
                                            卡类型:{_setDatas.Find(it => it.Id == roomData?.CTDId)?.Name}<br/>
                                            是否由地接支付:{isFeeMark1} <br/>";
-
                         }
 
                         var breakfastData = groupHotelContentFeeViews.Find(it => it.HrId == item.HrId && it.PriceType == 2); //早餐 
@@ -578,7 +578,10 @@ ORDER BY
                             item.IsPay = 2;
                             item.PayTips = paymentStr;
                         }
-
+                        //item.CNYPrice = roomData?.Price ?? 0.00M * roomData?.Rate ?? 0.00M +
+                        //                breakfastData?.Price ?? 0.00M * breakfastData?.Rate ?? 0.00M +
+                        //                landTaxData?.Price ?? 0.00M * landTaxData?.Rate ?? 0.00M +
+                        //                cityTaxData?.Price ?? 0.00M * cityTaxData?.Rate ?? 0.00M;
                     }
                     else
                     {
@@ -5210,17 +5213,21 @@ WHERE
             var nowBool = DateTime.TryParse(nowLable, out DateTime now);
             if (!nowBool) return Ok(JsonView(false, $"请传入有效的当前时间(2024-11-27)!"));
 
+            var sql = string.Format(@"SELECT * FROM Grp_DelegationInfo WHERE ISdel = 0  AND '{0}' BETWEEN VisitStartDate AND VisitEndDate", nowLable);
+            var groupInfos = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).Select(x => new { x.Id, x.VisitCountry, x.TeamName, x.VisitStartDate, x.VisitEndDate }).ToListAsync();
+
+            var groupIds = groupInfos.Select(x => x.Id).ToList();
             #region 舱位类型
-            //457 头等舱
-            //458 公务舱
-            //459 超经舱
-            //460 经济舱
-            //461 退票
-            //565 其他
-            //574 长段公务舱
-            //575 短途经济舱
-            //1023    行程单打印费
-            //1024    选座费
+            //457   头等舱
+            //458   公务舱
+            //459   超经舱
+            //460   经济舱
+            //461   退票
+            //565   其他
+            //574   长段公务舱
+            //575   短途经济舱
+            //1023  行程单打印费
+            //1024  选座费
 
             var classTypes = new int[] { 457, 458, 459, 460, 574, 575 };
 
@@ -5228,21 +5235,99 @@ WHERE
 
             var throughCities = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
                 .LeftJoin<Grp_DelegationInfo>((atr, di) => atr.DIId == di.Id)
-                .Where((atr, di) => atr.IsDel == 0 && atr.FlightsDate.Trim().Equals(nowLable) && classTypes.Contains(atr.CType))
+                .Where((atr, di) => atr.IsDel == 0 && 
+                                    groupIds.Contains(atr.DIId) && 
+                                    atr.FlightsDate.Trim().Equals(nowLable) && 
+                                    classTypes.Contains(atr.CType))
                 .Select((atr, di) => new
                 {
                     atr.DIId,
                     di.TeamName,
                     atr.FlightsDate,
                     atr.FlightsCode,
-                    atr.FlightsCity
+                    atr.FlightsCity,
+                    atr.FlightsDescription
                 })
                 .ToListAsync();
 
+            if (!throughCities.Any()) return Ok(JsonView(false,"今日暂无团组出行!"));
+
+            foreach (var item in throughCities)
+            {
+                var dt = GeneralMethod.GetTableByBlackCode(item.DIId);
+
+                foreach (var row in dt.Rows)
+                {
+
+                    
+
+                }
+
+            }
+
+
+
+
+            throughCities = throughCities.Distinct().ToList(); // 去重
             var cities = await _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.IsDel == 0).ToListAsync();
 
+            var view = new List<StatisticsNowCityOfGroupView>();
+            foreach (var item in throughCities)
+            {
+                var viewInfo = new StatisticsNowCityOfGroupView();
+
+                string flightCityLable = item.FlightsCity,
+                       flightNoLable = item.FlightsCode;
+
+                if (flightCityLable.Contains(@"/") && flightNoLable.Contains(@"/"))
+                {
+                    var flightCityArray = flightCityLable.Split(@"/"); 
+                    var flightNoArray = flightNoLable.Split(@"/");
+                    int index = 0;
+                    foreach (var citys in flightCityArray)
+                    {
+                        viewInfo = CitySplit(citys, cities);
+                        viewInfo.CurrDate = nowLable;
+                        viewInfo.GroupName = item.TeamName;
+                        viewInfo.FlightNo = flightNoArray[index];
+                        view.Add(viewInfo);
+                        index++;
+                    }
+                }
+                else
+                {
+                    viewInfo = CitySplit(flightCityLable, cities);
+                    viewInfo.CurrDate = nowLable;
+                    viewInfo.GroupName = item.TeamName;
+                    viewInfo.FlightNo = flightNoLable;
+                    view.Add(viewInfo);
+                }
+            }
+            if (!view.Any()) return Ok(JsonView(false, "今日暂无团组出行!"));
+
+            return Ok(JsonView(view));
+        }
+
+        private StatisticsNowCityOfGroupView CitySplit(string cityLable,List<Res_ThreeCode> cities)
+        {
+            var info = new StatisticsNowCityOfGroupView();
+            if (string.IsNullOrEmpty(cityLable)) return info;
+
+            var cityArray = cityLable.Split("-");
+            var departCityCode = cityArray[0];
+            var arriveCityCode = cityArray[1];
+
+            var departAirportInfo = cities.Find(x => x.Three.Equals(departCityCode.ToUpper()));
+            info.DepartAirportCode = departCityCode;
+            info.DepartCountryName = departAirportInfo?.Country ?? "-";
+            info.DepartCityName = departAirportInfo?.City ?? "-";
+
+            var arriveAirportInfo = cities.Find(x => x.Three.Equals(arriveCityCode.ToUpper()));
+            info.ArriveAirportCode = arriveCityCode;
+            info.ArriveCountryName = arriveAirportInfo?.Country ?? "-";
+            info.ArriveCityName = arriveAirportInfo?.City ?? "-";
 
-            return Ok(JsonView(false));
+            return info;
         }
 
         #endregion

+ 0 - 2
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -207,8 +207,6 @@ namespace OASystem.API.OAMethodLib
             return notificationStr;
         }
 
-
-
         #endregion
 
         #region md5 加密

+ 17 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -1598,5 +1598,22 @@ namespace OASystem.Domain.ViewModels.Financial
         public GroupTypeInfo[] Details { get; set; }
     }
     #endregion
+
+
+    #region 团组数据统计-当前时间团组所在城市
+    public class StatisticsNowCityOfGroupView 
+    {
+        public string CurrDate { get; set; }
+        public string GroupName { get; set; }
+        public string FlightNo { get; set; }
+        public string DepartAirportCode { get; set; }
+        public string DepartCountryName { get; set; }
+        public string DepartCityName { get; set; }
+        public string ArriveAirportCode { get; set; }
+        public string ArriveCountryName { get; set; }
+        public string ArriveCityName { get; set; }
+    }
+
+    #endregion
     #endregion
 }

+ 5 - 50
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs

@@ -766,70 +766,25 @@ namespace OASystem.Domain.ViewModels.Groups
         public decimal SubTotal { get; set; }
     }
 
-    public class ChoiceThreeMobileSubInfo3To6BaseView
+    public class ChoiceMobileSubInfo3To6View
     {
         /// <summary>
         /// 主表Id
         /// </summary>
         public int ParentId { get; set; }
-        public DayAndCostMobileInfoView[] Details { get; set; }
-    }
-    public class ChoiceThreeMobileSubInfoView : ChoiceThreeMobileSubInfo3To6BaseView
-    {
-        /// <summary>
-        /// 住宿费合计 选择框
-        /// </summary>
-        public int ChoiceThree { get; set; }
-
-        /// <summary>
-        /// 住宿费合计
-        /// </summary>
-        public decimal ChoiceThreeTotalCost { get; set; }
-
-    }
-
-    public class ChoiceFourMobileSubInfoView : ChoiceThreeMobileSubInfo3To6BaseView
-    {
-        /// <summary>
-        /// 住宿费合计 选择框
-        /// </summary>
-        public int ChoiceFour { get; set; }
-
-        /// <summary>
-        /// 住宿费合计
-        /// </summary>
-        public decimal ChoiceFourTotalCost { get; set; }
-
-    }
-
-    public class ChoiceFiveMobileSubInfoView : ChoiceThreeMobileSubInfo3To6BaseView
-    {
         /// <summary>
         /// 住宿费合计 选择框
         /// </summary>
-        public int ChoiceFive { get; set; }
+        public int Choice { get; set; }
 
         /// <summary>
         /// 住宿费合计
         /// </summary>
-        public decimal ChoiceFiveTotalCost { get; set; }
-
-    }
-
-    public class ChoiceSixMobileSubInfoView : ChoiceThreeMobileSubInfo3To6BaseView
-    {
-        /// <summary>
-        /// 住宿费合计 选择框
-        /// </summary>
-        public int ChoiceSix { get; set; }
-
-        /// <summary>
-        /// 住宿费合计
-        /// </summary>
-        public decimal ChoiceSixTotalCost { get; set; }
+        public decimal TotalCost { get; set; }
 
+        public DayAndCostMobileInfoView[] Details { get; set; }
     }
-
+   
     public class DayOtherPriceMobileInfoView
     {
         public int SubId { get; set; }