Commit 996e432f by 泽锋 李

回货记录,加一个仓库筛选

parent fa9835a7
......@@ -542,15 +542,34 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
/// 缺货推送记录
/// </summary>
/// <returns></returns>
public static List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform,string bailun_sku, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date)
public static List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform,string bailun_sku, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date, string warehousecode, string warehousetype, int? warehousearea)
{
var sql = @"select t1.id, t1.platform, t1.bailun_sku,t3.warehouse_name, t1.warehouse_code, t1.push_date,t2.push_time from dc_auto_shortage_push as t1
left join dc_return_goods_push as t2 on t1.id =t2.shortage_push_id
left join dc_base_warehouse as t3 on t1.warehouse_code = t3.warehouse_code
where 1=1 ";
var countSql = " select count(1) from dc_auto_shortage_push as t1 where 1=1 ";
var countSql = " select count(1) from dc_auto_shortage_push as t1 left join dc_base_warehouse as t3 on t1.warehouse_code = t3.warehouse_code where 1=1 ";
DynamicParameters parameters = new DynamicParameters();
if (!string.IsNullOrWhiteSpace(warehousecode))
{
sql += " and t1.warehouse_code=@warehouse_code ";
countSql += " and t1.warehouse_code=@warehouse_code ";
parameters.Add("warehouse_code", warehousecode);
}
if (!string.IsNullOrWhiteSpace(warehousetype))
{
sql += " and t3.hq_type = @hq_type ";
countSql += " and t3.hq_type = @hq_type ";
parameters.Add("hq_type", warehousetype);
}
if (warehousearea > 0)
{
sql += " and t3.area_id = @area_id ";
countSql += " and t3.area_id = @area_id ";
parameters.Add("area_id", warehousearea);
}
if (start_date != null)
{
sql += " and t1.push_date>=@btime ";
......
......@@ -50,12 +50,12 @@ namespace AutoTurnOver.Services
return DB.daily.RealtimeList(monitor_status, searchType, key_words, warehouse_code, supplier_name, offset, limit, ref total,warehousetype,warehousearea, isSum, order, sort, has_tort:has_tort, categoryModels: categoryModels, buyer_name:buyer_name, start_date: start_date, end_date: end_date, f_start_date: f_start_date, f_end_date: f_end_date, product_type: product_type);
}
public List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform, string bailun_sku, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date)
public List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform, string bailun_sku, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date, string warehousecode, string warehousetype, int? warehousearea)
{
return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date);
return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date, warehousecode, warehousetype, warehousearea);
}
public MemoryStream ExportShortagePush(string platform, string bailun_sku, DateTime? start_date, DateTime? end_date, UserData user)
public MemoryStream ExportShortagePush(string platform, string bailun_sku, DateTime? start_date, DateTime? end_date, UserData user, string warehousecode, string warehousetype, int? warehousearea)
{
try
{
......@@ -66,7 +66,7 @@ namespace AutoTurnOver.Services
while (true)
{
int total = 0;
var list = ShortagePushList(platform, bailun_sku, page, rows, ref total, start_date, end_date);
var list = ShortagePushList(platform, bailun_sku, page, rows, ref total, start_date, end_date, warehousecode, warehousetype, warehousearea);
if (list == null || list.Count <= 0) break;
......
......@@ -108,13 +108,13 @@ namespace AutoTurnOver.Controllers
/// <param name="limit"></param>
/// <param name="total"></param>
/// <returns></returns>
public JsonResult ShortagePushList(string platform, string bailun_sku, int offset, int limit, DateTime? end_date, DateTime? start_date)
public JsonResult ShortagePushList(string platform, string bailun_sku, int offset, int limit, DateTime? end_date, DateTime? start_date, string warehousecode, string warehousetype, int? warehousearea)
{
try
{
var services = new DailyServices();
var total = 0;
var list = services.ShortagePushList(platform, bailun_sku, offset, limit, ref total, start_date,end_date);
var list = services.ShortagePushList(platform, bailun_sku, offset, limit, ref total, start_date,end_date,warehousecode, warehousetype, warehousearea);
return new JsonResult(new
{
rows = list,
......@@ -131,10 +131,10 @@ namespace AutoTurnOver.Controllers
}
}
public FileResult ExportShortagePush(string platform, string bailun_sku, DateTime? end_date, DateTime? start_date)
public FileResult ExportShortagePush(string platform, string bailun_sku, DateTime? end_date, DateTime? start_date, string warehousecode, string warehousetype, int? warehousearea)
{
var user = AutoUtility.GetUser();
var memory = new DailyServices().ExportShortagePush(platform, bailun_sku, start_date, end_date, AutoUtility.GetUser());
var memory = new DailyServices().ExportShortagePush(platform, bailun_sku, start_date, end_date, AutoUtility.GetUser(), warehousecode, warehousetype, warehousearea);
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