2 Commits d4e3374690 ... 6fe0872fca

Author SHA1 Message Date
  lifa 6fe0872fca 我的项目接口 新增 是否参与过夸克类型项目 判断 并返回相关项目详情 1 year ago
  lifa f01651d065 项目详情-推广码接口 新增 夸克类型项目返回参数 1 year ago

+ 5 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/ProjectQrcodePageInput.cs

@@ -16,6 +16,11 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
         /// 关键词(姓名或手机号)
         /// </summary>
         public string Keywords { get; set; }
+
+        /// <summary>
+        /// 夸克类型状态 0 全部 1未报备 2 报备中 3 报备成功 4报备失败
+        /// </summary>
+        public string? KuaKeStatus { get; set; }
         ///// <summary>
         ///// 手机号
         ///// </summary>

+ 75 - 5
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/ProjectQrcodePageOutput.cs

@@ -24,25 +24,95 @@ namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
         /// <summary>
         ///  二维码编号
         /// </summary>
-        public string Num { get; set; }
+        public string Num { get; set; } = "";
 
         /// <summary>
         /// 短链
         /// </summary>
-        public string ShortUrl { get; set; }
+        public string ShortUrl { get; set; } = "";
 
         /// <summary>
         /// 口令
         /// </summary>
-        public string ShareCommond { get; set; }
+        public string ShareCommond { get; set; } = "";
 
         /// <summary>
         /// 二维码URL
         /// </summary>
-        public string QrcodeUrl { get; set; }
+        public string QrcodeUrl { get; set; } = "";
         /// <summary>
         /// 查单链接(订单明细)
         /// </summary>
-        public string QueryUrl { get; set; }
+        public string QueryUrl { get; set; } = "";
+
+        /// <summary>
+        /// 夸克ID
+        /// </summary>
+        public string? KuaKeId { get; set; } = "";
+
+        /// <summary>
+        /// 行业
+        /// </summary>
+        public string? Industry { get; set; } = "";
+
+        /// <summary>
+        /// 推广平台
+        /// </summary>
+        public string? Platform { get; set; } = "";
+
+        /// <summary>
+        /// 夸克类型 状态文字
+        /// </summary>
+        private string? kuaKeStatus;
+        public string? KuaKeStatus
+        {
+            get
+            {
+                switch (kuaKeStatus)
+                {
+                    case "1":
+                        return "报备中";
+                        break;
+                    case "2":
+                        return "报备成功";
+                        break;
+                    case "3":
+                        return "报备失败";
+                        break;
+                    default:
+                        return "";
+                        break;
+
+                }
+            }
+            set { kuaKeStatus = value; }
+        }
+
+        /// <summary>
+        /// 夸克类型 字体颜色 报备中#FA6400    报备成功#00C855     报备失败#F54033
+        /// </summary>
+        public string? KuaKeStatusColor
+        {
+            get
+            {
+                switch (kuaKeStatus)
+                {
+                    case "1":
+                        return "#FA6400";
+                        break;
+                    case "2":
+                        return "#00C855";
+                        break;
+                    case "3":
+                        return "#F54033";
+                        break;
+                    default:
+                        return "";
+                        break;
+
+                }
+            }
+            set { kuaKeStatus = value; }
+        }
     }
 }

+ 85 - 23
src/platform/ZhonTai.Admin/Services/DiTuiAPI/ProjectsService.cs

@@ -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>()
             {

+ 40 - 0
src/platform/ZhonTai.Admin/ZhonTai.Admin.xml

@@ -2620,6 +2620,11 @@
             状态 1未报备 2报备成功 3报备失败
              </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Domain.KuaKe.KuaKeEntity.ProjectId">
+            <summary>
+            项目Id
+            </summary>        
+        </member>
         <member name="P:ZhonTai.Admin.Domain.LogGetPageDto.CreatedUserName">
             <summary>
             创建者
@@ -6063,6 +6068,11 @@
             关键词(姓名或手机号)
             </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageInput.KuaKeStatus">
+            <summary>
+            夸克类型状态 0 全部 1未报备 2 报备中 3 报备成功 4报备失败
+            </summary>
+        </member>
         <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.Id">
             <summary>
             ID
@@ -6103,6 +6113,31 @@
             查单链接(订单明细)
             </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.KuaKeId">
+            <summary>
+            夸克ID
+            </summary>
+        </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.Industry">
+            <summary>
+            行业
+            </summary>
+        </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.Platform">
+            <summary>
+            推广平台
+            </summary>
+        </member>
+        <member name="F:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.kuaKeStatus">
+            <summary>
+            夸克类型 状态文字
+            </summary>
+        </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.ProjectQrcodePageOutput.KuaKeStatusColor">
+            <summary>
+            夸克类型 字体颜色 报备中#FA6400    报备成功#00C855     报备失败#F54033
+            </summary>
+        </member>
         <member name="P:ZhonTai.Admin.Services.DiTuiAPI.Dto.QrcodeSettleInput.ProjectId">
             <summary>
             项目ID
@@ -6277,6 +6312,11 @@
             行业
             </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Services.DiTuiAPI.KuaKe.Dto.KuaKeInput.ProjectId">
+            <summary>
+            项目Id
+            </summary>
+        </member>
         <member name="P:ZhonTai.Admin.Services.DiTuiAPI.KuaKe.Dto.KuaKeInput.KuaKeID">
             <summary>
             夸克Id