Commit b2ac9e9c by guanzhenshan

仓库冗余的库存改为从每日库存表读取

parent b1149044
...@@ -374,7 +374,8 @@ namespace Bailun.DC.Services ...@@ -374,7 +374,8 @@ namespace Bailun.DC.Services
while (page == 1 || (resultcount == pagesize && resultcount != 0)) while (page == 1 || (resultcount == pagesize && resultcount != 0))
{ {
var strlimit = (((page - 1) * pagesize) + "," + pagesize); var strlimit = (((page - 1) * pagesize) + "," + pagesize);
var liststock = cn.Query<Models.Warehouse.mWarehouseRedundancy>($@"select t1.bailun_sku,t1.warehouse_code,t1.usable_stock,t2.sku_title_cn,t2.unit_price,t3.warehouse_name,t4.quantity,t5.quantity_out_stock,t6.oneday_total_sales,t6.threeday_total_sales,t6.sevenday_total_sales,t6.fourteenday_total_sales,t6.thirtyday_total_sales,t6.threeday_average_sales,t6.sevenday_average_sales,t6.fourteenday_average_sales,t6.thirtyday_average_sales,t5.quantity_purchase,t5.quantity_transfer,t2.product_code,t2.bailun_category_id,t2.bailun_category_name,t7.status as 'monitorstatus',t8.tortstatus from dc_base_stock t1 var liststock = cn.Query<Models.Warehouse.mWarehouseRedundancy>($@"select t1.bailun_sku,t1.warehouse_code,t1.usable_stock,t2.sku_title_cn,t2.unit_price,t3.warehouse_name,t4.quantity,t5.quantity_out_stock,t6.oneday_total_sales,t6.threeday_total_sales,t6.sevenday_total_sales,t6.fourteenday_total_sales,t6.thirtyday_total_sales,t6.threeday_average_sales,t6.sevenday_average_sales,t6.fourteenday_average_sales,t6.thirtyday_average_sales,t5.quantity_purchase,t5.quantity_transfer,t2.product_code,t2.bailun_category_id,t2.bailun_category_name,t7.status as 'monitorstatus',t8.tortstatus
from dc_daily_stock t1
join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
left join dc_auto_daily_redundance t4 on t4.record_time='{DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.bailun_sku=t4.bailun_sku and t1.warehouse_code=t4.warehouse_code -- 仓库冗余 left join dc_auto_daily_redundance t4 on t4.record_time='{DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.bailun_sku=t4.bailun_sku and t1.warehouse_code=t4.warehouse_code -- 仓库冗余
...@@ -382,6 +383,7 @@ namespace Bailun.DC.Services ...@@ -382,6 +383,7 @@ namespace Bailun.DC.Services
left join dc_daily_sales t6 on t1.bailun_sku=t6.bailun_sku and t6.record_date='{DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.warehouse_code=t6.warehouse_code left join dc_daily_sales t6 on t1.bailun_sku=t6.bailun_sku and t6.record_date='{DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}' and t1.warehouse_code=t6.warehouse_code
left join dc_auto_config_sku_warehouse t7 on t7.bailun_sku=t1.bailun_sku and t7.warehouse_code=t1.warehouse_code left join dc_auto_config_sku_warehouse t7 on t7.bailun_sku=t1.bailun_sku and t7.warehouse_code=t1.warehouse_code
left join dc_sku_monitor t8 on t8.sku=t1.bailun_sku and t8.warehousecode=t1.warehouse_code left join dc_sku_monitor t8 on t8.sku=t1.bailun_sku and t8.warehousecode=t1.warehouse_code
where t1.record_time='{DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'
limit {strlimit}", null, null, true, 30 * 60); limit {strlimit}", null, null, true, 30 * 60);
resultcount = liststock.AsList().Count; resultcount = liststock.AsList().Count;
...@@ -474,7 +476,6 @@ namespace Bailun.DC.Services ...@@ -474,7 +476,6 @@ namespace Bailun.DC.Services
Common.LogHelper.Info("SaveSkuWarehouseRedundancy", ex.Message); Common.LogHelper.Info("SaveSkuWarehouseRedundancy", ex.Message);
cn.Execute("call Proc_SaveWarehouseRedundancy", null, null, 2 * 60); cn.Execute("call Proc_SaveWarehouseRedundancy", null, null, 2 * 60);
} }
} }
return ""; return "";
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<th>sku</th> <th>sku</th>
<th>产品编码</th> <th>产品编码</th>
<th>sku标题</th> <th>sku标题</th>
<th>产品个数</th> <th>sku库存</th>
<th>在途数</th> <th>在途数</th>
<th>库存总金额</th> <th>库存总金额</th>
<th>日销产品个数</th> <th>日销产品个数</th>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<th>sku</th> <th>sku</th>
<th>产品编码</th> <th>产品编码</th>
<th>sku标题</th> <th>sku标题</th>
<th>产品个数</th> <th>sku库存</th>
<th>在途数</th> <th>在途数</th>
<th>库存总金额</th> <th>库存总金额</th>
<th>日销产品个数</th> <th>日销产品个数</th>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<th>sku</th> <th>sku</th>
<th>产品编码</th> <th>产品编码</th>
<th>sku标题</th> <th>sku标题</th>
<th>产品个数</th> <th>sku库存</th>
<th>在途数</th> <th>在途数</th>
<th>库存总金额</th> <th>库存总金额</th>
<th>昨日销量</th> <th>昨日销量</th>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<th>sku</th> <th>sku</th>
<th>产品编码</th> <th>产品编码</th>
<th>sku标题</th> <th>sku标题</th>
<th>产品个数</th> <th>sku库存</th>
<th>在途数</th> <th>在途数</th>
<th>库存总金额</th> <th>库存总金额</th>
<th>昨日销量</th> <th>昨日销量</th>
......
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