Browse Source

酒店预订数量统计

leiy 10 months ago
parent
commit
5391f17600

+ 0 - 1
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -128,7 +128,6 @@ namespace OASystem.API.Controllers
 
             }
 
-
             //#region 添加登录用户上线信息
             //_hubContext.SignalRLogin(uId);
             //#endregion

+ 401 - 10
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -18,6 +18,8 @@ using Microsoft.VisualBasic;
 using OASystem.Domain.Entities.Groups;
 using Microsoft.Extensions.DependencyInjection;
 using Aspose.Words.Lists;
+using static OASystem.API.OAMethodLib.GeneralMethod;
+using TypeInfo = OASystem.Domain.ViewModels.Statistics.TypeInfo;
 
 namespace OASystem.API.Controllers
 {
@@ -1106,6 +1108,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         ///  企业利润
         ///  Details 
+        ///  待添加权限验证
         /// </summary>
         /// <param name="_dto">团组列表请求dto</param>
         /// <returns></returns>
@@ -1117,10 +1120,12 @@ namespace OASystem.API.Controllers
             #region  参数验证
             if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
             if (_dto.PageId < 1) _dto.PageId = 38; //团组报表页面Id
+            if (_dto.Year < 1) return Ok(JsonView(false, "请输入有效的Year参数!"));
             if (_dto.StatisticsType > 2 && _dto.StatisticsType < 1) return Ok(JsonView(false, "请输入有效的StatisticsType参数,1 月份 2 季度"));
             if (_dto.BusinessType > 3 && _dto.BusinessType < 1) return Ok(JsonView(false, "请输入有效的BusinessType参数,1 所有 2 团组 3 会务"));
 
             PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
+
             #region 页面操作权限验证
             //pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
 
@@ -1130,10 +1135,10 @@ namespace OASystem.API.Controllers
             string sqlWhere = string.Empty;
 
             //起止时间
-            string beginDt = $"{_dto.Year}-01-01 00:00";
-            string endDt = $"{_dto.Year}-12-31 59:59";
+            DateTime beginDt = Convert.ToDateTime( $"{_dto.Year}-01-01 00:00:00");
+            DateTime endDt = Convert.ToDateTime($"{_dto.Year}-12-31 23:59:59");
 
-            sqlWhere = string.Format(@$" Where Isdel = 0 And CreateTime Between {beginDt} And {endDt}");
+            sqlWhere = string.Format(@$" Where Isdel = 0 ");
 
             //业务类型
             List<int> groupTypeId = new List<int>();
@@ -1165,7 +1170,7 @@ namespace OASystem.API.Controllers
 
             string sql = string.Format(@$"Select * From Grp_DelegationInfo {sqlWhere}");
 
-            var groupInfos = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToListAsync();
+            var groupInfos = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).Where(it => it.CreateTime >= beginDt && it.CreateTime <= endDt).ToListAsync();
 
             if (groupInfos.Count < 1) return Ok(JsonView(false, "暂无相关团组!"));
 
@@ -1173,9 +1178,34 @@ namespace OASystem.API.Controllers
 
             List<CorporateProfit> corporateProfits = await CorporateProfit(diIds);
 
+            List<MonthInfo> months = new List<MonthInfo>();
+            if (_dto.StatisticsType == 1) //月份
+            {
+                 months = GeneralMethod.GetMonthInfos(Convert.ToInt32(_dto.Year));
+               
+            }
+            else if (_dto.StatisticsType == 1) //季度
+            {
+                months = GeneralMethod.GetQuarter(Convert.ToInt32(_dto.Year));
+            }
 
+            List<CorporateProfitMonthView> _view = new List<CorporateProfitMonthView>();
+            foreach (var item in months)
+            {
+                DateTime monthBeginDt = Convert.ToDateTime($"{_dto.Year}-{item.Month}-{item.Days.BeginDays} 00:00:00");
+                DateTime monthEndDt = Convert.ToDateTime($"{_dto.Year}-{item.Month}-{item.Days.EndDays} 23:59:59");
+
+                var corporateProfit = corporateProfits.Where(it => it.CreateDt >= monthBeginDt && it.CreateDt <= monthEndDt).ToList();
+
+                _view.Add(new CorporateProfitMonthView()
+                {
+                    Month = item.Month,
+                    Profit = corporateProfit.Sum(it => it.ReceivedProfit),
+                    GroupInfos = corporateProfit.OrderBy(it => it.CreateDt).ToList()
+                });
+            }
 
