From 149ce84eb71311ccd9719dc4a883aa9b6e63eeb6 Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期四, 20 三月 2025 12:58:49 +0800 Subject: [PATCH] fix:订单列表新增字段 --- LifePayment/LifePayment.Domain.Shared/Ali/GetPayQrCodeInput.cs | 10 + LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml | 44 +++++++ LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs | 79 ++++++++++++- LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs | 23 +++ LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs | 29 ++++ LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs | 2 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs | 41 ++++++ LifePayment/LifePayment.Domain.Shared/ACOOLY/ACOOLYConstant.cs | 15 ++ LifePayment/LifePayment.Domain/Ali/IAliPayApi.cs | 2 LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs | 8 + LifePayment/LifePayment.Domain/Ali/AliPayApi.cs | 6 + LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs | 25 ++++ LifePayment/LifePayment.Application/LifePay/LifePayService.cs | 56 +++++++- 13 files changed, 320 insertions(+), 20 deletions(-) diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs index 00d88e3..4499824 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs @@ -10,6 +10,10 @@ public interface ILifePayService : IApplicationService { + + + //Task<ElectricParValueResponse> GetTopStatistics(); + /// <summary> /// 鑾峰彇鐢佃垂闈㈠�� /// </summary> @@ -54,8 +58,10 @@ /// <param name="orderNo"></param> /// <param name="acoolyOrderNo"></param> /// <param name="status"></param> + /// <param name="acoolyStatus"></param> + /// <param name="payAmount"></param> /// <returns></returns> - Task ACOOLYOrderNotifyHandler(string orderNo, string acoolyOrderNo, LifePayOrderStatusEnum status); + Task ACOOLYOrderNotifyHandler(string orderNo, string acoolyOrderNo, LifePayOrderStatusEnum status, ACOOLYStatusEnum acoolyStatus, decimal payAmount); /// <summary> /// 鍒涘缓鐢熸椿缂磋垂璇濊垂璁㈠崟 diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs index b1fc7b3..845117b 100644 --- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs +++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs @@ -181,6 +181,11 @@ public decimal RechargeAmount { get; set; } /// <summary> + /// 瀹為檯鍏呭�奸噾棰� + /// </summary> + public decimal? ActualRechargeAmount { get; set; } + + /// <summary> /// 浼樻儬閲戦 /// </summary> public decimal DiscountAmount { get; set; } @@ -194,6 +199,12 @@ /// 鏀粯鏃堕棿 /// </summary> public DateTime? PayTime { get; set; } + + + /// <summary> + /// 骞冲彴鎵f閲戦 + /// </summary> + public decimal? PlatformDeductionAmount { get; set; } /// <summary> /// 鏀粯鐘舵�� @@ -230,12 +241,25 @@ /// </summary> public DateTime? RefundTime { get; set; } - + /// <summary> + /// 鐢宠閫�娆惧師鍥� + /// </summary> public string RefundApplyRemark { get; set; } + /// <summary> + /// 椹冲洖鍘熷洜 + /// </summary> public string RefundCheckRemark { get; set; } + /// <summary> + /// 骞冲彴璁㈠崟鍙� + /// </summary> public string ACOOLYOrderNo { get; set; } + + /// <summary> + /// 渚涘簲鍟� + /// </summary> + public ACOOLYStatusEnum? ACOOLYStatus { get; set; } } @@ -504,4 +528,19 @@ public DateTime CreationTime { get; set; } public bool IsDeleted { get; set; } +} + +public class TopStatisticsOutput +{ + /// <summary> + /// 璐︽埛浣欓 + /// </summary> + public string Amount { get; set; } + + /// <summary> + /// 绱鏀舵 + /// </summary> + public string AccumulatedReceipts { get; set; } + + } \ No newline at end of file diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs index 5ce58d1..00e2476 100644 --- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs +++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs @@ -19,6 +19,7 @@ using Volo.Abp.EventBus.Distributed; using Z.EntityFramework.Plus; using ZeroD.Util; +using Alipay.EasySDK.Payment.Common.Models; using static LifePayment.Domain.Shared.LifePaymentConstant; namespace LifePayment.Application; @@ -218,7 +219,6 @@ /// <returns></returns> public async Task<PageOutput<LifePayOrderListOutput>> GetLifePayOrderPage(QueryLifePayOrderListInput input) { - var result = await (from a in _channelFilter.GetChannelLifePayOrderFilter(_lifePayOrderRepository) .WhereIf(input.BeginFinishTime.HasValue, x => x.FinishTime >= input.BeginFinishTime) .WhereIf(input.EndFinishTime.HasValue, x => x.FinishTime <= input.EndFinishTime) @@ -254,7 +254,10 @@ RefundCheckRemark = a.RefundCheckRemark, RefundApplyRemark = a.RefundApplyRemark, RefundTime = a.RefundTime, - ChannelName = b.ChannlesName + ChannelName = b.ChannlesName, + ActualRechargeAmount = a.ActualRechargeAmount, + PlatformDeductionAmount = a.PlatformDeductionAmount, + ACOOLYStatus = a.ACOOLYStatus }).GetPageResult(input.PageModel); return result; @@ -965,7 +968,7 @@ /// <param name="orderNo"></param> /// <param name="outOrderNo"></param> /// <returns></returns> - public async Task ACOOLYOrderNotifyHandler(string orderNo, string acoolyOrderNo, LifePayOrderStatusEnum status) + public async Task ACOOLYOrderNotifyHandler(string orderNo, string acoolyOrderNo, LifePayOrderStatusEnum status, ACOOLYStatusEnum acoolyStatus, decimal payAmount) { var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "璁㈠崟涓嶅瓨鍦�"); @@ -976,6 +979,8 @@ } order.LifePayOrderStatus = status; + order.ACOOLYStatus = acoolyStatus; + order.PlatformDeductionAmount = payAmount; if (acoolyOrderNo.IsNotNullOrEmpty()) { order.ACOOLYOrderNo = acoolyOrderNo; @@ -1015,11 +1020,39 @@ throw new UserFriendlyException("褰撳墠璁㈠崟鐘舵�佹棤娉曢��娆�"); } - /// TODO 閫�娆捐姹傚畬鎴愬悗濡備綍鎿嶄綔 - /// var refundResult = await WxPayDomesticRefunds(order.OrderNo, order.RefundApplyRemark, Convert.ToInt32(order.PayAmount * 100), Convert.ToInt32(order.PayAmount * 100)); + switch (order.LifePayType) + { + case LifePayTypeEnum.WxPay: + var wxRefundResult = await WxPayDomesticRefunds(order.OrderNo, order.RefundApplyRemark, Convert.ToInt32(order.PayAmount * 100), Convert.ToInt32(order.PayAmount * 100)); + if (wxRefundResult.Status == "SUCCESS") + { + order.PayStatus = LifePayStatusEnum.宸查��娆�; + order.LifePayOrderStatus = LifePayOrderStatusEnum.宸查��娆�; + } + else if (wxRefundResult.Status == "PROCESSING") + { + order.PayStatus = LifePayStatusEnum.閫�娆句腑; + order.LifePayOrderStatus = LifePayOrderStatusEnum.閫�娆句腑; + } + else + { + throw new UserFriendlyException("閫�娆惧け璐�"); + } - order.PayStatus = LifePayStatusEnum.宸查��娆�; - order.LifePayOrderStatus = LifePayOrderStatusEnum.宸查��娆�; + break; + case LifePayTypeEnum.AliPay: + var aliRefundResult = await AliTradeRefund(new AlipayTradeRefundRequest() { OutTradeNo = order.OrderNo, RefundAmount = order.PayAmount.ToString() }); + if (aliRefundResult.Code != AlipayResultCode.Success) + { + throw new UserFriendlyException("閫�娆惧け璐�"); + } + + order.PayStatus = LifePayStatusEnum.宸查��娆�; + order.LifePayOrderStatus = LifePayOrderStatusEnum.宸查��娆�; + break; + default: throw new UserFriendlyException("閫�娆惧け璐�"); + } + order.RefundCredentialsImgUrl = input.RefundCredentialsImgUrl; order.RefundCheckRemark = input.RefundCheckRemark; order.RefundTime = DateTime.Now; @@ -1063,7 +1096,7 @@ order.LifePayOrderStatus = LifePayOrderStatusEnum.閫�娆惧緟瀹℃牳; order.RefundApplyRemark = input.RefundApplyRemark; - order.RefundTime = DateTime.Now; + order.RefundApplyTime = DateTime.Now; await _lifePayOrderRepository.UpdateAsync(order); } @@ -1097,7 +1130,10 @@ return res; } - + private async Task<AlipayTradeRefundResponse> AliTradeRefund(AlipayTradeRefundRequest input) + { + return await _aliPayApi.TradeRefund(input); + } public async Task<int> AddUpdateUserAccount(AddUpdateUserAccountInput input) { @@ -1492,7 +1528,6 @@ CheckExtensions.IfTrueThrowUserFriendlyException(amount <= 0, CustomeErrorMessage.SometingMustSometing, "鑾峰彇鏀粯浜岀淮鐮佹椂閲戦", "澶т簬0"); - var res = await _wxPayApi.PayTransactionsH5(new PayTransactionsNativeH5 { Appid = _wxPayOptions.AppID, @@ -1545,6 +1580,7 @@ return res.QrCode; } + /// <summary> /// 鏋勯�犲緟绛惧悕瀛楃涓� /// </summary> diff --git a/LifePayment/LifePayment.Domain.Shared/ACOOLY/ACOOLYConstant.cs b/LifePayment/LifePayment.Domain.Shared/ACOOLY/ACOOLYConstant.cs index 8d96436..8ed9b72 100644 --- a/LifePayment/LifePayment.Domain.Shared/ACOOLY/ACOOLYConstant.cs +++ b/LifePayment/LifePayment.Domain.Shared/ACOOLY/ACOOLYConstant.cs @@ -62,5 +62,20 @@ public const string PROCESSING = "PROCESSING"; } + public static class Status + { + public const string 鍏呭�兼垚鍔� = "SUCCESS"; + + public const string 鍏呭�间腑 = "PROCESSING"; + + public const string 鍏呭�煎け璐� = "FAIL"; + + public const string 閫�娆句腑 = "REFUNDING"; + + public const string 閫�娆惧畬鎴� = "REFUND_CLOSE"; + + public const string 澶辫触鍏抽棴 = "FAIL_CLOSE"; + } + public const string NotifyUrl = "/api/ACOOLYNotify/ACOOLYNotify"; } diff --git a/LifePayment/LifePayment.Domain.Shared/Ali/GetPayQrCodeInput.cs b/LifePayment/LifePayment.Domain.Shared/Ali/GetPayQrCodeInput.cs index cd0fbd3..d8f195a 100644 --- a/LifePayment/LifePayment.Domain.Shared/Ali/GetPayQrCodeInput.cs +++ b/LifePayment/LifePayment.Domain.Shared/Ali/GetPayQrCodeInput.cs @@ -25,4 +25,14 @@ /// </summary> public string OutTradeNo { get; set; } } + + public class AlipayTradeRefundRequest + { + /// <summary> + /// 浜ゆ槗鍒涘缓鏃朵紶鍏ョ殑鍟嗘埛璁㈠崟鍙� + /// </summary> + public string OutTradeNo { get; set; } + + public string RefundAmount { get; set; } + } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs index 69ba26d..585f39d 100644 --- a/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs +++ b/LifePayment/LifePayment.Domain.Shared/Enum/LifePay/LifePayEnum.cs @@ -35,7 +35,10 @@ 寰呴��娆� = 30, [Description("宸查��娆�")] - 宸查��娆� = 40, + 宸查��娆� = 40, + + [Description("閫�娆句腑")] + 閫�娆句腑 = 50, } public enum LifePayOrderStatusEnum @@ -57,6 +60,26 @@ [Description("閫�娆惧け璐�")] 閫�娆惧け璐� = 60, + + + [Description("閫�娆句腑")] + 閫�娆句腑 = 70, +} + +public enum ACOOLYStatusEnum +{ + [Description("鍏呭�间腑")] + 鍏呭�间腑 = 10, + [Description("鍏呭�兼垚鍔�")] + 鍏呭�兼垚鍔� = 20, + [Description("宸插畬鎴�")] + 宸插畬鎴� = 30, + [Description("閮ㄥ垎鍏呭�兼垚鍔�")] + 閮ㄥ垎鍏呭�兼垚鍔� = 40, + [Description("鍏呭�煎け璐�")] + 鍏呭�煎け璐� = 50, + [Description("宸查��娆�")] + 宸查��娆� = 60, } public enum LifePayRefundStatusEnum diff --git a/LifePayment/LifePayment.Domain/Ali/AliPayApi.cs b/LifePayment/LifePayment.Domain/Ali/AliPayApi.cs index 40ccd7c..a64cc72 100644 --- a/LifePayment/LifePayment.Domain/Ali/AliPayApi.cs +++ b/LifePayment/LifePayment.Domain/Ali/AliPayApi.cs @@ -33,5 +33,11 @@ AlipayTradeQueryResponse response = Factory.Payment.Common().Query(input.OutTradeNo); return response; } + + public async Task<AlipayTradeRefundResponse> TradeRefund(AlipayTradeRefundRequest input) + { + AlipayTradeRefundResponse response = Factory.Payment.Common().Refund(input.OutTradeNo,input.RefundAmount); + return response; + } } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs b/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs index 7598a2f..482b9fe 100644 --- a/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs +++ b/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs @@ -26,6 +26,8 @@ internal const string DataBillErceiptApply = "alipay.data.bill.ereceiptagent.apply"; internal const string DataBillEreceiptQuery = "alipay.data.bill.accountbookereceipt.query"; internal const string DataDataserviceBillDownloadUrlQuery = "alipay.data.dataservice.bill.downloadurl.query"; + + } public class AlipayResultCode diff --git a/LifePayment/LifePayment.Domain/Ali/IAliPayApi.cs b/LifePayment/LifePayment.Domain/Ali/IAliPayApi.cs index 13d9afd..8759070 100644 --- a/LifePayment/LifePayment.Domain/Ali/IAliPayApi.cs +++ b/LifePayment/LifePayment.Domain/Ali/IAliPayApi.cs @@ -11,5 +11,7 @@ Task<AlipayTradePrecreateResponse> GetAliPayQRCode(GetPayQrCodeInput input); AlipayTradeQueryResponse OrderInQuiry(OrderInQuiryInput input); + + Task<AlipayTradeRefundResponse> TradeRefund(AlipayTradeRefundRequest input); } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs b/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs index f48715e..3a90b90 100644 --- a/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs +++ b/LifePayment/LifePayment.Domain/LifePay/LifePayOrder.cs @@ -38,6 +38,8 @@ /// </summary> public decimal RechargeAmount { get; set; } + + /// <summary> /// 浼樻儬閲戦 /// </summary> @@ -47,6 +49,11 @@ /// 瀹炰粯閲戦 /// </summary> public decimal PayAmount { get; set; } + + /// <summary> + /// 骞冲彴鎵f閲戦 + /// </summary> + public decimal? PlatformDeductionAmount { get; set; } /// <summary> /// 鏀粯鏃堕棿 @@ -74,6 +81,11 @@ public LifePayOrderStatusEnum LifePayOrderStatus { get; set; } /// <summary> + /// 骞冲彴鐘舵�� + /// </summary> + public ACOOLYStatusEnum? ACOOLYStatus { get; set; } + + /// <summary> /// 瀹屾垚鏃堕棿 /// </summary> public DateTime? FinishTime { get; set; } @@ -98,12 +110,29 @@ /// </summary> public DateTime? RefundTime { get; set; } + /// <summary> + /// 閫�娆剧敵璇峰師鍥� + /// </summary> public string RefundApplyRemark { get; set; } + /// <summary> + /// 閫�娆剧敵璇锋椂闂� + /// </summary> + public DateTime? RefundApplyTime { get; set; } + + /// <summary> + /// 椹冲洖鍘熷洜 + /// </summary> public string RefundCheckRemark { get; set; } + /// <summary> + /// 閫�娆惧鏍镐汉 + /// </summary> public Guid? RefundCheckUserId { get; set; } public string? ChannelId { get; set; } + /// 瀹為檯鍏呭�奸噾棰� + /// </summary> + public decimal? ActualRechargeAmount { get; set; } } } \ No newline at end of file diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml index 0dad992..1374b1f 100644 --- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml +++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml @@ -42,13 +42,15 @@ <param name="outOrderNo"></param> <returns></returns> </member> - <member name="M:LifePayment.Application.Contracts.ILifePayService.ACOOLYOrderNotifyHandler(System.String,System.String,LifePayment.Domain.Shared.LifePayOrderStatusEnum)"> + <member name="M:LifePayment.Application.Contracts.ILifePayService.ACOOLYOrderNotifyHandler(System.String,System.String,LifePayment.Domain.Shared.LifePayOrderStatusEnum,LifePayment.Domain.Shared.ACOOLYStatusEnum,System.Decimal)"> <summary> 鏀粯鎴愬姛鍥炶皟澶勭悊 </summary> <param name="orderNo"></param> <param name="acoolyOrderNo"></param> <param name="status"></param> + <param name="acoolyStatus"></param> + <param name="payAmount"></param> <returns></returns> </member> <member name="M:LifePayment.Application.Contracts.ILifePayService.CreateLifePayPhoneOrder(LifePayment.Application.Contracts.CreateLifePayOrderInput{LifePayment.Application.Contracts.LifePhoneData})"> @@ -621,6 +623,11 @@ 鍏呭�奸噾棰� </summary> </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.ActualRechargeAmount"> + <summary> + 瀹為檯鍏呭�奸噾棰� + </summary> + </member> <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.DiscountAmount"> <summary> 浼樻儬閲戦 @@ -634,6 +641,11 @@ <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.PayTime"> <summary> 鏀粯鏃堕棿 + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.PlatformDeductionAmount"> + <summary> + 骞冲彴鎵f閲戦 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.PayStatus"> @@ -669,6 +681,26 @@ <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.RefundTime"> <summary> 閫�娆炬椂闂� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.RefundApplyRemark"> + <summary> + 鐢宠閫�娆惧師鍥� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.RefundCheckRemark"> + <summary> + 椹冲洖鍘熷洜 + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.ACOOLYOrderNo"> + <summary> + 骞冲彴璁㈠崟鍙� + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.ACOOLYStatus"> + <summary> + 渚涘簲鍟� </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayOrderListTemplate.CreationTime"> @@ -851,6 +883,16 @@ 鍒涘缓鏃堕棿 </summary> </member> + <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.Amount"> + <summary> + 璐︽埛浣欓 + </summary> + </member> + <member name="P:LifePayment.Application.Contracts.TopStatisticsOutput.AccumulatedReceipts"> + <summary> + 绱鏀舵 + </summary> + </member> <member name="P:LifePayment.Application.Contracts.RecordOperateHistoryEto.RelationId"> <summary> 鍏宠仈鍏崇郴ID diff --git a/LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs index 8e0e2b9..a0ceec6 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs @@ -53,7 +53,9 @@ var baseInfo = JsonConvert.DeserializeObject<ACOOLYRequestBaseResponse>(body); var orderNo = string.Empty; var status = LifePayOrderStatusEnum.寰呯‘璁�; + var acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; var acoolyOrderNo = string.Empty; + decimal payAmount = 0; _logger.LogError("ACOOLY鍥炶皟閫氬鐞嗙被鍨嬶細" + baseInfo.Service); _logger.LogError("ACOOLY鍥炶皟鍐呭锛�" + body); switch (baseInfo.Service) @@ -62,29 +64,41 @@ var confirmElectricOrderResponse = JsonConvert.DeserializeObject<ConfirmElectricOrderResponse>(body); orderNo = confirmElectricOrderResponse.ElectricChargeOrder.OutOrderNo; acoolyOrderNo = confirmElectricOrderResponse.ElectricChargeOrder.BusiOrderNo; + payAmount = confirmElectricOrderResponse.ElectricChargeOrder.PayAmount; _logger.LogError("ACOOLY鍥炶皟閫氬鐞嗙粨鏋滅姸鎬侊細" + confirmElectricOrderResponse.ElectricChargeOrder.Status); - /// TODO 鐘舵�佷笉姝g‘ if (!confirmElectricOrderResponse.Success || (confirmElectricOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmElectricOrderResponse.Code != ACOOLYConstant.Code.PROCESSING)) { status = LifePayOrderStatusEnum.宸插け璐�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; } else - if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Code.SUCCESS) + if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.鍏呭�兼垚鍔�) { status = LifePayOrderStatusEnum.宸插畬鎴�; + if (confirmElectricOrderResponse.ElectricChargeOrder.ParValue == confirmElectricOrderResponse.ElectricChargeOrder.PayAmount) + { + + acoolyStatus = ACOOLYStatusEnum.鍏呭�兼垚鍔�; + } + else + { + acoolyStatus = ACOOLYStatusEnum.閮ㄥ垎鍏呭�兼垚鍔�; + } } else - if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Code.PROCESSING) + if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.鍏呭�间腑) { status = LifePayOrderStatusEnum.寰呯‘璁�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�间腑; } else { status = LifePayOrderStatusEnum.宸插け璐�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; } break; @@ -92,35 +106,88 @@ var confirmPhoneOrderResponse = JsonConvert.DeserializeObject<ConfirmPhoneOrderResponse>(body); orderNo = confirmPhoneOrderResponse.PhoneChargeOrder.OutOrderNo; acoolyOrderNo = confirmPhoneOrderResponse.PhoneChargeOrder.BusiOrderNo; + payAmount = confirmPhoneOrderResponse.PhoneChargeOrder.PayAmount; _logger.LogError("ACOOLY鍥炶皟閫氬鐞嗙粨鏋滅姸鎬侊細" + confirmPhoneOrderResponse.PhoneChargeOrder.Status); if (!confirmPhoneOrderResponse.Success || (confirmPhoneOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmPhoneOrderResponse.Code != ACOOLYConstant.Code.PROCESSING)) { status = LifePayOrderStatusEnum.宸插け璐�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; } else - if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Code.SUCCESS) + if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.鍏呭�兼垚鍔�) { status = LifePayOrderStatusEnum.宸插畬鎴�; + if (confirmPhoneOrderResponse.PhoneChargeOrder.ParValue == confirmPhoneOrderResponse.PhoneChargeOrder.PayAmount) + { + + acoolyStatus = ACOOLYStatusEnum.鍏呭�兼垚鍔�; + } + else + { + acoolyStatus = ACOOLYStatusEnum.閮ㄥ垎鍏呭�兼垚鍔�; + } } else - if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Code.PROCESSING) + if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.鍏呭�间腑) { status = LifePayOrderStatusEnum.寰呯‘璁�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�间腑; } else { status = LifePayOrderStatusEnum.宸插け璐�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; } break; + case ACOOLYConstant.Sevice.ConfirmGasOrder: + var confirmGasOrderResponse = JsonConvert.DeserializeObject<ConfirmGasOrderResponse>(body); + orderNo = confirmGasOrderResponse.GasChargeOrder.OutOrderNo; + acoolyOrderNo = confirmGasOrderResponse.GasChargeOrder.BusiOrderNo; + payAmount = confirmGasOrderResponse.GasChargeOrder.PayAmount; + _logger.LogError("ACOOLY鍥炶皟閫氬鐞嗙粨鏋滅姸鎬侊細" + confirmGasOrderResponse.GasChargeOrder.Status); + if (!confirmGasOrderResponse.Success + || (confirmGasOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmGasOrderResponse.Code != ACOOLYConstant.Code.PROCESSING)) + { + status = LifePayOrderStatusEnum.宸插け璐�; + } + else + if (confirmGasOrderResponse.GasChargeOrder.Status == ACOOLYConstant.Status.鍏呭�兼垚鍔�) + { + status = LifePayOrderStatusEnum.宸插畬鎴�; + // TODO 纭浠�涔堟儏鍐典笅鍙互鍒ゆ柇鏄儴鍒嗗厖鍊兼垚鍔� + + //if (confirmGasOrderResponse.GasChargeOrder.ParValue == confirmGasOrderResponse.GasChargeOrder.PayAmount) + //{ + + // acoolyStatus = ACOOLYStatusEnum.鍏呭�兼垚鍔�; + //} + //else + //{ + // acoolyStatus = ACOOLYStatusEnum.閮ㄥ垎鍏呭�兼垚鍔�; + //} + } + else + + if (confirmGasOrderResponse.GasChargeOrder.Status == ACOOLYConstant.Status.鍏呭�间腑) + { + status = LifePayOrderStatusEnum.寰呯‘璁�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�间腑; + } + else + { + status = LifePayOrderStatusEnum.宸插け璐�; + acoolyStatus = ACOOLYStatusEnum.鍏呭�煎け璐�; + } + break; default: break; } - await _lifePayService.ACOOLYOrderNotifyHandler(orderNo, acoolyOrderNo, status); + await _lifePayService.ACOOLYOrderNotifyHandler(orderNo, acoolyOrderNo, status, acoolyStatus, payAmount); } } } \ No newline at end of file diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs index 78fcb0a..7a3c36b 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs @@ -36,6 +36,17 @@ #region 鏌ヨ /// <summary> + /// 鑾峰彇椤堕儴缁熻鏁版嵁 + /// </summary> + /// <returns></returns> + //[HttpGet] + //[AllowAnonymous] + //public async Task<TopStatisticsOutput> GetTopStatistics() + //{ + // return await _lifePayService.GetTopStatistics(); + //} + + /// <summary> /// 鑾峰彇鐢佃垂闈㈠�� /// </summary> /// <returns></returns> @@ -181,6 +192,18 @@ } /// <summary> + /// 鑾峰彇璁㈠崟璇︽儏 + /// </summary> + /// <param name="orderNo"></param> + /// <returns></returns> + //[HttpGet] + //public async Task<UserLifePayOrderOutput> GetLifePayOrderDetail(string orderNo) + //{ + // return await _lifePayService.GetLifePayOrderDetail(orderNo); + //} + + + /// <summary> /// 鑾峰彇鎴戠殑璁㈠崟鍒嗛〉鏁版嵁 /// </summary> /// <param name="input"></param> -- Gitblit v1.9.1