Browse Source

添加成本收款账单导出

yuanrf 1 year ago
parent
commit
798528d03e

+ 387 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -40,6 +40,9 @@ using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Domain.Entities.Financial;
 using NPOI.POIFS.Crypt.Dsig;
 using System.Diagnostics.Eventing.Reader;
+using System.IO;
+using StackExchange.Redis;
+using Org.BouncyCastle.Utilities;
 
 namespace OASystem.API.Controllers
 {
@@ -3859,6 +3862,390 @@ namespace OASystem.API.Controllers
             return Ok(jw);
         }
 
+        /// <summary>
+        /// 导出收款账单
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> ExportPriceCheckWordFile(GroupCostExportWordFile dto)
+        {
+            if (dto.Diid == 0)
+            {
+                return Ok(JsonView(false, "请传递团组id"));
+            }
+
+            var deleInfo = await _groupRepository.PostGroupInfo(new GroupInfoDto { Id = dto.Diid, PortType = 1 });
+            if (deleInfo.Code != 0)
+            {
+                return Ok(JsonView(false, "团组信息查询失败!"));
+            }
+
+            var di = deleInfo.Data as DelegationInfoWebView;
+            if (di != null)
+            {
+                //文件名
+                string strFileName = di.TeamName + "-收款账单.doc";
+                //获取模板
+                string tmppath = (AppSettingsHelper.Get("WordBasePath") + "Template/收款账单(四川)模板.doc");
+                //载入模板
+                Document doc = new Document(tmppath);
+
+                decimal TotalPrice = 0.00M;
+                string itemStr = string.Empty;
+
+                Dictionary<string, string> airSouer = new Dictionary<string, string>();
+                //airSouer.Add("JJCTBR", "经济舱及酒店双人间");
+                airSouer.Add("JJCTBR", "经济舱及酒店双人间");
+                airSouer.Add("JJCSGR", "经济舱及酒店单人间");
+                airSouer.Add("GWCSGR", "公务舱及酒店单人间");
+                airSouer.Add("GWCJSES", "公务舱及酒店小套房");
+                airSouer.Add("GWCSUITE", "公务舱及酒店套房");
+                airSouer.Add("JJCSUITE", "经济舱及酒店套房");
+
+                var groupCostType = dto.airs.GroupBy(x => x.costType).OrderBy(x=>x.Key);
+
+                foreach(var cost in groupCostType)
+                {
+                    var List = cost.ToList();
+
+                    if (cost.Key == "A")
+                    {
+                        foreach (var ListItem in List)
+                        {
+                            if (ListItem.number > 0)
+                            {
+                                if (ListItem.code.Contains("TBR"))
+                                {
+                                    itemStr += "团费(" + airSouer[ListItem.code] + ")    RMB " + ListItem.price.ToString("F2") + "/人*" + ListItem.number + "(" + (ListItem.number / 2) + "间( ............合计 RMB " + (ListItem.number * ListItem.price).ToString("#0.00") + "\n";
+                                }
+                                else
+                                {
+                                    itemStr += "团费(" + airSouer[ListItem.code] + ")    RMB " + ListItem.price.ToString("F2") + "/人*" + ListItem.number + "(" + ListItem.number + "间( ............合计 RMB " + (ListItem.number * ListItem.price).ToString("#0.00") + "\n";
+                                }
+
+                                TotalPrice += (ListItem.number * ListItem.price);
+                            }
+                        }
+                    }
+                    else
+                    {
+                        itemStr = itemStr.Insert(0, "A段\r\n");
+                        itemStr += "B段\r\n";
+
+                        foreach (var ListItem in List)
+                        {
+                            if (ListItem.number > 0)
+                            {
+                                if (ListItem.code.Contains("TBR"))
+                                {
+                                    itemStr += "团费(" + airSouer[ListItem.code] + ")    RMB " + ListItem.price.ToString("F2")  + "/人*" + ListItem.number + "(" + (ListItem.number / 2) + "间( ............合计 RMB " + (ListItem.number * ListItem.price).ToString("#0.00") + "\n";
+                                }
+                                else
+                                {
+                                    itemStr += "团费(" + airSouer[ListItem.code] + ")    RMB " + ListItem.price.ToString("F2")  + "/人*" + ListItem.number + "(" + ListItem.number + "间( ............合计 RMB " + (ListItem.number * ListItem.price).ToString("#0.00") + "\n";
+                                }
+
+                                TotalPrice += (ListItem.number * ListItem.price);
+                            }
+                        }
+                    }
+                }
+                
+
+                #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", "WeChat");//微信号  di.WeChat;
+                marks.Add("PayItemContent", itemStr);//详细信息
+                marks.Add("Total", TotalPrice.ToString("F2"));//合计
+
+                #endregion
+
+                ////注
+                //if (doc.Range.Bookmarks["Attention"] != null)
+                //{
+                //    Bookmark mark = doc.Range.Bookmarks["Attention"];
+                //    mark.Text = frList[0].Attention;
+                //}
+
+                foreach (var item in marks.Keys)
+                {
+                    if (doc.Range.Bookmarks[item] != null)
+                    {
+                        Bookmark mark = doc.Range.Bookmarks[item];
+                        mark.Text = marks[item];
+                    }
+                }
+
+                byte[] bytes = null;
+
+                using (MemoryStream stream = new MemoryStream())
+                {
+                    doc.Save(stream, Aspose.Words.SaveFormat.Doc);
+                    bytes = stream.ToArray();
+                }
+
+                //doc.Save((AppSettingsHelper.Get("WordBasePath") + "Template/") + strFileName);
+
+                return Ok(JsonView(true,"",new
+                {
+                    Data = bytes,
+                    strFileName,
+                }));
+            }
+            else
+            {
+                return Ok(JsonView(false,"团组信息不存在!"));
+            }
+        }
+
+        [HttpPost]
+        public async Task<IActionResult> ExportGroupCostExcelFile(GroupCostExportExcelFile dto)
+        {
+            //Workbook SourceBook1 = new Workbook();
+            //List<string> fileList = new List<string>();
+
+            if (dto.Diid == 0)
+            {
+                return Ok(JsonView(false, "请传递团组id"));
+            }
+
+            List<GroupCost_Excel> List_GC1 = new List<GroupCost_Excel>();
+            WorkbookDesigner designer = new WorkbookDesigner();
+
+            //var style = new Aspose.Cells.Style();
+            //style.IsTextWrapped = true;
+
+            designer.Workbook = new Workbook(AppSettingsHelper.Get("ExcelBasePath") + ("officeTemplates/团组-成本.xls"));
+
+            var List_GC = _GroupCostRepository.GetAllByDiid(dto.Diid);
+
+            for (int i = 0; i < List_GC.Count; i++)
+            {
+                GroupCost_Excel gc = new GroupCost_Excel();
+                gc.Id = List_GC[i].Id;
+                gc.Diid = List_GC[i].Diid.ToString();
+                gc.DAY = List_GC[i].DAY;
+                string week = "";
+                if (!string.IsNullOrEmpty(List_GC[i].Date.Trim()))
+                    week = CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(Convert.ToDateTime(List_GC[i].Date).DayOfWeek);
+                gc.Date = (List_GC[i].Date + "\n" + week).ToString();
+                gc.ITIN = List_GC[i].ITIN;
+                gc.CarType = List_GC[i].CarType;
+                gc.CarTiming = List_GC[i].CarTiming.ToString() == "0" ? "/" : List_GC[i].CarTiming.ToString();
+                gc.CarCost = List_GC[i].CarCost.ToString() == "0" ? "/" : List_GC[i].CarCost.ToString();
+                gc.CarNumber = List_GC[i].CarNumber.ToString() == "0" ? "/" : List_GC[i].CarNumber.ToString();
+                gc.TGS = List_GC[i].TGS.ToString() == "0" ? "/" : List_GC[i].TGS.ToString();
+                gc.TGWH = List_GC[i].TGWH.ToString() == "0" ? "/" : List_GC[i].TGWH.ToString();
+                gc.TGN = List_GC[i].TGS.ToString() == "0" ? "/" : List_GC[i].TGN.ToString();
+                gc.TGOF = List_GC[i].TGOF.ToString() == "0" ? "/" : List_GC[i].TGOF.ToString();
+
+                gc.TGM = List_GC[i].TGM.ToString() == "0" ? "/" : List_GC[i].TGM.ToString();
+                gc.TGA = List_GC[i].TGA.ToString() == "0" ? "/" : List_GC[i].TGA.ToString();
+                gc.TGTF = List_GC[i].TGTF.ToString() == "0" ? "/" : List_GC[i].TGTF.ToString();
+                gc.TGEF = List_GC[i].TGEF.ToString() == "0" ? "/" : List_GC[i].TGEF.ToString();
+                gc.CFS = List_GC[i].CFS.ToString() == "0" ? "/" : List_GC[i].CFS.ToString();
+                gc.CFM = List_GC[i].CFM.ToString() == "0" ? "/" : List_GC[i].CFOF.ToString();
+                gc.CFOF = List_GC[i].CFOF.ToString() == "0" ? "/" : List_GC[i].CFOF.ToString();
+                gc.B = List_GC[i].B.ToString() == "0" ? "/" : List_GC[i].B.ToString();
+                gc.L = List_GC[i].L.ToString() == "0" ? "/" : List_GC[i].L.ToString();
+                gc.D = List_GC[i].D.ToString() == "0" ? "/" : List_GC[i].D.ToString();
+                gc.TBR = List_GC[i].TBR.ToString() == "0" ? "/" : List_GC[i].TBR.ToString();
+                gc.SGR = List_GC[i].SGR.ToString() == "0" ? "/" : List_GC[i].SGR.ToString();
+                gc.JS_ES = List_GC[i].JS_ES.ToString() == "0" ? "/" : List_GC[i].JS_ES.ToString();
+                gc.Suite = List_GC[i].Suite.ToString() == "0" ? "/" : List_GC[i].Suite.ToString();
+                gc.ACCON = List_GC[i].ACCON.ToString() == "0" ? "/" : List_GC[i].ACCON.ToString();
+                gc.TV = List_GC[i].TV.ToString() == "0" ? "/" : List_GC[i].TV.ToString();
+                gc.iL = List_GC[i].iL.ToString() == "0" ? "/" : List_GC[i].iL.ToString();
+                gc.IF = List_GC[i].IF.ToString() == "0" ? "/" : List_GC[i].IF.ToString();
+                gc.EF = List_GC[i].EF.ToString() == "0" ? "/" : List_GC[i].EF.ToString();
+                gc.B_R_F = List_GC[i].B_R_F.ToString() == "0" ? "/" : List_GC[i].B_R_F.ToString();
+                gc.TE = List_GC[i].TE.ToString() == "0" ? "/" : List_GC[i].TE.ToString();
+                gc.TGTips = List_GC[i].TGTips.ToString() == "0" ? "/" : List_GC[i].TGTips.ToString();
+                gc.DRVTips = List_GC[i].DRVTips.ToString() == "0" ? "/" : List_GC[i].DRVTips.ToString();
+                gc.PC = List_GC[i].PC.ToString() == "0" ? "/" : List_GC[i].PC.ToString();
+                gc.TLF = List_GC[i].TLF.ToString() == "0" ? "/" : List_GC[i].TLF.ToString();
+                gc.ECT = List_GC[i].ECT.ToString() == "0" ? "/" : List_GC[i].ECT.ToString();
+                List_GC1.Add(gc);
+            }
+
+            var dt = CommonFun.GetDataTableFromIList(List_GC1);
+            dt.TableName = "TB";
+
+            //document.querySelectorAll(".sheet-box .biaoge .el-table__header-wrapper .el-table__header .has-gutter tr")[0]
+
+            //报表标题等不用dt的值
+            designer.SetDataSource("TeamName", dto.title.TeamName);
+            designer.SetDataSource("Pnumber", dto.title.GroupNumber);
+            designer.SetDataSource("Tax", dto.title.Tax);
+            //designer.SetDataSource("FFYS", lblHotelCB.Text);
+            designer.SetDataSource("Currency", dto.title.Currency);
+            //designer.SetDataSource("HotelXS", txtHotelXS.Text);
+            designer.SetDataSource("Rate", dto.title.Rate);
+            //酒店 标间 单间 套房 小套房 小套房/豪华套房 等 间数
+
+            //酒店数量
+            //designer.SetDataSource("SGRNumber", txtSGRNumber.Text);
+            //designer.SetDataSource("TBRNumber", txtTBRNumber.Text);
+            //designer.SetDataSource("JSESNumber", txtJSESNumber.Text);
+            //designer.SetDataSource("SUITENumber", txtSUITENumber.Text);
+
+            //#region 
+            //designer.SetDataSource("VisaName", "签证(CNY)");
+            //designer.SetDataSource("VisaDRCB", txtVisaCost.Text);
+            //designer.SetDataSource("VisaRS", txtVisaNum.Text);
+            //designer.SetDataSource("VisaXS", txtVisaXS.Text);
+            //designer.SetDataSource("VisaZCB", lblVisaZCB.Text);
+            //designer.SetDataSource("VisaDRBJ", lblVisaDRBJ.Text);
+            //designer.SetDataSource("VisaZBJ", lblVisaZBJ.Text);
+            //designer.SetDataSource("VisaDRLR", lblVisaDRLR.Text);
+            //designer.SetDataSource("VisaZLR", lblVisaZLR.Text);
+
+            //designer.SetDataSource("BXName", "保险(CNY)");
+            //designer.SetDataSource("BXDRCB", txtBXCB.Text);
+            //designer.SetDataSource("BXRS", txtBXRS.Text);
+            //designer.SetDataSource("BXXS", txtBXXS.Text);
+            //designer.SetDataSource("BXZCB", lblBXZCB.Text);
+            //designer.SetDataSource("BXDRBJ", lblBXDRBJ.Text);
+            //designer.SetDataSource("BXZBJ", lblBXZBJ.Text);
+            //designer.SetDataSource("BXDRLR", lblBXDRLR.Text);
+            //designer.SetDataSource("BXZLR", lblBXZLR.Text);
+
+            //designer.SetDataSource("HSName", "核酸检测(CNY)");
+            //designer.SetDataSource("HSDRCB", txtHSCB.Text);
+            //designer.SetDataSource("HSRS", txtHSRS.Text);
+            //designer.SetDataSource("HSXS", txtHSXS.Text);
+            //designer.SetDataSource("HSZCB", lblHSZCB.Text);
+            //designer.SetDataSource("HSDRBJ", lblHSDRBJ.Text);
+            //designer.SetDataSource("HSZBJ", lblHSZBJ.Text);
+            //designer.SetDataSource("HSDRLR", lblHSDRLR.Text);
+            //designer.SetDataSource("HSZLR", lblHSZLR.Text);
+
+            //designer.SetDataSource("AirJJCName", "机票-经济舱(CNY)");
+            //designer.SetDataSource("JPJJCCB", tbJJCCB.Text);
+            //designer.SetDataSource("JPJJCPnum", tbJJCPnum.Text);
+            //designer.SetDataSource("JPJJCXS", BtxtJPJJCXS.Text);
+            //designer.SetDataSource("JPJJCZCB", lbJJCZCB.Text);
+            //designer.SetDataSource("JPJJCDRBJ", lblJJCDRBJ.Text);
+            //designer.SetDataSource("JPJJCZBJ", lblJJCZBJ.Text);
+            //designer.SetDataSource("JPJJCDRLR", lblJJCDRLR.Text);
+            //designer.SetDataSource("JPJJCZLR", LBLJJCZLR.Text);
+
+            //designer.SetDataSource("AirGWCName", "机票-公务舱(CNY)");
+            //designer.SetDataSource("JPGWCCB", tbGWCCB.Text);
+            //designer.SetDataSource("JPGWCPNum", tbGWCPNum.Text);
+            //designer.SetDataSource("JPGWCXS", txtJPGWCXS.Text);
+            //designer.SetDataSource("JPGWCZCB", lbGWCZCB.Text);
+            //designer.SetDataSource("JPGWCDRBJ", lblGWCDRBJ.Text);
+            //designer.SetDataSource("JPGWCZBJ", lblGWCZBJ.Text);
+            //designer.SetDataSource("JPGWCDRLR", lblGWCDRLR.Text);
+            //designer.SetDataSource("JPGWCZLR", lblGWCZLR.Text);
+
+            //designer.SetDataSource("HCPCB", txtHCPCB.Text);
+            //designer.SetDataSource("HCPRS", txtHCPRS.Text);
+            //designer.SetDataSource("HCPXS", txtHCPXS.Text);
+            //designer.SetDataSource("HCPZCB", lblHCPZCB.Text);
+            //designer.SetDataSource("HCPDRBJ", lblHCPDRBJ.Text);
+            //designer.SetDataSource("HCPZBJ", lblHCPZBJ.Text);
+            //designer.SetDataSource("HCPDRLR", lblHCPDRLR.Text);
+            //designer.SetDataSource("HCPZLR", lblHCPZLR.Text);
+
+            //designer.SetDataSource("CPCB", txtCPCB.Text);
+            //designer.SetDataSource("CPRS", txtCPRS.Text);
+            //designer.SetDataSource("CPXS", txtCPXS.Text);
+            //designer.SetDataSource("CPZCB", lblCPZCB.Text);
+            //designer.SetDataSource("CPDRBJ", lblCPDRBJ.Text);
+            //designer.SetDataSource("CPZBJ", lblCPZBJ.Text);
+            //designer.SetDataSource("CPDRLR", lblCPDRLR.Text);
+            //designer.SetDataSource("CPZLR", lblCPZLR.Text);
+
+            ////TBR
+            //designer.SetDataSource("HotelTBRDRCB", lblHotelTBRDRCB.Text);
+            //designer.SetDataSource("HotelTBRRS", txtHotelTBRRS.Text);
+            //designer.SetDataSource("HotelTBRXS", txtHoteLTBRXS.Text);
+            //designer.SetDataSource("HotelTBRCB", lblHotelTBRCB.Text);
+            //designer.SetDataSource("HotelTBRDRBJ", lblHotelTBRDRBJ.Text);
+            //designer.SetDataSource("HotelTBRZBJ", lblHotelTBRZBJ.Text);
+            //designer.SetDataSource("HotelTBRDRLR", lblHotelTBRDRLR.Text);
+            //designer.SetDataSource("HotelTBRZLR", lblHotelTBRZLR.Text);
+
+            ////SGR
+            //designer.SetDataSource("HotelSGRDRCB", lblHotelSGRDRCB.Text);
+            //designer.SetDataSource("HotelSGRRS", txtHotelSGRRS.Text);
+            //designer.SetDataSource("HotelSGRXS", txtHotelSGRXS.Text);
+            //designer.SetDataSource("HotelSGRCB", lblHotelSGRZCB.Text);
+            //designer.SetDataSource("HotelSGRDRBJ", lblHotelSGRDRBJ.Text);
+            //designer.SetDataSource("HotelSGRZBJ", lblHotelSGRZBJ.Text);
+            //designer.SetDataSource("HotelSGRDRLR", lblHotelSGRDRLR.Text);
+            //designer.SetDataSource("HotelSGRZLR", lblHotelSGRZLR.Text);
+
+
+            ////JS/ES
+            //designer.SetDataSource("HotelJSESDRCB", lblHotelJSESDRCB.Text);
+            //designer.SetDataSource("HotelJSESRS", txtHotelJSESRS.Text);
+            //designer.SetDataSource("HotelJSESXS", txtHotelJSESXS.Text);
+            //designer.SetDataSource("HotelJSESCB", lblHotelJSESZCB.Text);
+            //designer.SetDataSource("HotelJSESDRBJ", lblHotelJSESDRBJ.Text);
+            //designer.SetDataSource("HotelJSESZBJ", lblHotelJSESZBJ.Text);
+            //designer.SetDataSource("HotelJSESDRLR", lblHotelJSESDRLR.Text);
+            //designer.SetDataSource("HotelJSESZLR", lblHotelJSESZLR.Text);
+
+            ////SUITE
+            //designer.SetDataSource("HotelSUITEDRCB", lblHotelSUITEDRCB.Text);
+            //designer.SetDataSource("HotelSUITERS", txtHotelSUITERS.Text);
+            //designer.SetDataSource("HotelSUITEXS", txtHotelSUITEXS.Text);
+            //designer.SetDataSource("HotelSUITECB", lblHotelSUITEZCB.Text);
+            //designer.SetDataSource("HotelSUITEDRBJ", lblHotelSUITEDRBJ.Text);
+            //designer.SetDataSource("HotelSUITEZBJ", lblHotelSUITEZBJ.Text);
+            //designer.SetDataSource("HotelSUITEDRLR", lblHotelSUITEDRLR.Text);
+            //designer.SetDataSource("HotelSUITEZLR", lblHotelSUITEZLR.Text);
+
+            //designer.SetDataSource("DJDRCB", lblDJDRCB.Text);
+            //designer.SetDataSource("DJRS", txtDJRS.Text);
+            //designer.SetDataSource("DJXS", txtDJXS.Text);
+            //designer.SetDataSource("DJCB", lblDJCB.Text);
+            //designer.SetDataSource("DJDRBJ", lblDJDRBJ.Text);
+            //designer.SetDataSource("DJZBJ", lblDJZBJ.Text);
+            //designer.SetDataSource("DJDRLR", lblDJDRLR.Text);
+            //designer.SetDataSource("DJZLR", lblDJZLR.Text);
+
+
+            //designer.SetDataSource("GWDRCD", lblGWDRCD.Text);
+            //designer.SetDataSource("GWRS", txtGWRS.Text);
+            //designer.SetDataSource("GWXS", txtGWXS.Text);
+            //designer.SetDataSource("GWCB", lblGWCB.Text);
+            //designer.SetDataSource("GWDRBJ", lblGWDRBJ.Text);
+            //designer.SetDataSource("GWZBJ", lblGWZBJ.Text);
+            //designer.SetDataSource("GWDRLR", lblGWDRLR.Text);
+            //designer.SetDataSource("GWZLR", lblGWZLR.Text);
+
+            //designer.SetDataSource("LYJDRCB", lblLYJDRCB.Text);
+            //designer.SetDataSource("LYJRS", txtLYJRS.Text);
+            //designer.SetDataSource("LYJXS", txtLYJXS.Text);
+            //designer.SetDataSource("LYJCB", lblLYJCB.Text);
+            //designer.SetDataSource("LYJDRBJ", lblLYJDRBJ.Text);
+            //designer.SetDataSource("LYJZBJ", lblLYJZBJ.Text);
+            //designer.SetDataSource("LYJDRLR", lblLYJDRLR.Text);
+            //designer.SetDataSource("LYJZLR", lblLYJZLR.Text);
+            //#endregion
+
+
+
+
+            designer.SetDataSource(dt);
+            designer.Workbook.Worksheets[0].Name = "清单";
+
+
+            return Ok();
+        }
 
         #endregion
 

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