-            return Ok(JsonView(true));
+            return Ok(JsonView(true,"操作成功!",_view));
             #endregion
 
         }
@@ -1545,7 +1575,7 @@ namespace OASystem.API.Controllers
                 {
                     DiId = _diId,
                     TeamName = groupInfo?.TeamName ?? "Unkwnon",
-                    CreateDt = groupInfo?.CreateTime.ToString("yyyy-MM-dd") ?? "Unkwnon",
+                    CreateDt = Convert.ToDateTime(groupInfo?.CreateTime),
                     TotalExpenditure = _totalExpenditure,
                     ExpenditureItem = expenditureInfos,
                     AmountReceivable = _amountReceivable,
@@ -1558,18 +1588,379 @@ namespace OASystem.API.Controllers
 
             #endregion
 
-
             return corporateProfits;
         }
 
-
-
-
         //未来预测-地区接团/出团量
         //未来预测-地区酒店预订量
         //未来预测-地区机票预订量
         //未来预测-地区车辆预订量
 
+        /// <summary>
+        ///  (国家/城市)地区预订数量(团,酒店,机票,车辆)
+        ///  Details
+        ///  待添加权限验证 
+        /// </summary>
+        /// <param name="_dto">团组列表请求dto</param>
+        /// <returns></returns>
+        [HttpPost("PostRegionalBookingsNumber")]
+        //[JsonConverter(typeof(DecimalConverter), 2)]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostRegionalBookingsNumber(PostRegionalBookingsNumberDto _dto)
+        {
+            #region  参数验证
+            if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+            //if (_dto.PageId < 1) _dto.PageId = 38; //团组报表页面Id
+            if (_dto.Type > 1 && _dto.Type > 5) return Ok(JsonView(false, "请输入有效的Type参数,1 团 2 酒店 3 机票 4 车辆"));
+            if (_dto.Year < 1) return Ok(JsonView(false, "请输入有效的Year参数!"));
+
+            PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
+
+            #region 页面操作权限验证
+            //pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+
+            //if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
+            #endregion
+
+            string sqlWhere = string.Empty;
+
+            //起止时间
+            DateTime beginDt = Convert.ToDateTime($"{_dto.Year}-01-01 00:00:00");
+            DateTime endDt = Convert.ToDateTime($"{_dto.Year}-12-31 23:59:59");
+
+            sqlWhere = string.Format(@$" Where Isdel = 0 ");
+
+
+
+            string sql = string.Format(@$"Select * From Grp_DelegationInfo {sqlWhere}");
+
+            var groupInfos = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).Where(it => it.CreateTime >= beginDt && it.CreateTime <= endDt).ToListAsync();
+
+            if (groupInfos.Count < 1) return Ok(JsonView(false, "暂无相关团组!"));
+
+            List<GroupTypeNumberInfo> datas = new List<GroupTypeNumberInfo>();
+            foreach (var item in groupInfos)
+            {
+                var data = await GroupBookingsNumber(_dto.Type,item);
+
+                if (data.TypeItem.Count > 0)
+                {
+                    datas.Add(data);
+                }
+
+            }
+
+            //类型处理
+            if (_dto.Type == 1)//接团
+            {
+                List<GroupBookingNumberView> views = new List<GroupBookingNumberView>();
+                dynamic groupData = null;
+                foreach (var item in datas)
+                {
+                    if (item.TypeItem.Count > 0)
+                    {
+                        foreach (var item1 in item.TypeItem)
+                        {
+                            if (item1.RegionItem.Count > 0)
+                            {
+                                GroupInfo groupInfo = new GroupInfo()
+                                { 
+                                    DiId=item.DiId,
+                                    TeamName = item.GroupName,
+                                    CreateTime = groupInfos.Find(it => it.Id == item.DiId)?.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") ?? "Unknown",
+                                    ClientUnit = groupInfos.Find(it => it.Id == item.DiId)?.ClientUnit ?? "Unknown",
+                                    Principal = groupInfos.Find(it => it.Id == item.DiId)?.ClientName ?? "Unknown",
+                                };
+                                views.Add(new GroupBookingNumberView() { Name = item1.RegionItem[0].Name, Number = item1.RegionItem[0].Number, GroupItem = new List<GroupInfo>() { groupInfo } });
+                            }
+                        }
+                    }
+                }
+
+                var viewsGroup = views.GroupBy(it => it.Name);
+                List<GroupBookingNumberView> _view = new List<GroupBookingNumberView>();
+                foreach (var item in viewsGroup)
+                {
+                    List<GroupInfo> infos = new List<GroupInfo>();
+                    foreach (var item1 in item)
+                    {
+                        infos.AddRange(item1.GroupItem);
+                    }
+                    infos = infos.OrderByDescending(it => it.CreateTime).ToList(); //
+
+                    _view.Add(new GroupBookingNumberView() { Name = item.Key, Number = item.Count(),GroupItem = infos });
+                }
+
+                _view = _view.OrderByDescending(it => it.Number).Take(10).ToList();
+
+                return Ok(JsonView(true, "操作成功!", _view, _view.Count));
+
+            }
+            else if (_dto.Type == 2)
+            {
+                List<HotelBookingNumberView> views = new List<HotelBookingNumberView>();
+
+                foreach (var item in datas)
+                {
+                    if (item.TypeItem.Count > 0)
+                    {
+                        foreach (var item1 in item.TypeItem)
+                        {
+                            if (item1.RegionItem.Count > 0)
+                            {
+                                foreach (var item2 in item1.RegionItem)
+                                {
+                                    GroupInfo groupInfo = new GroupInfo()
+                                    {
+                                        DiId = item.DiId,
+                                        TeamName = item.GroupName,
+                                        CreateTime = groupInfos.Find(it => it.Id == item.DiId)?.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") ?? "Unknown",
+                                        ClientUnit = groupInfos.Find(it => it.Id == item.DiId)?.ClientUnit ?? "Unknown",
+                                        Principal = groupInfos.Find(it => it.Id == item.DiId)?.ClientName ?? "Unknown",
+                                    };
+
+                                    List<HotelInfo> hotels = new List<HotelInfo>();
+                                    foreach (var item3 in item2.Data)
+                                    {
+
+                                        StatisticsHotelInfo statisticsHotelInfos = JsonConvert.DeserializeObject<StatisticsHotelInfo>(JsonConvert.SerializeObject( item3));
+
+                                        HotelInfo hotelInfo = new HotelInfo()
+                                        {
+                                            HotelName = statisticsHotelInfos.HotelName,
+                                            SingleRoomNum = statisticsHotelInfos.SingleRoomNum,
+                                            DoubleRoomNum = statisticsHotelInfos.DoubleRoomNum,
+                                            SuiteRoomNum = statisticsHotelInfos.SuiteRoomNum,
+                                            OtherRoomNum = statisticsHotelInfos.OtherRoomNum,
+                                            GroupInfo = groupInfo
+                                        };
+                                        hotels.Add(hotelInfo);
+                                    }
+
+                                    views.Add(new HotelBookingNumberView() { Name = item1.RegionItem[0].Name, Number = item1.RegionItem[0].Number, HotelItem = hotels });
+                                }
+                            }
+                        }
+                    }
+                }
+
+                var viewsGroup = views.GroupBy(it => it.Name);
+                List<HotelBookingNumberView> _view = new List<HotelBookingNumberView>();
+
+                foreach (var item in viewsGroup)
+                {
+                    List<HotelInfo> infos = new List<HotelInfo>();
+                    foreach (var item1 in item)
+                    {
+                        infos.AddRange(item1.HotelItem);
+                    }
+                    _view.Add(new HotelBookingNumberView() { Name = item.Key, Number = item.Count(), HotelItem = infos });
+                }
+
+                _view = _view.OrderByDescending(it => it.Number).Take(10).ToList();
+
+                return Ok(JsonView(true, "操作成功!", views, views.Count));
+            }
+
+            return Ok(JsonView(false, "操作失败!"));
+            #endregion
+
+        }
+
+        /// <summary>
+        /// 计算团组ALLType预订数量
+        /// </summary>
+        /// <param name="diIds"></param>
+        /// <returns></returns>
+        private async Task<GroupTypeNumberInfo> GroupBookingsNumber(int type, Grp_DelegationInfo info)
+        {
+            GroupTypeNumberInfo _view = new GroupTypeNumberInfo();
+            if (info == null)
+            {
+                return _view;
+            }
+
+            _view.DiId = info.Id;
+            _view.GroupName = info.TeamName;
+            List<TypeInfo> _types = new List<TypeInfo>();
+            #region 计算团组ALLType预订数量
+
+            if (type == 1)
+            {
+                //接团 客户集团所在地区
+                string group_region = string.Empty;
+                int group_number = 0;
+                if (!string.IsNullOrEmpty(info.ClientUnit))
+                {
+                    var _NewClientData = await _sqlSugar.Queryable<Crm_NewClientData>().Where(it => it.IsDel == 0 && it.Client.Equals(info.ClientUnit)).FirstAsync();
+                    if (_NewClientData != null)
+                    {
+                        var regionInfo = await _sqlSugar.Queryable<Sys_SetData>().Where(it => it.Id == _NewClientData.Lvlid).FirstAsync();
+                        if (regionInfo != null)
+                        {
+                            group_region = regionInfo.Name.Replace("级", "");
+                            group_number++;
+                        }
+                    }
+                }
+                if (group_number > 0)
+                {
+                    _types.Add(new TypeInfo() { Id = 1, RegionItem = new List<RegionInfo>() { new RegionInfo() { Name = group_region, Number = group_number } } });
+                }
+            }
+            else if (type == 2)
+            {
+                //酒店
+                var hotelInfos = await _sqlSugar.Queryable<Grp_HotelReservations>().Where(it => it.IsDel == 0 && it.DiId == info.Id).ToListAsync();
+
+                if (hotelInfos.Count > 0)
+                {
+                    List<RegionInfo> hotelRegions = new List<RegionInfo>();
+                    foreach (var item in hotelInfos)
+                    {
+                        var hotelNumberInfo = new StatisticsHotelInfo()
+                        {
+                            HotelName = item.HotelName,
+                            SingleRoomNum = item.SingleRoomCount,
+                            DoubleRoomNum = item.DoubleRoomCount,
+                            SuiteRoomNum = item.SuiteRoomCount,
+                            OtherRoomNum = item.OtherRoomCount,
+                        };
+                        int hotelRoomTotal = item.SingleRoomCount + item.DoubleRoomCount + item.SuiteRoomCount + item.OtherRoomCount;
+                        if (hotelRegions.Select(it => it.Name).ToList().Contains(item.City))
+                        {
+                            RegionInfo hotelRegion = hotelRegions.Find(it => it.Name.Equals(item.City));
+                            if (hotelRegion != null)
+                            {
+                                hotelRegions.Remove(hotelRegion);
+                                if (hotelRegion.Data.Count > 0)
+                                {
+                                    hotelRegion.Data.Add(hotelNumberInfo);
+                                }
+
+                                hotelRegion.Number += hotelRoomTotal;
+                                hotelRegions.Add(hotelRegion);
+                            }
+                        }
+                        else
+                        {
+                            hotelRegions.Add(new RegionInfo() { Name = item.City, Number = hotelRoomTotal, Data = new List<dynamic>() { hotelNumberInfo } });
+                        }
+                    }
+                    _types.Add(new TypeInfo() { Id = 2, RegionItem = hotelRegions });
+                }
+            }
+            else if (type == 3)
+            {
+                //机票
+                var airTicketInfos = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
+                                                    .LeftJoin<Grp_CreditCardPayment>((atr, ccp) => atr.Id == ccp.CId && ccp.IsPay == 1)
+                                                    .LeftJoin<Sys_SetData>((atr, ccp, sd) => atr.CType == sd.Id)
+                                                    .Where((atr, ccp, sd) => atr.IsDel == 0 && atr.DIId == info.Id)
+                                                    .Select((atr, ccp, sd) => new { atr.ClientNum, atr.CType, ccp.Payee, AirType = sd.Name })
+                                                    .ToListAsync();
+
+                if (airTicketInfos.Count > 0)
+                {
+                    List<RegionInfo> airTicketRegions = new List<RegionInfo>();
+                    foreach (var item in airTicketInfos)
+                    {
+                        var ticketClass = new
+                        {
+                            TiketClass = item.AirType,
+                            Number = item.ClientNum
+                        };
+
+                        if (airTicketRegions.Select(it => it.Name).ToList().Contains(item.Payee))
+                        {
+                            RegionInfo airTicketRegion = airTicketRegions.Find(it => it.Name.Equals(item.Payee));
+                            if (airTicketRegion != null)
+                            {
+                                airTicketRegions.Remove(airTicketRegion);
+                                if (airTicketRegion.Data.Count > 0)
+                                {
+                                    airTicketRegion.Data.Add(ticketClass);
+                                }
+
+                                airTicketRegion.Number += item.ClientNum;
+                                airTicketRegions.Add(airTicketRegion);
+                            }
+                        }
+                        else
+                        {
+                            airTicketRegions.Add(new RegionInfo() { Name = item.Payee, Number = item.ClientNum, Data = new List<dynamic>() { ticketClass } });
+                        }
+                    }
+
+                    _types.Add(new TypeInfo() { Id = 3, RegionItem = airTicketRegions });
+                }
+            }
+            else if (type == 4)
+            {
+                //车辆
+                var opInfos = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().Where(it => it.IsDel == 0 && it.DiId == info.Id).ToListAsync();
+                var opContentInfos = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(it => it.IsDel == 0 && it.DiId == info.Id).ToListAsync();
+                if (opInfos.Count > 0)
+                {
+                    List<RegionInfo> opRegions = new List<RegionInfo>();
+
+                    foreach (var item in opInfos)
+                    {
+                        int carNum = 0;
+                        var opContentInfo = opContentInfos.Where(it => it.CTGGRId == item.Id && it.SId == 91).ToList();
+
+                        if (opContentInfo.Count > 0)
+                        {
+                            foreach (var item1 in opContentInfo)
+                            {
+                                if (item1.Price > 0 && item1.Count > 0)
+                                {
+                                    carNum += item1.Count;
+                                }
+                            }
+                        }
+                        if (carNum > 0)
+                        {
+                            var opData = new
+                            {
+                                ServiceCompany = item.ServiceCompany,
+                                BusName = item.BusName,
+                                Numbuer = carNum
+                            };
+                            if (opRegions.Select(it => it.Name).ToList().Contains(item.Area))
+                            {
+                                RegionInfo opRegion = opRegions.Find(it => it.Name.Equals(item.Area));
+                                if (opRegion != null)
+                                {
+                                    opRegions.Remove(opRegion);
+                                    if (opRegion.Data.Count > 0)
+                                    {
+                                        opRegion.Data.Add(opData);
+                                    }
+
+                                    opRegion.Number += carNum;
+                                    opRegions.Add(opRegion);
+                                }
+
+                            }
+                            else
+                            {
+                                opRegions.Add(new RegionInfo() { Name = item.Area, Number = carNum, Data = new List<dynamic>() { opData } });
+                            }
+                        }
+
+                    }
+                    _types.Add(new TypeInfo() { Id = 4, RegionItem = opRegions });
+                }
+            }
+
+            #endregion
+
+            _view.TypeItem = _types;
+
+            return _view;
+        }
+
         #endregion
 
     }

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

