From 82831a86d529817e51f5b6e3cec636d21cef3c9b Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期三, 19 三月 2025 16:17:40 +0800
Subject: [PATCH] fix:bug修复

---
 LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml      |   22 ++++++++++
 LifePayment/LifePayment.Domain/LifePay/LifePayUser.cs                           |    5 ++
 LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs                    |    2 
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs           |   24 ++++++++++++
 LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs              |    2 +
 LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs                         |    2 
 LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs               |    2 
 LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs          |    5 ++
 LifePayment/LifePayment.Application/User/UserRoleService.cs                     |    4 +-
 LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs |    4 +-
 LifePayment/LifePayment.Domain/Common/UserChannle.cs                            |    2 
 LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs        |    2 
 LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml                     |    2 
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs                   |   34 ++++++++++++++++-
 14 files changed, 99 insertions(+), 13 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
index 70adeed..00d88e3 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/ILifePayService.cs
@@ -171,7 +171,7 @@
     /// </summary>
     /// <param name="input"></param>
     /// <returns></returns>
-    Task<PageOutput<UserListOutput>> GetUserPage(PageInput input);
+    Task<PageOutput<UserListOutput>> GetUserPage(QueryUserPageInput input);
 
 
     /// <summary>
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
index d0353ba..3482efa 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayInput.cs
@@ -391,4 +391,28 @@
     /// </summary>
     [StringLength(30, ErrorMessage = "澶囨敞淇℃伅浠呮敮鎸佸~鍐�30涓瓧绗︺��")]
     public string Remark { get; set; } = string.Empty;
+}
+
+public class QueryUserPageInput : ChannelsBaseInput
+{
+    /// <summary>
+    /// 鎵嬫満鍙�/鐢ㄦ埛鍚�
+    /// </summary>
+    public string? QueryCondition { get; set; }
+
+    /// <summary>
+    /// 娉ㄥ唽鏃堕棿
+    /// </summary>
+    public DateTime? CreationTime { get; set; }
+}
+
+public class Model_UserAccountExtraProperties
+{
+    public string? Name { get; set; }
+
+    public string IspCode { get; set; }
+
+    public string Phone { get; set; }
+
+    public string Remark { get; set; }
 }
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
index 853c9a4..b1fc7b3 100644
--- a/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -125,6 +125,11 @@
     public string PhoneNumber { get; set; }
 
     /// <summary>
+    /// 濮撳悕
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
     /// 鏈�鍚庣櫥褰曟笭閬�
     /// </summary>
     public string? CreationChannle { get; set; }
diff --git a/LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs b/LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs
index 74cce24..b880d90 100644
--- a/LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs
+++ b/LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs
@@ -31,7 +31,7 @@
         /// <summary>
         /// 娓犻亾鍒楄〃
         /// </summary>
-        public Guid[] ChannlesId { get; set; }
+        public string[] ChannlesId { get; set; }
 
         /// <summary>
         /// 缁勭粐鏋舵瀯鍏徃id
@@ -231,7 +231,7 @@
         /// <summary>
         /// 娓犻亾Id
         /// </summary>
-        public Guid Id { get; set; }
+        public string Id { get; set; }
 
         /// <summary>
         /// 娓犻亾鍚�
diff --git a/LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs b/LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs
index 2a96375..9e766f5 100644
--- a/LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs
+++ b/LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs
@@ -77,7 +77,7 @@
         /// <summary>
         /// 娓犻亾鍒楄〃
         /// </summary>
-        public Guid[] ChannlesId { get; set; }
+        public string[] ChannlesId { get; set; }
 
         /// <summary>
         /// 灏忕▼搴廜penId
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index f87e0a1..d0c1245 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -29,6 +29,8 @@
 using Z.EntityFramework.Plus;
 using LifePayment.Domain.LifePay;
 using pingan.openbank.api.sdk.enums;
+using System.Linq.Dynamic.Core;
+using static Volo.Abp.Identity.Settings.IdentitySettingNames;
 
 namespace LifePayment.Application;
 
@@ -169,15 +171,19 @@
     /// </summary>
     /// <param name="input"></param>
     /// <returns></returns>
