fix:运营端——渠道管理——渠道管理(渠道折扣接口请求进行编辑可低于供应商折扣)
3个文件已修改
53 ■■■■ 已修改文件
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/appsettings.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1349,6 +1349,7 @@
    public async Task LifePaySuccessHandler(string orderNo, string outOrderNo)
    {
        var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync();
        _logger.LogInformation($"正在处理订单:{order?.Id}-{order?.PayStatus}");
        CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在");
        if (order.PayStatus != LifePayStatusEnum.未支付)
@@ -1377,6 +1378,7 @@
                default:
                    break;
            }
            _logger.LogInformation("已向供应商发起订单");
            order.LifePayRefundStatus = LifePayRefundStatusEnum.无需退款;
            order.LifePayOrderStatus = LifePayOrderStatusEnum.充值中;
@@ -1384,10 +1386,13 @@
            order.OutRequestNo = result.RequestNo.IsNullOrEmpty() ? null : result.RequestNo;
            order.ACOOLYOrderNo = result.ACOOLYOrderNo;
            order.ACOOLYStatus = ACOOLYStatusEnum.充值中;
            await _lifePayOrderRepository.UpdateAsync(order);
            _logger.LogInformation("生活缴费订单状态:" + order.LifePayOrderStatus.ToString());
            /// 创建生活缴费消费记录
            await _lifePayOrderService.CreatLifePayConsumption(ACOOLYStatusEnum.充值中, order.OrderNo, order.ACOOLYOrderNo,
                                order.PlatformDeductionAmount ?? 0, order.ChannelId, order.CreationTime, order.FinishTime);
            _logger.LogInformation("已插入消费记录");
        }
        catch (Exception ex)
        {
@@ -1396,10 +1401,9 @@
            order.LifePayRefundStatus = LifePayRefundStatusEnum.待退款;
            order.ACOOLYStatus = ACOOLYStatusEnum.充值失败;
            order.RefundApplyRemark = ex.Message;
            await _lifePayOrderRepository.UpdateAsync(order);
            _logger.LogError("生活缴费订单状态:" + order.LifePayOrderStatus.ToString());
        }
        _logger.LogError("生活缴费订单状态:" + order.LifePayOrderStatus.ToString());
        await _lifePayOrderRepository.UpdateAsync(order);
    }
    public async Task LifePayRefundsHandler(string orderNo, LifePayRefundStatusEnum refundStatus)
@@ -1791,6 +1795,9 @@
                dto.PromoterId = promoter.Id;
            }
            var rate = await _lifePayRateRepository.FirstOrDefaultAsync(it => it.RateType == LifePayRateTypeEnum.供应商折扣价);
            CheckExtensions.IfTrueThrowUserFriendlyException(rate != null && input.ChannlesRate < rate.Rate, "渠道折扣无法低于供应商折扣");
            dto.ChannlesName = input.ChannlesName;
            dto.ChannlesNum = input.ChannlesNum;
            dto.ChannlesRate = input.ChannlesRate;
@@ -1800,6 +1807,7 @@
            dto.AgentType = input.AgentType;
            dto.AreaProvinceId = input.AreaProvinceId;
            dto.AreaCityId = input.AreaCityId;
            #region 记录日志
            await LifePayOrderHistory("渠道管理", "编辑", input.Id.Value, TableType.LifePayChannles);
LifePayment/LifePayment.Host/appsettings.json
@@ -19,10 +19,10 @@
    "OssRoleRan": "acs:ram::1483797030072898:role/boleoss"
  },
  "ConnectionStrings": {
    //"AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589",
    //"LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589",
    "LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePayment;Uid=bole;Pwd=Blcs20@%27;",
    "AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePaymentIdentity;Uid=bole;Pwd=Blcs20@%27;",
    "AbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589",
    "LifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589",
    //"LifePaymentServices": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePayment;Uid=bole;Pwd=Blcs20@%27;",
    //"AbpIdentity": "Server=rm-bp1mt744021h1s6dg4o.sqlserver.rds.aliyuncs.com,2333;Database=Dev_LifePaymentIdentity;Uid=bole;Pwd=Blcs20@%27;",
    "SyncAbpIdentity": "Server=120.26.58.240; Database=Dev_LifePaymentIdentity; User=bole;Password=Bole1472589",
    "SyncLifePaymentServices": "Server=120.26.58.240; Database=Dev_LifePayment; User=bole;Password=Bole1472589"
LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs
@@ -11,6 +11,7 @@
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Caching;
using Volo.Abp.Uow;
using ZeroD.Util;
namespace LifePayment.HttpApi
{
@@ -52,19 +53,22 @@
        {
            try
            {
                _logger.LogError($"生活管家微信充值回调通知:进入微信回调:");
                var req = input.ToJson();
                _logger.LogInformation($"生活管家微信充值回调通知:进入微信回调:" + req);
                var data = _wxPayApi.AesGcmDecrypt(input.Resource.AssociatedData, input.Resource.Nonce, input.Resource.Ciphertext);
                _logger.LogError($"生活管家微信充值回调通知data:" + data);
                _logger.LogInformation($"生活管家微信充值回调通知data:" + data);
                var wxPayNotice = JsonConvert.DeserializeObject<WxPayNotice>(data);
                if (wxPayNotice.OutTradeNo.Contains("JF") )
                if (wxPayNotice.OutTradeNo.Contains("JF"))
                {
                    if (wxPayNotice.TradeState == LifePaymentConstant.WxPayStatus.支付成功)
                    {
                        var key = $"WxRechargeNotify_{wxPayNotice.OutTradeNo}";
                        if (string.IsNullOrWhiteSpace(distributedCache.Get(key)))
                        {
                            _logger.LogInformation("正在处理回调");
                            await _lifePayService.LifePaySuccessHandler(wxPayNotice.OutTradeNo, wxPayNotice.TransactionId);
                            _logger.LogInformation("已处理回调");
                            // 插入收支流水
                            await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
@@ -75,13 +79,26 @@
                                ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
                                Amount = wxPayNotice.Amount.Total
                            });
                            _logger.LogInformation("已插入收支流水");
                            distributedCache.Set(key, data, new DistributedCacheEntryOptions
                            {
                                AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10)
                            });
                        }
                        else
                        {
                            _logger.LogInformation("已过滤重复请求");
                        }
                    }
                    else
                    {
                        _logger.LogInformation("交易状态不符合规则");
                    }
                }
                else
                {
                    _logger.LogInformation("订单号不符合规则");
                }
            }
            catch (Exception ex)
@@ -113,12 +130,12 @@
            {
                _logger.LogError($"微信退款回调通知:进入微信回调");
                var data = _wxPayApi.AesGcmDecrypt(input.Resource.AssociatedData, input.Resource.Nonce, input.Resource.Ciphertext);
                _logger.LogError($"微信退款回调通知data:"+ data);
                _logger.LogError($"微信退款回调通知data:" + data);
                var wxPayNotice = JsonConvert.DeserializeObject<WxPayDomesticRefundsNotice>(data);
                if (wxPayNotice.OutTradeNo.Contains("JF"))
                {
                    switch (wxPayNotice.RefundStatus)
                    {
                        case LifePaymentConstant.WxPayRefundStatus.退款成功:
@@ -139,13 +156,13 @@
                        case LifePaymentConstant.WxPayRefundStatus.退款异常:
                            await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中);
                            break;
                        default : await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中);break;
                        default: await _lifePayService.LifePayRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中); break;
                    }
                }
            }
            catch (Exception ex)
            {
                return new WxRechargeNotifyResult
                {
                    Code = "FAIL",