浏览代码

出入境费用明细 模板样式调整

leiy 10 月之前
父节点
当前提交
7aaa83e102
共有 2 个文件被更改,包括 52 次插入18 次删除
  1. 51 17
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  2. 1 1
      OASystem/OpWin/OpWin.csproj

+ 51 - 17
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -4119,10 +4119,26 @@ namespace OASystem.API.Controllers
                             table1.Rows.RemoveAt(i - 1);
                         }
 
+
                         dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
-                        dic.Add("VisaPay", _EnterExitCosts.Visa.ToString("#0.00"));
-                        dic.Add("SafePay", _EnterExitCosts.Safe.ToString("#0.00"));
-                        dic.Add("YiMiao", _EnterExitCosts.YiMiao.ToString("#0.00"));
+
+                        string otherFeeStr = "";
+                        if (_EnterExitCosts.Visa > 0) otherFeeStr += $"签证费: {_EnterExitCosts.Visa.ToString("#0.00")} 元,";
+                        if (_EnterExitCosts.Safe > 0) otherFeeStr += $"保险费: {_EnterExitCosts.Safe.ToString("#0.00")} 元,";
+                        if (_EnterExitCosts.Ticket > 0) otherFeeStr += $"参展门票费: {_EnterExitCosts.Ticket.ToString("#0.00")} 元,";
+
+                        if (otherFeeStr.Length > 0)
+                        {
+                            otherFeeStr = otherFeeStr.Substring(0, otherFeeStr.Length - 1);
+                            otherFeeStr = $"({otherFeeStr})";
+
+                            dic.Add("OtherFeeStr", otherFeeStr);
+                        }
+
+
+                        //dic.Add("VisaPay", _EnterExitCosts.Visa.ToString("#0.00"));
+                        //dic.Add("SafePay", _EnterExitCosts.Safe.ToString("#0.00"));
+                        //dic.Add("YiMiao", _EnterExitCosts.YiMiao.ToString("#0.00"));
 
                         foreach (var key in dic.Keys)
                         {
@@ -4221,9 +4237,9 @@ namespace OASystem.API.Controllers
                             new DataColumn(){ ColumnName = "criterion"},
                             new DataColumn(){ ColumnName = "number",DataType = typeof(int)},
                             new DataColumn(){ ColumnName = "day",DataType = typeof(int)},
-                            new DataColumn(){ ColumnName = "cost",  DataType = typeof(float)},
+                            new DataColumn(){ ColumnName = "cost",  DataType = typeof(decimal)},
                             new DataColumn(){ ColumnName = "rate",  DataType = typeof(decimal) },
-                            new DataColumn(){ ColumnName = "costRMB"},
+                            new DataColumn(){ ColumnName = "costRMB",  DataType = typeof(decimal) },
                         });
                         DataTable dtdac2 = new DataTable();
                         dtdac2.Columns.AddRange(new DataColumn[] {
@@ -4232,9 +4248,9 @@ namespace OASystem.API.Controllers
                             new DataColumn(){ ColumnName = "criterion"},
                             new DataColumn(){ ColumnName = "number",DataType = typeof(int)},
                             new DataColumn(){ ColumnName = "day",DataType = typeof(int)},
-                            new DataColumn(){ ColumnName = "cost",  DataType = typeof(float)},
+                            new DataColumn(){ ColumnName = "cost",  DataType = typeof(decimal)},
                             new DataColumn(){ ColumnName = "rate",  DataType = typeof(decimal) },
-                            new DataColumn(){ ColumnName = "costRMB"},
+                            new DataColumn(){ ColumnName = "costRMB",DataType = typeof(decimal)},
                         });
                         dtdac1.TableName = "tb1";
                         dtdac2.TableName = "tb2";
@@ -4250,8 +4266,8 @@ namespace OASystem.API.Controllers
 
                             row["city"] =item.Place;
 
-                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Name ?? "Unknwon";
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Remark ?? "Unknwon";
+                            decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
                             row["curr"] = currency;
                             row["rate"] = rate;
                             row["criterion"] = item.Cost;