@@ -1371,5 +1371,63 @@ namespace OASystem.API.OAMethodLib
 
 
         #endregion
+
+        #region 月份/季度
+
+        /// <summary>
+        /// 获取月份对应的起始天数
+        /// </summary>
+        /// <param name="year"></param>
+        /// <returns></returns>
+        public static List<MonthInfo> GetMonthInfos(int year)
+        {
+            List<MonthInfo> months = new List<MonthInfo>();
+
+            if (year > 1)
+            {
+                for (int i = 1; i < 13; i++)
+                {
+                    months.Add(new MonthInfo()
+                    {
+                        Month = i,
+                        Days = new DaysInfo() { BeginDays = 1, EndDays = DateTime.DaysInMonth(year, i) }
+                    });
+                }
+            }
+            return months;
+        }
+
+        
+        /// <summary>
+        /// 获取季度对应的起始天数
+        /// </summary>
+        /// <param name="year"></param>
+        /// <returns></returns>
+        public static List<MonthInfo> GetQuarter(int year)
+        {
+            List<MonthInfo> months = new List<MonthInfo>();
+
+            months.Add(new MonthInfo() { Month = 1, Days = new DaysInfo() { BeginDays = 1, EndDays = 31 }});  //1.1 - 3.31
+            months.Add(new MonthInfo() { Month = 2, Days = new DaysInfo() { BeginDays = 1, EndDays = 31 } }); //4.1 - 6.30
+            months.Add(new MonthInfo() { Month = 3, Days = new DaysInfo() { BeginDays = 1, EndDays = 31 } }); //7.1 - 9.31
+            months.Add(new MonthInfo() { Month = 4, Days = new DaysInfo() { BeginDays = 1, EndDays = 31 } }); //10.1 - 12.31
+
+            return months;
+        }
+        public class MonthInfo
+        {
+            public int Month { get; set; }
+
+            public DaysInfo Days { get; set; }
+        }
+
+        public class DaysInfo
+        {
+            public int BeginDays { get; set; }
+            public int EndDays { get; set; }
+        }
+
+        #endregion
+
     }
 }

