|
@@ -6,7 +6,10 @@ using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using ZhonTai.Admin.Core.Attributes;
|
|
|
using ZhonTai.Admin.Core.Consts;
|
|
|
+using ZhonTai.Admin.Core.Dto;
|
|
|
+using ZhonTai.Admin.Repositories.ProjectLink;
|
|
|
using ZhonTai.Admin.Services.DiTuiAPI.Dto;
|
|
|
+using ZhonTai.Admin.Services.ProjectLink.Dto;
|
|
|
using ZhonTai.DynamicApi;
|
|
|
using ZhonTai.DynamicApi.Attributes;
|
|
|
|
|
@@ -19,6 +22,11 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
|
|
|
//public class DiTuiAPIService : BaseService, IDiTuiAPIService, IDynamicApi
|
|
|
public class ProjectsService : BaseService, IProjectsService, IDynamicApi
|
|
|
{
|
|
|
+ private ProjectLinkRepository _ProjectLinkRepository;
|
|
|
+ public ProjectsService(ProjectLinkRepository projectLinkRepository)
|
|
|
+ {
|
|
|
+ _ProjectLinkRepository = projectLinkRepository;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 我的项目
|
|
@@ -97,5 +105,98 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
|
|
|
return projectSpecOutput;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 项目推广码
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="input"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<PageOutput<ProjectQrcodePageOutput>> ProjectQrcodePageAsync(PageInput<ProjectQrcodePageInput> input)
|
|
|
+ {
|
|
|
+ var Salesman = input.Filter?.Salesman;
|
|
|
+ var SalesmanPhone = input.Filter?.SalesmanPhone;
|
|
|
+ var ProjectId = input.Filter?.ProjectId;
|
|
|
+
|
|
|
+ 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))
|
|
|
+ .Count(out var total)
|
|
|
+ .Page(input.CurrentPage, input.PageSize)
|
|
|
+ .ToList(m => new ProjectQrcodePageOutput()
|
|
|
+ {
|
|
|
+ Id = m.Id,
|
|
|
+ Salesman = m.Salesman,
|
|
|
+ UseTime = m.UseTime,
|
|
|
+ QrcodeUrl = m.QrcodeUrl,
|
|
|
+ QueryUrl = m.QueryUrl
|
|
|
+ });
|
|
|
+
|
|
|
+ var data = new PageOutput<ProjectQrcodePageOutput>()
|
|
|
+ {
|
|
|
+ List = list,
|
|
|
+ Total = total
|
|
|
+ };
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 项目统计
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="input"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<PageOutput<ProjectCountPageOutput>> ProjectCountPageAsync(PageInput<ProjectCountPageInput> input)
|
|
|
+ {
|
|
|
+ var ProjectId = input.Filter?.ProjectId;
|
|
|
+
|
|
|
+ //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))
|
|
|
+ //.Count(out var total)
|
|
|
+ //.Page(input.CurrentPage, input.PageSize)
|
|
|
+ //.ToList(m => new ProjectQrcodePageOutput()
|
|
|
+ //{
|
|
|
+ // Id = m.Id,
|
|
|
+ // Salesman = m.Salesman,
|
|
|
+ // UseTime = m.UseTime,
|
|
|
+ // QrcodeUrl = m.QrcodeUrl,
|
|
|
+ // QueryUrl = m.QueryUrl
|
|
|
+ //});
|
|
|
+
|
|
|
+ List<ProjectCountPageOutput> list = new List<ProjectCountPageOutput>();
|
|
|
+ List<SettleCount> settleCounts = new List<SettleCount>();
|
|
|
+ settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ settleCounts.Add(new SettleCount("电商首购B级", "201/300单", "201元"));
|
|
|
+ settleCounts.Add(new SettleCount("电商首购C级", "202/300单", "202元"));
|
|
|
+ settleCounts.Add(new SettleCount("今日汇总", "603/900单", "603元"));
|
|
|
+
|
|
|
+ //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ list.Add(new ProjectCountPageOutput(416237348180038, "2023-05-02", settleCounts));
|
|
|
+
|
|
|
+ List<SettleCount> settleCounts1 = new List<SettleCount>();
|
|
|
+ settleCounts1.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ settleCounts1.Add(new SettleCount("电商首购B级", "199/300单", "199元"));
|
|
|
+ settleCounts1.Add(new SettleCount("电商首购C级", "198/300单", "198元"));
|
|
|
+ settleCounts1.Add(new SettleCount("今日汇总", "597/900单", "597元"));
|
|
|
+
|
|
|
+ //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ //settleCounts.Add(new SettleCount("电商首购A级", "200/300单", "200元"));
|
|
|
+ list.Add(new ProjectCountPageOutput(416237348180038, "2023-05-01", settleCounts1));
|
|
|
+
|
|
|
+ var total = list.Count;
|
|
|
+
|
|
|
+
|
|
|
+ var data = new PageOutput<ProjectCountPageOutput>()
|
|
|
+ {
|
|
|
+ List = list,
|
|
|
+ Total = total
|
|
|
+ };
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|
|
|
}
|