Merge branch 'master' of http://120.26.58.240:8888/r/LifePaymentApi
| | |
| | | /// </summary> |
| | | public string PhoneNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 最后登录渠道 |
| | | /// </summary> |
| | | public string? CreationChannle { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 最后登录渠道 |
| | | /// </summary> |
| | | public string? LastLoginChannle { get; set; } |
| | | |
| | | public DateTime? LastLoginTime { get; set; } |
| | | |
| | | public DateTime? CreationTime { get; set; } |
| | |
| | | public string[] RoleNames { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 渠道列表 |
| | | /// </summary> |
| | | public Guid[] ChannlesId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 组织架构公司id |
| | | /// </summary> |
| | | public Guid? CompanyOrgId { get; set; } |
| | |
| | | /// </summary> |
| | | public IEnumerable<RoleDto> Roles { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 角色信息 |
| | | /// </summary> |
| | | public IEnumerable<UserChannleDto> Channles { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | |
| | | public string Remark { get; set; } |
| | | } |
| | | |
| | | public class UserChannleDto |
| | | { |
| | | /// <summary> |
| | | /// 渠道Id |
| | | /// </summary> |
| | | public Guid Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 渠道名 |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | } |
| | | |
| | | public class GetRolesInput : PageInput |
| | | { |
| | | /// <summary> |
| | |
| | | public string[] RoleNames { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 渠道列表 |
| | | /// </summary> |
| | | public Guid[] ChannlesId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 小程序OpenId |
| | | /// </summary> |
| | | public string OpenId { get; set; } |
| | |
| | | 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, |
| | | CreationTime = x.CreationTime, |
| | | LastLoginTime = x.LastLoginTime |
| | |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.Extensions.Configuration; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp; |
| | |
| | | private readonly IConfiguration _configuration; |
| | | private readonly IIdentityModelAuthenticationService _authenticator; |
| | | private readonly IRepository<User, Guid> _userRepository; |
| | | private readonly IRepository<UserChannle, Guid> _userChannleRep; |
| | | private readonly IIdentityUserAppService _identityUserService; |
| | | |
| | | public AccountService( |
| | |
| | | IIdentityModelAuthenticationService authenticator, |
| | | IRepository<User, Guid> userRepository, |
| | | IIdentityUserAppService identityUserService, |
| | | IRepository<LifePayUser, Guid> lifePayUserRepository) |
| | | IRepository<LifePayUser, Guid> lifePayUserRepository, |
| | | IRepository<UserChannle, Guid> userChannleRep) |
| | | { |
| | | _configuration = configuration; |
| | | _wxManager = wxManager; |
| | |
| | | _lifePayUserRepository = lifePayUserRepository; |
| | | _authenticator = authenticator; |
| | | _userRepository = userRepository; |
| | | _userChannleRep = userChannleRep; |
| | | } |
| | | |
| | | #region 查询 |
| | |
| | | lifeUser = new LifePayUser() |
| | | { |
| | | Id = GuidGenerator.Create(), |
| | | CreationChannleNum = input.CheckChannelId, |
| | | PhoneNumber = input.PhoneNumber, |
| | | LastLoginTime = DateTime.Now |
| | | }; |
| | |
| | | } |
| | | else |
| | | { |
| | | lifeUser.LastLoginChannleNum = input.CheckChannelId; |
| | | lifeUser.LastLoginTime = DateTime.Now; |
| | | await _lifePayUserRepository.UpdateAsync(lifeUser); |
| | | } |
| | |
| | | DepartmentOrgId = input.ClientId == LifePaymentConstant.ClientId.Back ? input.DepartmentOrgId : null, |
| | | CompanyOrgId = input.ClientId == LifePaymentConstant.ClientId.Back ? input.CompanyOrgId : null |
| | | }); |
| | | |
| | | List<UserChannle> userChannles = new List<UserChannle>(); |
| | | foreach (var item in input.ChannlesId) |
| | | { |
| | | userChannles.Add(new UserChannle() |
| | | { |
| | | Id = Guid.NewGuid(), |
| | | ChannleId = item, |
| | | UserId = user.Id |
| | | }); |
| | | } |
| | | |
| | | await _userChannleRep.InsertManyAsync(userChannles); |
| | | //if (input.ClientId == Constant.ClientType.Back) |
| | | //{ |
| | | // await _distributedEventBus.PublishAsync(new SendPhoneMessageInput |
| | |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.Models; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System; |
| | |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Services; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Z.EntityFramework.Plus; |
| | | using ZeroD.Util; |
| | | |
| | | namespace HumanResourcesServices.Application |
| | |
| | | { |
| | | private readonly IRepository<User, Guid> _userRepository; |
| | | private readonly IRepository<Role, Guid> _roleRepository; |
| | | private readonly IRepository<LifePayChannles, Guid> _channleRepository; |
| | | private readonly IRepository<UserRole, Guid> _userRoleRep; |
| | | private readonly IRepository<UserChannle, Guid> _userChannleRep; |
| | | |
| | | public UserRoleService( |
| | | IRepository<User, Guid> userRepository, |
| | | IRepository<Role, Guid> roleRepository, |
| | | IRepository<UserRole, Guid> userRoleRep) |
| | | IRepository<LifePayChannles, Guid> channleRepository, |
| | | IRepository<UserRole, Guid> userRoleRep, |
| | | IRepository<UserChannle, Guid> userChannleRep) |
| | | { |
| | | _userRepository = userRepository; |
| | | _roleRepository = roleRepository; |
| | | _channleRepository = channleRepository; |
| | | _userRoleRep = userRoleRep; |
| | | _userChannleRep = userChannleRep; |
| | | } |
| | | |
| | | public async Task<PageOutput<UserDto>> GetBackClientUsers(GetBackClientUsersInput input) |
| | | { |
| | | var query = _userRepository.Where(s => s.ClientId == Constant.ClientType.Back).Include(i => i.UserRoles).Select(u => new UserDto |
| | | var query = _userRepository.Where(s => s.ClientId == Constant.ClientType.Back).Include(i => i.UserRoles).Include(i => i.UserChannle).Select(u => new UserDto |
| | | { |
| | | Id = u.Id, |
| | | UserName = u.UserName, |
| | |
| | | { |
| | | Id = r.Id, |
| | | Name = r.Name, |
| | | }, |
| | | Channles = from uc in u.UserChannle |
| | | from c in _channleRepository.Where(s => s.Id == uc.ChannleId) |
| | | select new UserChannleDto |
| | | { |
| | | Id = c.Id, |
| | | Name = c.ChannlesName, |
| | | }, |
| | | Remark = u.Remark, |
| | | CompanyOrgId = u.CompanyOrgId, |
| | |
| | | entity.Remark = input.Remark; |
| | | entity.DepartmentOrgId = input.DepartmentOrgId; |
| | | entity.CompanyOrgId = input.CompanyOrgId; |
| | | |
| | | var userchannle = await _userChannleRep.Where(s => s.UserId == input.Id).DeleteAsync(); |
| | | List<UserChannle> userChannles = new List<UserChannle>(); |
| | | foreach (var item in input.ChannlesId) |
| | | { |
| | | userChannles.Add(new UserChannle() |
| | | { |
| | | Id = Guid.NewGuid(), |
| | | ChannleId = item, |
| | | UserId = entity.Id |
| | | }); |
| | | } |
| | | |
| | | await _userChannleRep.InsertManyAsync(userChannles); |
| | | |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
New file |
| | |
| | | using LifePayment.Domain.Models; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.Auditing; |
| | | using Volo.Abp.DependencyInjection; |
| | | using Volo.Abp.Domain.Entities; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Volo.Abp.Users; |
| | | |
| | | namespace LifePayment.Domain.Common |
| | | { |
| | | public abstract class AbstractChannelFilter |
| | | { |
| | | public abstract Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query); |
| | | |
| | | |
| | | public IAbpLazyServiceProvider LazyServiceProvider { get; set; } |
| | | protected ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>(); |
| | | |
| | | protected IRepository<UserChannle> UserChannleRepository => LazyServiceProvider.LazyGetRequiredService<IRepository<UserChannle>>(); |
| | | } |
| | | } |
New file |
| | |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.Models; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Services; |
| | | using Volo.Abp.Domain.Entities; |
| | | using Volo.Abp.Domain.Repositories; |
| | | using Z.EntityFramework.Plus; |
| | | using ZeroD.Util; |
| | | |
| | | namespace LifePayment.Domain.Common |
| | | { |
| | | public class ChannelFilter : AbstractChannelFilter |
| | | { |
| | | public async override Task<IQueryable<ChannelsBase>> GetChannelFilter(IQueryable<ChannelsBase> query) |
| | | { |
| | | var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList(); |
| | | var queryResult = query.Where(s => queryUser.Contains(s.ChannleId)); |
| | | return queryResult; |
| | | } |
| | | } |
| | | |
| | | public class ChannelsBase : Entity<Guid> |
| | | { |
| | | public Guid ChannleId { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using DynamicQuery.Net.Dto.Input; |
| | | using DynamicQuery.Net; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using ZeroD.Application.Services.Dto; |
| | | using Volo.Abp.Users; |
| | | using Volo.Abp.Auditing; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace LifePayment.Domain |
| | | { |
| | | public interface IChannelFilter |
| | | { |
| | | |
| | | public Task<IQueryable<TEntity>> GetChannelFilter<TEntity, TKey>(IQueryable<TEntity> query) |
| | | where TEntity : class, IChannelData, IMayHaveCreator, IEntity<TKey>; |
| | | //public static IQueryable<T> GetChannleQuery<T>(this IQueryable<T> query, ChannelFilterInput input) where T : class, IChannelData |
| | | //{ |
| | | // if (query == null) |
| | | // { |
| | | // return query; |
| | | // } |
| | | // if (input.Channels != null && input.Channels.Any()) |
| | | // { |
| | | // query = query.Where(r => input.Channels.Contains(r.ChannelId)); |
| | | // } |
| | | // return query; |
| | | //} |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public interface IChannelData |
| | | { |
| | | public Guid ChannleId { get; set; } |
| | | } |
| | | |
| | | public class ChannelFilterInput |
| | | { |
| | | public List<Guid> Channels { get; set; } = new List<Guid>(); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | public User() |
| | | { |
| | | |
| | | UserRoles = new HashSet<UserRole>(); |
| | | |
| | | UserChannle = new HashSet<UserChannle>(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public Guid? IndustrialParkId { get; set; } |
| | | |
| | | |
| | | |
| | | public ICollection<UserRole> UserRoles { get; set; } |
| | | |
| | | |
| | | public ICollection<UserChannle> UserChannle { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using Volo.Abp.Domain.Entities; |
| | | |
| | | namespace LifePayment.Domain.Models |
| | | { |
| | | public class UserChannle : Entity<Guid> |
| | | { |
| | | /// <summary> |
| | | /// 用户Id |
| | | /// </summary> |
| | | public Guid UserId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 渠道Id |
| | | /// </summary> |
| | | public Guid ChannleId { get; set; } |
| | | public virtual User User { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string OpenId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 注册渠道编号 |
| | | /// </summary> |
| | | public string? CreationChannleNum { get; set; } |
| | | |
| | | public string UnionId { get; set; } |
| | | |
| | | public DateTime? LastLoginTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 最后登录渠道编号 |
| | | /// </summary> |
| | | public string? LastLoginChannleNum { get; set; } |
| | | } |
| | | } |
| | |
| | | |
| | | public virtual DbSet<UserRole> UserRoles { get; set; } |
| | | |
| | | public virtual DbSet<UserChannle> UserChannle { get; set; } |
| | | |
| | | public virtual DbSet<OperateHistory> OperateHistory { get; set; } |
| | | |
| | | public virtual DbSet<LifePayChannles> LifePayChannles { get; set; } |
| | |
| | | cacheOptions.KeyPrefix = "LifePaymentServices_"; |
| | | cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20); |
| | | }); |
| | | this.Configure<OssSettings>(configuration.GetSection("ossSettings")); |
| | | this.Configure<ACOOLYOption>(configuration.GetSection("ACOOLY")); |
| | | this.Configure<Config>("AliPayEcsign", configuration.GetSection("AliPayEcsign")); |
| | | this.Configure<InformationOption>(configuration.GetSection("WeiXinCgi")); |
| | |
| | | 用户手机号 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserListOutput.CreationChannle"> |
| | | <summary> |
| | | 最后登录渠道 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserListOutput.LastLoginChannle"> |
| | | <summary> |
| | | 最后登录渠道 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.LifePayOrderListOutput.PhoneNumber"> |
| | | <summary> |
| | | 用户手机号 |
| | |
| | | 角色 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.CreateBackClientUserInput.ChannlesId"> |
| | | <summary> |
| | | 渠道列表 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.CreateBackClientUserInput.CompanyOrgId"> |
| | | <summary> |
| | | 组织架构公司id |
| | |
| | | 角色信息 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserDto.Channles"> |
| | | <summary> |
| | | 角色信息 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserDto.Remark"> |
| | | <summary> |
| | | 备注 |
| | |
| | | 备注 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserChannleDto.Id"> |
| | | <summary> |
| | | 渠道Id |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.UserChannleDto.Name"> |
| | | <summary> |
| | | 渠道名 |
| | | </summary> |
| | | </member> |
| | | <member name="P:LifePayment.Application.Contracts.GetRolesInput.QueryCondition"> |
| | | <summary> |
| | | 查询条件:角色名称 |