zhengyuxuan
2025-03-27 72ed026e6dc651e7bd1f77f41face93a7a9f49cb
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1537,7 +1537,7 @@
            var userAccount = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.Id == input.Id)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(userAccount == null, "户号不存在");
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id)
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id && x.IsDeleted == false)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
@@ -1551,22 +1551,36 @@
        }
        else
        {
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content)
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.IsDeleted == false)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
            var userAccount = new LifePayAccount
            /// CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
            if (repeatAccountContent != null)
            {
                Id = Guid.NewGuid(),
                UserId = input.UserId,
                Content = input.Content,
                Province = input.Province,
                LifePayType = input.LifePayType,
                City = input.City,
                Remark = input.Remark,
                Operators = input.Operators,
                ExtraProperties = input.ExtraProperties,
            };
            await _lifePayAccount.InsertAsync(userAccount);
                repeatAccountContent.LifePayType = input.LifePayType;
                repeatAccountContent.Content = input.Content;
                repeatAccountContent.Province = input.Province;
                repeatAccountContent.City = input.City;
                repeatAccountContent.Remark = input.Remark;
                repeatAccountContent.Operators = input.Operators;
                repeatAccountContent.ExtraProperties = input.ExtraProperties;
            }
            else
            {
                var userAccount = new LifePayAccount
                {
                    Id = Guid.NewGuid(),
                    UserId = input.UserId,
                    Content = input.Content,
                    Province = input.Province,
                    LifePayType = input.LifePayType,
                    City = input.City,
                    Remark = input.Remark,
                    Operators = input.Operators,
                    ExtraProperties = input.ExtraProperties,
                };
                await _lifePayAccount.InsertAsync(userAccount);
            }
        }
        if (input.LifePayType == LifePayOrderTypeEnum.话费订单)