@@ -779,5 +779,465 @@ namespace OASystem.Domain.Dtos.Groups
         public int Diid { get; set; } 
     }
 
+    public class GroupCostExportWordFile
+    {
+        public int Diid { get; set; }
+        public List<ExportWordFileAir> airs { get; set; }
+
+    }
+
+    public class ExportWordFileAir
+    {
+        public string code { get; set; }
+        public int number { get; set; }
+        public decimal price { get; set; }
+        public string costType { get; set; }
+    }
+
+    public class GroupCostExportExcelFile
+    {
+        public int Diid { get; set; }
+
+        public titleChunk title { get; set; }
+    }
+
+    /// <summary>
+    /// GroupCost 适用 excel 导出 
+    /// </summary>
+    public class GroupCost_Excel
+    {
+        int id;
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public int Id
+        {
+            get { return id; }
+            set { id = value; }
+        }
+
+        string diid;
+        /// <summary>
+        /// 团号
+        /// </summary>
+        public string Diid
+        {
+            get { return diid; }
+            set { diid = value; }
+        }
+        string day;
+        /// <summary>
+        /// 天数
+        /// </summary>
+
+        public string DAY
+        {
+            get { return day; }
+            set { day = value; }
+        }
+        string date;
+        /// <summary>
+        /// 日期
+        /// </summary>
+        public string Date
+        {
+            get { return date; }
+            set { date = value; }
+        }
+
+        string itin;
+        /// <summary>
+        /// 行程描述
+        /// </summary>
+        public string ITIN
+        {
+            get { return itin; }
+            set { itin = value; }
+        }
+        string carType;
+        /// <summary>
+        /// 车型
+        /// </summary>
+        public string CarType
+        {
+            get { return carType; }
+            set { carType = value; }
+        }
+
+        string carCost;
+        /// <summary>
+        /// 车费用
+        /// </summary>
+        public string CarCost
+        {
+            get { return carCost; }
+            set { carCost = value; }
+        }
+
+        string carNumber;
+        /// <summary>
+        /// 车数量
+        /// </summary>
+        public string CarNumber
+        {
+            get { return carNumber; }
+            set { carNumber = value; }
+        }
+
+        string carTiming;
+        /// <summary>
+        /// 用车时间
+        /// </summary>
+        public string CarTiming
+        {
+            get { return carTiming; }
+            set { carTiming = value; }
+        }
+
+        string tgs;
+        /// <summary>
+        ///  导游工资
+        /// </summary>
+        public string TGS
+        {
+            get { return tgs; }
+            set { tgs = value; }
+        }
+
+        string tgn;
+        /// <summary>
+        /// 导游人数
+        /// </summary>
+        public string TGN
+        {
+            get { return tgn; }
+            set { tgn = value; }
+        }
+
+        string tgwk;
+        /// <summary>
+        ///  导游工资
+        /// </summary>
+        public string TGWH
+        {
+            get { return tgwk; }
+            set { tgwk = value; }
+        }
+        /// <summary>
+        /// 导游超时费用
+        /// </summary>
+        string tgof;
+        public string TGOF
+        {
+            get { return tgof; }
+            set { tgof = value; }
+        }
+
+        string tgm;
+        /// <summary>
+        /// 导游餐补
+        /// </summary>
+        public string TGM
+        {
+            get { return tgm; }
+            set { tgm = value; }
+        }
+
+        string tga;
+        /// <summary>
+        /// 导游房补
+        /// </summary>
+        public string TGA
+        {
+            get { return tga; }
+            set { tga = value; }
+        }
+
+        string tgtf;
+        /// <summary>
+        /// 导游交通费
+        /// </summary>
+        public string TGTF
+        {
+            get { return tgtf; }
+            set { tgtf = value; }
+        }
+
+        string tgef;
+        /// <summary>
+        /// 导游景点费
+        /// </summary>
+        public string TGEF
+        {
+            get { return tgef; }
+            set { tgef = value; }
+        }
+
+        string cfs;
+        /// <summary>
+        ///  司机工资
+        /// </summary>
+        public string CFS
+        {
+            get { return cfs; }
+            set { cfs = value; }
+        }
+
+        /// <summary>
+        /// 司机餐补
+        /// </summary>
+        string cfm;
+        public string CFM
+        {
+            get { return cfm; }
+            set { cfm = value; }
+        }
+
+        /// <summary>
+        /// 司机超时费用
+        /// </summary>
+        string cfof;
+        public string CFOF
+        {
+            get { return cfof; }
+            set { cfof = value; }
+        }
+
+        string b;
+        /// <summary>
+        /// 早餐
+        /// </summary>
+        public string B
+        {
+            get { return b; }
+            set { b = value; }
+        }
+
+        string l;
+        /// <summary>
+        /// 午餐
+        /// </summary>
+        public string L
+        {
+            get { return l; }
+            set { l = value; }
+        }
 
+        string d;
+        /// <summary>
+        /// 晚餐
+        /// </summary>
+        public string D
+        {
+            get { return d; }
+            set { d = value; }
+        }
+
+        string tbr;
+        /// <summary>
+        /// 1/2 双人间
+        /// </summary>
+        public string TBR
+        {
+            get { return tbr; }
+            set { tbr = value; }
+        }
+        string sgr;
+        /// <summary>
+        /// 单间
+        /// </summary>
+        public string SGR
+        {
+            get { return sgr; }
+            set { sgr = value; }
+        }
+        string jses;
+        /// <summary>
+        /// 小套房
+        /// </summary>
+        public string JS_ES
+        {
+            get { return jses; }
+            set { jses = value; }
+        }
+
+        string suite;
+        /// <summary>
+        /// 套房
+        /// </summary>
+        public string Suite
+        {
+            get { return suite; }
+            set { suite = value; }
+        }
+
+        string accon;
+        /// <summary>
+        /// 酒店名称
+        /// </summary>
+        public string ACCON
+        {
+            get { return accon; }
+            set { accon = value; }
+        }
+
+        string tv;
+        /// <summary>
+        /// 公务活动费用
+        /// </summary>
+        public string TV
+        {
+            get { return tv; }
+            set { tv = value; }
+        }
+
+        string il;
+        /// <summary>
+        /// 邀请函相关费用
+        /// </summary>
+        public string iL
+        {
+            get { return il; }
+            set { il = value; }
+        }
+
+        string iF;
+        /// <summary>
+        /// 公务翻译费用
+        /// </summary>
+        public string IF
+        {
+            get { return iF; }
+            set { iF = value; }
+        }
+
+        string ef;
+        /// <summary>
+        /// 景点门票
+        /// </summary>
+        public string EF
+        {
+            get { return ef; }
+            set { ef = value; }
+        }
+
+        string brf;
+        /// <summary>
+        /// 饮料零食水果
+        /// </summary>
+        public string B_R_F
+        {
+            get { return brf; }
+            set { brf = value; }
+        }
+
+        string te;
+        /// <summary>
+        /// 出行物资
+        /// </summary>
+        public string TE
+        {
+            get { return te; }
+            set { te = value; }
+        }
+
+        string tgtips;
+        /// <summary>
+        /// 导游小费
+        /// </summary>
+        public string TGTips
+        {
+            get { return tgtips; }
+            set { tgtips = value; }
+        }
+        string drvtips;
+        /// <summary>
+        /// 司机小费
+        /// </summary>
+        public string DRVTips
+        {
+            get { return drvtips; }
+            set { drvtips = value; }
+        }
+
+        string pc;
+        /// <summary>
+        /// 零用金
+        /// </summary>
+        public string PC
+        {
+            get { return pc; }
+            set { pc = value; }
+        }
+
+        string tlf;
+        /// <summary>
+        /// 领队费
+        /// </summary>
+        public string TLF
+        {
+            get { return tlf; }
+            set { tlf = value; }
+        }
+
+        string ect;
+        /// <summary>
+        /// 会务费
+        /// </summary>
+        public string ECT
+        {
+            get { return ect; }
+            set { ect = value; }
+        }
+
+        int oper;
+        /// <summary>
+        /// 操作员
+        /// </summary>
+        public int Oper
+        {
+            get { return oper; }
+            set { oper = value; }
+        }
+
+        string opTime;
+        /// <summary>
+        /// 操作时间
+        /// </summary>
+        public string OpTime
+        {
+            get { return opTime; }
+            set { opTime = value; }
+        }
+
+        int isdel;
+        /// <summary>
+        ///  删除标识
+        /// </summary>
+        public int Isdel
+        {
+            get { return isdel; }
+            set { isdel = value; }
+        }
+    }
+
+
+    public class titleChunk
+    {
+
+        public int GroupNumber { get; set; }
+
+        public string TeamName { get; set; }
+
+        public decimal Tax {  get; set; }
+
+        public string Currency { get; set; }
+
+        public decimal Rate { get; set; }
+
+
+
+
+
+    }
 }

