|
@@ -29,6 +29,11 @@ namespace molilian.api.Controllers
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 账号列表
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="form"></param>
|
|
|
|
|
+ /// <returns></returns>
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
public ActionResult list([FromBody] JsonElement form)
|
|
public ActionResult list([FromBody] JsonElement form)
|
|
|
{
|
|
{
|
|
@@ -95,6 +100,7 @@ namespace molilian.api.Controllers
|
|
|
foreach (var item in result.List)
|
|
foreach (var item in result.List)
|
|
|
{
|
|
{
|
|
|
item.current_amt = Math.Round(TkPoolCore.GetIncomeAmt(item.name), 2);
|
|
item.current_amt = Math.Round(TkPoolCore.GetIncomeAmt(item.name), 2);
|
|
|
|
|
+ item.cookies = string.Empty;
|
|
|
}
|
|
}
|
|
|
return new APIResult(new { data = result });
|
|
return new APIResult(new { data = result });
|
|
|
}
|
|
}
|
|
@@ -110,14 +116,9 @@ namespace molilian.api.Controllers
|
|
|
string order = form.Read<string>("order");
|
|
string order = form.Read<string>("order");
|
|
|
|
|
|
|
|
var report_date = form.PathReadArray<string>("query_date[]");
|
|
var report_date = form.PathReadArray<string>("query_date[]");
|
|
|
- var accountName = form.Read("accountName", string.Empty);
|
|
|
|
|
string dailys_accountName = "all";
|
|
string dailys_accountName = "all";
|
|
|
|
|
|
|
|
string filter = string.Empty;
|
|
string filter = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(accountName))
|
|
|
|
|
- {
|
|
|
|
|
- filter += $" AND A.accountName=@accountName";
|
|
|
|
|
- }
|
|
|
|
|
DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
|
|
DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
|
|
|
if (report_date.Count == 2)
|
|
if (report_date.Count == 2)
|
|
|
{
|
|
{
|
|
@@ -145,7 +146,7 @@ namespace molilian.api.Controllers
|
|
|
.LeftJoin("daily_logs",
|
|
.LeftJoin("daily_logs",
|
|
|
"B.log_date = A.report_date AND B.accountName=@dailys_accountName",
|
|
"B.log_date = A.report_date AND B.accountName=@dailys_accountName",
|
|
|
"total_count, B.abandon_count, B.success_count, B.abandon_percentage, B.success_percentage")
|
|
"total_count, B.abandon_count, B.success_count, B.abandon_percentage, B.success_percentage")
|
|
|
- .Where(filter, new { accountName, dailys_accountName, stime, etime })
|
|
|
|
|
|
|
+ .Where(filter, new { dailys_accountName, stime, etime })
|
|
|
.Page(size, page)
|
|
.Page(size, page)
|
|
|
.Order(orderBy)
|
|
.Order(orderBy)
|
|
|
.PageList<TkReportDTO>(getTotal);
|
|
.PageList<TkReportDTO>(getTotal);
|
|
@@ -396,5 +397,109 @@ namespace molilian.api.Controllers
|
|
|
// RedisHelper.IncrBy($":total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
|
|
// RedisHelper.IncrBy($":total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
|
|
|
//}
|
|
//}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [HttpPost]
|
|
|
|
|
+ public ActionResult settle_bills_total([FromBody] JsonElement form)
|
|
|
|
|
+ {
|
|
|
|
|
+ int page = form.Read("current", 1);
|
|
|
|
|
+ int size = form.Read("pageSize", 10);
|
|
|
|
|
+ bool getTotal = form.Read("getTotal", true);
|
|
|
|
|
+ string sort = form.Read<string>("sort");
|
|
|
|
|
+ string order = form.Read<string>("order");
|
|
|
|
|
+
|
|
|
|
|
+ var belongTime = form.PathReadArray<string>("query_date[]");
|
|
|
|
|
+
|
|
|
|
|
+ string filter = string.Empty;
|
|
|
|
|
+ DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
|
|
|
|
|
+ if (belongTime.Count == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (DateTime.TryParse(belongTime[0], out stime) && DateTime.TryParse(belongTime[1], out etime))
|
|
|
|
|
+ {
|
|
|
|
|
+ etime = etime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
+ filter += $" AND belongTime BETWEEN @stime AND @etime";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ filter = filter.StringTrimStart(" AND ");
|
|
|
|
|
+
|
|
|
|
|
+ //排序
|
|
|
|
|
+ string orderBy = "belongTime DESC";
|
|
|
|
|
+ if (!string.IsNullOrEmpty(order))
|
|
|
|
|
+ {
|
|
|
|
|
+ order = "descending".Equals(order) ? "DESC" : "ASC";
|
|
|
|
|
+ orderBy = sort switch
|
|
|
|
|
+ {
|
|
|
|
|
+ _ => $"{sort} {order}",
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ var result = new DBContext.Table("v_tk_report_bills")
|
|
|
|
|
+ .Where(filter, new { stime, etime })
|
|
|
|
|
+ .Page(size, page)
|
|
|
|
|
+ .Order(orderBy)
|
|
|
|
|
+ .PageList<TkSettleBillDTO>(getTotal);
|
|
|
|
|
+
|
|
|
|
|
+ return new APIResult(new { data = result });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [HttpPost]
|
|
|
|
|
+ public ActionResult settle_bills([FromBody] JsonElement form)
|
|
|
|
|
+ {
|
|
|
|
|
+ int page = form.Read("current", 1);
|
|
|
|
|
+ int size = form.Read("pageSize", 10);
|
|
|
|
|
+ bool getTotal = form.Read("getTotal", true);
|
|
|
|
|
+ string sort = form.Read<string>("sort");
|
|
|
|
|
+ string order = form.Read<string>("order");
|
|
|
|
|
+ string name = form.Read<string>("keyword");
|
|
|
|
|
+
|
|
|
|
|
+ var belongTime = form.PathReadArray<string>("query_date[]");
|
|
|
|
|
+
|
|
|
|
|
+ string filter = string.Empty;
|
|
|
|
|
+ if (!string.IsNullOrEmpty(name))
|
|
|
|
|
+ {
|
|
|
|
|
+ filter += $" AND accountId IN (SELECT ID FROM tk_pool WHERE company=@name)";
|
|
|
|
|
+ }
|
|
|
|
|
+ DateTime stime = DateTime.MinValue, etime = DateTime.MinValue;
|
|
|
|
|
+ if (belongTime.Count == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (DateTime.TryParse(belongTime[0], out stime) && DateTime.TryParse(belongTime[1], out etime))
|
|
|
|
|
+ {
|
|
|
|
|
+ etime = etime.AddDays(1).AddSeconds(-1);
|
|
|
|
|
+ filter += $" AND belongTime BETWEEN @stime AND @etime";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ filter = filter.StringTrimStart(" AND ");
|
|
|
|
|
+
|
|
|
|
|
+ //排序
|
|
|
|
|
+ string orderBy = "belongTime DESC";
|
|
|
|
|
+ if (!string.IsNullOrEmpty(order))
|
|
|
|
|
+ {
|
|
|
|
|
+ order = "descending".Equals(order) ? "DESC" : "ASC";
|
|
|
|
|
+ orderBy = sort switch
|
|
|
|
|
+ {
|
|
|
|
|
+ _ => $"{sort} {order}",
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var result = new DBContext.Table("tk_settle_bill")
|
|
|
|
|
+ .Where(filter, new { name, stime, etime })
|
|
|
|
|
+ .Page(size, page)
|
|
|
|
|
+ .Order(orderBy)
|
|
|
|
|
+ .PageList<TkSettleBillDTO>(getTotal);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //foreach (var item in result.List)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (string.IsNullOrEmpty(name))
|
|
|
|
|
+ // {
|
|
|
|
|
+ // item.accountName = "-";
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
|
|
+ return new APIResult(new { data = result });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|