Commit a5a878de by lizefeng

实时库存新增采购员查询

parent 73471d8c
...@@ -246,7 +246,7 @@ UNION ALL ...@@ -246,7 +246,7 @@ UNION ALL
/// <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 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,int? has_tort = null, List<bailun_category_new_dto> categoryModels = 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,int? has_tort = null, List<bailun_category_new_dto> categoryModels = null,string buyer_name = null)
{ {
var sql = ""; var sql = "";
if (isSum) if (isSum)
...@@ -332,7 +332,7 @@ from ...@@ -332,7 +332,7 @@ from
dc_base_stock as t1 dc_base_stock as t1
left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
"; ";
if (categoryModels != null && categoryModels.Count >= 1) if ((categoryModels != null && categoryModels.Count >= 1 ) || !string.IsNullOrWhiteSpace(buyer_name))
{ {
countSql += " left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku "; countSql += " left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku ";
} }
...@@ -352,6 +352,11 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -352,6 +352,11 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
sql += " and t3.category_simple_id in ( " + string.Join(",", categoryModels.Select(s => s.id).Distinct()) + ")"; sql += " and t3.category_simple_id in ( " + string.Join(",", categoryModels.Select(s => s.id).Distinct()) + ")";
countSql += " and t3.category_simple_id in ( " + string.Join(",", categoryModels.Select(s => s.id).Distinct()) + ")"; countSql += " and t3.category_simple_id in ( " + string.Join(",", categoryModels.Select(s => s.id).Distinct()) + ")";
} }
if (!string.IsNullOrWhiteSpace(buyer_name))
{
sql += " and t3.buyer_name = @buyer_name ";
parameters.Add("buyer_name", buyer_name);
}
if (has_tort != null) if (has_tort != null)
{ {
......
...@@ -39,14 +39,14 @@ namespace AutoTurnOver.Services ...@@ -39,14 +39,14 @@ namespace AutoTurnOver.Services
} }
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,int? has_tort = null,string categoryIds = 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,int? has_tort = null,string categoryIds = null,string buyer_name = null)
{ {
List<bailun_category_new_dto> categoryModels = null; List<bailun_category_new_dto> categoryModels = null;
if (!string.IsNullOrWhiteSpace(categoryIds)) if (!string.IsNullOrWhiteSpace(categoryIds))
{ {
categoryModels = ApiServices.GetNewClientNodesByIds(categoryIds.Split(',').Select(s => int.Parse(s)).ToList()); categoryModels = ApiServices.GetNewClientNodesByIds(categoryIds.Split(',').Select(s => int.Parse(s)).ToList());
} }
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, has_tort:has_tort, categoryModels: categoryModels); 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, has_tort:has_tort, categoryModels: categoryModels, buyer_name:buyer_name);
} }
......
...@@ -62,14 +62,14 @@ namespace AutoTurnOver.Controllers ...@@ -62,14 +62,14 @@ 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 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,int? has_tort = null, string categoryIds = null) public JsonResult RealtimeList(string sku,string bailun_sku, string warehousecode, string product_inner_code,string buyer_name, string sku_title_cn,string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea,int? has_tort = null, string categoryIds = null)
{ {
try try
{ {
var services = new DailyServices(); var services = new DailyServices();
var total = 0; var total = 0;
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, has_tort: has_tort, categoryIds: categoryIds); 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, has_tort: has_tort, categoryIds: categoryIds, buyer_name: buyer_name);
return new JsonResult(new return new JsonResult(new
{ {
......
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