+ 63 - 0
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -1,6 +1,7 @@
 using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
 using System.Globalization;
+using System.Reflection;
 using System.Reflection.Metadata;
 
 namespace OASystem.Infrastructure.Tools;
@@ -409,4 +410,66 @@ public static class CommonFun
     }
 
     #endregion
+
+    /// <summary>
+    /// List to DataTable
+    /// 集合转换成datatable
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    /// <param name="aIList"></param>
+    /// <returns></returns>
+    public static DataTable GetDataTableFromIList<T>(List<T> aIList)
+    {
+
+        DataTable _returnTable = new DataTable();
+
+        if (aIList != null && aIList.Count > 0)
+        {
+
+            object _baseObj = aIList[0];
+
+            Type objectType = _baseObj.GetType();
+
+            PropertyInfo[] properties = objectType.GetProperties();
+
+            DataColumn _col;
+
+            foreach (PropertyInfo property in properties)
+            {
+
+                _col = new DataColumn();
+
+                _col.ColumnName = (string)property.Name;
+
+                _col.DataType = property.PropertyType;
+
+                _returnTable.Columns.Add(_col);
+
+            }
+
+            //Adds the rows to the table
+
+            DataRow _row;
+
+            foreach (object objItem in aIList)
+            {
+
+                _row = _returnTable.NewRow();
+
+                foreach (PropertyInfo property in properties)
+                {
+
+                    _row[property.Name] = property.GetValue(objItem, null);
+
+                }
+
+                _returnTable.Rows.Add(_row);
+
+            }
+
+        }
+
+        return _returnTable;
+
+    }
 }