소스 검색

cps增加title;
报表接口按照客户要求调整格式;

dodo hold 2 년 전
부모
커밋
a67a4235a7
4개의 변경된 파일212개의 추가작업 그리고 27개의 파일을 삭제
  1. 209 27
      molilian.core/Core/API/ApiReportCore.cs
  2. 1 0
      molilian.core/Core/cps/UnionCpsCore.cs
  3. 1 0
      molilian.core/DTO/cps/CpsPoolDTO.cs
  4. 1 0
      molilian.core/DTO/cps/UnionCpsDTO.cs

+ 209 - 27
molilian.core/Core/API/ApiReportCore.cs

@@ -46,6 +46,7 @@ namespace molilian.core
             //type可以不入参,留空就两个场景的数据都显示就行了
             //先只要成功的就行了,,到时候他们要明细再加就行了
 
+            int distributiontype = form.Read("distributiontype", 0);
             int data_type = form.Read("type", 0);
             var report_date = form.PathReadArray<string>("query_date[]");
 
@@ -63,7 +64,7 @@ namespace molilian.core
                 case 1:
                 case 2:
                     {
-                        var data = await DataTypeReportDailysAsync(data_type, stime, etime, clientIp, debug);
+                        var data = await DataTypeReportDailysAsync(distributiontype, data_type, stime, etime, clientIp, debug);
                         list.AddRange(data);
 
                     }
@@ -73,7 +74,7 @@ namespace molilian.core
                         int[] types = { 1, 2 };
                         foreach (var type in types)
                         {
-                            var data = await DataTypeReportDailysAsync(type, stime, etime, clientIp, debug);
+                            var data = await DataTypeReportDailysAsync(distributiontype, type, stime, etime, clientIp, debug);
                             list.AddRange(data);
                         }
                     }
@@ -82,7 +83,7 @@ namespace molilian.core
             return list;
         }
 
-        public static async Task<List<dynamic>> DataTypeReportDailysAsync(int data_type, DateTime stime, DateTime etime, string clientIp, bool debug = false)
+        public static async Task<List<dynamic>> DataTypeReportDailysAsync(int distributiontype, int data_type, DateTime stime, DateTime etime, string clientIp, bool debug = false)
         {
             string filter = "`is_show`=@is_show AND data_type=@data_type AND report_date>=@stime AND report_date<=@etime";
             string orderBy = "report_date DESC";
@@ -105,32 +106,213 @@ namespace molilian.core
                 }
             }
 
-            List<dynamic> data = list.Select(e => new
+            //List<dynamic> data = list.Select(e => new
+            //{
+            //    report_date = e.report_date.ToString("yyyy-MM-dd"),
+            //    type = e.data_type,
+            //    e.uclk_uv,
+            //    e.uclk_pv,
+            //    e.pay_ord_num,
+            //    e.order_ord_num,
+            //    e.pay_ord_amt,
+            //    e.pay_tk_disp_tfee,
+            //    e.pay_ord_uv,
+            //    e.eff_ord_num,
+            //    e.eff_ord_amt,
+            //    e.eff_tk_disp_tfee,
+            //    e.total_count,
+            //    //e.abandon_count,
+            //    e.success_count,
+            //    e.req_other_aff_num,
+            //    e.req_goods_num,
+            //    e.req_live_num,
+            //    e.req_video_num,
+            //    e.req_shop_num,
+            //    e.req_base_num,
+            //    e.req_note_num,
+            //    e.resp_deeplink_num
+            //}).ToList<dynamic>();
+
+
+
+            List<dynamic> data = list.SelectMany(e =>
             {
-                report_date = e.report_date.ToString("yyyy-MM-dd"),
-                type = e.data_type,
-                e.uclk_uv,
-                e.uclk_pv,
-                e.pay_ord_num,
-                e.order_ord_num,
-                e.pay_ord_amt,
-                e.pay_tk_disp_tfee,
-                e.pay_ord_uv,
-                e.eff_ord_num,
-                e.eff_ord_amt,
-                e.eff_tk_disp_tfee,
-                e.total_count,
-                //e.abandon_count,
-                e.success_count,
-                e.req_other_aff_num,
-                e.req_goods_num,
-                e.req_live_num,
-                e.req_video_num,
-                e.req_shop_num,
-                e.req_base_num,
-                e.req_note_num,
-                e.resp_deeplink_num
+                var results = new List<dynamic>();
+
+                if (distributiontype == 0 || distributiontype == 1) // 全分类或 goods
+                {
+                    results.Add(new
+                    {
+                        //metric_type = "req_goods_num",
+                        //metric_value = e.req_goods_num,
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_goods_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+                if (distributiontype == 0 || distributiontype == 2) // 全分类或 live
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_live_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+                if (distributiontype == 0 || distributiontype == 3) // 全分类或 video
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_video_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+                if (distributiontype == 0 || distributiontype == 4) // 全分类或 req_shop_num
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_shop_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+                if (distributiontype == 0 || distributiontype == 5) // 全分类或 req_base_num
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_base_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+
+                if (distributiontype == 0 || distributiontype == 6) // 全分类或 req_other_aff_num
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_other_aff_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+
+
+                if (distributiontype == 0 || distributiontype == 7) // 全分类或 req_note_num
+                {
+                    results.Add(new
+                    {
+                        report_date = e.report_date.ToString("yyyy-MM-dd"),
+                        type = e.data_type,
+                        e.uclk_uv,
+                        e.uclk_pv,
+                        e.pay_ord_num,
+                        e.order_ord_num,
+                        e.pay_ord_amt,
+                        e.pay_tk_disp_tfee,
+                        e.pay_ord_uv,
+                        e.eff_ord_num,
+                        e.eff_ord_amt,
+                        e.eff_tk_disp_tfee,
+                        e.total_count,
+                        e.success_count,
+                        e.req_note_num,
+                        e.resp_deeplink_num
+                    });
+                }
+
+
+                return results;
             }).ToList<dynamic>();
+
+            return data;
+
+
+
             return data;
         }
 

+ 1 - 0
molilian.core/Core/cps/UnionCpsCore.cs

@@ -98,6 +98,7 @@ namespace molilian.core
             result.token = account.token;
             result.category = account.category;
             result.pid = account.pid;
+            result.title = account.title;
             result.success = true;
             result.message = "OK";
 

+ 1 - 0
molilian.core/DTO/cps/CpsPoolDTO.cs

@@ -39,6 +39,7 @@ namespace molilian.core
         public DateTime end_time { get; set; }
         public int priority_weight { get; set; }
         public int time_range { get; set; }
+        public string title { get; set; } = string.Empty;
     }
 
 }

+ 1 - 0
molilian.core/DTO/cps/UnionCpsDTO.cs

@@ -36,5 +36,6 @@ namespace molilian.core
         public string end_point { get; set; } = string.Empty;
         public string category { get; set; } = string.Empty;
         public string pid { get; set; } = string.Empty;
+        public string title { get; set; } = string.Empty;
     }
 }