Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

LEIYI 4 days ago
parent
commit
7c57661874

+ 636 - 6
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -51,6 +51,7 @@ using Org.BouncyCastle.Utilities;
 using Quartz.Util;
 using SqlSugar.Extensions;
 using System.Collections;
+using System.Collections.Generic;
 using System.Data;
 using System.Diagnostics;
 using System.Drawing.Printing;
@@ -4063,7 +4064,7 @@ FROM
 
                 await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
 
-                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "85" };
                 await APNsTools.iOS_PushNotifications1("051", $"机票费用审核", "", content, true, "ExpenseAuditWebView", h5);
 
             }
@@ -5589,7 +5590,7 @@ FROM
 
                 await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
 
-                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "81" };
                 await APNsTools.iOS_PushNotifications1("051", $"商邀费用审核", "", content, true, "ExpenseAuditWebView", h5);
             }
             catch (Exception ex)
@@ -13964,7 +13965,7 @@ FROM
                 else if (dto.Status == 2) content = $"[更新-签证费用录入({groupInfo?.TeamName ?? "-"})]一项费用:{(ccpInfo.PayMoney * ccpInfo.DayRate):#0.00} CNY;";
 
                 await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
-                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "80" };
                 await APNsTools.iOS_PushNotifications1("051", $"签证费用审核", "", content, true, "ExpenseAuditWebView", h5);
             }
             catch (Exception ex)
@@ -14337,7 +14338,7 @@ FROM
                     string content = $"[更新-OP费用录入填写详情({groupInfo?.TeamName ?? "-"})]一项费用:{(((ccpInfo.PayMoney * ccpInfo.DayRate) / 100) * ccpInfo.PayPercentage):#0.00} CNY;";
 
                     await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
-                    PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                    PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "79" };
                     await APNsTools.iOS_PushNotifications1("051", $"OP费用审核", "", content, true, "ExpenseAuditWebView", h5);
 
                 }
@@ -17962,6 +17963,635 @@ ORDER by  gctggrc.id DESC
             return Ok(jw);
         }
 
