|
@@ -511,7 +511,7 @@ namespace OASystem.API.Controllers
|
|
|
ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ctggr.CreateTime
|
|
|
From Grp_CarTouristGuideGroundReservations ctggr
|
|
|
Left Join ( Select cggrc.CTGGRId,sd1.Name As PriceName,cggrc.Price,sd2.Name As PriceCurrency,
|
|
|
- cggrc.PriceContent
|
|
|
+ cggrc.DatePrice,cggrc.PriceContent
|
|
|
From Grp_CarTouristGuideGroundReservationsContent cggrc
|
|
|
Left Join Sys_SetData sd1 On cggrc.SId = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On cggrc.Currency = sd2.Id
|
|
@@ -582,6 +582,11 @@ namespace OASystem.API.Controllers
|
|
|
item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
}
|
|
|
|
|
|
+ if (item.DatePrice != null)
|
|
|
+ {
|
|
|
+ item.PriceName = $"{item.PriceName}({Convert.ToDateTime(item.DatePrice).ToString("yyyy-MM-dd")})";
|
|
|
+ }
|
|
|
+
|
|
|
//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;
|
|
@@ -2993,12 +2998,25 @@ Order By Count Desc");
|
|
|
/// </summary>
|
|
|
/// <param name="_dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- [HttpPost("DailypaymentTypeDataSave")]
|
|
|
+ [HttpPost("DailypaymentRange")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> DailypaymentRange(DailypaymentTypeDataSaveDto _dto)
|
|
|
+ public async Task<IActionResult> DailypaymentRange(DailypaymentRangeDto _dto)
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.PortType < 1 || _dto.PortType > 3) return Ok(JsonView(false, msg: MsgTips.Port));
|
|
|
+
|
|
|
+ var validator = new DailypaymentRangeDtoValidator();
|
|
|
+ var validationRes = validator.Validate(_dto);
|
|
|
+
|
|
|
+ if (!validationRes.IsValid)
|
|
|
+ {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ foreach (var item in validationRes.Errors)
|
|
|
+ {
|
|
|
+ sb.AppendLine(item.ErrorMessage);
|
|
|
+ }
|
|
|
+ return Ok(JsonView(false, sb.ToString()));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
#region 页面操作权限验证
|
|
@@ -3010,19 +3028,61 @@ Order By Count Desc");
|
|
|
#endregion
|
|
|
if (_dto.PortType == 1 || _dto.PortType == 2 || _dto.PortType == 3) // web/Android/IOS
|
|
|
{
|
|
|
- if (_dto.TypeIds.Count < 1) return Ok(JsonView(false, "请传入需要保存的TypeIds"));
|
|
|
+ DateTime _beginDt = Convert.ToDateTime($"{_dto.BeginDt} 00:00:00"),
|
|
|
+ _endDt = Convert.ToDateTime($"{_dto.EndDt} 23:59:59");
|
|
|
|
|
|
- var res = await RedisRepository.RedisFactory
|
|
|
- .CreateRedisRepository()
|
|
|
- .StringSetAsync(
|
|
|
- key: "DailypaymentTypeData",
|
|
|
- _dto.TypeIds,
|
|
|
- timeout: null);
|
|
|
-
|
|
|
- if (!res) return Ok(JsonView(false, "操作失败"));
|
|
|
+ string sqlWhere = string.Format(@" And dfp.CreateTime Between '{0}' And '{1}'",_beginDt,_endDt);
|
|
|
|
|
|
+ var dailypaymentTypeData = await RedisRepository.RedisFactory
|
|
|
+ .CreateRedisRepository()
|
|
|
+ .StringGetAsync<List<int>>("DailypaymentTypeData") ?? new List<int>();
|
|
|
+
|
|
|
+ string sql = string.Format(@"
|
|
|
+Select
|
|
|
+ dfp.Id,
|
|
|
+ dfp.Instructions,
|
|
|
+ dfp.PriceTypeId,
|
|
|
+ sd1.Name As FeeType,
|
|
|
+ dfp.TransferTypeId,
|
|
|
+ sd2.Name As TransferType,
|
|
|
+ dfp.SumPrice,
|
|
|
+ dfp.FAuditDate,
|
|
|
+ dfp.MAuditDate,
|
|
|
+ dfp.CompanyId,
|
|
|
+ c.CompanyName,
|
|
|
+ dfp.CreateUserId As ApplicantId,
|
|
|
+ u.CnName As Applicant,
|
|
|
+ dfp.CreateTime As ApplicantDt
|
|
|
+From Fin_DailyFeePayment dfp
|
|
|
+Left Join Sys_Users u On dfp.CreateUserId = u.Id
|
|
|
+Left Join Sys_SetData sd1 On dfp.TransferTypeId = sd1.Id
|
|
|
+Left Join Sys_Company c On dfp.CompanyId = c.Id
|
|
|
+Left Join Sys_SetData sd2 On dfp.PriceTypeId = sd2.Id
|
|
|
+Where dfp.IsDel = 0 And dfp.IsPay = 1
|
|
|
+",sqlWhere);//--Order By dfp.CreateTime Desc
|
|
|
+
|
|
|
+ RefAsync<int> total = 0;
|
|
|
+ var _view = await _sqlSugar.SqlQueryable<DailyFeePaymentRangeView>(sql)
|
|
|
+ //.Includes(x => x.Contents)
|
|
|
+ //.ToListAsync();
|
|
|
+ .Where(x => x.ApplicantDt >= _beginDt && x.ApplicantDt <= _endDt)
|
|
|
+ .WhereIF(dailypaymentTypeData.Count > 0,
|
|
|
+ x => dailypaymentTypeData.Contains(x.PriceTypeId))
|
|
|
+ .OrderByDescending(x => x.ApplicantDt)
|
|
|
+ .ToPageListAsync(
|
|
|
+ pageNumber: _dto.PageIndex,
|
|
|
+ pageSize: _dto.PageSize,
|
|
|
+ totalNumber: total
|
|
|
+ );
|
|
|
+
|
|
|
+ _sqlSugar.ThenMapper(_view, x =>
|
|
|
+ {
|
|
|
+ x.Contents = _sqlSugar.Queryable<DailyFeePaymentContentView>()
|
|
|
+ .SetContext(x1 => x1.DFPId, () => x.Id, x)
|
|
|
+ .ToList();
|
|
|
+ });
|
|
|
|
|
|
- return Ok(JsonView(true, "操作成功!"));
|
|
|
+ return Ok(JsonView(true, "操作成功!", _view, total));
|
|
|
}
|
|
|
else return Ok(JsonView(false, "操作失败"));
|
|
|
}
|