|
@@ -239,10 +239,11 @@ namespace molilian.api.Controllers
|
|
|
|
|
|
|
|
if (item.tool_total_count == 0)
|
|
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;
|
|
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)
|
|
if (item.tool_total_count > 0)
|
|
|
{
|
|
{
|
|
|
item.tool_success_percentage = $"{item.tool_success_count / (double)item.tool_total_count * 100:f2}%";
|
|
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)
|
|
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;
|
|
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)
|
|
if (item.tool_total_count > 0)
|
|
|
{
|
|
{
|
|
@@ -519,12 +520,110 @@ namespace molilian.api.Controllers
|
|
|
var isHourtrend = form.Read<bool>("isLeaf", false);
|
|
var isHourtrend = form.Read<bool>("isLeaf", false);
|
|
|
var total_key = form.Read("total_key", "total");
|
|
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 (string.IsNullOrEmpty(accountName)) accountName = "tb";
|
|
|
- //if (total_key == "tool_total")
|
|
|
|
|
- //{
|
|
|
|
|
- // accountName = "tool";
|
|
|
|
|
- // total_key = "parse_total";
|
|
|
|
|
- //}
|
|
|
|
|
|
|
|
|
|
DateTime stime = DateTime.MinValue;
|
|
DateTime stime = DateTime.MinValue;
|
|
|
if (!DateTime.TryParse(report_date[0], out stime)) return new APIResult(new { data = result, data2 = reason_result });
|
|
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)
|
|
if (total > 0)
|
|
|
{
|
|
{
|
|
|
string[] keys = ["success"];
|
|
string[] keys = ["success"];
|
|
|
- //if (accountName == "tool")
|
|
|
|
|
- //{
|
|
|
|
|
- // keys = ["success", "bdpan", "wemeet"];
|
|
|
|
|
- //}
|
|
|
|
|
|
|
|
|
|
cacheKey = $":{total_key}:{accountName}:message:{_report_date}";
|
|
cacheKey = $":{total_key}:{accountName}:message:{_report_date}";
|
|
|
string[] message_keys = TkLogCore.GetTotalKeys(cacheKey);
|
|
string[] message_keys = TkLogCore.GetTotalKeys(cacheKey);
|
|
@@ -552,11 +647,6 @@ namespace molilian.api.Controllers
|
|
|
foreach (var keyname in combinedKeys)
|
|
foreach (var keyname in combinedKeys)
|
|
|
{
|
|
{
|
|
|
cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
|
|
cacheKey = $":{total_key}:{accountName}:{keyname}:{_report_date}";
|
|
|
- //if (accountName == "tool")
|
|
|
|
|
- //{
|
|
|
|
|
- // cacheKey = $":{total_key}:{keyname}:{_report_date}";
|
|
|
|
|
- //}
|
|
|
|
|
-
|
|
|
|
|
int value = TkLogCore.GetTotal(cacheKey);
|
|
int value = TkLogCore.GetTotal(cacheKey);
|
|
|
if (value == 0) continue;
|
|
if (value == 0) continue;
|
|
|
result.Add(new { name = keyname, value, increases = Math.Round(value / total * 100, 2) });
|
|
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 });
|
|
return new APIResult(new { total, data = result, data2 = reason_result });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
public ActionResult settle_bills_total([FromBody] JsonElement form)
|
|
public ActionResult settle_bills_total([FromBody] JsonElement form)
|
|
|
{
|
|
{
|