+        /// <summary>
+        /// 报价Word下载
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> GroupQuotationsFileDown(GroupQuotationsFileDownDto dto)
+        {
+            var di = await _sqlSugar.Queryable<Grp_DelegationInfo>()
+                .FirstAsync(x => x.Id == dto.Diid && x.IsDel == 0);
+            if (di == null)
+            {
+                return Ok(JsonView(false, "团组不存在!"));
+            }
+
+            var mainPrice = _GroupCostParameterRepository.GetGroupCostParameterMainByDiid(dto.Diid);
+            if (mainPrice == null || mainPrice.IsShare == 0)
+            {
+                return Ok(JsonView(false, "团组成本不存在!"));
+            }
+
+            var costTypeHotelNumbers = await _sqlSugar.Queryable<Grp_CostTypeHotelNumber>()
+                                                        .FirstAsync(x => x.Type == "Default" && x.Diid == dto.Diid && x.IsDel == 0);
+            if (costTypeHotelNumbers == null)
+            {
+                return Ok(JsonView(false, "团组成本不存在!"));
+            }
+
+            //文件名
+            string strFileName = di.TeamName + "-收款账单.doc";
+            //获取模板
+            string tmppath = (AppSettingsHelper.Get("WordBasePath") + "Template/收款账单(四川)模板.doc");
+            //载入模板
+            Document doc = new Document(tmppath);
+
+            decimal allPrice = 0.00M;
+            string itemStr = string.Empty;
+
+            Dictionary<string, string> airSouer = new Dictionary<string, string>();
+            airSouer.Add("经济舱TBR", "经济舱及酒店双人间");
+            airSouer.Add("经济舱SGR", "经济舱及酒店单人间");
+            airSouer.Add("公务舱SGR", "公务舱及酒店单人间");
+            airSouer.Add("公务舱JSES", "公务舱及酒店小套房");
+            airSouer.Add("公务舱SUITE", "公务舱及酒店套房");
+            airSouer.Add("经济舱SUITE", "经济舱及酒店套房");
+            airSouer.Add("头等舱JSES", "头等舱及酒店小套房");
+            airSouer.Add("头等舱SUITE", "头等舱及酒店套房");
+            airSouer.Add("经济舱JSES", "经济舱及酒店小套房");
+
+            var priceDataList = new List<(string rsName, string cbName, string xsName, string prefix)>
+            {
+                ("VisaRS", "VisaCB", "VisaXS", "qz"),
+                ("BXRS", "BXCB", "BXXS", "bx"),
+                ("HCPRS", "HCPCB", "HCPXS", "hcp"),
+                ("JJCRS", "JJCCB", "JJCXS", "jjc"),
+                ("GWCRS", "GWCCB", "GWCXS", "gwc")                     ,
+                ("TDCRS", "TDCCB", "TDCXS", "tdc")                      ,
+                ("CPRS", "CPCB", "CPXS", "cp")                           ,
+                ("HSRS", "HSCB", "HSXS", "hsjc")                       ,
+                ("TBRNumber", "TBRCB", "TBRXS", "tbr")                 ,
+                ("SGRNumber", "SGRCB", "SGRXS", "sgr")                 ,
+                ("JSESNumber", "JSESCB", "JSESXS", "jses")             ,
+                ("SUITENumber", "SUITECB", "SUITEXS", "suite")         ,
+                ("DJRS", "DJCB", "DJXS", "dj")                           ,
+                ("GWRS", "GWCB", "GWXS", "gw")                           ,
+                ("LYJRS", "LYJCB", "LYJXS", "lyj")                      ,
+            };
+            var OtherCostPropertyBJ = new string[] { "qz", "hcp", "cp", "bx", "hsjc", "dj", "gw", "lyj" };
+            var rightSum = 0.00M;
+
+            foreach (var (rsName, cbName, xsName, prefix) in priceDataList)
+            {
+                var rsValue = (int)mainPrice.GetType().GetProperty(rsName).GetValue(mainPrice);
+                var cbValue = (decimal)mainPrice.GetType().GetProperty(cbName).GetValue(mainPrice);
+                var xsValue = (decimal)mainPrice.GetType().GetProperty(xsName).GetValue(mainPrice);
+
+                if (prefix == "tbr")
+                {
+                    rsValue *= 2;
+                    cbValue /= 2;
+                }
+
+                if (OtherCostPropertyBJ.Contains(prefix))
+                {
+                    rightSum += cbValue * xsValue;
+                }
+            }
+
+
+            var hotelRooms = new Dictionary<string, int>
+                {
+                    { "SGR", costTypeHotelNumbers.SGR },
+                    { "TBR", costTypeHotelNumbers.TBR },
+                    { "JSES", costTypeHotelNumbers.JSES },
+                    { "SUITE", costTypeHotelNumbers.SUITE }
+                };
+
+            var flights = new Dictionary<string, int>
+                {
+                    { "经济舱", mainPrice.JJCRS },
+                    { "公务舱", mainPrice.GWCRS },
+                    { "头等舱", mainPrice.TDCRS }
+                };
+
+            var flightRoomMatchingRules = new Dictionary<string, string[]>
+            {
+                { "经济舱", new[] { "TBR", "SGR", "JSES", "SUITE" } },
+                { "公务舱", new[] { "SUITE", "JSES", "SGR" } },
+                { "头等舱", new[] { "SUITE", "JSES" } }
+            };
+
+            var result = new Dictionary<string, int>();
+
+            List<AirHotelPrice> airHotelPriceList = new List<AirHotelPrice>();
+
+            foreach (var flight in flights.Keys)
+            {
+                // 获取当前舱位的匹配规则
+                if (flightRoomMatchingRules.TryGetValue(flight, out string[] roomTypes))
+                {
+                    MatchRooms(ref hotelRooms, ref flights, roomTypes, flight, ref result);
+                }
+            }
+
+            #region right计算
+
+            if (result.Keys.Contains("经济舱TBR") && result["经济舱TBR"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = (mainPrice.TBRCB * mainPrice.TBRXS) / 2;
+                airHotelPriceList.Add(new
+                     AirHotelPrice
+                {
+                     Name = "经济舱TBR",
+                     Price = rightSum + air + hotel,
+                     Count = result["经济舱TBR"] * 2
+                });
+                allPrice += (rightSum + air + hotel) * result["经济舱TBR"] * 2;
+            }
+
+            if (result.Keys.Contains("经济舱SGR") && result["经济舱SGR"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.SGRCB * mainPrice.SGRXS;
+                airHotelPriceList.Add(new
+                    AirHotelPrice
+                {
+                    Name = "经济舱SGR",
+                    Price = rightSum + air + hotel,
+                    Count = result["经济舱SGR"]
+                });
+                allPrice += (rightSum + air + hotel) * result["经济舱SGR"];
+            }
+
+            if (result.Keys.Contains("公务舱SGR") && result["公务舱SGR"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.SGRCB * mainPrice.SGRXS;
+                airHotelPriceList.Add(new
+                    AirHotelPrice
+                {
+                    Name = "公务舱SGR",
+                    Price = rightSum + air + hotel,
+                    Count = result["公务舱SGR"]
+                });
+                allPrice += (rightSum + air + hotel) * result["公务舱SGR"];
+            }
+
+            if (result.Keys.Contains("公务舱JSES") && result["公务舱JSES"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                airHotelPriceList.Add(new
+     AirHotelPrice
+                {
+                    Name = "公务舱JSES",
+                    Price = rightSum + air + hotel,
+                    Count = result["公务舱JSES"]
+                });
+                allPrice += (rightSum + air + hotel) * result["公务舱JSES"];
+            }
+
+            if (result.Keys.Contains("公务舱SUITE") && result["公务舱SUITE"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                airHotelPriceList.Add(new
+     AirHotelPrice
+                {
+                    Name = "公务舱SUITE",
+                    Price = rightSum + air + hotel,
+                    Count = result["公务舱SUITE"]
+                });
+                allPrice += (rightSum + air + hotel) * result["公务舱SUITE"];
+            }
+
+            if (result.Keys.Contains("经济舱SUITE") && result["经济舱SUITE"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                airHotelPriceList.Add(new
+     AirHotelPrice
+                {
+                    Name = "经济舱SUITE",
+                    Price = rightSum + air + hotel,
+                    Count = result["经济舱SUITE"]
+                });
+                allPrice += (rightSum + air + hotel) * result["经济舱SUITE"];
+            }
+
+            if (result.Keys.Contains("头等舱JSES") && result["头等舱JSES"] > 0)
+            {
+                var air = mainPrice.TDCCB * mainPrice.TDCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                airHotelPriceList.Add(new
+      AirHotelPrice
+                {
+                    Name = "头等舱JSES",
+                    Price = rightSum + air + hotel,
+                    Count = result["头等舱JSES"]
+                });
+                allPrice += (rightSum + air + hotel) * result["头等舱JSES"];
+            }
+
+            if (result.Keys.Contains("头等舱SUITE") && result["头等舱SUITE"] > 0)
+            {
+                var air = mainPrice.TDCCB * mainPrice.TDCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                airHotelPriceList.Add(new
+AirHotelPrice
+                {
+                    Name = "头等舱SUITE",
+                    Price = rightSum + air + hotel,
+                    Count = result["头等舱SUITE"]
+                });
+                allPrice += (rightSum + air + hotel) * result["头等舱SUITE"];
+            }
+
+            if (result.Keys.Contains("经济舱JSES") && result["经济舱JSES"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                airHotelPriceList.Add(new
+AirHotelPrice
+                {
+                    Name = "经济舱JSES",
+                    Price = rightSum + air + hotel,
+                    Count = result["经济舱JSES"]
+                });
+                allPrice += (rightSum + air + hotel) * result["经济舱JSES"];
+            }
+
+            #endregion
+
+            foreach (var item in airSouer.Keys)
+            {
+                var find = airHotelPriceList.FirstOrDefault(x => x.Name == item);
+                if (find !=  null && find.Count > 0)
+                {
+                    if (item.Contains("TBR"))
+                    {
+                        itemStr += "团费(" + airSouer[item] + ")    RMB " + find.Price.ToString("F2") + "/人*" + find.Count + "(" + (find.Count / 2) + "间) ............合计 RMB " + (find.Count * find.Price).ToString("#0.00") + "\n";
+                    }
+                    else
+                    {
+                        itemStr += "团费(" + airSouer[item] + ")    RMB " + find.Price.ToString("F2") + "/人*" + find.Count + "(" + find.Count + "间) ............合计 RMB " + (find.Count * find.Price).ToString("#0.00") + "\n";
+                    }
+                }
+            }
+
+            #region 替换Word模板书签内容
+
+            Dictionary<string, string> marks = new Dictionary<string, string>();
+            marks.Add("To", di.ClientUnit);//付款方
+            marks.Add("ToTel", di.TellPhone);//付款方电话
+            marks.Add("Date", DateTime.Now.ToString("yyyy-MM-dd"));//导出时间
+            marks.Add("Team", di.VisitCountry.Replace(" ", "、"));//团队名称
+            marks.Add("TontractTime", (di.VisitDate).ToString("yyyy年MM月dd日"));//付款日期
+            marks.Add("PayDay", (di.PayDay).ToString());//付款预期
+            marks.Add("PaymentMoney", (di.PaymentMoney).ToString("#0.00"));//付款金额
+            marks.Add("WeChat", di.WeChatNo ?? "");//微信号 
+            marks.Add("PayItemContent", itemStr);//详细信息
+            marks.Add("Total", allPrice.ToString("F2"));//合计
+
+            #endregion
+
+            foreach (var item in marks.Keys)
+            {
+                if (doc.Range.Bookmarks[item] != null)
+                {
+                    Bookmark mark = doc.Range.Bookmarks[item];
+                    mark.Text = marks[item];
+                }
+            }
+
+            string savePaht = $"{AppSettingsHelper.Get("WordBasePath")}GroupCostQuotations/{di.TeamName}_报批费用.doc";
+            doc.Save(savePaht);
+
+            var jw = new JsonView();
+            jw.Msg = "生成成功!";
+            jw.Code = 200;
+            jw.Data = new { Url = AppSettingsHelper.Get("WordBaseUrl") + savePaht.Replace(AppSettingsHelper.Get("WordBasePath"), AppSettingsHelper.Get("WordFtpPath")) };
+            return Ok(jw);
+        }
+
+        /// <summary>
+        /// 详细报价费用Excel下载
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> GroupQuotationsDetailFileDown(GroupQuotationsFileDownDto dto)
+        {
+            var di = await _sqlSugar.Queryable<Grp_DelegationInfo>()
+                .FirstAsync(x => x.Id == dto.Diid && x.IsDel == 0);
+            if (di == null)
+            {
+                return Ok(JsonView(false, "团组不存在!"));
+            }
+
+            var mainPrice = _GroupCostParameterRepository.GetGroupCostParameterMainByDiid(dto.Diid);
+            if (mainPrice == null || mainPrice.IsShare == 0)
+            {
+                return Ok(JsonView(false, "团组成本不存在!"));
+            }
+
+            var costTypeHotelNumbers = await _sqlSugar.Queryable<Grp_CostTypeHotelNumber>()
+                                                        .FirstAsync(x=>x.Type == "Default" && x.Diid == dto.Diid && x.IsDel == 0);
+            if (costTypeHotelNumbers == null)
+            {
+                return Ok(JsonView(false, "团组成本不存在!"));
+            }
+
+            WorkbookDesigner designer = new WorkbookDesigner();
+            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + ("Template/报价详细表.xls"));
+            List<int> hideRowsList = new List<int>();
+
+            int conterStartIndex = 3;
+            int rowIndex = conterStartIndex;
+            designer.SetDataSource("GroupName", di.TeamName);
+
+            var priceDataList = new List<(string rsName, string cbName, string xsName, string prefix)>
+            {
+                ("VisaRS", "VisaCB", "VisaXS", "qz"),
+                ("BXRS", "BXCB", "BXXS", "bx"),
+                ("HCPRS", "HCPCB", "HCPXS", "hcp"),
+                ("JJCRS", "JJCCB", "JJCXS", "jjc"),
+                ("GWCRS", "GWCCB", "GWCXS", "gwc")                     ,
+                ("TDCRS", "TDCCB", "TDCXS", "tdc")                      ,
+                ("CPRS", "CPCB", "CPXS", "cp")                           ,
+                ("HSRS", "HSCB", "HSXS", "hsjc")                       ,
+                ("TBRNumber", "TBRCB", "TBRXS", "tbr")                 ,
+                ("SGRNumber", "SGRCB", "SGRXS", "sgr")                 ,
+                ("JSESNumber", "JSESCB", "JSESXS", "jses")             ,
+                ("SUITENumber", "SUITECB", "SUITEXS", "suite")         ,
+                ("DJRS", "DJCB", "DJXS", "dj")                           ,
+                ("GWRS", "GWCB", "GWXS", "gw")                           ,
+                ("LYJRS", "LYJCB", "LYJXS", "lyj")                      ,
+            };
+            var OtherCostPropertyBJ = new string[] { "qz", "hcp", "cp", "bx", "hsjc", "dj", "gw", "lyj" };
+            var rightSum = 0.00M;
+
+            foreach (var (rsName, cbName, xsName, prefix) in priceDataList)
+            {
+                var rsValue = (int)mainPrice.GetType().GetProperty(rsName).GetValue(mainPrice);
+                var cbValue = (decimal)mainPrice.GetType().GetProperty(cbName).GetValue(mainPrice);
+                var xsValue = (decimal)mainPrice.GetType().GetProperty(xsName).GetValue(mainPrice);
+
+                if (prefix == "tbr")
+                {
+                    rsValue *= 2;
+                    cbValue /= 2;
+                }
+
+                if (OtherCostPropertyBJ.Contains(prefix))
+                {
+                    rightSum += cbValue * xsValue;
+                }
+
+                if (rsValue == 0)
+                {
+                    hideRowsList.Add(rowIndex);
+                }
+                else
+                {
+                    designer.SetDataSource($"{prefix}rs", rsValue);
+                    designer.SetDataSource($"{prefix}bj", cbValue * xsValue);
+                    designer.SetDataSource($"{prefix}zbj", cbValue * xsValue * rsValue);
+                }
+
+                rowIndex += 2;
+            }
+
+            var hotelRooms = new Dictionary<string, int>
+                {
+                    { "SGR", costTypeHotelNumbers.SGR },
+                    { "TBR", costTypeHotelNumbers.TBR },
+                    { "JSES", costTypeHotelNumbers.JSES },
+                    { "SUITE", costTypeHotelNumbers.SUITE }
+                };
+
+            var flights = new Dictionary<string, int>
+                {
+                    { "经济舱", mainPrice.JJCRS },
+                    { "公务舱", mainPrice.GWCRS },
+                    { "头等舱", mainPrice.TDCRS }
+                };
+
+            var flightRoomMatchingRules = new Dictionary<string, string[]>
+            {
+                { "经济舱", new[] { "TBR", "SGR", "JSES", "SUITE" } },
+                { "公务舱", new[] { "SUITE", "JSES", "SGR" } },
+                { "头等舱", new[] { "SUITE", "JSES" } } 
+            };
+
+            var result = new Dictionary<string, int>();
+
+            foreach (var flight in flights.Keys)
+            {
+                // 获取当前舱位的匹配规则
+                if (flightRoomMatchingRules.TryGetValue(flight, out string[] roomTypes))
+                {
+                    MatchRooms(ref hotelRooms,ref flights, roomTypes, flight,ref result);
+                }
+            }
+
+            var allPrice = 0.00M;
+
+            #region right计算
+
+            int airRowIndex = 35;
+
+            if (result.Keys.Contains("经济舱TBR") && result["经济舱TBR"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = (mainPrice.TBRCB * mainPrice.TBRXS) / 2;
+                designer.SetDataSource("jjctbrrs", result["经济舱TBR"] * 2);
+                designer.SetDataSource("jjctbrbj", rightSum + air + hotel);
+                designer.SetDataSource("jjctbrzbj", (rightSum + air + hotel) * result["经济舱TBR"] * 2);
+                allPrice += (rightSum + air + hotel) * result["经济舱TBR"] * 2;
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("经济舱SGR") && result["经济舱SGR"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.SGRCB * mainPrice.SGRXS;
+                designer.SetDataSource("jjcsgrrs", result["经济舱SGR"]);
+                designer.SetDataSource("jjcsgrbj", rightSum + air + hotel);
+                designer.SetDataSource("jjcsgrzbj", (rightSum + air + hotel) * result["经济舱SGR"]);
+                allPrice += (rightSum + air + hotel) * result["经济舱SGR"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("公务舱SGR") && result["公务舱SGR"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.SGRCB * mainPrice.SGRXS;
+                designer.SetDataSource("gwcsgrrs", result["公务舱SGR"]);
+                designer.SetDataSource("gwcsgrbj", rightSum + air + hotel);
+                designer.SetDataSource("gwcsgrzbj", (rightSum + air + hotel) * result["公务舱SGR"]);
+                allPrice += (rightSum + air + hotel) * result["公务舱SGR"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("公务舱JSES") && result["公务舱JSES"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                designer.SetDataSource("gwcjsesrs", result["公务舱JSES"]);
+                designer.SetDataSource("gwcjsesbj", rightSum + air + hotel);
+                designer.SetDataSource("gwcjseszbj", (rightSum + air + hotel) * result["公务舱JSES"]);
+                allPrice += (rightSum + air + hotel) * result["公务舱JSES"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("公务舱SUITE") && result["公务舱SUITE"] > 0)
+            {
+                var air = mainPrice.GWCCB * mainPrice.GWCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                designer.SetDataSource("gwcsuiters", result["公务舱SUITE"]);
+                designer.SetDataSource("gwcsuitebj", rightSum + air + hotel);
+                designer.SetDataSource("gwcsuitezbj", (rightSum + air + hotel) * result["公务舱SUITE"]);
+                allPrice += (rightSum + air + hotel) * result["公务舱SUITE"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("经济舱SUITE") && result["经济舱SUITE"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                designer.SetDataSource("jjcsuiters", result["经济舱SUITE"]);
+                designer.SetDataSource("jjcsuitebj", rightSum + air + hotel);
+                designer.SetDataSource("jjcsuitezbj", (rightSum + air + hotel) * result["经济舱SUITE"]);
+                allPrice += (rightSum + air + hotel) * result["经济舱SUITE"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("头等舱JSES") && result["头等舱JSES"] > 0)
+            {
+                var air = mainPrice.TDCCB * mainPrice.TDCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                designer.SetDataSource("tdcjsesrs", result["头等舱JSES"]);
+                designer.SetDataSource("tdcjsesbj", rightSum + air + hotel);
+                designer.SetDataSource("tdcjseszbj", (rightSum + air + hotel) * result["头等舱JSES"]);
+                allPrice += (rightSum + air + hotel) * result["头等舱JSES"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("头等舱SUITE") && result["头等舱SUITE"] > 0)
+            {
+                var air = mainPrice.TDCCB * mainPrice.TDCXS;
+                var hotel = mainPrice.SUITECB * mainPrice.SUITEXS;
+                designer.SetDataSource("tdcsuiters", result["头等舱SUITE"]);
+                designer.SetDataSource("tdcsuitebj", rightSum + air + hotel);
+                designer.SetDataSource("tdcsuitezbj", (rightSum + air + hotel) * result["头等舱SUITE"]);
+                allPrice += (rightSum + air + hotel) * result["头等舱SUITE"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            airRowIndex += 2;
+
+            if (result.Keys.Contains("经济舱JSES") && result["经济舱JSES"] > 0)
+            {
+                var air = mainPrice.JJCCB * mainPrice.JJCXS;
+                var hotel = mainPrice.JSESCB * mainPrice.JSESXS;
+                designer.SetDataSource("jjcjsesrs", result["经济舱JSES"]);
+                designer.SetDataSource("jjcjsesbj", rightSum + air + hotel);
+                designer.SetDataSource("jjcjseszbj", (rightSum + air + hotel) * result["经济舱JSES"]);
+                allPrice += (rightSum + air + hotel) * result["经济舱JSES"];
+            }
+            else
+            {
+                hideRowsList.Add(airRowIndex);
+            }
+
+            #endregion
+
+            designer.SetDataSource("AllPrice","总金额:" + allPrice.ToString("#0.00"));
+            string savePaht = AppSettingsHelper.Get("ExcelBasePath") + "GroupCostQuotations/" + di.TeamName +"_详细报批费用.xls";
+            var ws = designer.Workbook.Worksheets[0];
+            foreach (var Rowindex in hideRowsList)
+            {
+                ws.Cells.HideRows(Rowindex, 2);
+            }
+            designer.Process();
+            designer.Workbook.Save(savePaht);
+
+            return Ok(JsonView(true, "生成成功!", new
+            {
+                Url = AppSettingsHelper.Get("ExcelBaseUrl") + savePaht.Replace(AppSettingsHelper.Get("ExcelBasePath"), AppSettingsHelper.Get("ExcelFtpPath"))
+            }));
+
+        }
+
+        private void MatchRooms(ref Dictionary<string, int> hotelRooms,ref Dictionary<string, int> flights, string[] roomTypes, string flightType,ref Dictionary<string, int> result)
+        {
+            foreach (var roomType in roomTypes)
+            {
+                while (hotelRooms[roomType] > 0 && flights[flightType] > 0)
+                {
+                    hotelRooms[roomType]--;
+                    flights[flightType]--;
+                    if (roomType == "TBR")
+                    {
+                        flights[flightType]--; // 双人间在减少1
+                    }
+
+                    string key = flightType + roomType;
+
+                    if (result.Keys.Contains(key))
+                    {
+                        result[key]++;
+                    }
+                    else
+                    {
+                        result.Add(key, 1);
+                    }
+                }
+            }
+        }
+
+        private class AirHotelPrice
+        {
+            public string Name { get; set; }
+
+            public decimal Price { get; set; }
+
+            public int Count { get; set; }
+        }
+
         #endregion
 
         #region 酒店预订 新 雷怡 2023-12-28 17:45
@@ -18269,7 +18899,7 @@ ORDER by  gctggrc.id DESC
 
                 try
                 {
-                    PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                    PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "76" };
                     await APNsTools.iOS_PushNotifications1("051", title, "", content, true, "ExpenseAuditWebView", h5);
                     //Logs($"【iOS推送通知PostHotelReservationsAddOrEdit】Start");
                     //var iosRes = await APNsTools.iOS_PushNotifications("051", title, "", content);
@@ -20430,7 +21060,7 @@ ORDER by  gctggrc.id DESC
 
                 await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
 
-                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21" };
+                PageParam_PriceAuditH5 h5 = new PageParam_PriceAuditH5() { diid = diId.ToString(), uid = "21", itemId = "82" };
                 await APNsTools.iOS_PushNotifications1("051", "保险费用审核", "", content, true, "ExpenseAuditWebView", h5);
             }
             catch (Exception ex)

+ 1 - 0
OASystem/OASystem.Api/OAMethodLib/APNs/APNsService.cs

@@ -384,6 +384,7 @@ namespace OASystem.API.OAMethodLib.APNs
     {
         public string diid { get; set; }
         public string uid { get; set; }
+        public string itemId { get; set; }
     }
 
 }

+ 5 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupCostSavaDto.cs

@@ -1379,6 +1379,11 @@ namespace OASystem.Domain.Dtos.Groups
         public string Keyword { get; set; }
     }
 
+    public class GroupQuotationsFileDownDto
+    {
+        public int Diid { get; set; }
+    }
+
     public class HistoryCarDataView
     {
         public int id { get; set; }