|  | @@ -12,6 +12,7 @@ using ZhonTai.Admin.Core.Configs;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Core.Consts;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Core.Dto;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Domain.User;
 | 
	
		
			
				|  |  | +using ZhonTai.Admin.Repositories.KuaKe;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Repositories.Project;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Repositories.ProjectLink;
 | 
	
		
			
				|  |  |  using ZhonTai.Admin.Services.DiTuiAPI.Dto;
 | 
	
	
		
			
				|  | @@ -35,19 +36,23 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
 | 
	
		
			
				|  |  |          private ProjectPriceRepository _projectPriceRepository;
 | 
	
		
			
				|  |  |          private ProjectStatRepository _projectStatRepository;
 | 
	
		
			
				|  |  |          private ProjectConfigRepository _projectConfigRepository;
 | 
	
		
			
				|  |  | +        private KuaKeRepository _kuaKeRepository;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public ProjectsService(
 | 
	
		
			
				|  |  |              ProjectLinkRepository projectLinkRepository,
 | 
	
		
			
				|  |  |              ProjectRepository projectRepository,
 | 
	
		
			
				|  |  |              ProjectPriceRepository projectPriceRepository,
 | 
	
		
			
				|  |  |              ProjectStatRepository projectStatRepository,
 | 
	
		
			
				|  |  | -            ProjectConfigRepository projectConfigRepository)
 | 
	
		
			
				|  |  | +            ProjectConfigRepository projectConfigRepository,
 | 
	
		
			
				|  |  | +            KuaKeRepository kuaKeRepository
 | 
	
		
			
				|  |  | +            )
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              _ProjectLinkRepository = projectLinkRepository;
 | 
	
		
			
				|  |  |              _projectRepository = projectRepository;
 | 
	
		
			
				|  |  |              _projectPriceRepository = projectPriceRepository;
 | 
	
		
			
				|  |  |              _projectStatRepository = projectStatRepository;
 | 
	
		
			
				|  |  |              _projectConfigRepository = projectConfigRepository;
 | 
	
		
			
				|  |  | +            _kuaKeRepository = kuaKeRepository;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          /// <summary>
 | 
	
	
		
			
				|  | @@ -73,6 +78,17 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
 | 
	
		
			
				|  |  |                      ProjectName = ""
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            // 查询是否取过夸克类型项目
 | 
	
		
			
				|  |  | +            var kuaKeList = _kuaKeRepository.Select
 | 
	
		
			
				|  |  | +                .Where(m => m.CreatedUserId == User.Id)
 | 
	
		
			
				|  |  | +                .GroupBy(m => new { m.ProjectId })
 | 
	
		
			
				|  |  | +                .ToList(m => new ProjectLinkManagePageOutput()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    ProjectId = m.Key.ProjectId,
 | 
	
		
			
				|  |  | +                    Count = m.Count(),
 | 
	
		
			
				|  |  | +                    UseCount = m.Count(),
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              var priceList = await _projectConfigRepository.Select
 | 
	
		
			
				|  |  |                  .Where(m=> m.EffectDate < DateTime.Now)
 | 
	
		
			
				|  |  |                  .OrderByDescending(m => m.DrawAmount)
 | 
	
	
		
			
				|  | @@ -84,10 +100,10 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
 | 
	
		
			
				|  |  |                          ProjectPriceId = m.ProjectPriceId,
 | 
	
		
			
				|  |  |                          DrawAmount = m.DrawAmount,
 | 
	
		
			
				|  |  |                          EffectDate = m.EffectDate,
 | 
	
		
			
				|  |  | -                    }); 
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +                    });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            var listProjectId = linkList.Select(m => m.ProjectId).Distinct().ToList();
 | 
	
		
			
				|  |  | +            var linkResult = linkList.Union(kuaKeList);
 | 
	
		
			
				|  |  | +            var listProjectId = linkResult.Select(m => m.ProjectId).Distinct().ToList();
 | 
	
		
			
				|  |  |              var listProject = new List<MyProject>();
 | 
	
		
			
				|  |  |              if (listProjectId.Count() > 0)
 | 
	
		
			
				|  |  |              {
 | 
	
	
		
			
				|  | @@ -156,7 +172,7 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
 | 
	
		
			
				|  |  |              
 | 
	
		
			
				|  |  |              var result = await _projectRepository.Select.DisableGlobalFilter()
 | 
	
		
			
				|  |  |                  .Where(a => a.Id == id)
 | 
	
		
			
				|  |  | -                .FirstAsync(a => new ProjectDescOutput(a.Id,a.Logo,a.Name,"",a.SettleDay.ToString(),a.Tips,a.ProjectType));
 | 
	
		
			
				|  |  | +                .FirstAsync(a => new ProjectDescOutput(a.Id,a.Logo,a.Name,"", "T+"+a.SettleDay.ToString()+"结算",a.Tips,a.ProjectType));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var maxPrice = await _projectPriceRepository
 | 
	
		
			
				|  |  |                          .Select
 | 
	
	
		
			
				|  | @@ -313,26 +329,72 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  throw ResultOutput.Exception("项目 ID 不可为空");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            var projectType = await _projectRepository
 | 
	
		
			
				|  |  | +                .Select
 | 
	
		
			
				|  |  | +                .DisableGlobalFilter(FilterNames.Tenant)
 | 
	
		
			
				|  |  | +                .Where(a => a.Id == ProjectId)
 | 
	
		
			
				|  |  | +                .FirstAsync(a => new
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    ProjectType = a.ProjectType
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            var list = _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
 | 
	
		
			
				|  |  | -                .WhereIf(ProjectId.HasValue && ProjectId.Value > 0, a => a.ProjectId == ProjectId)
 | 
	
		
			
				|  |  | -                .WhereIf(Salesman.NotNull(), a => a.Salesman.Contains(Salesman))
 | 
	
		
			
				|  |  | -                .WhereIf(SalesmanPhone.NotNull(), a => a.SalesmanPhone.Contains(SalesmanPhone))
 | 
	
		
			
				|  |  | -                .Where(a=> a.IsUse == 1 && a.TenantId == User.TenantId)
 | 
	
		
			
				|  |  | -                .OrderByDescending(a => a.UseTime)
 | 
	
		
			
				|  |  | -            .Count(out var total)
 | 
	
		
			
				|  |  | -            .Page(input.CurrentPage, input.PageSize)
 | 
	
		
			
				|  |  | -            .ToList(m => new ProjectQrcodePageOutput()
 | 
	
		
			
				|  |  | +            // 1 正常项目  2 夸克项目
 | 
	
		
			
				|  |  | +            List<ProjectQrcodePageOutput> list = new List<ProjectQrcodePageOutput>();
 | 
	
		
			
				|  |  | +            long total = 0;
 | 
	
		
			
				|  |  | +            if(projectType.ProjectType == 1)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                Id = m.Id,
 | 
	
		
			
				|  |  | -                Salesman = m.Salesman,
 | 
	
		
			
				|  |  | -                UseTime = m.UseTime,
 | 
	
		
			
				|  |  | -                ShortUrl = m.ShortUrl,
 | 
	
		
			
				|  |  | -                Num = m.Num,
 | 
	
		
			
				|  |  | -                ShareCommond = m.ShareCommand,
 | 
	
		
			
				|  |  | -                QrcodeUrl = m.QrcodeUrl,
 | 
	
		
			
				|  |  | -                QueryUrl = m.QueryUrl
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | +                  list = _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
 | 
	
		
			
				|  |  | +                    .WhereIf(ProjectId.HasValue && ProjectId.Value > 0, a => a.ProjectId == ProjectId)
 | 
	
		
			
				|  |  | +                    .WhereIf(Salesman.NotNull(), a => a.Salesman.Contains(Salesman))
 | 
	
		
			
				|  |  | +                    .WhereIf(SalesmanPhone.NotNull(), a => a.SalesmanPhone.Contains(SalesmanPhone))
 | 
	
		
			
				|  |  | +                    .Where(a => a.IsUse == 1 && a.TenantId == User.TenantId)
 | 
	
		
			
				|  |  | +                    .OrderByDescending(a => a.UseTime)
 | 
	
		
			
				|  |  | +                .Count(out total)
 | 
	
		
			
				|  |  | +                .Page(input.CurrentPage, input.PageSize)
 | 
	
		
			
				|  |  | +                .ToList(m => new ProjectQrcodePageOutput()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    Id = m.Id,
 | 
	
		
			
				|  |  | +                    Salesman = m.Salesman,
 | 
	
		
			
				|  |  | +                    UseTime = m.UseTime,
 | 
	
		
			
				|  |  | +                    ShortUrl = m.ShortUrl,
 | 
	
		
			
				|  |  | +                    Num = m.Num,
 | 
	
		
			
				|  |  | +                    ShareCommond = m.ShareCommand,
 | 
	
		
			
				|  |  | +                    QrcodeUrl = m.QrcodeUrl,
 | 
	
		
			
				|  |  | +                    QueryUrl = m.QueryUrl
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                string kuaKeStatus = null;
 | 
	
		
			
				|  |  | +                kuaKeStatus = input.Filter?.KuaKeStatus == "0"? null : input.Filter?.KuaKeStatus;
 | 
	
		
			
				|  |  | +                list = _kuaKeRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
 | 
	
		
			
				|  |  | +                //list = _ProjectLinkRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
 | 
	
		
			
				|  |  | +                    .WhereIf(ProjectId.HasValue && ProjectId.Value > 0, a => a.ProjectId == ProjectId)
 | 
	
		
			
				|  |  | +                    .WhereIf(Salesman.NotNull(), a => a.Name.Contains(Salesman))
 | 
	
		
			
				|  |  | +                    .WhereIf(SalesmanPhone.NotNull(), a => a.Phone.Contains(SalesmanPhone))
 | 
	
		
			
				|  |  | +                    .WhereIf(kuaKeStatus.NotNull(), a => a.Status.ToString().Contains(kuaKeStatus))
 | 
	
		
			
				|  |  | +                    .Where(a => a.TenantId == User.TenantId)
 | 
	
		
			
				|  |  | +                    .OrderByDescending(a => a.CreatedTime)
 | 
	
		
			
				|  |  | +                .Count(out total)
 | 
	
		
			
				|  |  | +                .Page(input.CurrentPage, input.PageSize)
 | 
	
		
			
				|  |  | +                .ToList(m => new ProjectQrcodePageOutput()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    Id = m.Id,
 | 
	
		
			
				|  |  | +                    Salesman = m.Name,
 | 
	
		
			
				|  |  | +                    UseTime = m.CreatedTime,
 | 
	
		
			
				|  |  | +                    ShortUrl = "",
 | 
	
		
			
				|  |  | +                    Num = "",
 | 
	
		
			
				|  |  | +                    ShareCommond = "",
 | 
	
		
			
				|  |  | +                    QrcodeUrl = "",
 | 
	
		
			
				|  |  | +                    QueryUrl = "",
 | 
	
		
			
				|  |  | +                    KuaKeStatus = m.Status.ToString(),
 | 
	
		
			
				|  |  | +                    KuaKeStatusColor = m.Status.ToString(),
 | 
	
		
			
				|  |  | +                    Industry = m.Industry,
 | 
	
		
			
				|  |  | +                    Platform = m.Platfrom
 | 
	
		
			
				|  |  | +                }); ;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var data = new PageOutput<ProjectQrcodePageOutput>()
 | 
	
		
			
				|  |  |              {
 |