|
@@ -2035,7 +2035,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
tree_Fin_DailyFeePaymentResult dailyResult = PayRequest_DailyByDateRange(dto.Status, checkedView.DailyPaymentIds, dto.beginDt, dto.endDt);
|
|
|
- tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(dto.Status, checkedView.GroupIds, dto.beginDt, dto.endDt);
|
|
|
+ tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(dto.Status, checkedView.GroupIds, checkedView.HotelSubIds, dto.beginDt, dto.endDt);
|
|
|
|
|
|
stopwatch.Stop();
|
|
|
return Ok(JsonView(true, $"查询成功!耗时{stopwatch.ElapsedMilliseconds / 1000}s", new { daily = dailyResult, group = groupResult }));
|
|
@@ -2093,7 +2093,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <param name="beginDt"></param>
|
|
|
/// <param name="endDt"></param>
|
|
|
/// <returns></returns>
|
|
|
- private tree_Group_DailyFeePaymentResult PayRequest_GroupPaymentByDateRange(int status, List<int> _groupIds, string beginDt, string endDt)
|
|
|
+ private tree_Group_DailyFeePaymentResult PayRequest_GroupPaymentByDateRange(int status, List<int> _groupIds,List<int> _hotelSubIds, string beginDt, string endDt)
|
|
|
{
|
|
|
tree_Group_DailyFeePaymentResult _DailyFeePaymentResult = new tree_Group_DailyFeePaymentResult();
|
|
|
List<tree_Group_DailyFeePaymentPageListView> dataList = new List<tree_Group_DailyFeePaymentPageListView>();
|
|
@@ -2257,6 +2257,8 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
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)
|
|
@@ -2279,6 +2281,9 @@ namespace OASystem.API.Controllers
|
|
|
decimal _CNYSubTotalAmount1 = _PaymentAmount1 * hotelContent.Rate;//此次付款金额
|
|
|
_CNYSubTotalAmount1 = Convert.ToDecimal(_CNYSubTotalAmount1.ToString("#0.00"));
|
|
|
|
|
|
+ //酒店子项Id选中状态更改
|
|
|
+ if (_hotelSubIds != null) status1 = _hotelSubIds.Contains(hotelContent.Id);
|
|
|
+
|
|
|
var childInfo1 = new Group_DailyFeePaymentContentInfolView()
|
|
|
{
|
|
|
IsChecked = status1,
|
|
@@ -2492,6 +2497,7 @@ namespace OASystem.API.Controllers
|
|
|
PaymentRequestCheckedView requestCheckedView = new PaymentRequestCheckedView();
|
|
|
List<int> groupIds = new List<int>();
|
|
|
List<int> dailyPaymentIds = new List<int>();
|
|
|
+ List<int> hotelIds = new List<int>();
|
|
|
|
|
|
#region 参数处理
|
|
|
if (!string.IsNullOrEmpty(dto.GroupIds))
|
|
@@ -2506,6 +2512,18 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(dto.HotelSubIds))
|
|
|
+ {
|
|
|
+ if (dto.HotelSubIds.Contains(","))
|
|
|
+ {
|
|
|
+ hotelIds = dto.HotelSubIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ hotelIds.Add(int.Parse(dto.HotelSubIds));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
{
|
|
|
if (dto.DailyPaymentIds.Contains(","))
|
|
@@ -2519,6 +2537,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
requestCheckedView.GroupIds = groupIds;
|
|
|
+ requestCheckedView.HotelSubIds = hotelIds;
|
|
|
requestCheckedView.DailyPaymentIds = dailyPaymentIds;
|
|
|
if (dto.Type == 1)
|
|
|
{
|
|
@@ -2631,7 +2650,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
+ tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(1, checkedView.GroupIds, checkedView.HotelSubIds, dto.beginDt, dto.endDt);
|
|
|
|
|
|
decimal _gz = dailyResult.gz + groupResult.gz;
|
|
|
decimal _sz = dailyResult.sz + groupResult.sz;
|
|
@@ -2654,133 +2673,134 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
|
|
|
|
- //if (string.IsNullOrEmpty(dto.GroupIds))
|
|
|
- //{
|
|
|
- // return Ok(JsonView(false, "请传入有效的GroupIds参数!"));
|
|
|
- //}
|
|
|
+ if (string.IsNullOrEmpty(dto.GroupIds))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请传入有效的GroupIds参数!"));
|
|
|
+ }
|
|
|
|
|
|
- //if (string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
- //{
|
|
|
- // return Ok(JsonView(false, "请传入有效的DailyPaymentIds参数!"));
|
|
|
- //}
|
|
|
+ if (string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请传入有效的DailyPaymentIds参数!"));
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- 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 (!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));
|
|
|
- }
|
|
|
- #endregion
|
|
|
+ List<int> groupIds = new List<int>();
|
|
|
+ List<int> dailyPaymentIds = new List<int>();
|
|
|
+ List<int> hotelSubIds = new List<int>();
|
|
|
|
|
|
- bool changeStatus = false;
|
|
|
- _sqlSugar.BeginTran();
|
|
|
+ #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 (groupIds.Count > 0)
|
|
|
+ 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)
|
|
|
{
|
|
|
- var groupStatus = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
- .SetColumns(it => it.IsPay == 1)
|
|
|
- .Where(it => groupIds.Contains(it.Id))
|
|
|
- .ExecuteCommand();
|
|
|
- if (groupStatus > 0)
|
|
|
+ foreach (var item in hotelSubIds)
|
|
|
{
|
|
|
- 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)
|
|
|
+ if (item < 1)
|
|
|
{
|
|
|
- var hrIspayStatus = _sqlSugar.Updateable<Grp_HotelReservationsContent>()
|
|
|
- .SetColumns(it => it.IsPay == 1)
|
|
|
- .Where(it => hrIds.Contains(it.Id))
|
|
|
- .ExecuteCommand();
|
|
|
-
|
|
|
+ hotelSubIds.Remove(item);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //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)
|
|
|
+ if (!string.IsNullOrEmpty(dto.DailyPaymentIds))
|
|
|
+ {
|
|
|
+ if (dto.DailyPaymentIds.Contains(",")) dailyPaymentIds = dto.DailyPaymentIds.Split(',').Select(int.Parse).ToList();
|
|
|
+ else dailyPaymentIds.Add(int.Parse(dto.DailyPaymentIds));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ bool changeStatus = false;
|
|
|
+ _sqlSugar.BeginTran();
|
|
|
+
|
|
|
+ if (groupIds.Count > 0)
|
|
|
+ {
|
|
|
+ var groupStatus = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ .SetColumns(it => it.IsPay == 1)
|
|
|
+ .Where(it => groupIds.Contains(it.Id))
|
|
|
+ .ExecuteCommand();
|
|
|
+ if (groupStatus > 0)
|
|
|
{
|
|
|
- var dailyPaymentStatus = _sqlSugar.Updateable<Fin_DailyFeePayment>()
|
|
|
- .SetColumns(it => it.IsPay == 1)
|
|
|
- .Where(it => dailyPaymentIds.Contains(it.Id))
|
|
|
- .ExecuteCommand();
|
|
|
- if (dailyPaymentStatus > 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)
|
|
|
{
|
|
|
- changeStatus = true;
|
|
|
+ var hrIspayStatus = _sqlSugar.Updateable<Grp_HotelReservationsContent>()
|
|
|
+ .SetColumns(it => it.IsPay == 1)
|
|
|
+ .Where(it => hrIds.Contains(it.Id))
|
|
|
+ .ExecuteCommand();
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if (changeStatus)
|
|
|
+ //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>()
|
|
|
+ .SetColumns(it => it.IsPay == 1)
|
|
|
+ .Where(it => dailyPaymentIds.Contains(it.Id))
|
|
|
+ .ExecuteCommand();
|
|
|
+ if (dailyPaymentStatus > 0)
|
|
|
{
|
|
|
- _sqlSugar.CommitTran();
|
|
|
+ changeStatus = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- #region 应用推送
|
|
|
- try
|
|
|
- {
|
|
|
- foreach (int ccpId in groupIds)
|
|
|
- {
|
|
|
- List<string> tempList = new List<string>() { ccpId.ToString() };
|
|
|
- await AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(ccpId, tempList);
|
|
|
- }
|
|
|
+ if (changeStatus)
|
|
|
+ {
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
|
|
|
- foreach (int dailyId in dailyPaymentIds)
|
|
|
- {
|
|
|
- List<string> tempList = new List<string>() { dailyId.ToString() };
|
|
|
- await AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dailyId, tempList);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
+ #region 应用推送
|
|
|
+ try
|
|
|
+ {
|
|
|
+ foreach (int ccpId in groupIds)
|
|
|
{
|
|
|
+ List<string> tempList = new List<string>() { ccpId.ToString() };
|
|
|
+ await AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(ccpId, tempList);
|
|
|
}
|
|
|
- #endregion
|
|
|
|
|
|
- return Ok(JsonView(true, "操作成功!"));
|
|
|
+ foreach (int dailyId in dailyPaymentIds)
|
|
|
+ {
|
|
|
+ List<string> tempList = new List<string>() { dailyId.ToString() };
|
|
|
+ await AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dailyId, tempList);
|
|
|
+ }
|
|
|
}
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- return Ok(JsonView(false, "付款状态修改失败!"));
|
|
|
-
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "操作成功!"));
|
|
|
+ }
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
+ return Ok(JsonView(false, "付款状态修改失败!"));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2845,7 +2865,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
tree_Fin_DailyFeePaymentResult dailyResult = PayRequest_DailyByDateRange(2, checkedView.DailyPaymentIds, dto.beginDt, dto.endDt);
|
|
|
- tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(2, checkedView.GroupIds, dto.beginDt, dto.endDt);
|
|
|
+ tree_Group_DailyFeePaymentResult groupResult = PayRequest_GroupPaymentByDateRange(2, checkedView.GroupIds, checkedView.HotelSubIds, dto.beginDt, dto.endDt);
|
|
|
|
|
|
if (dailyResult.childList == null)
|
|
|
{
|