| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Services; |
| | | using Volo.Abp.AutoMapper; |
| | | using Volo.Abp.Domain.Repositories; |
| | |
| | | ApplyCount = it.ApplyCount, |
| | | Remark = it.Remark, |
| | | }); |
| | | if (input.StartDate.HasValue) |
| | | { |
| | | query = query.Where(s => s.CreationTime >= input.StartDate); |
| | | } |
| | | |
| | | if (input.EndDate.HasValue) |
| | | { |
| | | query = query.Where(s => s.CreationTime <= input.EndDate); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(input.SearchKey)) |
| | | { |
| | | query = query.Where(s => |
| | | s.IdNumber.Contains(input.SearchKey) |
| | | || s.PhoneNumber.Contains(input.SearchKey) |
| | | || s.Name.Contains(input.SearchKey)); |
| | | } |
| | | |
| | | var result = await query.GetPageResult(input.PageModel); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取推广员信息 |
| | | /// </summary> |
| | | /// <param name="phoneNumber"></param> |
| | | /// <returns></returns> |
| | | public async Task<PromoterDto> GetPromoter(string phoneNumber) |
| | | { |
| | | return await lifePayPromoterRepository |
| | | .Where(it => it.PhoneNumber == phoneNumber) |
| | | .Select(it => new PromoterDto |
| | | { |
| | | Id = it.Id, |
| | | CreationTime = it.CreationTime, |
| | | IdNumber = it.IdNumber, |
| | | Name = it.Name, |
| | | PhoneNumber = it.PhoneNumber, |
| | | ClickCount = it.ClickCount, |
| | | ApplyCount = it.ApplyCount, |
| | | Remark = it.Remark, |
| | | }) |
| | | .FirstOrDefaultAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取渠道咨询Id |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="FriendlyException"></exception> |
| | | public async Task<ChannelConsultationDto> GetChannelConsultationById(Guid id) |
| | | { |
| | | var query = from cc in lifePayChannelConsultationRepository |
| | | join p in lifePayPromoterRepository on cc.PromoterId equals p.Id into pg |
| | | from pgd in pg.DefaultIfEmpty() |
| | | select new ChannelConsultationDto |
| | | { |
| | | Id = cc.Id, |
| | | CreationTime = cc.CreationTime, |
| | | Name = cc.Name, |
| | | AgentType = cc.AgentType, |
| | | PhoneNumber = cc.PhoneNumber, |
| | | CompanyName = cc.CompanyName, |
| | | CustomerResources = cc.CustomerResources, |
| | | PromoterIdNumber = pgd.IdNumber, |
| | | PromoterName = pgd.Name, |
| | | PromoterPhoneNumber = pgd.PhoneNumber, |
| | | FollowupStatus = cc.FollowupStatus, |
| | | LastFollowupTime = cc.LastFollowupTime, |
| | | FollowupRemark = cc.FollowupRemark, |
| | | }; |
| | | return await query.FirstOrDefaultAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取渠道咨询回访记录 |
| | | /// </summary> |
| | | /// <param name="id">渠道咨询Id</param> |