Quellcode durchsuchen

fix bug;
临时屏蔽域名bmlxkyy.com

dodo hold vor 2 Jahren
Ursprung
Commit
915aaee908

+ 112 - 20
molilian.api/Controllers/admin/TaobaoController.cs

@@ -239,10 +239,11 @@ namespace molilian.api.Controllers
 
                 if (item.tool_total_count == 0)
                 {
-                    item.tool_total_count = TkLogCore.GetTotal($":tool_total:tb:{item.report_date:yyyyMMdd}");
+                    item.tool_total_count = TkLogCore.GetTotal($":parse_total:tool:{item.report_date:yyyyMMdd}");
                     if (item.tool_total_count == 0) continue;
-                    item.tool_success_count = TkLogCore.GetTotal($":tool_total:tb:success:{item.report_date:yyyyMMdd}");
-                    item.tool_abandon_count = TkLogCore.GetTotal($":tool_total:tb:放弃转链:{item.report_date:yyyyMMdd}");
+                    item.tool_success_count = TkLogCore.GetTotal($":parse_total:tool:success:{item.report_date:yyyyMMdd}");
+                    item.tool_abandon_count = TkLogCore.GetTotal($":parse_total:tool:放弃转链:{item.report_date:yyyyMMdd}");
+
                     if (item.tool_total_count > 0)
                     {
                         item.tool_success_percentage = $"{item.tool_success_count / (double)item.tool_total_count * 100:f2}%";
@@ -368,10 +369,10 @@ namespace molilian.api.Controllers
 
                 if (item.tool_total_count == 0)
                 {
-                    item.tool_total_count = TkLogCore.GetTotal($":tool_total:{accountName}:{item.report_date:yyyyMMdd}");
+                    item.tool_total_count = TkLogCore.GetTotal($":parse_total:tool:{item.report_date:yyyyMMdd}");
                     if (item.tool_total_count == 0) continue;
-                    item.tool_success_count = TkLogCore.GetTotal($":tool_total:{accountName}:success:{item.report_date:yyyyMMdd}");
-                    item.tool_abandon_count = TkLogCore.GetTotal($":tool_total:{accountName}:放弃转链:{item.report_date:yyyyMMdd}");
+                    item.tool_success_count = TkLogCore.GetTotal($":parse_total:tool:success:{item.report_date:yyyyMMdd}");
+                    item.tool_abandon_count = TkLogCore.GetTotal($":parse_total:tool:放弃转链:{item.report_date:yyyyMMdd}");
 
                     if (item.tool_total_count > 0)
                     {
@@ -519,12 +520,110 @@ namespace molilian.api.Controllers
             var isHourtrend = form.Read<bool>("isLeaf", false);
             var total_key = form.Read("total_key", "total");
 
+            DateTime stime = DateTime.MinValue;
+            if (!DateTime.TryParse(report_date[0], out stime)) return new APIResult(new { data = result, data2 = reason_result });
+
+            string _report_date = stime.ToString("yyyyMMdd");
+            if (isHourtrend) _report_date = stime.ToString("yyyyMMddHH");
+
+
+
+            if (string.IsNullOrEmpty(accountName)) accountName = "tb";
+            if (total_key == "tool_total")
+            {
+                accountName = "tool";
+                total_key = "parse_total";
+
+                string cacheKey = $":{total_key}:{accountName}:{_report_date}";
+                double total = TkLogCore.GetTotal(cacheKey);
+                if (total > 0)
+                {
+                    string[] keys = ["bdpan", "wemeet"];
+
+                    foreach (var keyname in keys)
+                    {
+                        //                    string[] keys = ["bdpan:success", "bdpan:fail", "wemeet:success", "wemeet:fail"];
+
+                        cacheKey = $":{total_key}:{keyname}:{_report_date}";
+                        total = TkLogCore.GetTotal(cacheKey);
+
+                        cacheKey = $":{total_key}:{keyname}:success:{_report_date}";
+                        int value = TkLogCore.GetTotal(cacheKey);
+                        if (value == 0) continue;
+                        result.Add(new { name = $"{keyname}-成功", value, increases = Math.Round(value / total * 100, 2) });
+
+
+                        cacheKey = $":{total_key}:{keyname}:fail:{_report_date}";
+                        value = TkLogCore.GetTotal(cacheKey);
+                        if (value == 0) continue;
+                        result.Add(new { name = $"{keyname}-失败", value, increases = Math.Round(value / total * 100, 2) });
+                    }
+
+                    cacheKey = $":{total_key}:{accountName}:reason:{_report_date}";
+                    string[] reason_keys = TkLogCore.GetTotalKeys(cacheKey);
+
+                    foreach (var keyname in reason_keys)
+                    {
+                        cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
+                        int value = TkLogCore.GetTotal(cacheKey);
+                        if (value == 0) continue;
+                        reason_result.Add(new { name = keyname, value, increases = Math.Round(value / total * 100, 2) });
+                    }
+                    reason_result = reason_result.OrderByDescending(item => item.value).ToList();
+                }
+                return new APIResult(new { total, data = result, data2 = reason_result });
+            }
+            else
+            {
+                string cacheKey = $":{total_key}:{accountName}:{_report_date}";
+                double total = TkLogCore.GetTotal(cacheKey);
+                if (total > 0)
+                {
+                    string[] keys = ["success"];
+
+                    cacheKey = $":{total_key}:{accountName}:message:{_report_date}";
+                    string[] message_keys = TkLogCore.GetTotalKeys(cacheKey);
+
+                    var combinedKeys = keys.Union(message_keys).ToList();
+                    combinedKeys.RemoveAll(item => item == "fail");
+
+                    foreach (var keyname in combinedKeys)
+                    {
+                        cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
+                        int value = TkLogCore.GetTotal(cacheKey);
+                        if (value == 0) continue;
+                        result.Add(new { name = keyname, value, increases = Math.Round(value / total * 100, 2) });
+                    }
+                    result = result.OrderByDescending(item => item.value).ToList();
+
+                    cacheKey = $":{total_key}:{accountName}:reason:{_report_date}";
+                    string[] reason_keys = TkLogCore.GetTotalKeys(cacheKey);
+
+                    foreach (var keyname in reason_keys)
+                    {
+                        cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
+                        int value = TkLogCore.GetTotal(cacheKey);
+                        if (value < 50) continue;
+                        reason_result.Add(new { name = keyname, value, increases = Math.Round(value / total * 100, 2) });
+                    }
+                    reason_result = reason_result.OrderByDescending(item => item.value).ToList();
+                }
+                return new APIResult(new { total, data = result, data2 = reason_result });
+            }
+        }
+
+        [HttpPost]
+        public ActionResult chartData2([FromBody] JsonElement form)
+        {
+            var result = new List<dynamic>();
+            var reason_result = new List<dynamic>();
+
+            var report_date = form.PathReadArray<string>("query_date[]");
+            var accountName = form.Read("accountName", string.Empty);
+            var isHourtrend = form.Read<bool>("isLeaf", false);
+            var total_key = form.Read("total_key", "total");
+
             if (string.IsNullOrEmpty(accountName)) accountName = "tb";
-            //if (total_key == "tool_total")
-            //{
-            //    accountName = "tool";
-            //    total_key = "parse_total";
-            //}
 
             DateTime stime = DateTime.MinValue;
             if (!DateTime.TryParse(report_date[0], out stime)) return new APIResult(new { data = result, data2 = reason_result });
@@ -537,10 +636,6 @@ namespace molilian.api.Controllers
             if (total > 0)
             {
                 string[] keys = ["success"];
-                //if (accountName == "tool")
-                //{
-                //    keys = ["success", "bdpan", "wemeet"];
-                //}
 
                 cacheKey = $":{total_key}:{accountName}:message:{_report_date}";
                 string[] message_keys = TkLogCore.GetTotalKeys(cacheKey);
@@ -552,11 +647,6 @@ namespace molilian.api.Controllers
                 foreach (var keyname in combinedKeys)
                 {
                     cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
-                    //if (accountName == "tool")
-                    //{
-                    //    cacheKey = $":{total_key}:{keyname}:{_report_date}";
-                    //}
-
                     int value = TkLogCore.GetTotal(cacheKey);
                     if (value == 0) continue;
                     result.Add(new { name = keyname, value, increases = Math.Round(value / total * 100, 2) });
@@ -578,6 +668,8 @@ namespace molilian.api.Controllers
             return new APIResult(new { total, data = result, data2 = reason_result });
         }
 
+
+
         [HttpPost]
         public ActionResult settle_bills_total([FromBody] JsonElement form)
         {

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 29 - 1
molilian.core/Core/taoke/UnionParseCore.cs

@@ -167,17 +167,28 @@ namespace molilian.core
                 }
 
 
+
+
                 //============================== 放弃转链-初步筛选 ==============================
                 bool is_ignore = AlimamaPlus.FirstFilterIgnoreRequest(content, out reason);
 
                 if (string.IsNullOrEmpty(result.shortLinkurl) && is_ignore)
                 {
+
                     //没有短链接都放弃
                     result.success = false;
                     result.message = "放弃转链";
                     result.itemName = "点击打开淘宝APP";
                     result.reason = "初步筛选";
                     _ = TkLogCore.ParseLogAsync(result);
+
+                    //0621 临时增加
+                    if (content.Contains("bmlxkyy.com"))
+                    {
+                        result.itemName = "";
+                        result.deeplink_url = "";
+                    }
+
                     return TaobaoParseOutput(result, swData, new
                     {
                         result.success,
@@ -331,6 +342,24 @@ namespace molilian.core
                     }, APIResultCodeEnum.NotAcceptable);
                 }
 
+
+                if (!string.IsNullOrEmpty(result.shortLinkurl) && result.shortLinkurl.Contains("bmlxkyy.com"))
+                {
+                    result.success = false;
+                    result.message = "放弃转链";
+                    result.itemName = "点击打开淘宝APP";
+                    result.reason = "初步筛选";
+                    _ = TkLogCore.ParseLogAsync(result);
+                    return TaobaoParseOutput(result, swData, new
+                    {
+                        result.success,
+                        result.message,
+                        result.content,
+                        result.itemName,
+                        result.deeplink_url,
+                    });
+                }
+
                 stopwatch.Reset();
                 stopwatch.Start();
                 string reason = string.Empty;
@@ -535,7 +564,6 @@ namespace molilian.core
                         result.deeplink_url,
                     }, APIResultCodeEnum.NotAcceptable);
                 }
-                string reason = string.Empty;
                 if (string.IsNullOrEmpty(result.shortLinkurl) && AlimamaPlus.FirstFilterIgnoreRequest(content, out reason))
                 {
                     //没有短链接都放弃

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.