|
@@ -3719,6 +3719,8 @@ namespace OASystem.API.Controllers
|
|
|
var rateDatas = await _EnterExitCosts.CurrencyRemark.SplitExchangeRate();
|
|
|
|
|
|
|
|
|
+ _DelegationInfo.VisitCountry = _DelegationInfo.VisitCountry.Replace("|", "、");
|
|
|
+
|
|
|
if (dto.ExportType == 1) //明细表
|
|
|
{
|
|
|
if (dto.SubTypeId == 1005) //1005(默认明细表)
|
|
@@ -4011,8 +4013,8 @@ namespace OASystem.API.Controllers
|
|
|
dic.Add("VisitCountry", _DelegationInfo.VisitCountry);
|
|
|
dic.Add("ClientUnit", _DelegationInfo.ClientUnit);
|
|
|
|
|
|
- var Names = string.Join("、", DeleClientList.Select(it => it.Name).ToList()).TrimEnd('、');
|
|
|
- dic.Add("Names", Names);
|
|
|
+ //var Names = string.Join("、", DeleClientList.Select(it => it.Name).ToList()).TrimEnd('、');
|
|
|
+ //dic.Add("Names", Names);
|
|
|
|
|
|
|
|
|
NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
@@ -4034,7 +4036,7 @@ namespace OASystem.API.Controllers
|
|
|
builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 2, 0);
|
|
|
|
|
|
- string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknown";
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknown";
|
|
|
builder.Write(currency);//币种
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 3, 0);
|
|
|
builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
@@ -4047,7 +4049,7 @@ namespace OASystem.API.Controllers
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 7, 0);
|
|
|
|
|
|
decimal rate = 0.00M;
|
|
|
- rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency))?.Rate ?? 0.00M;
|
|
|
+ rate = rateDatas.Find(it => it.CurrencyName.Equals(currency))?.Rate ?? 0.00M;
|
|
|
|
|
|
builder.Write(rate.ToString("#0.0000"));//汇率
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 8, 0);
|
|
@@ -4088,7 +4090,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 2, 0);
|
|
|
- string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknown";
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknown";
|
|
|
builder.Write(currency);//币种
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 3, 0);
|
|
|
builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
@@ -4101,7 +4103,7 @@ namespace OASystem.API.Controllers
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 7, 0);
|
|
|
|
|
|
decimal rate = 0.00M;
|
|
|
- rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency))?.Rate ?? 0.00M;
|
|
|
+ rate = rateDatas.Find(it => it.CurrencyName.Equals(currency))?.Rate ?? 0.00M;
|
|
|
|
|
|
builder.Write(rate.ToString("#0.0000"));//汇率
|
|
|
|
|
@@ -4119,10 +4121,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 +4239,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 +4250,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 +4268,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 +4292,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;
|
|
@@ -4297,8 +4315,19 @@ namespace OASystem.API.Controllers
|
|
|
designer.SetDataSource("dac2totalPrice", dac2totalPrice);
|
|
|
string cell4Str = $" 4.国际旅费:经济舱:{_EnterExitCosts.OutsideJJPay.ToString("#0.00")}元,公务舱:{_EnterExitCosts.OutsaideGWPay.ToString("#0.00")}元";
|
|
|
string cellStr = $" 5.其他费用(签证费:{_EnterExitCosts.Visa.ToString("#0.00")}元,保险费 :{_EnterExitCosts.Safe.ToString("#0.00")}元)";
|
|
|
- decimal s = dac1totalPrice + dac2totalPrice + _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsaideGWPay + _EnterExitCosts.Visa + _EnterExitCosts.Safe;
|
|
|
- string celllastStr = $" 经审核,住宿费 {dac1totalPrice.ToString("#0.00")} 元,伙食费和公杂费 {dac2totalPrice.ToString(".00")} 元,培训费 元,国际旅费 {(_EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsaideGWPay).ToString("#0.00")} 元,其他费用 {(_EnterExitCosts.Visa + _EnterExitCosts.Safe).ToString("#0.00")} 元,本次出国经费预算合计为 {s.ToString("#0.00")} 元。其中:市本级安排 。";
|
|
|
+ decimal s = dac1totalPrice + dac2totalPrice + _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsaideGWPay + _EnterExitCosts.Visa + _EnterExitCosts.Safe + _EnterExitCosts.Ticket;
|
|
|
+
|
|
|
+ decimal pxFee = dac4.Sum(it => it.Cost);
|
|
|
+ decimal glvFee = _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsaideGWPay;
|
|
|
+ decimal otherFee = _EnterExitCosts.Visa + _EnterExitCosts.Safe + _EnterExitCosts.Ticket;
|
|
|
+ string celllastStr1 = "";
|
|
|
+ if (dac1totalPrice > 0) celllastStr1 += $"住宿费 {dac1totalPrice.ToString("#0.00")} 元";
|
|
|
+ if (dac2totalPrice > 0) celllastStr1 += $",伙食费和公杂费 {dac2totalPrice.ToString("#0.00")} 元";
|
|
|
+ if (pxFee > 0) celllastStr1 += $",培训费 {pxFee.ToString("#0.00")} 元";
|
|
|
+ if (glvFee > 0) celllastStr1 += $",国际旅费 {glvFee.ToString("#0.00")} 元";
|
|
|
+ if (otherFee > 0) celllastStr1 += $",其他费用 {otherFee.ToString("#0.00")} 元";
|
|
|
+
|
|
|
+ string celllastStr = $" 经审核,{celllastStr1},本次出国经费预算合计为 {s.ToString("#0.00")} 元。其中:市本级安排 。";
|
|
|
|
|
|
designer.SetDataSource("cell4Str", cell4Str);
|
|
|
designer.SetDataSource("cellStr", cellStr);
|
|
@@ -4369,7 +4398,13 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
dic.Add("TeamName", _DelegationInfo.TeamName);
|
|
|
dic.Add("ClientUnit", _DelegationInfo.ClientUnit);
|
|
|
- dic.Add("TellPhone", _DelegationInfo.TellPhone);
|
|
|
+ //dic.Add("TellPhone", _DelegationInfo.TellPhone);
|
|
|
+
|
|
|
+ string missionLeaderName = DeleClientList[0].Name,
|
|
|
+ missionLeaderJob = DeleClientList[0].Job;
|
|
|
+ dic.Add("MissionLeaderName", missionLeaderName);
|
|
|
+ dic.Add("MissionLeaderJob", missionLeaderJob);
|
|
|
+
|
|
|
dic.Add("VisitPNumber", _DelegationInfo.VisitPNumber.ToString());
|
|
|
dic.Add("VisitPurpose", _DelegationInfo.VisitPurpose);
|
|
|
|
|
@@ -4423,11 +4458,11 @@ namespace OASystem.API.Controllers
|
|
|
Document doc = new Document(tempPath);
|
|
|
DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
|
|
|
+ dic.Add("GroupClient", _DelegationInfo.ClientUnit);
|
|
|
+
|
|
|
var Names = string.Join("、", DeleClientList.Select(x => x.Name)).TrimEnd('、');
|
|
|
dic.Add("Names", Names);
|
|
|
|
|
|
- int accommodationStartIndex = 6;
|
|
|
- int foodandotherStartIndex = 19;//
|
|
|
int accommodationRows = 12, foodandotherRows = 12;
|
|
|
var Dac1currCn = dac1.GroupBy(x => x.Currency).Select(x => x.Key).ToList();
|
|
|
var Dac2currCn = dac2.GroupBy(x => x.Currency).Select(x => x.Key).ToList();
|
|
@@ -4435,6 +4470,8 @@ namespace OASystem.API.Controllers
|
|
|
NodeCollection allTables = doc.GetChildNodes(NodeType.Table, true);
|
|
|
Aspose.Words.Tables.Table table1 = allTables[0] as Aspose.Words.Tables.Table;
|
|
|
|
|
|
+
|
|
|
+ int accommodationStartIndex = 6;
|
|
|
decimal dac1totalPrice = 0.00M;
|
|
|
foreach (var dac in dac1)
|
|
|
{
|
|
@@ -4449,7 +4486,7 @@ namespace OASystem.API.Controllers
|
|
|
builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));//城市
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 2, 0);
|
|
|
|
|
|
- string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknwon";
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknwon";
|
|
|
builder.Write(currency);//币种
|
|
|
builder.MoveToCell(0, accommodationStartIndex, 3, 0);
|
|
|
builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
@@ -4461,7 +4498,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 +4508,32 @@ namespace OASystem.API.Controllers
|
|
|
dac1totalPrice += rbmPrice;
|
|
|
}
|
|
|
|
|
|
- dic.Add("dac1totalPrice", dac1totalPrice.ToString());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ dic.Add("dac1totalPrice", dac1totalPrice.ToString("#0.00"));
|
|
|
+
|
|
|
+
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 1, 0);
|
|
|
+ builder.Write("小计");
|
|
|
+ builder.MoveToCell(0, accommodationStartIndex, 8, 0);
|
|
|
+ builder.Write(dac1totalPrice.ToString("#0.00"));
|
|
|
+
|
|
|
+ accommodationStartIndex++;
|
|
|
+
|
|
|
+
|
|
|
+ int nullRow = accommodationRows - dac1.Count;
|
|
|
+ //删除空行
|
|
|
+ //if (nullRow > 0)
|
|
|
+ //{
|
|
|
+ // int rowIndex = accommodationStartIndex;
|
|
|
+ // for (int i = 0; i < nullRow; i++)
|
|
|
+ // {
|
|
|
+ // Row row = table1.Rows[rowIndex];
|
|
|
+ // row.Remove();
|
|
|
+ // rowIndex++;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
if (dac2.Count == dac3.Count)//国家 币种 金额
|
|
|
{
|
|
@@ -4482,6 +4544,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ int foodandotherStartIndex = 19;//
|
|
|
decimal dac2totalPrice = 0.00M;
|
|
|
foreach (var dac in dac2)
|
|
|
{
|
|
@@ -4489,12 +4552,12 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+ //foodandotherStartIndex = 12;
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 1, 0);
|
|
|
builder.Write(GetEnterExitCostExportCity(placeData, dac.NationalTravelFeeId));//城市
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 2, 0);
|
|
|
|
|
|
- string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknwon";
|
|
|
+ string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Remark ?? "Unknwon";
|
|
|
builder.Write(currency);//币种
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 3, 0);
|
|
|
builder.Write(dac.Cost.ToString("#0.00"));//标准
|
|
@@ -4506,8 +4569,8 @@ 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;
|
|
|
- builder.Write(rate.ToString());//汇率
|
|
|
+ decimal rate = rateDatas.Find(it => it.CurrencyName == currency)?.Rate ?? 0.00M;
|
|
|
+ builder.Write(rate.ToString("#0.0000"));//汇率
|
|
|
builder.MoveToCell(0, foodandotherStartIndex, 8, 0);
|
|
|
|
|
|
decimal rbmPrice = rate * dac.SubTotal;
|
|
@@ -4516,12 +4579,30 @@ namespace OASystem.API.Controllers
|
|
|
dac2totalPrice += rbmPrice;
|
|
|
}
|
|
|
|
|
|
- dic.Add("dac2totalPrice", dac2totalPrice.ToString());
|
|
|
-
|
|
|
+ dic.Add("dac2totalPrice", dac2totalPrice.ToString("#0.00"));
|
|
|
//删除空行
|
|
|
- if (dac1.Count < accommodationRows)
|
|
|
+ if (dac2.Count < foodandotherRows)
|
|
|
{
|
|
|
- int nullRow = accommodationRows - dac1.Count;
|
|
|
+ //int nullRow = accommodationRows - dac2.Count;
|
|
|
+ //while (table2.Rows.Count > dac2.Count)
|
|
|
+ //{
|
|
|
+ // table2.Rows.RemoveAt(dac2.Count);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
foreach (var key in dic.Keys)
|
|
@@ -4586,8 +4667,10 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
string strFileName = $"{_DelegationInfo.TeamName}组团人员名单({DateTime.Now.ToString("yyyyMMddHHmmss")}).doc";
|
|
|
-
|
|
|
+ //C:/Server/File/OA2023/Office/Word/EnterExitCost/File/
|
|
|
+ //C:\Server\File\OA2023\Office\Word\EnterExitCost\File\
|
|
|
doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
|
|
|
+
|
|
|
string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
|
|
|
return Ok(JsonView(true, "成功", new { Url = url }));
|
|
|
}
|
|
@@ -10343,9 +10426,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));
|
|
|
}
|
|
|
|