| | |
| | | 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, "户号已存在"); |
| | | |
| | |
| | | } |
| | | 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.话费订单) |