From b4288a88cb00793368c8e9244a7b3181daeadb96 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期五, 28 三月 2025 16:11:11 +0800
Subject: [PATCH] fix:条件编译更新
---
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 10 +++++
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs | 57 ++++++++++++++++------------
LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 4 +-
3 files changed, 44 insertions(+), 27 deletions(-)
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index e8e3126..1828a28 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1210,4 +1210,14 @@
/// 浜ゆ槗鏃堕棿
/// </summary>
public DateTime FinishTime { get; set; }
+}
+public class LifePayExpensesReceiptsPageOutput<T> : PageOutputBase
+{
+
+ public List<T> Data { get; set; } = new List<T>();
+
+ /// <summary>
+ /// 绱鍏呭��
+ /// </summary>
+ public decimal TotalRechargeAmount { get; set; }
}
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
index b6c399e..2655d8e 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -13,6 +13,7 @@
using ZeroD.Util;
using LifePayment.Domain;
using static LifePayment.Domain.Shared.LifePaymentConstant;
+using Newtonsoft.Json;
namespace LifePayment.Application.LifePay
{
@@ -101,29 +102,29 @@
}
- //public async Task<LifePayExpensesReceiptsPageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input)
- //{
- // var list = await _lifePayExpensesReceiptsRepository.Where(x => x.IsDeleted == false)
- // .WhereIf(input.KeyWord.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWord))
- // .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
- // .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
- // .Select(x => new LifePayRechargeReceiptsListOutput()
- // {
- // Id = x.Id,
- // OrderNo = x.OrderNo,
- // RechargeAmount = x.RechargeAmount,
- // Remark = x.Remark,
- // Voucher = x.Voucher.GetOssPath(),
- // CreationTime = x.CreationTime,
- // })
- // .GetPageResult(input.PageModel);
+ public async Task<LifePayExpensesReceiptsPageOutput<LifePayExpensesReceiptsListOutput>> GetLifePayExpensesReceiptsPage(LifePayExpensesReceiptsPageInput input)
+ {
+ var list = await _lifePayExpensesReceiptsRepository.Where(x => x.IsDeleted == false)
+ .WhereIf(input.KeyWord.IsNotNullOrEmpty(), x => x.OrderNo.Contains(input.KeyWord))
+ .WhereIf(input.CreationTimeBegin.HasValue, x => x.CreationTime >= input.CreationTimeBegin)
+ .WhereIf(input.CreationTimeEnd.HasValue, x => x.CreationTime <= input.CreationTimeEnd)
+ .Select(x => new LifePayRechargeReceiptsListOutput()
+ {
+ Id = x.Id,
+ OrderNo = x.OrderNo,
+ RechargeAmount = x.RechargeAmount,
+ Remark = x.Remark,
+ Voucher = x.Voucher.GetOssPath(),
+ CreationTime = x.CreationTime,
+ })
+ .GetPageResult(input.PageModel);
- // var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount);
- // LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput> result = new LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>();
- // result.Data = list.Data;
- // result.TotalRechargeAmount = total;
- // return result;
- //}
+ var total = await _lifePayRechargeReceiptsRepository.Where(x => x.IsDeleted == false).SumAsync(x => x.RechargeAmount);
+ LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput> result = new LifePayRechargeReceiptsPageOutput<LifePayRechargeReceiptsListOutput>();
+ result.Data = list.Data;
+ result.TotalRechargeAmount = total;
+ return result;
+ }
/// <summary>
/// 鎻掑叆鏀舵敮娴佹按
@@ -143,7 +144,7 @@
OutOrderNo = input.OutOrderNo,
LifePayType = input.LifePayType,
ExpensesReceiptsType = input.ExpensesReceiptsType,
- Amount = input.Amount
+ Amount = input.Amount,
};
switch (input.LifePayType)
@@ -154,6 +155,8 @@
var query = await _aliPayApi.OrderInQuiry(new OrderInQuiryInput() { OutTradeNo = input.OrderNo });
if (query.Code == AlipayResultCode.Success && query.TradeStatus == AlipayStatus.TRADESUCCESS)
{
+ data.ExtraProperties = JsonConvert.SerializeObject(query);
+ data.FinishTime = Convert.ToDateTime(query.SendPayDate);
await _lifePayExpensesReceiptsRepository.InsertAsync(data);
}
}
@@ -162,6 +165,8 @@
var query = await _aliPayApi.QueryAlipayTradeRefund(new OrderInQuiryInput() { OutTradeNo = input.OrderNo });
if (query.Code == AlipayResultCode.Success && query.RefundStatus == AlipayRefundStatus.Success)
{
+ data.ExtraProperties = JsonConvert.SerializeObject(query);
+ //data.FinishTime = Convert.ToDateTime(query.SendPayDate);
await _lifePayExpensesReceiptsRepository.InsertAsync(data);
}
}
@@ -172,6 +177,8 @@
var query = await _wxPayApi.WxPayTradeQuery(input.OrderNo);
if (query.Code == AlipayResultCode.Success && query.Status == WxPayStatus.鏀粯鎴愬姛)
{
+ data.ExtraProperties = JsonConvert.SerializeObject(query);
+ data.FinishTime = Convert.ToDateTime(query.SuccessTime);
await _lifePayExpensesReceiptsRepository.InsertAsync(data);
}
}
@@ -180,14 +187,14 @@
var query = await _wxPayApi.WxPayDomesticRefundsQuery(input.OrderNo);
if (query.Code == AlipayResultCode.Success && query.RefundStatus == WxPayRefundStatus.閫�娆炬垚鍔�)
{
+ data.ExtraProperties = JsonConvert.SerializeObject(query);
+ data.FinishTime = Convert.ToDateTime(query.SuccessTime);
await _lifePayExpensesReceiptsRepository.InsertAsync(data);
}
}
break;
default: break;
}
-
-
}
}
}
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index e847711..8403c87 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1052,8 +1052,8 @@
//var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, 0.01m, ip, input.H5Type);
var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, res.PayAmount, ip, input.H5Type);
#else
- //var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, 0.01m, ip, input.H5Type);
- var payUrl = await GetPayQRCode(order.LifePayType.Value, order.OrderNo, desc, order.PayAmount??0, ip, input.H5Type);
+ //var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, 0.01m, ip, input.H5Type);
+ var payUrl = await GetPayQRCode(res.LifePayType, res.OrderNo, res.Desc, res.PayAmount, ip, input.H5Type);
#endif
return payUrl;
--
Gitblit v1.9.1