Commit dcb3df55 by lizefeng

异常缺货明细,过滤掉fba的

parent 9dc79b73
...@@ -199,7 +199,7 @@ WHERE ...@@ -199,7 +199,7 @@ WHERE
/// <param name="sku">sku</param> /// <param name="sku">sku</param>
/// <param name="warehouse_code">仓库编码</param> /// <param name="warehouse_code">仓库编码</param>
/// <returns></returns> /// <returns></returns>
public static List<dc_base_stock_dto> RealtimeList(string sku, string warehouse_code, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, ref int total, string warehousetype, int? warehousearea, bool isSum = false, string order = null, string sort = null) public static List<dc_base_stock_dto> RealtimeList(string sku,string bailun_sku, string warehouse_code, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, ref int total, string warehousetype, int? warehousearea, bool isSum = false, string order = null, string sort = null)
{ {
var sql = ""; var sql = "";
if (isSum) if (isSum)
...@@ -312,6 +312,13 @@ where 1=1 ...@@ -312,6 +312,13 @@ where 1=1
parameters.Add("bailun_skus", sku.Split(',')); parameters.Add("bailun_skus", sku.Split(','));
} }
if (!string.IsNullOrWhiteSpace(bailun_sku))
{
sql += " and t1.bailun_sku like @bailun_sku ";
countSql += " and t1.bailun_sku like @bailun_sku ";
parameters.Add("bailun_sku", $"%{bailun_sku}%");
}
if (!string.IsNullOrWhiteSpace(warehouse_code)) if (!string.IsNullOrWhiteSpace(warehouse_code))
{ {
sql += " and t1.warehouse_code=@warehouse_code "; sql += " and t1.warehouse_code=@warehouse_code ";
......
...@@ -113,8 +113,8 @@ where 1=1 "; ...@@ -113,8 +113,8 @@ where 1=1 ";
} }
if (!string.IsNullOrWhiteSpace(m.sku_name)) if (!string.IsNullOrWhiteSpace(m.sku_name))
{ {
sql += " and dat.sku_title like" + $"'%{m.sku_name}%'"; sql += " and dat.sku_title like" + $"'{m.sku_name}%'";
sqlCount += " and dat.sku_title like" + $"'%{m.sku_name}%'"; sqlCount += " and dat.sku_title like" + $"'{m.sku_name}%'";
} }
if (!string.IsNullOrWhiteSpace(m.product_inner_code)) if (!string.IsNullOrWhiteSpace(m.product_inner_code))
{ {
...@@ -163,6 +163,11 @@ where 1=1 "; ...@@ -163,6 +163,11 @@ where 1=1 ";
sql += " and dat.status=1"; sql += " and dat.status=1";
sqlCount += " and dat.status=1"; sqlCount += " and dat.status=1";
} }
if (!string.IsNullOrWhiteSpace(m.supplier_name))
{
sql += " and t4.suppliers_name = '"+ m.supplier_name+"'";
sqlCount += " and t4.suppliers_name = '" + m.supplier_name + "'";
}
if (isSum) if (isSum)
{ {
......
...@@ -143,7 +143,7 @@ count(1) ...@@ -143,7 +143,7 @@ count(1)
from dc_base_oms_sku as t1 from dc_base_oms_sku as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
where t1.pay_time>'2019-03-01' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') where t1.create_time>'2019-03-01 12:00:00' and t1.bailun_picking_status!='TotalPicked' and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') and t_db.hq_type!='FBA仓'
"; ";
sql = @" sql = @"
select select
...@@ -187,7 +187,7 @@ left join ( ...@@ -187,7 +187,7 @@ left join (
FROM FROM
( `dc_base_oms_sku` `t1` LEFT JOIN `dc_base_warehouse` `t2` ON ( ( `t1`.`warehouse_code` = `t2`.`warehouse_code` ) ) ) ( `dc_base_oms_sku` `t1` LEFT JOIN `dc_base_warehouse` `t2` ON ( ( `t1`.`warehouse_code` = `t2`.`warehouse_code` ) ) )
WHERE WHERE
( ( `t2`.`hq_type` = '国内仓' ) AND ( `t1`.`bailun_picking_status` <> 'TotalPicked' ) AND ( `t1`.`pay_time` > '2019-03-01' ) ) and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') ( ( `t2`.`hq_type` = '国内仓' and t1.warehouse_code not in('GZBLZZG','QYBLZZC','SZBLZZC') ) AND ( `t1`.`bailun_picking_status` <> 'TotalPicked' ) AND ( `t1`.`create_time` > '2019-03-01 12:00:00' ) ) and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part')
"; ";
if(!string.IsNullOrWhiteSpace(m.bailun_sku)) if(!string.IsNullOrWhiteSpace(m.bailun_sku))
{ {
...@@ -201,7 +201,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_ ...@@ -201,7 +201,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_auto_config_sku_warehouse as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_auto_config_sku_warehouse as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join view_buy_ontheway_detail as t8 on t1.bailun_sku = t8.bailun_sku and t1.warehouse_code = t8.warehouse_code left join view_buy_ontheway_detail as t8 on t1.bailun_sku = t8.bailun_sku and t1.warehouse_code = t8.warehouse_code
where t1.bailun_picking_status!='TotalPicked' and t1.pay_time>'2019-03-01' and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') where t1.bailun_picking_status!='TotalPicked' and t1.create_time>'2019-03-01 12:00:00' and t1.bailun_order_status !='Canceled' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') and t_db.hq_type!='FBA仓'
"; ";
if (!string.IsNullOrWhiteSpace(m.product_inner_code)) if (!string.IsNullOrWhiteSpace(m.product_inner_code))
{ {
......
...@@ -272,6 +272,8 @@ namespace AutoTurnOver.Models ...@@ -272,6 +272,8 @@ namespace AutoTurnOver.Models
public string buyer_name { get; set; } public string buyer_name { get; set; }
public string supplier_name { get; set; }
/// <summary> /// <summary>
/// sku 前缀 /// sku 前缀
/// </summary> /// </summary>
...@@ -354,6 +356,8 @@ namespace AutoTurnOver.Models ...@@ -354,6 +356,8 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public string product_inner_code { get; set; } public string product_inner_code { get; set; }
public string suppliers_name { get; set; }
/// <summary> /// <summary>
/// 商品编码 /// 商品编码
/// </summary> /// </summary>
......
...@@ -33,9 +33,9 @@ namespace AutoTurnOver.Services ...@@ -33,9 +33,9 @@ namespace AutoTurnOver.Services
} }
public List<dc_base_stock_dto> RealtimeList(string sku, string warehouse_code, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, ref int total, string warehousetype, int? warehousearea,bool isSum = false,string order = null,string sort = null) public List<dc_base_stock_dto> RealtimeList(string sku,string bailun_sku, string warehouse_code, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, ref int total, string warehousetype, int? warehousearea,bool isSum = false,string order = null,string sort = null)
{ {
return DB.daily.RealtimeList(sku, warehouse_code,product_inner_code,sku_title_cn, supplier_name, offset, limit, ref total,warehousetype,warehousearea, isSum, order, sort); return DB.daily.RealtimeList(sku, bailun_sku, warehouse_code,product_inner_code,sku_title_cn, supplier_name, offset, limit, ref total,warehousetype,warehousearea, isSum, order, sort);
} }
......
...@@ -61,12 +61,12 @@ namespace AutoTurnOver.Controllers ...@@ -61,12 +61,12 @@ namespace AutoTurnOver.Controllers
/// <param name="offset"></param> /// <param name="offset"></param>
/// <param name="limit"></param> /// <param name="limit"></param>
/// <returns></returns> /// <returns></returns>
public JsonResult RealtimeList(string sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea) public JsonResult RealtimeList(string sku,string bailun_sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea)
{ {
var services = new DailyServices(); var services = new DailyServices();
var total = 0; var total = 0;
var list = services.RealtimeList(sku, warehousecode,product_inner_code, sku_title_cn, supplier_name, offset, limit, ref total,warehousetype,warehousearea,order: order, sort: sort); var list = services.RealtimeList(sku, bailun_sku, warehousecode,product_inner_code, sku_title_cn, supplier_name, offset, limit, ref total,warehousetype,warehousearea,order: order, sort: sort);
return new JsonResult(new return new JsonResult(new
{ {
...@@ -75,12 +75,12 @@ namespace AutoTurnOver.Controllers ...@@ -75,12 +75,12 @@ namespace AutoTurnOver.Controllers
}); });
} }
public JsonResult RealtimeListSumFooter(string sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea) public JsonResult RealtimeListSumFooter(string sku, string bailun_sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea)
{ {
var services = new DailyServices(); var services = new DailyServices();
var total = 0; var total = 0;
var list = services.RealtimeList(sku, warehousecode, product_inner_code, sku_title_cn, supplier_name, offset, limit, ref total, warehousetype, warehousearea,true); var list = services.RealtimeList(sku, bailun_sku, warehousecode, product_inner_code, sku_title_cn, supplier_name, offset, limit, ref total, warehousetype, warehousearea,true);
return new JsonResult(list == null || list.Count <= 0 ? new dc_base_stock_dto() : list[0]); return new JsonResult(list == null || list.Count <= 0 ? new dc_base_stock_dto() : list[0]);
} }
...@@ -115,11 +115,11 @@ namespace AutoTurnOver.Controllers ...@@ -115,11 +115,11 @@ namespace AutoTurnOver.Controllers
/// <param name="sku"></param> /// <param name="sku"></param>
/// <param name="warehousecode"></param> /// <param name="warehousecode"></param>
/// <returns></returns> /// <returns></returns>
public FileResult ExportRealtime(string sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, string warehousetype, int? warehousearea) public FileResult ExportRealtime(string sku,string bailun_sku, string warehousecode, string product_inner_code, string sku_title_cn,string supplier_name, string warehousetype, int? warehousearea)
{ {
var services = new DailyServices(); var services = new DailyServices();
var total = 0; var total = 0;
var list = services.RealtimeList(sku, warehousecode, product_inner_code, sku_title_cn, supplier_name, 0, int.MaxValue, ref total,warehousetype,warehousearea); var list = services.RealtimeList(sku, bailun_sku, warehousecode, product_inner_code, sku_title_cn, supplier_name, 0, int.MaxValue, ref total,warehousetype,warehousearea);
DataTable table = new DataTable(); DataTable table = new DataTable();
string[] cols = new string[] { "Sku", "采购名称", "中文名", "英文名称","内部编码", "仓库编码", "仓库名称", "货主编码","实时采购在途","实时调拨在途" string[] cols = new string[] { "Sku", "采购名称", "中文名", "英文名称","内部编码", "仓库编码", "仓库名称", "货主编码","实时采购在途","实时调拨在途"
......
...@@ -28,7 +28,7 @@ namespace AutoTurnOver.Controllers ...@@ -28,7 +28,7 @@ namespace AutoTurnOver.Controllers
/// <param name="pagesize">每页记录数</param> /// <param name="pagesize">每页记录数</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public JsonResult List(int limit, int offset, string order, string sort, string sku, string sku_prefix, string buyer_name, int? IsRedundant, int? IsStockOut, string warehousecode, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null) public JsonResult List(int limit, int offset, string order, string sort, string sku, string sku_prefix, string buyer_name, int? IsRedundant, int? IsStockOut, string warehousecode,string supplier_name, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null)
{ {
var m = new Condition_AutoTurnOver var m = new Condition_AutoTurnOver
...@@ -47,7 +47,8 @@ namespace AutoTurnOver.Controllers ...@@ -47,7 +47,8 @@ namespace AutoTurnOver.Controllers
hasAadvise = hasAadvise, hasAadvise = hasAadvise,
categoryIds = categoryIds, categoryIds = categoryIds,
monitor_status = monitor_status, monitor_status = monitor_status,
buyer_name = buyer_name buyer_name = buyer_name,
supplier_name = supplier_name
}; };
...@@ -82,7 +83,8 @@ namespace AutoTurnOver.Controllers ...@@ -82,7 +83,8 @@ namespace AutoTurnOver.Controllers
p.bailun_category_name, p.bailun_category_name,
p.history_fourteenday_sales, p.history_fourteenday_sales,
p.history_sevenday_sales, p.history_sevenday_sales,
p.monitor_status p.monitor_status,
p.suppliers_name
}); });
return new JsonResult(new return new JsonResult(new
...@@ -93,7 +95,7 @@ namespace AutoTurnOver.Controllers ...@@ -93,7 +95,7 @@ namespace AutoTurnOver.Controllers
}); });
} }
public JsonResult ListSumFooter(int limit, int offset, string order, string sort, string sku,string buyer_name, string sku_prefix, int? IsRedundant, int? IsStockOut, string warehousecode, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null) public JsonResult ListSumFooter(string supplier_name, int limit, int offset, string order, string sort, string sku,string buyer_name, string sku_prefix, int? IsRedundant, int? IsStockOut, string warehousecode, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null)
{ {
var m = new Condition_AutoTurnOver var m = new Condition_AutoTurnOver
{ {
...@@ -111,7 +113,8 @@ namespace AutoTurnOver.Controllers ...@@ -111,7 +113,8 @@ namespace AutoTurnOver.Controllers
hasAadvise = hasAadvise, hasAadvise = hasAadvise,
categoryIds = categoryIds, categoryIds = categoryIds,
monitor_status = monitor_status, monitor_status = monitor_status,
buyer_name = buyer_name buyer_name = buyer_name,
supplier_name = supplier_name
}; };
var total = 0; var total = 0;
var service = new Services.SkuAutoTurnServices(); var service = new Services.SkuAutoTurnServices();
...@@ -126,7 +129,7 @@ namespace AutoTurnOver.Controllers ...@@ -126,7 +129,7 @@ namespace AutoTurnOver.Controllers
/// <param name="sku"></param> /// <param name="sku"></param>
/// <param name="warehousecode"></param> /// <param name="warehousecode"></param>
/// <returns></returns> /// <returns></returns>
public FileResult Export(int limit, int offset, string order, string sort, string sku,string buyer_name, string sku_prefix, int? IsRedundant, int? IsStockOut, string warehousecode, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null) public FileResult Export(string supplier_name, int limit, int offset, string order, string sort, string sku,string buyer_name, string sku_prefix, int? IsRedundant, int? IsStockOut, string warehousecode, string warehousetype, int? warehousearea, bool? hasDefectConfig, string product_inner_code, string sku_name, string product_code, bool? hasAadvise = null, string categoryIds = null, int? monitor_status = null)
{ {
var m = new Condition_AutoTurnOver var m = new Condition_AutoTurnOver
{ {
...@@ -144,7 +147,8 @@ namespace AutoTurnOver.Controllers ...@@ -144,7 +147,8 @@ namespace AutoTurnOver.Controllers
hasAadvise = hasAadvise, hasAadvise = hasAadvise,
categoryIds = categoryIds, categoryIds = categoryIds,
monitor_status = monitor_status, monitor_status = monitor_status,
buyer_name = buyer_name buyer_name = buyer_name,
supplier_name = supplier_name
}; };
var total = 0; var total = 0;
...@@ -185,7 +189,8 @@ namespace AutoTurnOver.Controllers ...@@ -185,7 +189,8 @@ namespace AutoTurnOver.Controllers
p.history_thirtyday_sales, p.history_thirtyday_sales,
p.unit_price, p.unit_price,
p.weight, p.weight,
p.usable_stock p.usable_stock,
p.suppliers_name
}); });
DataTable table = new DataTable(); DataTable table = new DataTable();
......
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