From 72ed026e6dc651e7bd1f77f41face93a7a9f49cb Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期四, 27 三月 2025 08:58:34 +0800
Subject: [PATCH] fix:新增在线客服配置、户号编辑功能优化、用户列表更新

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   44 +++++++++++++++++++++++++++++---------------
 1 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 405d11c..4820c56 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/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.璇濊垂璁㈠崟)

--
Gitblit v1.9.1