|
@@ -34,6 +34,10 @@ using System.Globalization;
|
|
|
using static QRCoder.PayloadGenerator;
|
|
|
using Bookmark = Aspose.Words.Bookmark;
|
|
|
using Aspose.Words.Fields;
|
|
|
+using NPOI.POIFS.FileSystem;
|
|
|
+using Microsoft.AspNetCore.Mvc.ViewEngines;
|
|
|
+using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
+using OASystem.Domain.Entities.Financial;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -908,238 +912,485 @@ namespace OASystem.API.Controllers
|
|
|
/// </summary>
|
|
|
/// <param name="paras">参数Json字符串</param>
|
|
|
/// <returns></returns>
|
|
|
+
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostSearchGrpCreditCardPayment(Search_GrpCreditCardPaymentDto _dto)
|
|
|
{
|
|
|
- #region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
|
|
|
- if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
|
|
|
+ try
|
|
|
+ {
|
|
|
+ #region 参数验证
|
|
|
+ if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
|
|
|
+ if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
|
|
|
|
|
|
- PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
+ PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
- #region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId,_dto.PageId);
|
|
|
+ #region 页面操作权限验证
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
|
|
|
- if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
|
|
|
- #endregion
|
|
|
-
|
|
|
- #endregion
|
|
|
+ if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
|
|
|
+ #endregion
|
|
|
|
|
|
- Grp_CreditCardPaymentView _view = new Grp_CreditCardPaymentView();
|
|
|
+ #endregion
|
|
|
|
|
|
- #region 费用清单
|
|
|
- var exp = Expressionable.Create<Grp_CreditCardPayment>();
|
|
|
- exp.AndIF(_dto.AuditStatus != -1, it => it.IsAuditGM == _dto.AuditStatus);
|
|
|
- exp.AndIF(_dto.Label != -1, it => it.CTable == _dto.Label);
|
|
|
+ Grp_CreditCardPaymentView _view = new Grp_CreditCardPaymentView();
|
|
|
|
|
|
- List<Grp_CreditCardPayment> entityList = _groupRepository
|
|
|
- .Query<Grp_CreditCardPayment>(s => s.DIId == _dto.DiId && s.IsDel == 0 && s.CreateUserId > 0)
|
|
|
- .Where(exp.ToExpression())
|
|
|
- .ToList();
|
|
|
+ #region 费用清单
|
|
|
+ var exp = Expressionable.Create<Grp_CreditCardPayment>();
|
|
|
+ exp.AndIF(_dto.AuditStatus != -1, it => it.IsAuditGM == _dto.AuditStatus);
|
|
|
+ exp.AndIF(_dto.Label != -1, it => it.CTable == _dto.Label);
|
|
|
|
|
|
- List<Grp_CreditCardPaymentDetailView> detailList = new List<Grp_CreditCardPaymentDetailView>();
|
|
|
- decimal CNY = 0;
|
|
|
- decimal PayCNY = 0;
|
|
|
- decimal BalanceCNY = 0;
|
|
|
- decimal YSFYCNY = 0;
|
|
|
+ List<Grp_CreditCardPayment> entityList = _groupRepository
|
|
|
+ .Query<Grp_CreditCardPayment>(s => s.DIId == _dto.DiId && s.IsDel == 0 && s.CreateUserId > 0)
|
|
|
+ .Where(exp.ToExpression())
|
|
|
+ .ToList();
|
|
|
|
|
|
- decimal USD = 0;
|
|
|
- decimal PayUSD = 0;
|
|
|
- decimal BalanceUSD = 0;
|
|
|
- decimal YSFYUSD = 0;
|
|
|
|
|
|
- decimal EUR = 0;
|
|
|
- decimal PayEUR = 0;
|
|
|
- decimal BalanceEUR = 0;
|
|
|
- decimal YSFYEUR = 0;
|
|
|
+ List<Grp_CreditCardPaymentDetailView> detailList = new List<Grp_CreditCardPaymentDetailView>();
|
|
|
|
|
|
- foreach (var entity in entityList)
|
|
|
- {
|
|
|
- Grp_CreditCardPaymentDetailView _detail = new Grp_CreditCardPaymentDetailView();
|
|
|
+ List<CreditCardPaymentCurrencyPriceItem> ccpCurrencyPrices = new List<CreditCardPaymentCurrencyPriceItem>();
|
|
|
|
|
|
- _detail.Id = entity.Id;
|
|
|
+ /*
|
|
|
+ * 76://酒店预订
|
|
|
+ */
|
|
|
+
|
|
|
+ List<Grp_HotelReservations> _HotelReservations = await _groupRepository
|
|
|
+ .Query<Grp_HotelReservations>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
|
|
|
/*
|
|
|
- * Bus名称
|
|
|
+ * 79://车/导游地接
|
|
|
*/
|
|
|
- _detail.BusName = "";
|
|
|
+ List<Grp_CarTouristGuideGroundReservations> _CarTouristGuideGroundReservations = await _groupRepository
|
|
|
+ .Query<Grp_CarTouristGuideGroundReservations>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
+ List<Grp_CarTouristGuideGroundReservationsContent> _CarTouristGuideGroundReservationsContent = await _groupRepository
|
|
|
+ .Query<Grp_CarTouristGuideGroundReservationsContent>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
|
|
|
/*
|
|
|
- *费用所属
|
|
|
+ * 80: //签证
|
|
|
*/
|
|
|
- switch (entity.CTable)
|
|
|
- {
|
|
|
- case 85:
|
|
|
- Grp_AirTicketReservations jpRes = _groupRepository.Query<Grp_AirTicketReservations>(s => s.Id == entity.CId).First();
|
|
|
- if (jpRes != null)
|
|
|
- {
|
|
|
- string FlightsDescription = jpRes.FlightsDescription;
|
|
|
- string PriceDescription = jpRes.PriceDescription;
|
|
|
- _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
|
|
|
- _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
|
|
|
- }
|
|
|
- break;
|
|
|
- case 79:
|
|
|
- _detail.BusName = "待增加";
|
|
|
- break;
|
|
|
- case 98:
|
|
|
- Grp_DecreasePayments gdpRes = _groupRepository.Query<Grp_DecreasePayments>(s => s.Id == entity.CId).First();
|
|
|
- if (gdpRes != null)
|
|
|
- {
|
|
|
- _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
|
|
|
- _detail.PriceNameContent = gdpRes.PriceName;
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+
|
|
|
+ List<Grp_VisaInfo> _VisaInfos = await _groupRepository
|
|
|
+ .Query<Grp_VisaInfo>(s => s.DIId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
|
|
|
/*
|
|
|
- * 费用模块
|
|
|
+ *81: //邀请/公务活动
|
|
|
*/
|
|
|
- Sys_SetData sdPriceName = _groupRepository.Query<Sys_SetData>(s => s.Id == entity.CTable).First();
|
|
|
- if (sdPriceName != null)
|
|
|
- {
|
|
|
- _detail.PriceName = sdPriceName.Name;
|
|
|
- }
|
|
|
+
|
|
|
+ List<Grp_InvitationOfficialActivities> _InvitationOfficialActivities = await _groupRepository
|
|
|
+ .Query<Grp_InvitationOfficialActivities>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
|
|
|
/*
|
|
|
- * 应付款金额
|
|
|
+ * 82: //团组客户保险
|
|
|
*/
|
|
|
- Sys_SetData sdPaymentCurrency_WaitPay = _groupRepository.Query<Sys_SetData>(s => s.Id == entity.PaymentCurrency).First();
|
|
|
- string PaymentCurrency_WaitPay = "Unknown";
|
|
|
- if (sdPaymentCurrency_WaitPay != null)
|
|
|
- {
|
|
|
- PaymentCurrency_WaitPay = sdPaymentCurrency_WaitPay.Name;
|
|
|
- }
|
|
|
- _detail.WaitPay = entity.PayMoney.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
|
|
|
|
|
|
/*
|
|
|
- * 此次付款金额
|
|
|
+ * Label = 98 其他款项
|
|
|
*/
|
|
|
- decimal CurrPayStr = 0;
|
|
|
- if (entity.PayPercentage == 0)
|
|
|
- {
|
|
|
- if (entity.PayThenMoney != 0)
|
|
|
- CurrPayStr = entity.PayThenMoney * entity.DayRate;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- CurrPayStr = entity.PayMoney * (decimal.Parse(entity.PayPercentage.ToString("#0.00")) / 100 * entity.DayRate);
|
|
|
- }
|
|
|
- _detail.CurrPay = CurrPayStr.ToString("#0.00") + " CNY";
|
|
|
|
|
|
+ List<Grp_DecreasePayments> _DecreasePayments = await _groupRepository
|
|
|
+ .Query<Grp_DecreasePayments>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
/*
|
|
|
- * 剩余尾款
|
|
|
+ * Lable = 85 机票预订
|
|
|
+ */
|
|
|
+
|
|
|
+ List<Grp_AirTicketReservations> p_AirTicketReservations = await _groupRepository
|
|
|
+ .Query<Grp_AirTicketReservations>(s => s.DIId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 98 机票预定
|
|
|
+ */
|
|
|
+
|
|
|
+ List<Grp_AirTicketReservations> _AirTicketReservations = await _groupRepository.Query<Grp_AirTicketReservations>(s => s.DIId == _dto.DiId && s.IsDel == 0).ToListAsync();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 285://收款退还
|
|
|
+ */
|
|
|
+ List<Fin_PaymentRefundAndOtherMoney> _PaymentRefundAndOtherMoneys= await _groupRepository
|
|
|
+ .Query<Fin_PaymentRefundAndOtherMoney>(s => s.DiId == _dto.DiId && s.IsDel == 0)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ List<Grp_Customers> _Customers = await _groupRepository.Query<Grp_Customers>(s => s.DiId == _dto.DiId && s.IsDel == 0) .ToListAsync();
|
|
|
+ /*
|
|
|
+ * 币种信息
|
|
|
*/
|
|
|
- decimal BalanceStr = 0;
|
|
|
- if (entity.PayMoney - (CurrPayStr / entity.DayRate) < 0.01M)
|
|
|
- BalanceStr = 0;
|
|
|
- else
|
|
|
- BalanceStr = (entity.PayMoney - CurrPayStr / entity.DayRate);
|
|
|
|
|
|
- _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
|
|
|
+ var currencyItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 66 && s.IsDel == 0).ToListAsync();
|
|
|
|
|
|
/*
|
|
|
- * 申请人
|
|
|
+ * 车/导游地接 费用类型
|
|
|
*/
|
|
|
- string operatorName = "无";
|
|
|
- Sys_Users _opUser = _groupRepository.Query<Sys_Users>(s => s.Id == entity.CreateUserId).First();
|
|
|
- if (_opUser != null)
|
|
|
+
|
|
|
+ var carFeeTypeItems = await _groupRepository.Query<Sys_SetData>(s => s.STid == 17 && s.IsDel == 0).ToListAsync();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 用户信息
|
|
|
+ */
|
|
|
+
|
|
|
+ var userItems = await _groupRepository.Query<Sys_Users>(s => s.IsDel == 0).ToListAsync();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 费用模块
|
|
|
+ */
|
|
|
+ Sys_SetData sdPriceName = _groupRepository.Query<Sys_SetData>(s => s.Id == _dto.Label).First();
|
|
|
+ string priceModule = string.Empty;
|
|
|
+ if (sdPriceName != null)
|
|
|
{
|
|
|
- operatorName = _opUser.CnName;
|
|
|
+ priceModule = sdPriceName.Name;
|
|
|
}
|
|
|
- _detail.OperatorName = operatorName;
|
|
|
|
|
|
/*
|
|
|
- * 审核人
|
|
|
- */
|
|
|
- string auditOperatorName = "Unknown";
|
|
|
- if (entity.AuditGMOperate == 0)
|
|
|
- auditOperatorName = "无";
|
|
|
- else if (entity.AuditGMOperate == 4)
|
|
|
- auditOperatorName = "自动审核";
|
|
|
- else
|
|
|
+ * 处理详情数据
|
|
|
+ */
|
|
|
+ foreach (var entity in entityList)
|
|
|
{
|
|
|
- Sys_Users _adUser = _groupRepository.Query<Sys_Users>(s => s.Id == entity.AuditGMOperate).First();
|
|
|
- if (_adUser != null)
|
|
|
+ Grp_CreditCardPaymentDetailView _detail = new Grp_CreditCardPaymentDetailView();
|
|
|
+
|
|
|
+ _detail.Id = entity.Id;
|
|
|
+
|
|
|
+ _detail.PriceName = priceModule;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 应付款金额
|
|
|
+ */
|
|
|
+ Sys_SetData sdPaymentCurrency_WaitPay = currencyItems.Where(s => s.Id == entity.PaymentCurrency).FirstOrDefault();
|
|
|
+ string PaymentCurrency_WaitPay = "Unknown";
|
|
|
+ string hotelCurrncyCode = "Unknown";
|
|
|
+ string hotelCurrncyName = "Unknown";
|
|
|
+ if (sdPaymentCurrency_WaitPay != null)
|
|
|
+ {
|
|
|
+ PaymentCurrency_WaitPay = sdPaymentCurrency_WaitPay.Name;
|
|
|
+ hotelCurrncyCode = sdPaymentCurrency_WaitPay.Name;
|
|
|
+ hotelCurrncyName = sdPaymentCurrency_WaitPay.Remark;
|
|
|
+ }
|
|
|
+ _detail.WaitPay = entity.PayMoney.ConvertToDecimal1() + " " + PaymentCurrency_WaitPay;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 此次付款金额
|
|
|
+ */
|
|
|
+ decimal CurrPayStr = 0;
|
|
|
+ if (entity.PayPercentage == 0)
|
|
|
{
|
|
|
- auditOperatorName = _adUser.CnName;
|
|
|
+ if (entity.PayThenMoney != 0)
|
|
|
+ CurrPayStr = (entity.PayThenMoney * entity.DayRate).ConvertToDecimal1();
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CurrPayStr = (entity.PayMoney * (decimal.Parse(entity.PayPercentage.ToString("#0.00")) / 100 * entity.DayRate)).ConvertToDecimal1();
|
|
|
+ }
|
|
|
+ _detail.CurrPay = CurrPayStr.ToString("#0.00") + " CNY";
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 剩余尾款
|
|
|
+ */
|
|
|
+ decimal BalanceStr = 0;
|
|
|
+ if (entity.PayMoney - (CurrPayStr / entity.DayRate) < 0.01M)
|
|
|
+ BalanceStr = 0;
|
|
|
+ else
|
|
|
+ BalanceStr = (entity.PayMoney - CurrPayStr / entity.DayRate).ConvertToDecimal1();
|
|
|
+
|
|
|
+ _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Bus名称
|
|
|
+ */
|
|
|
+ _detail.BusName = "待增加";
|
|
|
+
|
|
|
+ /*
|
|
|
+ *费用所属
|
|
|
+ */
|
|
|
+ switch (entity.CTable)
|
|
|
+ {
|
|
|
+
|
|
|
+ case 76://酒店预订
|
|
|
+ Grp_HotelReservations hotelReservations = _HotelReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (hotelReservations != null)
|
|
|
+ {
|
|
|
+ _detail.PriceMsgContent = "信用卡金额:" + _detail.WaitPay + " " + hotelCurrncyCode + "(" + hotelCurrncyName + ")<br/>" +
|
|
|
+ "房间说明:" + hotelReservations.Remark;
|
|
|
+ _detail.PriceNameContent = hotelReservations.HotelName;
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 79://车/导游地接
|
|
|
+ Grp_CarTouristGuideGroundReservations touristGuideGroundReservations = _CarTouristGuideGroundReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (touristGuideGroundReservations != null)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(touristGuideGroundReservations.BusName))
|
|
|
+ {
|
|
|
+ _detail.BusName = touristGuideGroundReservations.BusName;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ _detail.PriceNameContent = touristGuideGroundReservations.Area;
|
|
|
+
|
|
|
+ List<Grp_CarTouristGuideGroundReservationsContent> touristGuideGroundReservationsContents = _CarTouristGuideGroundReservationsContent
|
|
|
+ .Where(s => s.CTGGRId == touristGuideGroundReservations.Id && s.IsDel == 0 && s.Price != 0).ToList();
|
|
|
+
|
|
|
+ string priceMsg = string.Empty;
|
|
|
+ foreach (var item in touristGuideGroundReservationsContents)
|
|
|
+ {
|
|
|
+ string typeName = "Unknown";
|
|
|
+ string carCurrencyCode = "Unknown";
|
|
|
+ string carCurrencyName = "Unknown";
|
|
|
+ var carTypeData = carFeeTypeItems.Where(s => s.Id == item.SId && s.IsDel == 0).FirstOrDefault();
|
|
|
+ if (carTypeData != null) typeName = carTypeData.Name;
|
|
|
+
|
|
|
+
|
|
|
+ var currencyData = currencyItems.Where(s => s.Id == item.Currency && s.IsDel == 0).FirstOrDefault();
|
|
|
+ if (currencyData != null) {
|
|
|
+ carCurrencyCode = currencyData.Name;
|
|
|
+ carCurrencyName = currencyData.Remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ priceMsg += typeName + ":" + item.Price.ToString("#0.00") + " " + carCurrencyCode + "(" + carCurrencyName + ")<br/>" +
|
|
|
+ "明细:" + item.PriceContent + "<br/>" +
|
|
|
+ "备注:" + item.Remark + "<br/><br/>";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ _detail.PriceMsgContent = priceMsg;
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 80: //签证
|
|
|
+ Grp_VisaInfo visaInfo = _VisaInfos.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (visaInfo != null)
|
|
|
+ {
|
|
|
+ _detail.PriceNameContent = visaInfo.VisaClient;
|
|
|
+ _detail.PriceMsgContent = "备注:" + visaInfo.Remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 81: //邀请/公务活动
|
|
|
+
|
|
|
+ Grp_InvitationOfficialActivities invitationOfficialActivities = _InvitationOfficialActivities.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (invitationOfficialActivities != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ string ioaCurrencyCode = "Unknown";
|
|
|
+ string ioaCurrencyName= "Unknown";
|
|
|
+
|
|
|
+ var currencyData = currencyItems.Where(s => s.Id == invitationOfficialActivities.Currency && s.IsDel == 0).FirstOrDefault();
|
|
|
+ if (currencyData != null)
|
|
|
+ {
|
|
|
+ ioaCurrencyCode = currencyData.Name;
|
|
|
+ ioaCurrencyName = currencyData.Remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ _detail.PriceNameContent = invitationOfficialActivities.InviterArea;
|
|
|
+ _detail.PriceMsgContent = "邀请费用:" + invitationOfficialActivities.InviteCosts + " "+ ioaCurrencyCode + "("+ ioaCurrencyName+ ")<br/>" +
|
|
|
+ "活动费用:- <br/>" +
|
|
|
+ "备注:" + invitationOfficialActivities.Remark + "<br/>";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 82: //团组客户保险
|
|
|
+
|
|
|
+ Grp_Customers customers = _Customers.Where(s => s.Id == entity.Id && s.IsDel == 0).FirstOrDefault();
|
|
|
+ if (customers != null)
|
|
|
+ {
|
|
|
+ _detail.PriceNameContent = customers.ClientName;
|
|
|
+ _detail.PriceMsgContent = "备注:" + customers.Remark + "<br/>";
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 85: //机票预订
|
|
|
+ Grp_AirTicketReservations jpRes = _AirTicketReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (jpRes != null)
|
|
|
+ {
|
|
|
+ string FlightsDescription = jpRes.FlightsDescription;
|
|
|
+ string PriceDescription = jpRes.PriceDescription;
|
|
|
+ _detail.PriceMsgContent = "航班号:" + jpRes.FlightsCode + "<br/>城市A-B:" + jpRes.FlightsCity + "<br/>航班描述:" + FlightsDescription.Replace("\r\n", "<br />") + "<br/>" + "价格描述:" + PriceDescription;
|
|
|
+ _detail.PriceNameContent = "(" + jpRes.FlightsCode + ")";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 98://其他款项
|
|
|
+ Grp_DecreasePayments gdpRes = _DecreasePayments.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (gdpRes != null)
|
|
|
+ {
|
|
|
+ _detail.PriceMsgContent = "备注:" + gdpRes.Remark;
|
|
|
+ _detail.PriceNameContent = gdpRes.PriceName;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 285://收款退还
|
|
|
+ Fin_PaymentRefundAndOtherMoney refundAndOtherMoney = _PaymentRefundAndOtherMoneys.Where(s => s.Id == entity.CId).FirstOrDefault();
|
|
|
+ if (refundAndOtherMoney != null)
|
|
|
+ {
|
|
|
+ _detail.PriceMsgContent = "备注:" + refundAndOtherMoney.Remark;
|
|
|
+ _detail.PriceNameContent = refundAndOtherMoney.PriceName;
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 751://酒店早餐
|
|
|
+
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 申请人
|
|
|
+ */
|
|
|
+ string operatorName = " - ";
|
|
|
+ Sys_Users _opUser = userItems.Where(s => s.Id == entity.CreateUserId).FirstOrDefault();
|
|
|
+ if (_opUser != null)
|
|
|
+ {
|
|
|
+ operatorName = _opUser.CnName;
|
|
|
+ }
|
|
|
+ _detail.OperatorName = operatorName;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 审核人
|
|
|
+ */
|
|
|
+ string auditOperatorName = "Unknown";
|
|
|
+ if (entity.AuditGMOperate == 0)
|
|
|
+ auditOperatorName = " - ";
|
|
|
+ else if (entity.AuditGMOperate == 4)
|
|
|
+ auditOperatorName = "自动审核";
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Sys_Users _adUser = userItems.Where(s => s.Id == entity.AuditGMOperate).FirstOrDefault();
|
|
|
+ if (_adUser != null)
|
|
|
+ {
|
|
|
+ auditOperatorName = _adUser.CnName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _detail.AuditOperatorName = auditOperatorName;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 超预算比例
|
|
|
+ */
|
|
|
+ string overBudgetStr = "";
|
|
|
+
|
|
|
+ if (entity.ExceedBudget == -1)
|
|
|
+ overBudgetStr = sdPriceName.Name + "尚无预算";
|
|
|
+ else if (entity.ExceedBudget == 0)
|
|
|
+ overBudgetStr = "未超预算";
|
|
|
+ else
|
|
|
+ overBudgetStr = entity.ExceedBudget.ToString("P");
|
|
|
+ _detail.OverBudget = overBudgetStr;
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 费用总计
|
|
|
+ */
|
|
|
+ ccpCurrencyPrices.Add(new CreditCardPaymentCurrencyPriceItem()
|
|
|
+ {
|
|
|
+ CurrencyId = entity.PaymentCurrency,
|
|
|
+ CurrencyName = PaymentCurrency_WaitPay,
|
|
|
+ AmountPayable = entity.PayMoney,
|
|
|
+ ThisPayment = CurrPayStr,
|
|
|
+ BalancePayment = BalanceStr,
|
|
|
+ AuditedFunds = CurrPayStr
|
|
|
+ });
|
|
|
+
|
|
|
+ _detail.IsAuditGM = entity.IsAuditGM;
|
|
|
+
|
|
|
+ detailList.Add(_detail);
|
|
|
}
|
|
|
- _detail.AuditOperatorName = auditOperatorName;
|
|
|
|
|
|
- /*
|
|
|
- *
|
|
|
- * *超预算比例
|
|
|
- */
|
|
|
- string overBudgetStr = "";
|
|
|
+ #endregion
|
|
|
|
|
|
- if (entity.ExceedBudget == -1)
|
|
|
- overBudgetStr = sdPriceName.Name + "尚无预算";
|
|
|
- else if (entity.ExceedBudget == 0)
|
|
|
- overBudgetStr = "未超预算";
|
|
|
- else
|
|
|
- overBudgetStr = entity.ExceedBudget.ToString("P");
|
|
|
- _detail.OverBudget = overBudgetStr;
|
|
|
+ _view.DetailList = new List<Grp_CreditCardPaymentDetailView>(detailList);
|
|
|
|
|
|
|
|
|
/*
|
|
|
- * 费用总计
|
|
|
+ * 下方描述处理
|
|
|
*/
|
|
|
|
|
|
+ List<CreditCardPaymentCurrencyPriceItem> nonDuplicat = ccpCurrencyPrices.Where((x, i) => ccpCurrencyPrices.FindIndex(z => z.CurrencyId == x.CurrencyId) == i).ToList();//Lambda表达式去重
|
|
|
|
|
|
- if (entity.PaymentCurrency == 48)
|
|
|
+ CreditCardPaymentCurrencyPriceItem ccpCurrencyPrice = nonDuplicat.Where(it => it.CurrencyId == 836).FirstOrDefault();
|
|
|
+ if (ccpCurrencyPrice != null)
|
|
|
{
|
|
|
- CNY += entity.PayMoney;
|
|
|
- PayCNY += CurrPayStr;
|
|
|
- BalanceCNY += BalanceStr;
|
|
|
- YSFYCNY += CurrPayStr;
|
|
|
+ int CNYIndex = nonDuplicat.IndexOf(ccpCurrencyPrice);
|
|
|
+ nonDuplicat.MoveItemAtIndexToFront(CNYIndex);
|
|
|
+
|
|
|
}
|
|
|
- if (entity.PaymentCurrency == 49)
|
|
|
+ else
|
|
|
{
|
|
|
- USD += entity.PayMoney;
|
|
|
- PayUSD += CurrPayStr;
|
|
|
- BalanceUSD += BalanceStr;
|
|
|
- YSFYUSD += CurrPayStr;
|
|
|
+ nonDuplicat.OrderBy(it => it.CurrencyId).ToList();
|
|
|
}
|
|
|
- if (entity.PaymentCurrency == 51)
|
|
|
+ string amountPayableStr = string.Format(@"应付款总金额: ");
|
|
|
+ string thisPaymentStr = string.Format(@"此次付款总金额: ");
|
|
|
+ string balancePaymentStr = string.Format(@"目前剩余尾款总金额: ");
|
|
|
+ string auditedFundsStr = string.Format(@"已审费用总额: ");
|
|
|
+
|
|
|
+ foreach (var item in nonDuplicat)
|
|
|
{
|
|
|
- EUR += entity.PayMoney;
|
|
|
- PayEUR += CurrPayStr;
|
|
|
- BalanceEUR += BalanceStr;
|
|
|
- YSFYEUR += CurrPayStr;
|
|
|
- }
|
|
|
+ var strs = ccpCurrencyPrices.Where(it => it.CurrencyId == item.CurrencyId).ToList();
|
|
|
+ if (strs.Count > 0)
|
|
|
+ {
|
|
|
+ decimal amountPayable = strs.Sum(it => it.AmountPayable);
|
|
|
+
|
|
|
+ decimal balancePayment = strs.Sum(it => it.BalancePayment);
|
|
|
+ amountPayableStr += string.Format(@"{0}{1} |", amountPayable.ToString("#0.00"), item.CurrencyName);
|
|
|
|
|
|
- _detail.IsAuditGM = entity.IsAuditGM;
|
|
|
+ //单独处理此次付款金额
|
|
|
+ if (item.CurrencyId == 836) //人名币
|
|
|
+ {
|
|
|
+ decimal thisPayment = ccpCurrencyPrices.Sum(it => it.ThisPayment);
|
|
|
+ thisPaymentStr += string.Format(@"{0}{1} |", thisPayment.ToString("#0.00"), item.CurrencyName);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ thisPaymentStr += string.Format(@"{0}{1} |","0.00", item.CurrencyName);
|
|
|
+ }
|
|
|
|
|
|
- detailList.Add(_detail);
|
|
|
+ balancePaymentStr += string.Format(@"{0}{1} |", balancePayment.ToString("#0.00"), item.CurrencyName);
|
|
|
|
|
|
- }
|
|
|
+ //单独处理已审核费用
|
|
|
+ if (item.CurrencyId == 836) //人名币
|
|
|
+ {
|
|
|
|
|
|
- #endregion
|
|
|
+ decimal auditedFunds = ccpCurrencyPrices.Sum(it => it.AuditedFunds);
|
|
|
+ auditedFundsStr += string.Format(@"{0}{1} |", auditedFunds.ToString("#0.00"), item.CurrencyName);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ auditedFundsStr += string.Format(@"{0}{1} |", "0.00", item.CurrencyName);
|
|
|
+ }
|
|
|
|
|
|
- _view.DetailList = new List<Grp_CreditCardPaymentDetailView>(detailList);
|
|
|
- _view.TotalStr1 = string.Format(@"应付款总金额:{0}CNY | {1}USD | {2}EUR", CNY, USD, EUR);
|
|
|
- _view.TotalStr2 = string.Format(@"此次付款总金额:{0}CNY | {1}USD | {2}EUR", PayCNY, PayUSD, PayEUR);
|
|
|
- _view.TotalStr3 = string.Format(@"目前剩余尾款总金额:{0}CNY | {1}USD | {2}EUR", BalanceCNY, BalanceUSD, BalanceEUR);
|
|
|
- _view.TotalStr4 = string.Format(@"已审费用总额:{0}CNY | {1}USD | {2}EUR", YSFYCNY, YSFYUSD, YSFYEUR);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ _view.TotalStr1 = amountPayableStr.Substring(0, amountPayableStr.Length - 1);
|
|
|
+ _view.TotalStr2 = thisPaymentStr.Substring(0, thisPaymentStr.Length - 1);
|
|
|
+ _view.TotalStr3 = balancePaymentStr.Substring(0, balancePaymentStr.Length - 1);
|
|
|
+ _view.TotalStr4 = auditedFundsStr.Substring(0, auditedFundsStr.Length - 1);
|
|
|
+
|
|
|
+
|
|
|
+ var _view1 = new
|
|
|
+ {
|
|
|
+ PageFuncAuth = pageFunAuthView,
|
|
|
+ Data = _view
|
|
|
+ };
|
|
|
|
|
|
- var _view1 = new
|
|
|
+ return Ok(JsonView(_view1));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- PageFuncAuth = pageFunAuthView,
|
|
|
- Data = _view
|
|
|
- };
|
|
|
|
|
|
- return Ok(JsonView(_view1));
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 费用审核
|
|
|
+ /// 费用审核
|
|
|
/// 修改团组费用审核状态
|
|
|
/// </summary>
|
|
|
/// <param name="_dto">参数Json字符串</param>
|
|
@@ -1153,7 +1404,6 @@ namespace OASystem.API.Controllers
|
|
|
if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
#region 页面操作权限验证
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
@@ -1180,20 +1430,20 @@ namespace OASystem.API.Controllers
|
|
|
if (result < 1)
|
|
|
{
|
|
|
rst = -1;
|
|
|
+ _groupRepository.RollbackTran();
|
|
|
+ return Ok(JsonView(false, "操作失败并回滚!"));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _groupRepository.RollbackTran();
|
|
|
- return Ok(JsonView(false, "保存失败并回滚!"));
|
|
|
}
|
|
|
}
|
|
|
_groupRepository.CommitTran();
|
|
|
if (rst == 0)
|
|
|
{
|
|
|
- return Ok(JsonView(true, "保存成功!"));
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
}
|
|
|
|
|
|
- return Ok(JsonView(false, "保存失败!"));
|
|
|
+ return Ok(JsonView(false, "操作失败!"));
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -3469,10 +3719,10 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
_sqlSugar.BeginTran();
|
|
|
isTrue = await _GroupCostRepository.
|
|
|
- SaveGroupCostList(Grp_groups,dto.Diid); //列表
|
|
|
- isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs,dto.Diid); //选中项
|
|
|
- isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber,dto.Userid,dto.Diid); //酒店房间数量
|
|
|
- isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters , dto.Userid ,dto.Diid); //系数
|
|
|
+ SaveGroupCostList(Grp_groups, dto.Diid); //列表
|
|
|
+ isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs, dto.Diid); //选中项
|
|
|
+ isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber, dto.Userid, dto.Diid); //酒店房间数量
|
|
|
+ isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters, dto.Userid, dto.Diid); //系数
|
|
|
|
|
|
_sqlSugar.CommitTran();
|
|
|
jw = JsonView(true, "保存成功!", isTrue);
|
|
@@ -3766,8 +4016,8 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -3794,12 +4044,12 @@ namespace OASystem.API.Controllers
|
|
|
if (!string.IsNullOrEmpty(h.DetermineNo))
|
|
|
{
|
|
|
string strFileName = "HotelStatement/";
|
|
|
- Grp_DelegationInfo dele= _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == h.DiId && a.IsDel == 0);
|
|
|
+ Grp_DelegationInfo dele = _sqlSugar.Queryable<Grp_DelegationInfo>().First(a => a.Id == h.DiId && a.IsDel == 0);
|
|
|
if (dele != null)
|
|
|
strFileName += dele.TourCode;
|
|
|
|
|
|
-
|
|
|
- //载入模板
|
|
|
+
|
|
|
+ //载入模板
|
|
|
string sss = AppSettingsHelper.Get("WordBasePath") + "Template/酒店预订模板.doc";
|
|
|
|
|
|
Document doc = new Document(sss);
|
|
@@ -3810,7 +4060,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
//这里可以创建个DataTable循环添加书签的值,这里提示一下就不多做修改了
|
|
|
//入住卷预定号码
|
|
|
-
|
|
|
+
|
|
|
if (doc.Range.Bookmarks["VNO"] != null)
|
|
|
{
|
|
|
Bookmark mark = doc.Range.Bookmarks["VNO"];
|
|
@@ -3873,7 +4123,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
mark.Text = h.HotelFax;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
//入住时间
|
|
|
if (doc.Range.Bookmarks["CIn"] != null)
|
|
@@ -3907,7 +4157,7 @@ namespace OASystem.API.Controllers
|
|
|
if (doc.Range.Bookmarks["NOTE"] != null)
|
|
|
{
|
|
|
Bookmark mark = doc.Range.Bookmarks["NOTE"];
|
|
|
- Sys_SetData ss = _sqlSugar.Queryable<Sys_SetData>().First(a=>a.Id==h.ReservationsWebsite);
|
|
|
+ Sys_SetData ss = _sqlSugar.Queryable<Sys_SetData>().First(a => a.Id == h.ReservationsWebsite);
|
|
|
if (ss != null)
|
|
|
mark.Text = ss.Name;
|
|
|
}
|
|
@@ -3949,20 +4199,20 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
strFileName += "VOUCHER.doc";
|
|
|
|
|
|
- var fileDir = AppSettingsHelper.Get("WordBasePath")+ strFileName;
|
|
|
+ var fileDir = AppSettingsHelper.Get("WordBasePath") + strFileName;
|
|
|
doc.Save(fileDir);
|
|
|
string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + strFileName;
|
|
|
return Ok(JsonView(true, "成功!", Url));
|
|
|
|
|
|
//保存为doc,并打开
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3973,7 +4223,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
return Ok(JsonView(false, "酒店确定号码未填写,无法生成Voucher!"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -4423,8 +4673,8 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "失败!"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|