@@ -4274,8 +4290,8 @@ namespace OASystem.API.Controllers
                             }
                             DataRow row = dtdac2.NewRow();
                             row["city"] = item.Place;
-                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Name ?? "Unknwon";
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Remark ?? "Unknwon";
+                            decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
                             row["curr"] = currency;
                             row["rate"] = rate;
                             row["criterion"] = item.Cost;
@@ -4461,7 +4477,7 @@ namespace OASystem.API.Controllers
                             builder.Write(dac.SubTotal.ToString("#0.00"));//小计
                             builder.MoveToCell(0, accommodationStartIndex, 7, 0);
 
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
                             builder.Write(rate.ToString("#0.0000"));//汇率
                             builder.MoveToCell(0, accommodationStartIndex, 8, 0);
 
@@ -4471,7 +4487,7 @@ namespace OASystem.API.Controllers
                             dac1totalPrice += rbmPrice;
                         }
 
-                        dic.Add("dac1totalPrice", dac1totalPrice.ToString());
+                        dic.Add("dac1totalPrice", dac1totalPrice.ToString("#0.00"));
 
                         if (dac2.Count == dac3.Count)//国家 币种 金额
                         {
@@ -4506,7 +4522,7 @@ namespace OASystem.API.Controllers
                             builder.Write(dac.SubTotal.ToString("#0.00"));//小计
                             builder.MoveToCell(0, foodandotherStartIndex, 7, 0);
 
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
                             builder.Write(rate.ToString());//汇率
                             builder.MoveToCell(0, foodandotherStartIndex, 8, 0);
 
@@ -4516,7 +4532,25 @@ namespace OASystem.API.Controllers
                             dac2totalPrice += rbmPrice;
                         }
 
-                        dic.Add("dac2totalPrice", dac2totalPrice.ToString());
+                        dic.Add("dac2totalPrice", dac2totalPrice.ToString("#0.00"));
+
+
+                        dic.Add("CityTranffic", _EnterExitCosts.CityTranffic.ToString("#0.00"));
+
+                        string otherFeeStr = "";
+                        if (_EnterExitCosts.Visa > 0) otherFeeStr += $"签证费: {_EnterExitCosts.Visa.ToString("#0.00")} 元,";
+                        if (_EnterExitCosts.Safe > 0) otherFeeStr += $"保险费: {_EnterExitCosts.Safe.ToString("#0.00")} 元,";
+                        if (_EnterExitCosts.Ticket > 0) otherFeeStr += $"参展门票费: {_EnterExitCosts.Ticket.ToString("#0.00")} 元,";
+
+                        if (otherFeeStr.Length > 0)
+                        {
+                            otherFeeStr = otherFeeStr.Substring(0, otherFeeStr.Length - 1);
+                            otherFeeStr = $"({otherFeeStr})";
+
+                            dic.Add("OtherFeeStr", otherFeeStr);
+                        }
+
+
 
                         //删除空行
                         if (dac1.Count < accommodationRows)
@@ -10345,9 +10379,9 @@ namespace OASystem.API.Controllers
 
             string fileName = "组团人员名单(" + DateTime.Now.ToString("yyyyhhddHHmmss") + ").doc";
 
-            var fileDir = AppSettingsHelper.Get("WordBasePath") + fileName;
+            var fileDir = AppSettingsHelper.Get("WordBasePath")+ "TourClientList/" + fileName;
             doc.Save(fileDir);
-            string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + fileName;
+            string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/TourClientList/" + fileName;
             return Ok(JsonView(true, "操作成功!", Url));
         }
 

+ 1 - 1
OASystem/OpWin/OpWin.csproj

@@ -14,7 +14,7 @@
 
   <ItemGroup>
     <Reference Include="Aspose.Words">
-      <HintPath>..\..\..\OA2021\Lib\Aspose.Words.dll</HintPath>
+      <HintPath>..\package\Aspose.Words.dll</HintPath>
     </Reference>
   </ItemGroup>