|
|
@@ -14296,6 +14296,7 @@ FROM
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public IActionResult QueryAssociateSupplier(AssociateSupplierDto dto)
|
|
|
{
|
|
|
var dbResult = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
@@ -14325,6 +14326,7 @@ FROM
|
|
|
/// <param name="file"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> DecreasePaymentsOTAMate(IFormFile file)
|
|
|
{
|
|
|
if (file.Length < 1) return Ok(JsonView(false, "请上传文件!"));
|
|
|
@@ -14411,6 +14413,71 @@ FROM
|
|
|
return Ok(JsonView(true, "操作成功", new { url }));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组增减款项 Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DecreasePaymentsExcelDownload(DecreasePaymentsExcelDownloadDto dto)
|
|
|
+ {
|
|
|
+ if (dto.GroupId < 1) return Ok(JsonView(false, "请选择团组!"));
|
|
|
+ if (dto.GroupId < 1) return Ok(JsonView(false, "请传入用户ID!"));
|
|
|
+
|
|
|
+ var userPers = new List<int>() {
|
|
|
+ 400, // 李允
|
|
|
+ 233 // 刘华举
|
|
|
+ };
|
|
|
+
|
|
|
+ if (!userPers.Contains(dto.CurrUserId)) return Ok(JsonView(false, "您没有权限进行此操作!"));
|
|
|
+
|
|
|
+ string feeSql = string.Format(@"Select dp.Id As DPId,dp.DiId As DPDiId,dp.PriceName,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
|
|
|
+ccp.DayRate,(((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice,ccp.ConsumptionDate,
|
|
|
+Case When ccp.OrbitalPrivateTransfer = 0 Then '公转' Else '私转' End As CostMark,
|
|
|
+Case When ccp.IsPay = 0 Then '未付款' Else '已付款' End As IsPay,sd2.Name As PaymentModes,
|
|
|
+ccp.Payee,ccp.AuditGMDate,u.CnName As Applicant,dp.CreateTime,dp.Remark
|
|
|
+From Grp_DecreasePayments dp
|
|
|
+Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 98 And dp.Id = ccp.CId
|
|
|
+Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
+Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
+Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
+Where dp.IsDel = 0 And ccp.Ctable = 98 And dp.Diid = {0}
|
|
|
+Order By CreateTime",dto.GroupId);
|
|
|
+
|
|
|
+ var feeViews = _sqlSugar.SqlQueryable<GroupOtherFeeExcelView>(feeSql).ToList();
|
|
|
+
|
|
|
+ var groupName = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == dto.GroupId).Select(x => x.TeamName).FirstAsync() ?? "";
|
|
|
+ //获取模板
|
|
|
+ string tempPath = (AppSettingsHelper.Get("ExcelBasePath") + "Template/团组其他费用统计模板.xls");
|
|
|
+ var designer = new WorkbookDesigner();
|
|
|
+ designer.Workbook = new Workbook(tempPath);
|
|
|
+ // 获取工作簿中的工作表集合
|
|
|
+ var worksheets = designer.Workbook.Worksheets;
|
|
|
+
|
|
|
+ //其他费用相关
|
|
|
+ var otherFeeSheet = worksheets["其他费用"];
|
|
|
+ DataTable otherFeeDt = CommonFun.ToDataTableArray(feeViews);
|
|
|
+ otherFeeDt.TableName = "OtherFeeView"; // 设置表名
|
|
|
+ decimal otherCNYTotalCost = feeViews.Sum(x => x.CNYPrice);
|
|
|
+
|
|
|
+ var dataSet = new System.Data.DataSet();
|
|
|
+ dataSet.Tables.Add(otherFeeDt);
|
|
|
+ designer.SetDataSource(dataSet);
|
|
|
+
|
|
|
+ //designer.SetDataSource(otherFeeDt);
|
|
|
+ designer.SetDataSource("GroupName", groupName);
|
|
|
+ designer.SetDataSource("OtherCNYTotalCost", $"{otherCNYTotalCost.ToString("#0.00")} CNY");
|
|
|
+
|
|
|
+ designer.Process();
|
|
|
+
|
|
|
+ //文件名
|
|
|
+ string fileName = $"{groupName}_团组其他费用费用清单{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
+ designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "GroupStatement/" + fileName);
|
|
|
+ string url = AppSettingsHelper.Get("ExcelBaseUrl") + "Office/Excel/GroupStatement/" + fileName;
|
|
|
+ return Ok(JsonView(true, "成功", url));
|
|
|
+ }
|
|
|
+
|
|
|
#region
|
|
|
private static DataTable ConvertExcelToDataTable(string excelFilePath)
|
|
|
{
|
|
|
@@ -33344,6 +33411,12 @@ AirHotelPrice
|
|
|
otherRoomFeeStr = $"{item.OtherRoomPrice.ToString("#0.00")} {roomCurr}\r\n{((item.OtherRoomPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}";
|
|
|
rateDatas.Add(new { code = roomCurr, rate = roomInfo.Rate });
|
|
|
var ccpPaymentCurrency = currDatas.Find(it => it.Id == ccpInfo?.PaymentCurrency)?.Name ?? "";
|
|
|
+
|
|
|
+
|
|
|
+ var currencytempid = ccpInfo.PaymentCurrency;
|
|
|
+ var currencytempName = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.Id == currencytempid).ToList()[0].Name;
|
|
|
+
|
|
|
+
|
|
|
if (ccpPaymentCurrency.Equals("CNY"))
|
|
|
{
|
|
|
payMoneyStr = $"{ccpInfo.PayMoney.ToString("#0.00")} CNY";
|
|
|
@@ -33353,7 +33426,11 @@ AirHotelPrice
|
|
|
{
|
|
|
|
|
|
rateDatas.Add(new { code = ccpPaymentCurrency, rate = ccpInfo.DayRate });
|
|
|
- payMoneyStr = $"{ccpInfo.PayMoney.ToString("#0.00")} {ccpPaymentCurrency}\r\n{((ccpInfo.PayMoney * ccpInfo.DayRate) / _rate).ToString("#0.00")} CNY";
|
|
|
+ //payMoneyStr = $"{ccpInfo.PayMoney.ToString("#0.00")} {ccpPaymentCurrency}\r\n{((ccpInfo.PayMoney * ccpInfo.DayRate) / _rate).ToString("#0.00")} CNY";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ payMoneyStr = $"{((ccpInfo.PayMoney * ccpInfo.DayRate) / _rate).ToString("#0.00")} {currencytempName}";
|
|
|
}
|
|
|
|
|
|
var hotelcardPriceCurrency = currDatas.Find(it => it.Id == item?.CardPriceCurrency)?.Name ?? "";
|
|
|
@@ -33363,7 +33440,8 @@ AirHotelPrice
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- cardPriceStr = $"{item.CardPrice.ToString("#0.00")} {hotelcardPriceCurrency}\r\n{((item.CardPrice * roomInfo.Rate) / _rate).ToString("#0.00")} CNY";
|
|
|
+ //cardPriceStr = $"{item.CardPrice.ToString("#0.00")} {hotelcardPriceCurrency}\r\n{((item.CardPrice * roomInfo.Rate) / _rate).ToString("#0.00")} CNY";
|
|
|
+ cardPriceStr = $"{((item.CardPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {currencytempName}";
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -33597,7 +33675,7 @@ AirHotelPrice
|
|
|
var breakfastInfo = hotelSubData.Where(it => it.HrId == item.Id && it.PriceType == 2).FirstOrDefault(); //早餐
|
|
|
var governmentRentInfo = hotelSubData.Where(it => it.HrId == item.Id && it.PriceType == 3).FirstOrDefault(); //地税
|
|
|
var cityTaxInfo = hotelSubData.Where(it => it.HrId == item.Id && it.PriceType == 4).FirstOrDefault(); //城市税
|
|
|
-
|
|
|
+
|
|
|
|
|
|
string roomCurr = currDatas.Find(it => it.Id == roomInfo?.Currency)?.Name ?? "";
|
|
|
|
|
|
@@ -33622,8 +33700,18 @@ AirHotelPrice
|
|
|
doubleRoomFeeStr = $"{((item.DoubleRoomPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{item.DoubleRoomPrice.ToString("#0.00")} {roomCurr}";
|
|
|
suiteRoomFeeStr = $"{((item.SuiteRoomPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{item.SuiteRoomPrice.ToString("#0.00")} {roomCurr}";
|
|
|
otherRoomFeeStr = $"{((item.OtherRoomPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{item.OtherRoomPrice.ToString("#0.00")} {roomCurr}";
|
|
|
- payMoneyStr = $"{((ccpInfo.PayMoney * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{ccpInfo.PayMoney.ToString("#0.00")} {roomCurr}";
|
|
|
- cardPriceStr = $"{((item.CardPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{item.CardPrice.ToString("#0.00")} {roomCurr}";
|
|
|
+
|
|
|
+
|
|
|
+ var currencytempid = ccpInfo.PaymentCurrency;
|
|
|
+ var currencytempName = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.Id == currencytempid).ToList()[0].Name;
|
|
|
+
|
|
|
+
|
|
|
+ //payMoneyStr = $"{((ccpInfo.PayMoney * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{ccpInfo.PayMoney.ToString("#0.00")} {roomCurr}";
|
|
|
+ payMoneyStr = $"{ccpInfo.PayMoney.ToString("#0.00")} {currencytempName}";
|
|
|
+
|
|
|
+ //cardPriceStr = $"{((item.CardPrice * roomInfo.Rate) / _rate).ToString("#0.00")} {_currency}\r\n{item.CardPrice.ToString("#0.00")} {roomCurr}";
|
|
|
+
|
|
|
+ cardPriceStr = $"{item.CardPrice.ToString("#0.00")} {currencytempName}";
|
|
|
}
|
|
|
string breakfastPriceStr = string.Empty,
|
|
|
breakfastCurrency = currDatas.Find(it => it.Id == item.BreakfastCurrency)?.Name ?? "",
|