From 4aad201a4468477a2353b1999b1af77971b432ee Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期三, 19 三月 2025 16:28:21 +0800
Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/LifePaymentApi

---
 LifePayment/LifePayment.Application/LifePay/LifePayService.cs |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayService.cs
index 3e317b6..0e4a39c 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;
 
@@ -171,15 +173,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
                                                    })
@@ -566,7 +572,7 @@
             PayAmount = amount.PayAmont,
             DiscountAmount = amount.DiscountAmount,
             RechargeAmount = amount.RechargeAmount,
-            ChannelId = channle.Id
+            ChannelId = channle.ChannlesNum
         };
 
         await CreateLifePayOrder(orderInput);
@@ -610,7 +616,7 @@
             PayAmount = amount.PayAmont,
             DiscountAmount = amount.DiscountAmount,
             RechargeAmount = amount.RechargeAmount,
-            ChannelId = channle.Id
+            ChannelId = channle.ChannlesNum
         };
 
         await CreateLifePayOrder(orderInput);
@@ -654,7 +660,7 @@
             PayAmount = amount.PayAmont,
             DiscountAmount = amount.DiscountAmount,
             RechargeAmount = amount.RechargeAmount,
-            ChannelId = channle.Id
+            ChannelId = channle.ChannlesNum
         };
 
         await CreateLifePayOrder(orderInput);
@@ -1074,6 +1080,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
@@ -1094,8 +1109,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)
@@ -1133,6 +1153,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;
     }
 

--
Gitblit v1.9.1