-    public async Task<PageOutput<UserListOutput>> GetUserPage(PageInput input)
+    public async Task<PageOutput<UserListOutput>> GetUserPage(QueryUserPageInput input)
     {
-        return await _lifePayUserRepository.Select(x =>
+        return await _lifePayUserRepository.Where(x => x.IsDeleted == false)
+            .WhereIf(!string.IsNullOrEmpty(input.QueryCondition), x => x.PhoneNumber.Contains(input.QueryCondition) || x.Name.Contains(input.QueryCondition))
+            .WhereIf(input.CreationTime.HasValue, x => x.CreationTime.ToString("yyyy-MM-dd") == input.CreationTime.Value.ToString("yyyy-MM-dd"))
+                                            .Select(x =>
                                                    new UserListOutput()
                                                    {
                                                        Id = x.Id,
                                                        CreationChannle = string.IsNullOrEmpty(x.CreationChannleNum) ? "" : _lifePayChannlesRep.Where(c => c.ChannlesNum == x.CreationChannleNum).FirstOrDefault().ChannlesName,
                                                        LastLoginChannle = string.IsNullOrEmpty(x.LastLoginChannleNum) ? "" : _lifePayChannlesRep.Where(c => c.ChannlesNum == x.LastLoginChannleNum).FirstOrDefault().ChannlesName,
                                                        PhoneNumber = x.PhoneNumber,
+                                                       Name = string.IsNullOrEmpty(x.Name) ? "" : x.Name,
                                                        CreationTime = x.CreationTime,
                                                        LastLoginTime = x.LastLoginTime
                                                    })
@@ -1071,6 +1077,15 @@
         await _lifePayOrderRepository.UpdateAsync(order);
     }
 
+    /// <summary>
+    /// 寰俊閫�娆�
+    /// </summary>
+    /// <param name="outTradeNo"></param>
+    /// <param name="reason"></param>
+    /// <param name="refund"></param>
+    /// <param name="total"></param>
+    /// <param name="currency"></param>
+    /// <returns></returns>
     public async Task<WxPayDomesticRefundsReponse> WxPayDomesticRefunds(string outTradeNo, string reason, int refund, int total, string currency = "CNY")
     {
         WxPayDomesticRefundsRequest req = new WxPayDomesticRefundsRequest
@@ -1091,8 +1106,13 @@
         return res;
     }
 
+
+
     public async Task<int> AddUpdateUserAccount(AddUpdateUserAccountInput input)
     {
+        var user = await _lifePayUserRepository.Where(r => r.Id == input.UserId && !r.IsDeleted).FirstOrDefaultAsync();
+        CheckExtensions.IfTrueThrowUserFriendlyException(user == null, "鐢ㄦ埛涓嶅瓨鍦�");
+
         if (input.Id.HasValue)
         {
             var userAccount = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.Id == input.Id)
@@ -1130,6 +1150,16 @@
             await _lifePayAccount.InsertAsync(userAccount);
         }
 
+        if (input.LifePayType == LifePayOrderTypeEnum.璇濊垂璁㈠崟)
+        {
+            var extraProperties = JsonConvert.DeserializeObject<Model_UserAccountExtraProperties>(input.ExtraProperties);
+            if (!string.IsNullOrEmpty(extraProperties.Name))
+            {
+                user.Name = extraProperties.Name;
+            }
+        }
+
+
         return Constant.SUCCESS;
     }
 
diff --git a/LifePayment/LifePayment.Application/User/UserRoleService.cs b/LifePayment/LifePayment.Application/User/UserRoleService.cs
index 97fbd78..3a0aad5 100644
--- a/LifePayment/LifePayment.Application/User/UserRoleService.cs
+++ b/LifePayment/LifePayment.Application/User/UserRoleService.cs
@@ -53,10 +53,10 @@
                             Name = r.Name,
                         },
                 Channles = from uc in u.UserChannle
-                           from c in _channleRepository.Where(s => s.Id == uc.ChannleId)
+                           from c in _channleRepository.Where(s => s.ChannlesNum == uc.ChannleId)
                         select new UserChannleDto
                         {
-                            Id = c.Id,
+                            Id = c.ChannlesNum,
                             Name = c.ChannlesName,
                         },
                 Remark = u.Remark,
diff --git a/LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs b/LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs
index 1cbcb93..88a9193 100644
--- a/LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs
+++ b/LifePayment/LifePayment.Domain.Shared/WeChat/WxPayPostBaseModel.cs
@@ -772,4 +772,6 @@
         public int RefundFee { get; set; }
 
     }
+
+
 }
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs b/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs
index 407c6a0..7598a2f 100644
--- a/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs
+++ b/LifePayment/LifePayment.Domain/Ali/AlipayApiConstant.cs
@@ -17,7 +17,7 @@
         internal const string FundTransCommonQuery = "alipay.fund.trans.common.query";
         internal const string FundTransOrderChanged = "alipay.fund.trans.order.changed";
         internal const string FundTransPagePay = "alipay.fund.trans.page.pay";
