Sfoglia il codice sorgente

收款账单 --> 汇款账单 --> 增加头等舱相关信息

LEIYI 8 mesi fa
parent
commit
bea0496366

+ 25 - 4
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1052,8 +1052,30 @@ namespace OASystem.API.Controllers
                             var client = ClientItemList[i]; //每个人员
                             var firstName = ClientItemList[i].Name;
 
+                            /*
+                             *  457	头等舱
+                             *  458	公务舱
+                             *  460	经济舱
+                             */
+
+                            decimal airPrice = 0.00M;
+                            string airName = string.Empty;
+                            if (client.AirType == 457)
+                            {
+                                airName = $"头等舱";
+                                airPrice = _EnterExitCosts.AirTD;
+                            }else if (client.AirType == 458)
+                            {
+                                airName = $"公务舱";
+                                airPrice = _EnterExitCosts.AirGW;
+                            }else if (client.AirType == 460)
+                            {
+                                airName = $"经济舱";
+                                airPrice = _EnterExitCosts.AirJJ;
+                            }
+
                             //计算费用总和
-                            decimal airPrice = client.AirType == 460 ? _EnterExitCosts.AirJJ : _EnterExitCosts.AirGW;
+
                             decimal AllPrice = airPrice + _EnterExitCosts.CityTranffic + dac1.Sum(x => x.SubTotal) + dac2.Sum(x => x.SubTotal) +
                                                dac3.Sum(x => x.SubTotal) + dac4.Sum(x => x.SubTotal) + _EnterExitCosts.Visa + _EnterExitCosts.Safe +
                                                +_EnterExitCosts.YiMiao + _EnterExitCosts.YiMiao + _EnterExitCosts.Ticket + _EnterExitCosts.Service;
@@ -1229,8 +1251,7 @@ namespace OASystem.API.Controllers
 
                             TeableBookmarkArr.Add("fw", _EnterExitCosts.Service.ToString("#0.00") + "元/人");//服务费
                             TeableBookmarkArr.Add("AllPrice", AllPrice.ToString("#0.00") + "元/人");//表格合计费用
-                            string airStr = client.AirType == 460 ? "经济舱" : client.AirType == 458 ? "公务舱" : "";
-                            TeableBookmarkArr.Add("title", $"费用清单-{airStr}({firstName})");
+                            TeableBookmarkArr.Add("title", $"费用清单-{airName}({firstName})");
                             foreach (var book in TeableBookmarkArr.Keys)
                             {
 
@@ -4360,7 +4381,7 @@ Group by PriceType ", dto.diId);
                  * 
                  */
 
-                var ids = new List<int>();
+                            var ids = new List<int>();
                 if (cardType == 74) //美元卡
                 {
                     var AirGroupReuslt = List_ccp.Where(x => x.CTable == 85).GroupBy(x => x.DIId).ToList();

+ 25 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3,7 +3,9 @@ using Aspose.Words;
 using Aspose.Words.Drawing;
 using Aspose.Words.Tables;
 using Microsoft.AspNetCore.SignalR;
+using MySqlX.XDevAPI.Relational;
 using NPOI.HSSF.UserModel;
+using NPOI.SS.Format;
 using NPOI.SS.UserModel;
 using NPOI.SS.Util;
 using NPOI.XSSF.UserModel;
@@ -10901,6 +10903,7 @@ ORDER by  gctggrc.id DESC
                     builder.ParagraphFormat.Style.Font.Bold = true;
                     builder.Writeln(@$"VOUCHER No:{item.CheckNumber}   DATE: {item.CreateTime.ToString("yyyy-MM-dd")}");
 
+
                     builder.StartTable();
 
                     // 设置边框颜色
@@ -10913,11 +10916,13 @@ ORDER by  gctggrc.id DESC
                     builder.InsertCell();
                     builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(20);//列宽 - 百分比
                     builder.CellFormat.HorizontalMerge = CellMerge.None;
+                    //builder.CellFormat.AllowAutoFit = false;
                     builder.ParagraphFormat.Style.Font.Name = "微软雅黑";
                     builder.ParagraphFormat.Style.Font.Size = 7.5;
-                    builder.ParagraphFormat.Style.Font.Bold = false;
                     builder.CellFormat.FitText = true;//单元格内文字设为多行(默认为单行,会影响单元格宽)
-                    builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;//对齐 
+                    builder.CellFormat.WrapText = true; //自动换行
+                    builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;//对齐
+                    builder.RowFormat.AllowBreakAcrossPages = false; //文字自适应大小
                     builder.ParagraphFormat.SpaceBefore = 0;    //设置段前间距 0
                     builder.ParagraphFormat.SpaceAfter = 0;     //设置段后间距 0
                     builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Exactly;  //设置行距 固定值
@@ -11342,6 +11347,24 @@ ORDER by  gctggrc.id DESC
                     builder.Writeln("");
                 }
 
+                #region 获取文档中的所有表格 设置文字自适应
+
+                // 获取文档中的所有表格。
+                foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
+                {
+                    // 遍历表格中的所有行。
+                    foreach (Aspose.Words.Tables.Row row in table.Rows)
+                    {
+                        foreach (Cell cell in row.Cells)
+                        {
+                             Aspose.Words.Tables.CellFormat cellFormat = cell.CellFormat;
+                            cellFormat.Width = 0;
+                        }
+                    }
+                }
+
+                #endregion
+
 
 
                 #region 设置页眉