From 67c77f970453ff4d62912060daaf99d2dfc5ed81 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 26 三月 2025 10:16:32 +0800
Subject: [PATCH] fix: bug
---
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 12 ++++++++----
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml | 5 +++++
LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 8 ++++----
LifePayment/LifePayment.Application/LifePay/StatisticsService.cs | 8 ++++----
4 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index f944c9a..0659e93 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -377,6 +377,12 @@
[Name("骞冲彴閫�娆剧姸鎬�")]
public string? LifePayRefundStatusStr { get; set; }
+ /// <summary>
+ /// 璁㈠崟鐘舵��
+ /// </summary>
+ [Name("骞冲彴璁㈠崟鐘舵��")]
+ public LifePayOrderStatusEnum LifePayOrderStatus { get; set; }
+
public ACOOLYStatusEnum? ACOOLYStatus { get; set; }
@@ -406,8 +412,8 @@
///// </summary>
//public LifePayOrderStatusEnum LifePayOrderStatus { get; set; }
- //[Name("璁㈠崟鐘舵��")]
- //public string LifePayOrderStatusStr { get; set; }
+ [Name("骞冲彴璁㈠崟鐘舵��")]
+ public string LifePayOrderStatusStr { get; set; }
/// <summary>
/// 瀹屾垚鏃堕棿
@@ -418,8 +424,6 @@
public string FinishTimeStr { get; set; }
-
-
}
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 597e1a6..1160377 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -729,7 +729,7 @@
{
DiscountAmount = x.DiscountAmount,
FinishTime = x.FinishTime,
- //LifePayOrderStatus = x.LifePayOrderStatus,
+ LifePayOrderStatus = x.LifePayOrderStatus,
LifePayOrderType = x.LifePayOrderType,
LifePayType = x.LifePayType,
OrderNo = x.OrderNo,
@@ -762,7 +762,7 @@
s.ActualRechargeAmountStr = s.ActualRechargeAmount.ToString("F2");
s.LifePayRefundStatusStr = s.LifePayRefundStatus == LifePayRefundStatusEnum.鏃犻渶閫�娆� ? "" : s.LifePayRefundStatus.GetDescription();
s.ACOOLYStatusStr = s.ACOOLYStatus.GetDescription();
- //s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription();
+ s.LifePayOrderStatusStr = s.LifePayOrderStatus.GetDescription();
s.FinishTimeStr = !s.FinishTime.HasValue ? string.Empty : s.FinishTime.Value.ToString(LifePaymentConstant.DateTimeFormatStr.yyyyMMddHHmmss);
});
return result;
@@ -1800,10 +1800,10 @@
private (decimal PayAmont, decimal DiscountAmount, decimal RechargeAmount) CalculateAmount(decimal amount, decimal rate)
{
/// 姝e父鏀粯
- var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero);
+ //var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero);
/// 1鍒嗛挶鏀粯
- //decimal payAmount = 0.01m;
+ decimal payAmount = 0.01m;
CheckExtensions.IfTrueThrowUserFriendlyException(payAmount < 0.01m, "鏀粯閲戦閿欒");
diff --git a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
index 02d873c..1bd87b0 100644
--- a/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/StatisticsService.cs
@@ -42,11 +42,11 @@
if (statistics == null)
{
/// 绱鏀舵锛氱粺璁″钩鍙拌处鎴蜂笅璁㈠崟鍒涘缓鏃堕棿鍦ㄦ槰澶╁強涔嬪墠鏀跺埌鐨勩�愮敤鎴锋敮浠樻垚鍔熺殑閲戦-閫�娆剧粰鐢ㄦ埛鐨勯噾棰濄�戯紱
- var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.PayStatus == LifePayStatusEnum.宸叉敮浠�).SumAsync(x => x.PayAmount) - await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayRefundStatus == LifePayRefundStatusEnum.宸查��娆�).SumAsync(x => x.RefundPrice);
+ var accumulatedReceipts = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.PayStatus != LifePayStatusEnum.鏈敮浠�).SumAsync(x => x.PayAmount) - await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayRefundStatus == LifePayRefundStatusEnum.宸查��娆�).SumAsync(x => (x.RefundPrice ?? 0));
/// 鏄ㄦ棩鏀舵锛氱粺璁″钩鍙拌处鎴蜂笅璁㈠崟鍒涘缓鏃堕棿鍦ㄦ槰澶╂敹鍒扮殑銆愮敤鎴锋敮浠樻垚鍔熺殑閲戦-閫�娆剧粰鐢ㄦ埛鐨勯噾棰濄�戯紱
var receiptsYesterday = await _lifePayOrderRepository.Where(x => x.CreationTime >= today.AddDays(-1) && x.CreationTime < today && x.PayStatus == LifePayStatusEnum.宸叉敮浠�).SumAsync(x => x.PayAmount) - await _lifePayOrderRepository.Where(x => x.CreationTime >= today.AddDays(-1) && x.CreationTime < today && x.LifePayRefundStatus == LifePayRefundStatusEnum.宸查��娆�).SumAsync(x => x.PayAmount);
/// 绱鏀跺叆锛氱粺璁″钩鍙拌处鎴蜂笅璁㈠崟鐘舵�佷负鈥滃凡瀹屾垚鈥濅笖璁㈠崟鍒涘缓鏃堕棿鍦ㄦ槰澶╁強涔嬪墠鏀跺埌鐨勩�愮敤鎴峰疄浠橀噾棰�-骞冲彴鎵f閲戦-閮ㄥ垎閫�娆鹃噾棰濄�戯紱
- var accumulatedIncome = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayOrderStatus == LifePayOrderStatusEnum.宸插畬鎴�).SumAsync(x => x.PayAmount - x.PlatformDeductionAmount - x.RefundPrice);
+ var accumulatedIncome = await _lifePayOrderRepository.Where(x => x.CreationTime < today && x.LifePayOrderStatus == LifePayOrderStatusEnum.宸插畬鎴�).SumAsync(x => x.PayAmount - (x.PlatformDeductionAmount ?? 0) - (x.RefundPrice ?? 0));
/// 绱涓嬪崟锛氱粺璁″钩鍙颁腑璁㈠崟涓嬪崟鏃堕棿鍦ㄦ槰澶╁強涔嬪墠鏃堕棿鐨勮鍗曡褰曪紱
var accumulatedOrders = await _lifePayOrderRepository.Where(x => x.CreationTime < today).CountAsync();
/// 鏄ㄦ棩涓嬪崟锛氱粺璁″钩鍙颁腑璁㈠崟涓嬪崟鏃堕棿鍦ㄦ槰澶╃殑璁㈠崟璁板綍锛�
@@ -65,8 +65,8 @@
Id = GuidGenerator.Create(),
CreationTime = DateTime.Now,
Amount = 0,
- AccumulatedReceipts = accumulatedReceipts.HasValue? accumulatedReceipts.Value:0,
- AccumulatedIncome = accumulatedIncome.HasValue ? accumulatedIncome.Value : 0,
+ AccumulatedReceipts = accumulatedReceipts,
+ AccumulatedIncome = accumulatedIncome,
ReceiptsYesterday = receiptsYesterday,
AccumulatedOrders = accumulatedOrders,
OrdersNumYesterday = ordersNumYesterday,
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index e3465f2..a7b1079 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -928,6 +928,11 @@
骞冲彴閫�娆剧姸鎬�
</summary>
</member>
+ <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplate.LifePayOrderStatus">
+ <summary>
+ 璁㈠崟鐘舵��
+ </summary>
+ </member>
<member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplate.ACOOLYStatusStr">
<summary>
渚涘簲鍟嗚鍗曠姸鎬�
--
Gitblit v1.9.1