Commit 2ce6b9c6 by 泽锋 李

新增离线下载页面

parent aa648c14
...@@ -669,6 +669,44 @@ where 1=1 "; ...@@ -669,6 +669,44 @@ where 1=1 ";
return obj.AsList(); return obj.AsList();
} }
public static List<dc_task_download> TaskDownloadList(string user_name, string task_name, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date)
{
var sql = @"select t1.* from dc_task_download as t1
where 1=1 ";
var countSql = " select count(1) from dc_task_download as t1 where 1=1 ";
DynamicParameters parameters = new DynamicParameters();
if (start_date != null)
{
sql += " and t1.create_date>=@btime ";
countSql += " and t1.create_date>=@btime ";
parameters.Add("btime", start_date);
}
if (end_date != null)
{
sql += " and t1.create_date<=@etime ";
countSql += " and t1.create_date<=@etime ";
parameters.Add("etime", end_date);
}
if (!string.IsNullOrWhiteSpace(user_name))
{
sql += " and t1.create_user like @user_name ";
countSql += " and t1.create_user like @user_names ";
parameters.Add("user_name", $"%{user_name}%");
}
if (!string.IsNullOrWhiteSpace(task_name))
{
sql += " and t1.task_name like @task_name ";
countSql += " and t1.task_name like @task_name ";
parameters.Add("task_name", $"%{task_name}%");
}
sql += " order by t1.id desc ";
total = _connection.QueryFirst<int>(countSql, parameters, commandTimeout: 0);
sql += " limit " + offset + "," + limit;
var obj = _connection.Query<dc_task_download>(sql, parameters, buffered: false, commandTimeout: 0);
return obj.AsList();
}
public static string MapField(string sort) public static string MapField(string sort)
{ {
sort = sort.Replace("-", ""); sort = sort.Replace("-", "");
......
...@@ -53,6 +53,11 @@ namespace AutoTurnOver.Services ...@@ -53,6 +53,11 @@ namespace AutoTurnOver.Services
{ {
return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date, warehousecode, warehousetype, warehousearea); return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date, warehousecode, warehousetype, warehousearea);
} }
public List<dc_task_download> TaskDownloadList(string user_name, string task_name, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date)
{
return DB.daily.TaskDownloadList(user_name, task_name, offset, limit,ref total, start_date, end_date);
}
public MemoryStream ExportShortagePush(string platform, string bailun_sku, DateTime? start_date, DateTime? end_date, UserData user, string warehousecode, string warehousetype, int? warehousearea) public MemoryStream ExportShortagePush(string platform, string bailun_sku, DateTime? start_date, DateTime? end_date, UserData user, string warehousecode, string warehousetype, int? warehousearea)
{ {
......
...@@ -133,6 +133,38 @@ namespace AutoTurnOver.Controllers ...@@ -133,6 +133,38 @@ namespace AutoTurnOver.Controllers
}); });
} }
} }
/// <summary>
/// 缺货推送记录
/// </summary>
/// <param name="platform"></param>
/// <param name="bailun_sku"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="total"></param>
/// <returns></returns>
[BrowseLog("Bailun_aims", "访问【百伦自动周转系统】->【离线下载】->【搜索】页面", 0)]
public JsonResult TaskDownloadList(string user_name, string task_name, int offset, int limit, DateTime? start_date, DateTime? end_date)
{
try
{
var services = new DailyServices();
var total = 0;
var list = services.TaskDownloadList(user_name, task_name, offset, limit, ref total, start_date, end_date);
return new JsonResult(new
{
rows = list,
total = total,
});
}
catch (Exception ex)
{
return new JsonResult(new
{
message = ex.Message,
stack_trace = ex.StackTrace
});
}
}
public FileResult ExportShortagePush(string platform, string bailun_sku, DateTime? end_date, DateTime? start_date, string warehousecode, string warehousetype, int? warehousearea) public FileResult ExportShortagePush(string platform, string bailun_sku, DateTime? end_date, DateTime? start_date, string warehousecode, string warehousetype, int? warehousearea)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment