Commit f612a905 by 泽锋 李

库存监控,新增时间范围筛选

parent 9d76f4f1
......@@ -34,6 +34,15 @@ where 1=1 ";
DynamicParameters parameters = new DynamicParameters();
if (search != null)
{
if (search.start_date != null)
{
sql += " and t1.push_time>=@start_date ";
parameters.Add("start_date", search.start_date.Value.ToString("yyyy-MM-dd 00:00:00"));
}if (search.end_date != null)
{
sql += " and t1.push_time<=@end_date ";
parameters.Add("end_date", search.start_date.Value.ToString("yyyy-MM-dd 23:59:59"));
}
if (search.bailun_sku != null)
{
sql += " and t1.bailun_sku=@bailun_sku ";
......
......@@ -250,5 +250,7 @@ namespace AutoTurnOver.Models
public int? type { get; set; }
public string bailun_sku { get; set; }
public DateTime? end_date { get; set; }
public DateTime? start_date { get; set; }
}
}
......@@ -191,13 +191,14 @@ namespace AutoTurnOver.Controllers
/// </summary>
/// <returns></returns>
[UseAction]
public JsonResult StockMonitorList(int? type, string bailun_sku,int offset, int limit, string order, string sort)
public JsonResult StockMonitorList(int? type, string bailun_sku,int offset, int limit, string order, string sort,
DateTime? end_date, DateTime? start_date)
{
try
{
var services = new StockMonitorService();
var page_data = services.GetPage(new dc_auto_stock_monitor_search_dto { type = type, bailun_sku =bailun_sku,page= offset+1,rows = limit,sidx = sort, sord = order });
var page_data = services.GetPage(new dc_auto_stock_monitor_search_dto { type = type, bailun_sku =bailun_sku,page= offset+1,rows = limit,sidx = sort, sord = order,start_date = start_date,end_date = end_date });
return new JsonResult(new
{
......@@ -224,10 +225,11 @@ namespace AutoTurnOver.Controllers
/// <param name="warehousecode"></param>
/// <returns></returns>
[UseAction]
public FileResult ExportStockMonitor(int? type, string bailun_sku)
public FileResult ExportStockMonitor(int? type, string bailun_sku,
DateTime? end_date, DateTime? start_date)
{
var user = AutoUtility.GetUser();
var memory = new StockMonitorService().Export(user, new dc_auto_stock_monitor_search_dto { type = type, bailun_sku = bailun_sku, page = 1, rows = int.MaxValue});
var memory = new StockMonitorService().Export(user, new dc_auto_stock_monitor_search_dto { type = type, bailun_sku = bailun_sku, page = 1, rows = int.MaxValue, start_date = start_date, end_date = end_date });
return File(memory, "text/csv", $"{user.UserAccount}库存监控.csv");
}
}
......
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