+ 15 - 1
OASystem/OASystem.Domain/Dtos/Statistics/GroupStatementDto.cs

@@ -49,7 +49,7 @@ namespace OASystem.Domain.Dtos.Statistics
         /// <summary>
         /// 年份
         /// </summary>
-        public string Year { get; set; }
+        public int Year { get; set; }
 
         /// <summary>
         /// 业务类型
@@ -64,4 +64,18 @@ namespace OASystem.Domain.Dtos.Statistics
         public int StatisticsType { get; set; }
     }
 
+    /// <summary>
+    /// 地区预订 dto
+    /// </summary>
+    public class PostRegionalBookingsNumberDto : UserPageFuncDtoBase
+    {
+        /// <summary>
+        /// 类型
+        /// 1 团 2 酒店 3 机票 4 车辆
+        /// </summary>
+        public int Type { get; set; }
+
+        public int Year { get; set; }
+    }
+
 }

+ 136 - 1
OASystem/OASystem.Domain/ViewModels/Statistics/CorporateProfit.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection.Metadata.Ecma335;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -15,7 +16,7 @@ namespace OASystem.Domain.ViewModels.Statistics
 
         public string TeamName { get; set; }
 
-        public string CreateDt { get; set; }
+        public DateTime CreateDt { get; set; }
 
         /// <summary>
         /// 总支出
