zhengyuxuan
2025-04-02 8c1dce43d197565302ead9d3ae78dff8ea4f9687
fix:bug修复
5个文件已修改
76 ■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayOrderService.cs
@@ -27,4 +27,6 @@
    Task GetAllLifePayExpensesReceipts();
    Task GetAllChannlesRake();
    Task GetAllLifePayConsumption();
}
LifePayment/LifePayment.Application/LifePay/LifePayOrderService.cs
@@ -16,6 +16,7 @@
using Newtonsoft.Json;
using LifePayment.Domain.Common;
using Spire.Pdf.Exporting.XPS.Schema;
using Nest;
namespace LifePayment.Application.LifePay
{
@@ -342,21 +343,18 @@
                {
                    OrderNo = item.OrderNo,
                    AcoolyOrderNo = item.ACOOLYOrderNo,
                    Amount = item.PlatformDeductionAmount.Value,
                    Amount = item.PlatformDeductionAmount.HasValue? item.PlatformDeductionAmount.Value : 0,
                };
                if (item.ACOOLYStatus != null)
                {
                switch (item.ACOOLYStatus)
                {
                    case ACOOLYStatusEnum.充值中:
                        lifePayConsumption.FinishTime = item.CreationTime;
                        lifePayConsumption.ACOOLYStatus = ACOOLYStatusEnum.充值中;
                        lifePayConsumption.FrozenStatus = ConsumptionFrozenStatusEnum.Frozen;
                        lifePayConsumption.Flow = ConsumptionFlowEnum.Unchanged;
                        lifePayConsumption.DeductionAmount = 0;
                        lifePayConsumption.FrozenAmount = lifePayConsumption.Amount;
                            await CreatLifePayConsumption(ACOOLYStatusEnum.充值中, item, lifePayConsumption);
                        break;
                    default: break;
                }
                }
            }
        }
@@ -460,6 +458,29 @@
            return list;
        }
        private async Task CreatLifePayConsumption(ACOOLYStatusEnum status, LifePayOrder order, LifePayConsumption lifePayConsumption)
        {
            switch (status)
            {
                case ACOOLYStatusEnum.充值中:
                    lifePayConsumption.FinishTime = order.CreationTime;
                    lifePayConsumption.ACOOLYStatus = ACOOLYStatusEnum.充值中;
                    lifePayConsumption.FrozenStatus = ConsumptionFrozenStatusEnum.Frozen;
                    lifePayConsumption.Flow = ConsumptionFlowEnum.Unchanged;
                    lifePayConsumption.DeductionAmount = 0;
                    lifePayConsumption.FrozenAmount = lifePayConsumption.Amount;
                    var repeat = await _lifePayConsumption.Where(x => x.OrderNo == lifePayConsumption.OrderNo
                    && x.ACOOLYStatus == lifePayConsumption.ACOOLYStatus && x.Flow == lifePayConsumption.Flow).FirstOrDefaultAsync();
                    if (repeat == null)
                    {
                        await _lifePayConsumption.InsertAsync(lifePayConsumption);
                    };
                    break;
                default: break;
            }
        }
        #endregion
    }
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -929,7 +929,8 @@
        var channle = await GetLifePayChannlesDtoByNum(input.ChannelId);
        CheckExtensions.IfTrueThrowUserFriendlyException(channle == null, "渠道不存在");
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.PhoneOrder && x.PayStatus == LifePayStatusEnum.已支付
        var repeatOrder = await _lifePayOrderRepository.Where(x => x.LifePayOrderType == LifePayOrderTypeEnum.PhoneOrder
        && x.PayStatus == LifePayStatusEnum.已支付
        && x.LifePayOrderStatus == LifePayOrderStatusEnum.充值中
        && x.OrderParamDetailJsonStr.Contains(input.ProductData.Phone)).ToListAsync();
         CheckExtensions.IfTrueThrowUserFriendlyException(repeatOrder.Count() > 0, "您有同户号订单正在充值中,请勿重复充值");
@@ -1663,6 +1664,18 @@
        userAccount.DeleterId = userAccount.UserId;
        userAccount.DeletionTime = DateTime.Now;
        userAccount.IsDeleted = true;
        /// 清除户号对应的用户姓名
        if (userAccount.LifePayType == LifePayOrderTypeEnum.PhoneOrder || userAccount.LifePayType == LifePayOrderTypeEnum.ElectricOrder)
        {
            var user = await _lifePayUserRepository.Where(r => r.Id == userAccount.UserId && !r.IsDeleted).FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(user == null, "用户不存在");
            var extraProperties = JsonConvert.DeserializeObject<Model_UserAccountExtraProperties>(userAccount.ExtraProperties);
            if (!string.IsNullOrEmpty(extraProperties.Name) && extraProperties.Phone == user.PhoneNumber)
            {
                user.Name = string.Empty;
            }
        }
        return Constant.SUCCESS;
    }
@@ -1697,8 +1710,7 @@
            #region 记录日志
            await PublishLifePayOrderHistoryEvent("退款驳回", "退款", order.Id);
            await LifePayOrderHistory("退款驳回", "退款", order.Id, (int)OperateHistoryTypeEnum.LifePayRefund);
            #endregion
        }
        else
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -357,6 +357,12 @@
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetAllLifePayConsumption">
            <summary>
            统计交易流水
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.CreateLifePayPhoneOrder(LifePayment.Application.Contracts.CreateLifePayOrderInput{LifePayment.Application.Contracts.LifePhoneData})">
            <summary>
            创建生活缴费话费订单
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -631,7 +631,16 @@
            await _lifePayOrderService.GetAllChannlesRake();
        }
        /// <summary>
        /// 统计交易流水
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task GetAllLifePayConsumption()
        {
            await _lifePayOrderService.GetAllLifePayConsumption();
        }
        #endregion
        #region 操作