-
+        internal const string TradeRefund = "alipay.trade.refund";
 
         //internal const string FundBatchUniTransfer = "alipay.fund.batch.uni.transfer";
         //internal const string FundBatchDetailQuery = "alipay.fund.batch.detail.query";
diff --git a/LifePayment/LifePayment.Domain/Common/UserChannle.cs b/LifePayment/LifePayment.Domain/Common/UserChannle.cs
index b4b9c3d..51ea304 100644
--- a/LifePayment/LifePayment.Domain/Common/UserChannle.cs
+++ b/LifePayment/LifePayment.Domain/Common/UserChannle.cs
@@ -13,7 +13,7 @@
         /// <summary>
         /// 娓犻亾Id
         /// </summary>
-        public virtual Guid ChannleId { get; set; }
+        public virtual string ChannleId { get; set; }
         public virtual User User { get; set; }
     }
 }
\ No newline at end of file
diff --git a/LifePayment/LifePayment.Domain/LifePay/LifePayUser.cs b/LifePayment/LifePayment.Domain/LifePay/LifePayUser.cs
index 5540d1f..21ed0f8 100644
--- a/LifePayment/LifePayment.Domain/LifePay/LifePayUser.cs
+++ b/LifePayment/LifePayment.Domain/LifePay/LifePayUser.cs
@@ -16,6 +16,11 @@
         public string PhoneNumber { get; set; }
 
         /// <summary>
+        /// 鍏呭�兼墜鏈哄彿瀵瑰簲鐨勬埛涓诲鍚�
+        /// </summary>
+        public string? Name { get; set; }
+
+        /// <summary>
         /// 灏忕▼搴廜penId
         /// </summary>
         public string OpenId { get; set; }
diff --git a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
index 8fbb84f..676a9e4 100644
--- a/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -110,7 +110,7 @@
             </summary>
             <returns></returns>
         </member>
-        <member name="M:LifePayment.HttpApi.LifePayController.GetUserPage(ZeroD.Util.PageInput)">
+        <member name="M:LifePayment.HttpApi.LifePayController.GetUserPage(LifePayment.Application.Contracts.QueryUserPageInput)">
             <summary>
             鑾峰彇鐢ㄦ埛鍒嗛〉鏁版嵁
             </summary>
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index cc63059..b3ef1b8 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -154,7 +154,7 @@
             <param name="orderNo"></param>
             <returns></returns>
         </member>
-        <member name="M:LifePayment.Application.Contracts.ILifePayService.GetUserPage(ZeroD.Util.PageInput)">
+        <member name="M:LifePayment.Application.Contracts.ILifePayService.GetUserPage(LifePayment.Application.Contracts.QueryUserPageInput)">
             <summary>
             鑾峰彇鐢ㄦ埛鍒嗛〉鏁版嵁
             </summary>
@@ -496,6 +496,16 @@
             澶囨敞
             </summary>
         </member>
+        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.QueryCondition">
+            <summary>
+            鎵嬫満鍙�/鐢ㄦ埛鍚�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.CreationTime">
+            <summary>
+            娉ㄥ唽鏃堕棿
+            </summary>
+        </member>
         <member name="P:LifePayment.Application.Contracts.LifePayIntroInfoInput.LifePayType">
             <summary>
             鐢熸椿缂磋垂绫诲瀷
@@ -564,6 +574,11 @@
         <member name="P:LifePayment.Application.Contracts.UserListOutput.PhoneNumber">
             <summary>
             鐢ㄦ埛鎵嬫満鍙�
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.UserListOutput.Name">
+            <summary>
+            濮撳悕
             </summary>
         </member>
         <member name="P:LifePayment.Application.Contracts.UserListOutput.CreationChannle">
@@ -1715,6 +1730,11 @@
             瑙掕壊
             </summary>
         </member>
+        <member name="P:LifePayment.Application.Contracts.CreateAccountInput.ChannlesId">
+            <summary>
+            娓犻亾鍒楄〃
+            </summary>
+        </member>
         <member name="P:LifePayment.Application.Contracts.CreateAccountInput.OpenId">
             <summary>
             灏忕▼搴廜penId
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
index 41d72d7..78fcb0a 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -164,7 +164,7 @@
         /// <param name="input"></param>
         /// <returns></returns>
         [HttpPost]
-        public async Task<PageOutput<UserListOutput>> GetUserPage(PageInput input)
+        public async Task<PageOutput<UserListOutput>> GetUserPage(QueryUserPageInput input)
         {
             return await _lifePayService.GetUserPage(input);
         }

--
Gitblit v1.9.1