|  |  | 
 |  |  | using LifePayment.Application.Contracts; | 
 |  |  | using LifePayment.Domain; | 
 |  |  | using LifePayment.Domain.Models; | 
 |  |  | using LifePayment.Domain.Shared; | 
 |  |  | using Microsoft.EntityFrameworkCore; | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | 
 |  |  | using Volo.Abp; | 
 |  |  | using Volo.Abp.Application.Services; | 
 |  |  | using Volo.Abp.Domain.Repositories; | 
 |  |  | using Volo.Abp.Identity; | 
 |  |  | using Z.EntityFramework.Plus; | 
 |  |  | using ZeroD.Util; | 
 |  |  | using static LifePayment.Domain.Shared.LifePaymentConstant; | 
 |  |  |  | 
 |  |  | namespace HumanResourcesServices.Application | 
 |  |  | { | 
 |  |  | 
 |  |  |         private readonly IRepository<LifePayChannles, Guid> _channleRepository; | 
 |  |  |         private readonly IRepository<UserRole, Guid> _userRoleRep; | 
 |  |  |         private readonly IRepository<UserChannle, Guid> _userChannleRep; | 
 |  |  |         private readonly IIdentityUserAppService _identityUserService; | 
 |  |  |  | 
 |  |  |         public UserRoleService( | 
 |  |  |                IRepository<User, Guid> userRepository, | 
 |  |  |                IRepository<Role, Guid> roleRepository, | 
 |  |  |                IRepository<LifePayChannles, Guid> channleRepository, | 
 |  |  |                IRepository<UserRole, Guid> userRoleRep, | 
 |  |  |                IRepository<UserChannle, Guid> userChannleRep) | 
 |  |  |                IRepository<UserChannle, Guid> userChannleRep, | 
 |  |  |                IIdentityUserAppService identityUserService) | 
 |  |  |         { | 
 |  |  |             _userRepository = userRepository; | 
 |  |  |             _roleRepository = roleRepository; | 
 |  |  |             _channleRepository = channleRepository; | 
 |  |  |             _userRoleRep = userRoleRep; | 
 |  |  |             _userChannleRep = userChannleRep; | 
 |  |  |             _identityUserService = identityUserService; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public async Task<PageOutput<UserDto>> GetBackClientUsers(GetBackClientUsersInput input) | 
 |  |  | 
 |  |  |             return Constant.SUCCESS; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 重置密码 | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="input"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         public async Task ResetPassword(ResetPasswordBaseInput input) | 
 |  |  |         { | 
 |  |  |             var user = await _userRepository.FirstOrDefaultAsync(x => x.Id == input.UserId); | 
 |  |  |             CheckExtensions.IfTrueThrowUserFriendlyException(user == null, CustomeErrorMessage.IsNoExistUser); | 
 |  |  |             CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrEmpty(input.Password), "请输入密码"); | 
 |  |  |             var identiResetInput = new ResetPassWordInput | 
 |  |  |             { | 
 |  |  |                 UserId = input.UserId, | 
 |  |  |                 Name = user.Name, | 
 |  |  |                 UserName = user.UserName, | 
 |  |  |                 Password = input.Password, | 
 |  |  |                 PhoneNumber = user.PhoneNumber | 
 |  |  |             }; | 
 |  |  |             var result = await _identityUserService.ResetPassword(identiResetInput); | 
 |  |  |             CheckExtensions.IfTrueThrowUserFriendlyException(result != Constant.SUCCESS, | 
 |  |  |                                                              CustomeErrorMessage.ResetPasswordFail); | 
 |  |  |         } | 
 |  |  |         public async Task<int> DeleteBackClientUser(Guid id) | 
 |  |  |         { | 
 |  |  |             var entity = await _userRepository.FirstOrDefaultAsync(s => s.Id == id && s.ClientId == Constant.ClientType.Back); |