|
@@ -43,6 +43,7 @@ using NPOI.HPSF;
|
|
|
using System.Data.OleDb;
|
|
|
using Org.BouncyCastle.Crypto;
|
|
|
using OfficeOpenXml;
|
|
|
+using Org.BouncyCastle.Asn1.Crmf;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -2127,6 +2128,7 @@ namespace OASystem.API.Controllers
|
|
|
var countryFeeDatas = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => it.IsDel == 0).ToList();
|
|
|
|
|
|
var hotelDatas = _sqlSugar.Queryable<Grp_HotelReservations>().Where(it => it.IsDel == 0 && groupIds.Contains(it.DiId)).ToList();
|
|
|
+ var hotelContentDatas = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => it.IsDel == 0 && groupIds.Contains(it.DiId)).ToList();
|
|
|
var opDatas = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().Where(it => it.IsDel == 0 && groupIds.Contains(it.DiId)).ToList();
|
|
|
var visaDatas = _sqlSugar.Queryable<Grp_VisaInfo>().Where(it => it.IsDel == 0 && groupIds.Contains(it.DIId)).ToList();
|
|
|
var ioaDatas = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().Where(it => it.IsDel == 0 && groupIds.Contains(it.DiId)).ToList();
|
|
@@ -2246,46 +2248,101 @@ namespace OASystem.API.Controllers
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- //
|
|
|
+
|
|
|
bool status1 = false;
|
|
|
if (_groupIds != null)
|
|
|
{
|
|
|
status1 = _groupIds.Contains(payInfo.Id);
|
|
|
}
|
|
|
|
|
|
- string payeeStr = string.Format(@" {0},开户行:{1},银行卡号:{2} ", string.IsNullOrEmpty(payInfo.Payee) ? "-" : payInfo.Payee,
|
|
|
- string.IsNullOrEmpty(payInfo.OtherBankName) ? "-" : payInfo.OtherBankName,
|
|
|
- string.IsNullOrEmpty(payInfo.OtherSideNo) ? "-" : payInfo.OtherSideNo);
|
|
|
+ if (payInfo.CTable == 76) //酒店单独处理
|
|
|
+ {
|
|
|
+ var hotelContents = hotelContentDatas.Where(it => it.HrId == payInfo.CId);
|
|
|
+ List<Group_DailyFeePaymentContentInfolView> childInfos = new List<Group_DailyFeePaymentContentInfolView>();
|
|
|
+ foreach (var hotelContent in hotelContents)
|
|
|
+ {
|
|
|
+ string subPriceName = "";
|
|
|
+ if (hotelContent.PriceType == 1) subPriceName = "房费";
|
|
|
+ else if (hotelContent.PriceType == 2) subPriceName = "早餐";
|
|
|
+ else if (hotelContent.PriceType == 3) subPriceName = "地税";
|
|
|
+ else if (hotelContent.PriceType == 4) subPriceName = "城市税";
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(subPriceName)) subPriceName = priName;
|
|
|
+ else subPriceName = $"{priName.Replace("]","")}-{subPriceName}]";
|
|
|
|
|
|
- decimal _PaymentAmount = (payInfo.PayMoney / 100) * payInfo.PayPercentage;//此次付款金额
|
|
|
- decimal _CNYSubTotalAmount = _PaymentAmount * payInfo.DayRate;//此次付款金额
|
|
|
- _CNYSubTotalAmount = Convert.ToDecimal(_CNYSubTotalAmount.ToString("#0.00"));
|
|
|
- var childInfo = new Group_DailyFeePaymentContentInfolView()
|
|
|
- {
|
|
|
- IsChecked = status1,
|
|
|
- Id = payInfo.Id,
|
|
|
- Payee = payeeStr,
|
|
|
- RowNumber = rouNumber,
|
|
|
- Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
|
|
|
- ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
- PayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "",
|
|
|
- TransferMark = orbitalPrivateTransfer,
|
|
|
- PriceName = priName,
|
|
|
- ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
|
|
|
- PayCurrCode = setDatas.Find(it => it.Id == payInfo.PaymentCurrency)?.Name ?? "",
|
|
|
- PaymentAmount = _PaymentAmount,
|
|
|
- PayRate = payInfo.DayRate,
|
|
|
- CNYSubTotalAmount = _CNYSubTotalAmount
|
|
|
- };
|
|
|
+ string payeeStr1 = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
|
|
|
+ string.IsNullOrEmpty(hotelContent.Payee) ? "-" : hotelContent.Payee,
|
|
|
+ string.IsNullOrEmpty(hotelContent.OtherBankName) ? "-" : hotelContent.OtherBankName,
|
|
|
+ string.IsNullOrEmpty(hotelContent.OtherSideNo) ? "-" : hotelContent.OtherSideNo);
|
|
|
+
|
|
|
+ decimal _PaymentAmount1 = hotelContent.Price;//此次付款金额
|
|
|
+ decimal _CNYSubTotalAmount1 = _PaymentAmount1 * hotelContent.Rate;//此次付款金额
|
|
|
+ _CNYSubTotalAmount1 = Convert.ToDecimal(_CNYSubTotalAmount1.ToString("#0.00"));
|
|
|
|
|
|
- //string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}】{rouNumber}、[申请人:{childInfo.Applicant}][收款方:{childInfo.Payee}]{priName},{payInfo.OtherBankName},{payInfo.OtherSideNo}[{payInfo.ConsumptionPatterns}] {childInfo.PayCurrCode} {payInfo.PayMoney.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
|
|
|
+ var childInfo1 = new Group_DailyFeePaymentContentInfolView()
|
|
|
+ {
|
|
|
+ IsChecked = status1,
|
|
|
+ Id = payInfo.Id,
|
|
|
+ HotelSubId = hotelContent.Id,
|
|
|
+ Payee = payeeStr1,
|
|
|
+ RowNumber = rouNumber,
|
|
|
+ Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
|
|
|
+ ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ PayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "",
|
|
|
+ TransferMark = orbitalPrivateTransfer,
|
|
|
+ PriceName = subPriceName,
|
|
|
+ ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
|
|
|
+ PayCurrCode = setDatas.Find(it => it.Id == hotelContent.Currency)?.Name ?? "",
|
|
|
+ PaymentAmount = _PaymentAmount1,
|
|
|
+ PayRate = hotelContent.Rate,
|
|
|
+ CNYSubTotalAmount = _CNYSubTotalAmount1
|
|
|
+ };
|
|
|
+ string remaksDescription1 = $"【{childInfo1.PayType}】【{childInfo1.ModuleName}】{rouNumber}、[申请人:{childInfo1.Applicant}]{subPriceName}[收款方:{childInfo1.Payee}] {childInfo1.PayCurrCode} {_PaymentAmount1.ToString("#0.00")}、CNY:{childInfo1.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
|
|
|
+
|
|
|
+ childInfo1.RemaksDescription = remaksDescription1;
|
|
|
+ childInfos.Add(childInfo1);
|
|
|
+ rouNumber++;
|
|
|
+ }
|
|
|
|
|
|
- string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}】{rouNumber}、[申请人:{childInfo.Applicant}]{priName}[收款方:{childInfo.Payee}] {childInfo.PayCurrCode} {_PaymentAmount.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
|
|
|
+ childList.AddRange(childInfos);
|
|
|
|
|
|
- childInfo.RemaksDescription = remaksDescription;
|
|
|
- childList.Add(childInfo);
|
|
|
- rouNumber++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string payeeStr = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
|
|
|
+ string.IsNullOrEmpty(payInfo.Payee) ? "-" : payInfo.Payee,
|
|
|
+ string.IsNullOrEmpty(payInfo.OtherBankName) ? "-" : payInfo.OtherBankName,
|
|
|
+ string.IsNullOrEmpty(payInfo.OtherSideNo) ? "-" : payInfo.OtherSideNo);
|
|
|
+
|
|
|
+
|
|
|
+ decimal _PaymentAmount = (payInfo.PayMoney / 100) * payInfo.PayPercentage;//此次付款金额
|
|
|
+ decimal _CNYSubTotalAmount = _PaymentAmount * payInfo.DayRate;//此次付款金额
|
|
|
+ _CNYSubTotalAmount = Convert.ToDecimal(_CNYSubTotalAmount.ToString("#0.00"));
|
|
|
+ var childInfo = new Group_DailyFeePaymentContentInfolView()
|
|
|
+ {
|
|
|
+ IsChecked = status1,
|
|
|
+ Id = payInfo.Id,
|
|
|
+ Payee = payeeStr,
|
|
|
+ RowNumber = rouNumber,
|
|
|
+ Applicant = userDatas.Find(it => it.Id == payInfo.CreateUserId)?.CnName ?? "",
|
|
|
+ ApplicantDt = payInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ PayType = setDatas.Find(it => it.Id == payInfo.PayDId)?.Name ?? "",
|
|
|
+ TransferMark = orbitalPrivateTransfer,
|
|
|
+ PriceName = priName,
|
|
|
+ ModuleName = setDatas.Find(it => it.Id == payInfo.CTable)?.Name ?? "",
|
|
|
+ PayCurrCode = setDatas.Find(it => it.Id == payInfo.PaymentCurrency)?.Name ?? "",
|
|
|
+ PaymentAmount = _PaymentAmount,
|
|
|
+ PayRate = payInfo.DayRate,
|
|
|
+ CNYSubTotalAmount = _CNYSubTotalAmount
|
|
|
+ };
|
|
|
+
|
|
|
+ string remaksDescription = $"【{childInfo.PayType}】【{childInfo.ModuleName}】{rouNumber}、[申请人:{childInfo.Applicant}]{priName}[收款方:{childInfo.Payee}] {childInfo.PayCurrCode} {_PaymentAmount.ToString("#0.00")}、CNY:{childInfo.CNYSubTotalAmount.ToString("#0.00")}(团组:{groupInfo.TeamName})";
|
|
|
+
|
|
|
+ childInfo.RemaksDescription = remaksDescription;
|
|
|
+ childList.Add(childInfo);
|
|
|
+ rouNumber++;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
CompanyInfo companyInfo = new CompanyInfo();
|
|
@@ -2432,64 +2489,57 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- try
|
|
|
- {
|
|
|
- PaymentRequestCheckedView requestCheckedView = new PaymentRequestCheckedView();
|
|
|
- List<int> groupIds = new List<int>();
|
|
|
- List<int> dailyPaymentIds = new List<int>();
|
|
|
+ PaymentRequestCheckedView requestCheckedView = new PaymentRequestCheckedView();
|
|
|
+ List<int> groupIds = new List<int>();
|
|
|
+ List<int> dailyPaymentIds = new List<int>();
|
|
|
|
|
|
- #region 参数处理
|
|
|
- if (!string.IsNullOrEmpty(dto.GroupIds))
|
|
|
+ #region 参数处理
|
|
|
+ if (!string.IsNullOrEmpty(dto.GroupIds))
|
|
|
+ {
|
|
|
+ if (dto.GroupIds.Contains(","))
|
|
|
{
|
|
|
- if (dto.GroupIds.Contains(","))
|
|
|
- {
|
|
|
- groupIds = dto.GroupIds.Split(',').Select(int.Parse).ToList();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- groupIds.Add(int.Parse(dto.GroupIds));
|
|
|
- }
|
|
|
+ groupIds = dto.GroupIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ groupIds.Add(int.Parse(dto.GroupIds));
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
+ if (!string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
+ {
|
|
|
+ if (dto.DailyPaymentIds.Contains(","))
|
|
|
{
|
|
|
- if (dto.DailyPaymentIds.Contains(","))
|
|
|
- {
|
|
|
- dailyPaymentIds = dto.DailyPaymentIds.Split(',').Select(int.Parse).ToList();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dailyPaymentIds.Add(int.Parse(dto.DailyPaymentIds));
|
|
|
- }
|
|
|
+ dailyPaymentIds = dto.DailyPaymentIds.Split(',').Select(int.Parse).ToList();
|
|
|
}
|
|
|
- #endregion
|
|
|
- requestCheckedView.GroupIds = groupIds;
|
|
|
- requestCheckedView.DailyPaymentIds = dailyPaymentIds;
|
|
|
- if (dto.Type == 1)
|
|
|
+ else
|
|
|
{
|
|
|
- TimeSpan ts = DateTime.Now.AddDays(180) - DateTime.Now; //设置redis 过期时间 半年(180)
|
|
|
- var status = await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync<string>("paymentRequestCheckedData", JsonConvert.SerializeObject(requestCheckedView), ts);
|
|
|
- if (status)
|
|
|
- {
|
|
|
- return Ok(JsonView(true, "操作成功!"));
|
|
|
- }
|
|
|
+ dailyPaymentIds.Add(int.Parse(dto.DailyPaymentIds));
|
|
|
}
|
|
|
- else if (dto.Type == 2)
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ requestCheckedView.GroupIds = groupIds;
|
|
|
+ requestCheckedView.DailyPaymentIds = dailyPaymentIds;
|
|
|
+ if (dto.Type == 1)
|
|
|
+ {
|
|
|
+ TimeSpan ts = DateTime.Now.AddDays(180) - DateTime.Now; //设置redis 过期时间 半年(180)
|
|
|
+ var status = await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync<string>("paymentRequestCheckedData", JsonConvert.SerializeObject(requestCheckedView), ts);
|
|
|
+ if (status)
|
|
|
{
|
|
|
- var status = await RedisRepository.RedisFactory.CreateRedisRepository().KeyDeleteAsync("paymentRequestCheckedData");
|
|
|
- if (status)
|
|
|
- {
|
|
|
- return Ok(JsonView(true, "操作成功!"));
|
|
|
- }
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
}
|
|
|
- return Ok(JsonView(false, "操作失败!"));
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ else if (dto.Type == 2)
|
|
|
{
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
+ var status = await RedisRepository.RedisFactory.CreateRedisRepository().KeyDeleteAsync("paymentRequestCheckedData");
|
|
|
+ if (status)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ return Ok(JsonView(false, "操作失败!"));
|
|
|
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 付款申请 (PageId=51)
|
|
@@ -2513,51 +2563,83 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, "结束日期格式不正确!正确格式:yyyy-MM-dd"));
|
|
|
}
|
|
|
|
|
|
- if (dto.UserId < 1)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
- }
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
+ if (dto.Id < 1) return Ok(JsonView(false, "请传入有效的Id参数!"));
|
|
|
+ if (dto.Rate <= 0) return Ok(JsonView(false, "请传入有效的Rate参数!"));
|
|
|
+ #endregion
|
|
|
|
|
|
- if (dto.Id < 1)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请传入有效的Id参数!"));
|
|
|
- }
|
|
|
+ int hotelSubStatus = 0,status = 0;
|
|
|
+ int diid = 0, cTable = 0, currId = 0;
|
|
|
|
|
|
- if (dto.Rate <= 0)
|
|
|
+ if (dto.HotelSubId > 0)
|
|
|
{
|
|
|
- return Ok(JsonView(false, "请传入有效的Rate参数!"));
|
|
|
+ //更改酒店子表汇率
|
|
|
+ hotelSubStatus = _sqlSugar.Updateable<Grp_HotelReservationsContent>()
|
|
|
+ .SetColumns(it => it.Rate == dto.Rate)
|
|
|
+ .Where(it => it.Id == dto.HotelSubId)
|
|
|
+ .ExecuteCommand();
|
|
|
+
|
|
|
+ if (hotelSubStatus > 0)
|
|
|
+ {
|
|
|
+ var hotelSubInfo = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => it.Id == dto.HotelSubId).First();
|
|
|
+ if (hotelSubInfo != null)
|
|
|
+ {
|
|
|
+ diid = hotelSubInfo.DiId;
|
|
|
+ currId = hotelSubInfo.Currency;
|
|
|
+ }
|
|
|
+
|
|
|
+ //付款申请汇率更改成功;更改团组汇率对应币种
|
|
|
+ string currCode = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.Id == currId).First()?.Name ?? "";
|
|
|
+ await _teamRateRep.UpdateGroupRateByDiIdAndCTableId(diid, 76, currCode, dto.Rate);
|
|
|
+ }
|
|
|
}
|
|
|
- #endregion
|
|
|
- try
|
|
|
+
|
|
|
+ if (dto.Id > 0)
|
|
|
{
|
|
|
- var status = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
- .SetColumns(it => it.DayRate == dto.Rate)
|
|
|
- .Where(it => it.Id == dto.Id)
|
|
|
- .ExecuteCommand();
|
|
|
+ var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(it => it.Id == dto.Id).First();
|
|
|
+ decimal cnyMoney = 0.00M;
|
|
|
+ if (ccpInfo != null) {
|
|
|
+ cnyMoney = ccpInfo.PayMoney * dto.Rate;
|
|
|
+ diid = ccpInfo.DIId;
|
|
|
+ cTable = ccpInfo.CTable;
|
|
|
+ currId = ccpInfo.PaymentCurrency;
|
|
|
+ }
|
|
|
+
|
|
|
+ status = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ .SetColumns(it => it.DayRate == dto.Rate)
|
|
|
+ .SetColumns(it => it.RMBPrice == cnyMoney)
|
|
|
+ .Where(it => it.Id == dto.Id)
|
|
|
+ .ExecuteCommand();
|
|
|
if (status > 0)
|
|
|
{
|
|
|
- PaymentRequestCheckedView checkedView = new PaymentRequestCheckedView();
|
|
|
- var checkedStr = await RedisRepository.RedisFactory.CreateRedisRepository().StringGetAsync<string>("paymentRequestCheckedData");
|
|
|
- if (checkedStr != null)
|
|
|
+ //付款申请汇率更改成功;更改团组汇率对应币种
|
|
|
+ if (cTable != 76)
|
|
|
{
|
|
|
- checkedView = JsonConvert.DeserializeObject<PaymentRequestCheckedView>(checkedStr.ToString());
|
|
|
+ string currCode = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.Id == currId).First()?.Name ?? "";
|
|
|
+ await _teamRateRep.UpdateGroupRateByDiIdAndCTableId(diid, cTable, currCode, dto.Rate);
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- tree_Fin_DailyFeePaymentResult dailyResult = PayRequest_DailyByDateRange(1, checkedView.DailyPaymentIds, dto.beginDt, dto.endDt);
|
|
|
- tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(1, checkedView.GroupIds, dto.beginDt, dto.endDt);
|
|
|
+ if (hotelSubStatus > 0 || status > 0)
|
|
|
+ {
|
|
|
+ PaymentRequestCheckedView checkedView = new PaymentRequestCheckedView();
|
|
|
+ var checkedStr = await RedisRepository.RedisFactory.CreateRedisRepository().StringGetAsync<string>("paymentRequestCheckedData");
|
|
|
+ if (checkedStr != null)
|
|
|
+ {
|
|
|
+ checkedView = JsonConvert.DeserializeObject<PaymentRequestCheckedView>(checkedStr.ToString());
|
|
|
+ }
|
|
|
|
|
|
- decimal _gz = dailyResult.gz + groupResult.gz;
|
|
|
- decimal _sz = dailyResult.sz + groupResult.sz;
|
|
|
+ tree_Fin_DailyFeePaymentResult dailyResult = PayRequest_DailyByDateRange(1, checkedView.DailyPaymentIds, dto.beginDt, dto.endDt);
|
|
|
+ tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(1, checkedView.GroupIds, dto.beginDt, dto.endDt);
|
|
|
|
|
|
- return Ok(JsonView(true, "操作成功!", new { gz = dailyResult, sz = groupResult }));
|
|
|
- }
|
|
|
+ decimal _gz = dailyResult.gz + groupResult.gz;
|
|
|
+ decimal _sz = dailyResult.sz + groupResult.sz;
|
|
|
|
|
|
- return Ok(JsonView(false, "该项汇率修改失败!"));
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
+ return Ok(JsonView(true, "操作成功!", new { gz = dailyResult, sz = groupResult }));
|
|
|
}
|
|
|
+
|
|
|
+ return Ok(JsonView(false, "该项汇率修改失败!"));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2570,10 +2652,7 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostPayRequestPayChange(PayRequestPayChangeDto dto)
|
|
|
{
|
|
|
- if (dto.UserId < 1)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
- }
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
|
|
|
//if (string.IsNullOrEmpty(dto.GroupIds))
|
|
|
//{
|
|
@@ -2585,34 +2664,37 @@ namespace OASystem.API.Controllers
|
|
|
// return Ok(JsonView(false, "请传入有效的DailyPaymentIds参数!"));
|
|
|
//}
|
|
|
|
|
|
- try
|
|
|
- {
|
|
|
+
|
|
|
List<int> groupIds = new List<int>();
|
|
|
List<int> dailyPaymentIds = new List<int>();
|
|
|
|
|
|
#region 参数处理
|
|
|
if (!string.IsNullOrEmpty(dto.GroupIds))
|
|
|
{
|
|
|
- if (dto.GroupIds.Contains(","))
|
|
|
- {
|
|
|
- groupIds = dto.GroupIds.Split(',').Select(int.Parse).ToList();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- groupIds.Add(int.Parse(dto.GroupIds));
|
|
|
- }
|
|
|
+ if (dto.GroupIds.Contains(",")) groupIds = dto.GroupIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ else groupIds.Add(int.Parse(dto.GroupIds));
|
|
|
}
|
|
|
|
|
|
+ //if (!string.IsNullOrEmpty(dto.HotelSubIds))
|
|
|
+ //{
|
|
|
+ // if (dto.HotelSubIds.Contains(",")) hotelSubIds = dto.HotelSubIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ // else hotelSubIds.Add(int.Parse(dto.HotelSubIds));
|
|
|
+ // if (hotelSubIds.Count > 0)
|
|
|
+ // {
|
|
|
+ // foreach (var item in hotelSubIds)
|
|
|
+ // {
|
|
|
+ // if (item < 1)
|
|
|
+ // {
|
|
|
+ // hotelSubIds.Remove(item);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
{
|
|
|
- if (dto.DailyPaymentIds.Contains(","))
|
|
|
- {
|
|
|
- dailyPaymentIds = dto.DailyPaymentIds.Split(',').Select(int.Parse).ToList();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dailyPaymentIds.Add(int.Parse(dto.DailyPaymentIds));
|
|
|
- }
|
|
|
+ if (dto.DailyPaymentIds.Contains(",")) dailyPaymentIds = dto.DailyPaymentIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ else dailyPaymentIds.Add(int.Parse(dto.DailyPaymentIds));
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -2628,9 +2710,36 @@ namespace OASystem.API.Controllers
|
|
|
if (groupStatus > 0)
|
|
|
{
|
|
|
changeStatus = true;
|
|
|
+
|
|
|
+
|
|
|
+ //更改酒店子表支付状态
|
|
|
+ var ccps = _sqlSugar.Queryable<Grp_CreditCardPayment>()
|
|
|
+ .Where(it => groupIds.Contains(it.Id) && it.CTable == 76)
|
|
|
+ .ToList();
|
|
|
+ List<int> hrIds = ccps.Select(it => it.CId).ToList();
|
|
|
+ if (hrIds.Count > 0)
|
|
|
+ {
|
|
|
+ var hrIspayStatus = _sqlSugar.Updateable<Grp_HotelReservationsContent>()
|
|
|
+ .SetColumns(it => it.IsPay == 1)
|
|
|
+ .Where(it => hrIds.Contains(it.Id))
|
|
|
+ .ExecuteCommand();
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //if (hotelSubIds.Count > 0)
|
|
|
+ //{
|
|
|
+ // var groupStatus = _sqlSugar.Updateable<Grp_HotelReservationsContent>()
|
|
|
+ // .SetColumns(it => it.IsPay == 1)
|
|
|
+ // .Where(it => hotelSubIds.Contains(it.Id))
|
|
|
+ // .ExecuteCommand();
|
|
|
+ // if (groupStatus > 0)
|
|
|
+ // {
|
|
|
+ // changeStatus = true;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
if (dailyPaymentIds.Count > 0)
|
|
|
{
|
|
|
var dailyPaymentStatus = _sqlSugar.Updateable<Fin_DailyFeePayment>()
|
|
@@ -2671,12 +2780,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
_sqlSugar.RollbackTran();
|
|
|
return Ok(JsonView(false, "付款状态修改失败!"));
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -3013,7 +3117,6 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
return new Result() { Code = -1, Msg = "暂无团组汇率,请前往设置!", Data = CurrencyRate };
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|