Commit a2c09187 by lizefeng

采购建议 下缺货单时, 有缺货的sku 就当他没有库存

parent d119fce9
......@@ -77,7 +77,11 @@ where 1=1 ";
sqlCount += " and t4.bailun_category_id in ( " + string.Join(",", m.categoryModels.Select(s => s.C_ID).Distinct()) + ")";
}
if (!string.IsNullOrWhiteSpace(m.buyer_name))
{
sql += " and t4.buyer_name = " + $"'{m.buyer_name}'";
sqlCount += " and t4.buyer_name = " + $"'{m.buyer_name}'";
}
if (m.monitor_status == 1)
{
sql += " and t5.`status`=1 ";
......
......@@ -102,7 +102,7 @@ select
t1.bailun_sku,
'GZBLWH' as 'warehouse_code',
sum(t1.quantity_init_advise) as 'quantity_init_advise', -- 原始采购建议数量 new
( sum(t1.quantity_out_stock) - ( sum(t1.quantity_inventory) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) ) ) as 'quantity_final_advise', -- 计算moq之后的数量 new
( sum(t1.quantity_out_stock) - ( sum((case when t1.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) ) ) as 'quantity_final_advise', -- 计算moq之后的数量 new
t6.product_inner_code as 'product_inner_code', -- 内部商品编码 new
0 as 'goods_quantity_init_advise', -- 商品本次的建议下单数量 new
0 as 'goods_moq', -- 商品的moq new
......@@ -128,7 +128,7 @@ select
where t6.buyer_name in ('赵美聪','张莹霞','张莹霞1','冯兆欣')
and t1.warehouse_code in ('GZBLWH','GZBLYS')
GROUP BY t1.bailun_sku
HAVING ( sum(t1.quantity_inventory) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) < sum(t1.quantity_out_stock) )
HAVING ( sum((case when t1.quantity_out_stock>0 then 0 else t1.quantity_inventory end )) + sum(t1.quantity_transfer) + sum(t1.quantity_purchase) < sum(t1.quantity_out_stock) )
) ", new { main_id = mainID }, commandTimeout: 0);
......
......@@ -265,6 +265,8 @@ namespace AutoTurnOver.Models
/// </summary>
public string bailun_sku { get; set; }
public string buyer_name { get; set; }
/// <summary>
/// sku 前缀
/// </summary>
......
......@@ -28,7 +28,7 @@ namespace AutoTurnOver.Controllers
/// <param name="pagesize">每页记录数</param>
/// <returns></returns>
[HttpGet]
public JsonResult List(int limit, int offset, string order, string sort, string sku, 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 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)
{
var m = new Condition_AutoTurnOver
......@@ -47,6 +47,7 @@ namespace AutoTurnOver.Controllers
hasAadvise = hasAadvise,
categoryIds = categoryIds,
monitor_status = monitor_status,
buyer_name = buyer_name
};
......@@ -92,7 +93,7 @@ namespace AutoTurnOver.Controllers
});
}
public JsonResult ListSumFooter(int limit, int offset, string order, string sort, string sku,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(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
{
......@@ -109,7 +110,8 @@ namespace AutoTurnOver.Controllers
product_code = product_code,
hasAadvise = hasAadvise,
categoryIds = categoryIds,
monitor_status = monitor_status
monitor_status = monitor_status,
buyer_name = buyer_name
};
var total = 0;
var service = new Services.SkuAutoTurnServices();
......@@ -124,7 +126,7 @@ namespace AutoTurnOver.Controllers
/// <param name="sku"></param>
/// <param name="warehousecode"></param>
/// <returns></returns>
public FileResult Export(int limit, int offset, string order, string sort, string sku,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(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
{
......@@ -141,7 +143,8 @@ namespace AutoTurnOver.Controllers
product_code = product_code,
hasAadvise = hasAadvise,
categoryIds = categoryIds,
monitor_status = monitor_status
monitor_status = monitor_status,
buyer_name = buyer_name
};
var total = 0;
......
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