@@ -60,4 +61,138 @@ namespace OASystem.Domain.ViewModels.Statistics
         /// </summary>
         public decimal Amount { get; set; }
     }
+
+    #region 企业利润 View
+
+    public class CorporateProfitMonthView
+    {
+        /// <summary>
+        /// 月份
+        /// </summary>
+        public int Month { get; set; }
+
+        /// <summary>
+        /// 利润
+        /// </summary>
+        public decimal Profit { get; set; }
+
+        public Object GroupInfos { get; set; }
+    }
+    #endregion
+
+    #region 团组各类型预订数量 View
+
+    public class BookingNumberBaseView
+    {
+        public string Name { get; set; }
+
+        public int Number { get; set; }
+
+        
+    }
+
+    /// <summary>
+    /// 接团 View
+    /// </summary>
+    public class GroupBookingNumberView: BookingNumberBaseView
+    {
+        public List<GroupInfo> GroupItem { get; set; }
+    }
+
+    /// <summary>
+    /// 酒店 View
+    /// </summary>
+    public class HotelBookingNumberView : BookingNumberBaseView
+    {
+        public List<HotelInfo> HotelItem { get; set; }
+    }
+
+    public class HotelInfo : StatisticsHotelInfo
+    {
+        public GroupInfo GroupInfo { get; set; }
+    }
+
+
+
+    public class GroupInfo
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 团组名称
+        /// </summary>
+        public string TeamName { get; set; }
+
+        /// <summary>
+        /// 接团时间
+        /// </summary>
+        public string CreateTime { get; set; }
+
+        /// <summary>
+        /// 单位
+        /// </summary>
+        public string ClientUnit { get; set; }
+
+        /// <summary>
+        /// 负责人
+        /// </summary>
+        public string Principal { get; set; }
+    }
+
+
+    public class GroupTypeNumberInfo
+    {
+        public int DiId { get; set; }
+
+        public string GroupName { get; set; }
+
+        public List<TypeInfo> TypeItem { get; set; }
+    }
+
+    public class TypeInfo
+    {
+        /// <summary>
+        /// 类型Id
+        /// 1 接团 2 酒店 3 机票 4 车辆
+        /// </summary>
+        public int Id { get; set; }
+
+        public string Name { get {
+                if (Id == 1) return "接团";
+                else if (Id == 2) return "酒店";
+                else if (Id == 3) return "机票";
+                else if (Id == 4) return "车辆";
+                return "Unknown";
+            } }
+
+        public List<RegionInfo> RegionItem { get; set; }
+    }
+
+    public class RegionInfo
+    {
+
+        public string Name { get; set; }
+        public int Number { get; set; }
+
+        public List<dynamic> Data { get; set; }= new List<dynamic>();
+    }
+
+    public class StatisticsHotelInfo
+    {
+        public string HotelName { get; set; }
+
+        public int SingleRoomNum { get; set; }
+
+        public int DoubleRoomNum { get; set; }
+
+        public int SuiteRoomNum { get; set; }
+
+        public int OtherRoomNum { get; set; }
+
+    }
+
+    #endregion
 }