|
@@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
using Microsoft.VisualBasic;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
+using Aspose.Words.Lists;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -457,13 +458,13 @@ namespace OASystem.API.Controllers
|
|
|
item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
|
|
|
- CTGGRFeeStr += string.Format(@"{0}总费用:{1} {2}(人名币:{3} CNY 当时支付汇率:{4})\r\n",
|
|
|
- item.Area, item.AmountPaid.ConvertToDecimal1(), item.PaymentCurrency, item.CNYPrice, item.DayRate);
|
|
|
+ CTGGRFeeStr += string.Format(@"{0} 总费用:{1} {2}(人名币:{3} CNY 当时支付汇率:{4})\r\n",
|
|
|
+ item.Area, item.AmountPaid.ConvertToDecimal1().ToString("#0.00"), item.PaymentCurrency, item.CNYPrice.ToString("#0.0000"), item.DayRate.ToString("#0.0000"));
|
|
|
CTGGRCNYTotalPrice += item.CNYPrice;
|
|
|
}
|
|
|
_geView.GroupCTGGRFeeViews = groupCTGGRFeeViews;
|
|
|
|
|
|
- _geView.GroupCTGGRFeeStr = string.Format(@"{0}人名币总费用:{1} CNY", CTGGRFeeStr,CTGGRCNYTotalPrice);
|
|
|
+ _geView.GroupCTGGRFeeStr = string.Format(@"{0}人名币总费用:{1} CNY", CTGGRFeeStr,CTGGRCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
#region 机票预订费用
|
|
@@ -484,24 +485,24 @@ namespace OASystem.API.Controllers
|
|
|
groupAirFeeViews = await _sqlSugar.SqlQueryable<GroupAirFeeView>(groupAirFeeSql).ToListAsync();
|
|
|
|
|
|
string str = "";
|
|
|
+ List<dynamic> airClientPris = new List<dynamic>();
|
|
|
decimal AirCNYTotalPrice = 0.00M;
|
|
|
decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M, JJCAveragePrice = 0.00M;
|
|
|
decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M, GWCAveragePrice = 0.00M;
|
|
|
|
|
|
- if (groupAirFeeViews.Count > 0)
|
|
|
- {
|
|
|
- JJCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.CNYPrice);
|
|
|
- JJCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.ClientNum);
|
|
|
- JJCAveragePrice = (JJCCNYTotalPrice / JJCPeopleNum).ConvertToDecimal1();
|
|
|
- GWCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.CNYPrice);
|
|
|
- GWCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.ClientNum);
|
|
|
- GWCAveragePrice = (GWCCNYTotalPrice / GWCPeopleNum).ConvertToDecimal1();
|
|
|
- }
|
|
|
+ //if (groupAirFeeViews.Count > 0)
|
|
|
+ //{
|
|
|
+ // JJCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.CNYPrice);
|
|
|
+ // JJCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.ClientNum);
|
|
|
+ // JJCAveragePrice = (JJCCNYTotalPrice / JJCPeopleNum).ConvertToDecimal1();
|
|
|
+ // GWCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.CNYPrice);
|
|
|
+ // GWCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.ClientNum);
|
|
|
+ // GWCAveragePrice = (GWCCNYTotalPrice / GWCPeopleNum).ConvertToDecimal1();
|
|
|
+ //}
|
|
|
|
|
|
int Index = 0;
|
|
|
foreach (var item in groupAirFeeViews)
|
|
|
{
|
|
|
-
|
|
|
if (item.AirId > 2924)
|
|
|
{
|
|
|
string itemClientName = "";
|
|
@@ -519,21 +520,32 @@ namespace OASystem.API.Controllers
|
|
|
if (clientIds.Length > 0)
|
|
|
{
|
|
|
int[] output = Array.ConvertAll<string, int>(clientIds, delegate (string s) { return int.Parse(s); });
|
|
|
+
|
|
|
+ if (output.Contains(-1))
|
|
|
+ {
|
|
|
+ itemClientName += $@"行程单";
|
|
|
+ output = output.Where(val => val != -1).ToArray();
|
|
|
+ }
|
|
|
+
|
|
|
var clients = _clientDatas.Where(it => output.Contains(it.Id)).ToList();
|
|
|
- string clientPinYinName = "";
|
|
|
decimal unitCost = 0.00M;
|
|
|
unitCost = (item.PayMoney / item.ClientNum).ConvertToDecimal1();
|
|
|
|
|
|
int clienIndex = 1;
|
|
|
foreach (var client in clients)
|
|
|
{
|
|
|
- Index += 1;
|
|
|
+ airClientPris.Add(new {
|
|
|
+ CnName = client.LastName+client.FirstName,
|
|
|
+ EnName = client.Pinyin,
|
|
|
+ Price = unitCost,
|
|
|
+ AirType = item.AirTypeName
|
|
|
+ });
|
|
|
+
|
|
|
string six = "";
|
|
|
if (client.Sex == 0) six = "Mr";
|
|
|
else if (client.Sex == 1) six = "Ms";
|
|
|
|
|
|
itemClientName += string.Format(@"{0}.{1} {2};", clienIndex, client.LastName + client.FirstName, six);
|
|
|
- clientPinYinName += string.Format(@"{0}.{1}出票价为:{2} CNY;", Index, client.Pinyin, unitCost);
|
|
|
clienIndex++;
|
|
|
}
|
|
|
}
|
|
@@ -566,15 +578,37 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
+ AirCNYTotalPrice += item.CNYPrice;
|
|
|
}
|
|
|
|
|
|
_geView.GroupAirFeeViews = groupAirFeeViews;
|
|
|
- if (!string.IsNullOrEmpty(str))
|
|
|
+ if (airClientPris.Count > 0)
|
|
|
{
|
|
|
- str = string.Format(@"其中:{0}", str);
|
|
|
+ var peoplePriStr = "";
|
|
|
+ var airClientPris1 = airClientPris.GroupBy(item => item.CnName)
|
|
|
+ .Select(group => group.First())
|
|
|
+ .ToList();
|
|
|
+ int airClientPrisIndex = 1;
|
|
|
+ foreach (var item in airClientPris1)
|
|
|
+ {
|
|
|
+ decimal price = 0.00M;
|
|
|
+ var prices = airClientPris.Where(it => it.CnName == item.CnName).ToList();
|
|
|
+ foreach (var pri in prices)
|
|
|
+ {
|
|
|
+ price += pri.Price;
|
|
|
+ }
|
|
|
+ peoplePriStr += $@"{airClientPrisIndex}.{item.EnName}出票价为: { price.ToString("#0.00")} CNY;";
|
|
|
+
|
|
|
+ airClientPrisIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(peoplePriStr))
|
|
|
+ {
|
|
|
+ str = $@"其中:{peoplePriStr}";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- _geView.GroupAirFeeStr = string.Format(@"人名币总费用:{0} CNY\r\n{1}\r\n经济舱均价为:{2}CNY/人;公务舱均价为:{3}CNY/人;", AirCNYTotalPrice, str, JJCAveragePrice, GWCAveragePrice);
|
|
|
+ _geView.GroupAirFeeStr = $@"人名币总费用:{AirCNYTotalPrice.ToString("#0.00")} CNY\r\n{str}\r\n经济舱均价为:{JJCAveragePrice.ToString("#0.00")}CNY/人;公务舱均价为:{GWCAveragePrice.ToString("#0.00")}CNY/人;";
|
|
|
#endregion
|
|
|
|
|
|
#region 签证费用
|
|
@@ -601,7 +635,6 @@ namespace OASystem.API.Controllers
|
|
|
string visaClients = item.VisaClient;
|
|
|
if (!string.IsNullOrEmpty(visaClients))
|
|
|
{
|
|
|
-
|
|
|
string[] clientIds = new string[] { };
|
|
|
if (visaClients.Contains(','))
|
|
|
{
|
|
@@ -761,13 +794,44 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
InsuranceCNYTotalPrice += item.CNYPrice;
|
|
|
|
|
|
+ string itemClientName = "";
|
|
|
+ string insClients = item.ClientName;
|
|
|
+ if (!string.IsNullOrEmpty(insClients))
|
|
|
+ {
|
|
|
+
|
|
|
+ string[] clientIds = new string[] { };
|
|
|
+ if (insClients.Contains(','))
|
|
|
+ {
|
|
|
+ clientIds = insClients.Split(',');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ clientIds = new string[] { insClients };
|
|
|
+ }
|
|
|
+
|
|
|
+ if (clientIds.Length > 0)
|
|
|
+ {
|
|
|
+ int[] output = Array.ConvertAll<string, int>(clientIds, delegate (string s) { return int.Parse(s); });
|
|
|
+ var clients = _clientDatas.Where(it => output.Contains(it.Id)).ToList();
|
|
|
+ foreach (var client in clients)
|
|
|
+ {
|
|
|
+ itemClientName += $"{client.LastName + client.FirstName},";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (itemClientName.Length > 0)
|
|
|
+ {
|
|
|
+ itemClientName = itemClientName.Substring(0, itemClientName.Length - 1);
|
|
|
+ }
|
|
|
+ item.ClientName = itemClientName;
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty(item.AuditGMDate))
|
|
|
{
|
|
|
item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
}
|
|
|
_geView.GroupInsuranceFeeViews = groupInsuranceFeeViews;
|
|
|
- _geView.GroupInsuranceFeeStr = string.Format(@"人名币总费用:{0} CNY", InsuranceCNYTotalPrice);
|
|
|
+ _geView.GroupInsuranceFeeStr = string.Format(@"人名币总费用:{0} CNY", InsuranceCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
#region 其他款项费用
|
|
@@ -832,7 +896,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
_geView.GroupDecreaseFeeViews = groupDecreaseFeeViews;
|
|
|
- _geView.GroupDecreaseFeeStr = string.Format(@"人名币总费用:{0} CNY", DecreaseCNYTotalPrice);
|
|
|
+ _geView.GroupDecreaseFeeStr = string.Format(@"人名币总费用:{0} CNY", DecreaseCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
_view.GroupExpenditure = _geView;
|