LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1175,6 +1175,23 @@ public string Name { get; set; } public string ChannlesNum { get; set; } public Guid ChannlesId { get; set; } } public class BackClientUserInfoOutput { /// <summary> /// 是否是后台用户 /// </summary> public bool IsBackClientUser { get; set; } public bool IsSystem { get; set; } /// <summary> /// 渠道号 /// </summary> public List<ChannelOutput> ChannleList { get; set; } } public class LifePayExpensesReceiptsListOutput LifePayment/LifePayment.Application.Contracts/User/IAccountService.cs
@@ -34,7 +34,7 @@ Task<Guid> CreateAccount(CreateAccountInput input, bool isSend = false, bool isAdminCreate = false); Task<List<ChannelOutput>> GetUserChannel(); Task<BackClientUserInfoOutput> GetBackClientUserInfo(); #endregion } } LifePayment/LifePayment.Application/User/AccountService.cs
@@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Services; @@ -93,25 +94,24 @@ return result; } public async Task<List<ChannelOutput>> GetUserChannel() public async Task<BackClientUserInfoOutput> GetBackClientUserInfo() { var userchannel = await _userChannleRep.Where(x => x.UserId == CurrentUser.Id) .Select(s => new ChannelOutput() { Name = _lifePayChannlesRepository.Where(x => x.ChannlesNum == s.ChannleId).Select(r => r.ChannlesName).FirstOrDefault(), ChannlesNum = s.ChannleId }).ToListAsync(); if (userchannel.Count() == 0) { userchannel = await _lifePayChannlesRepository .Select(s => new ChannelOutput() { Name = s.ChannlesName, ChannlesNum = s.ChannlesNum }).ToListAsync(); } var channlesNums = await _userChannleRep.Where(x => x.UserId == CurrentUser.Id).Select(s => s.ChannleId).Distinct().ToListAsync(); return userchannel; var channleList = await _lifePayChannlesRepository.Where(x => channlesNums.Contains(x.ChannlesNum)).Select(s => new ChannelOutput() { Name = s.ChannlesName, ChannlesId = s.Id, ChannlesNum = s.ChannlesNum }).ToListAsync(); BackClientUserInfoOutput result = new BackClientUserInfoOutput() { IsBackClientUser = CurrentUser.ClientId == Constant.ClientType.Back, IsSystem = CurrentUser.IsSystem, ChannleList = channleList }; return result; } LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -534,9 +534,9 @@ <param name="id">角色Id</param> <returns></returns> </member> <member name="M:LifePayment.HttpApi.UserRoleController.GetUserChannel"> <member name="M:LifePayment.HttpApi.UserRoleController.GetBackClientUserInfo"> <summary> 获取用户渠道 获取用户账号详情 </summary> <returns></returns> </member> LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1761,6 +1761,16 @@ 渠道号 </summary> </member> <member name="P:LifePayment.Application.Contracts.BackClientUserInfoOutput.IsBackClientUser"> <summary> 是否是后台用户 </summary> </member> <member name="P:LifePayment.Application.Contracts.BackClientUserInfoOutput.ChannleList"> <summary> 渠道号 </summary> </member> <member name="P:LifePayment.Application.Contracts.LifePayExpensesReceiptsListOutput.Id"> <summary> 编号 LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
@@ -202,13 +202,13 @@ } /// <summary> /// 获取用户渠道 /// 获取用户账号详情 /// </summary> /// <returns></returns> [HttpGet] public async Task<List<ChannelOutput>> GetUserChannel() public async Task<BackClientUserInfoOutput> GetBackClientUserInfo() { return await _accountService.GetUserChannel(); return await _accountService.GetBackClientUserInfo(); } } }