Commit e096cee0 by lizefeng

查看预测图表合并 预计采购入库和预计调拨入库数,改为统一预计入库

parent e2a9a383
...@@ -224,6 +224,10 @@ namespace AutoTurnOver.DB ...@@ -224,6 +224,10 @@ namespace AutoTurnOver.DB
public static dc_auto_inbound GetAutoInboundBySkuWH(string sku, string warehousecode,int type) public static dc_auto_inbound GetAutoInboundBySkuWH(string sku, string warehousecode,int type)
{ {
var sql = "select * from dc_auto_inbound where bailun_sku='" + sku+ "' and warehouse_code='" +warehousecode+"'"; var sql = "select * from dc_auto_inbound where bailun_sku='" + sku+ "' and warehouse_code='" +warehousecode+"'";
if (type > 0)
{
sql += $" and type={type} ";
}
return _connection.QueryFirstOrDefault<dc_auto_inbound>(sql); return _connection.QueryFirstOrDefault<dc_auto_inbound>(sql);
} }
...@@ -246,5 +250,19 @@ namespace AutoTurnOver.DB ...@@ -246,5 +250,19 @@ namespace AutoTurnOver.DB
#endregion #endregion
/// <summary>
/// 查询周转数据
/// </summary>
/// <param name="sku">产品SKU</param>
/// <param name="wCode">仓库编码</param>
/// <returns></returns>
public static dc_auto_turnover GetModel(string sku,string wCode)
{
DynamicParameters parameters = new DynamicParameters();
parameters.Add("bailun_sku",sku);
parameters.Add("warehouse_code", wCode);
return _connection.QueryFirst<dc_auto_turnover>(" select * from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@wCode ", parameters);
}
} }
} }
...@@ -22,10 +22,13 @@ namespace AutoTurnOver.Services ...@@ -22,10 +22,13 @@ namespace AutoTurnOver.Services
var sales = DB.SaleVolume.GetBySkuWarehouseCode(sku, warehousecode); var sales = DB.SaleVolume.GetBySkuWarehouseCode(sku, warehousecode);
//获取预计采购入库 //获取预计采购入库
var buyputin = DB.dc_auto_turnover.GetAutoInboundBySkuWH(sku, warehousecode,1); //var buyputin = DB.dc_auto_turnover.GetAutoInboundBySkuWH(sku, warehousecode,1);
//获取预计调拨入库 //获取预计调拨入库
var allotputin = DB.dc_auto_turnover.GetAutoInboundBySkuWH(sku, warehousecode, 2); //var allotputin = DB.dc_auto_turnover.GetAutoInboundBySkuWH(sku, warehousecode, 2);
// 预计入库
var putin = DB.dc_auto_turnover.GetAutoInboundBySkuWH(sku, warehousecode, 0);
//可用库存 //可用库存
var inventory = DB.dc_auto_turnover.GetAutoInventoryBySkuWH(sku, warehousecode); var inventory = DB.dc_auto_turnover.GetAutoInventoryBySkuWH(sku, warehousecode);
...@@ -35,8 +38,9 @@ namespace AutoTurnOver.Services ...@@ -35,8 +38,9 @@ namespace AutoTurnOver.Services
list.Add(sales != null ? sales.details : "[]"); list.Add(sales != null ? sales.details : "[]");
list.Add(buyputin != null ? buyputin.details : "[]"); //list.Add(buyputin != null ? buyputin.details : "[]");
list.Add(allotputin != null ? allotputin.details : "[]"); //list.Add(allotputin != null ? allotputin.details : "[]");
list.Add(putin != null ? putin.details : "[]");
list.Add(inventory != null ? inventory.details : "[]"); list.Add(inventory != null ? inventory.details : "[]");
list.Add(shortsupply != null ? shortsupply.details : "[]"); list.Add(shortsupply != null ? shortsupply.details : "[]");
...@@ -215,5 +219,6 @@ namespace AutoTurnOver.Services ...@@ -215,5 +219,6 @@ namespace AutoTurnOver.Services
return list; return list;
} }
} }
} }
...@@ -42,7 +42,7 @@ namespace AutoTurnOver.Controllers ...@@ -42,7 +42,7 @@ namespace AutoTurnOver.Controllers
date.Add(today.AddDays(i).ToString("MM/dd")); date.Add(today.AddDays(i).ToString("MM/dd"));
} }
var names = new List<string>() { "预测销量","预计采购入库","预计调拨入库","可用库存","预计缺货数量"}; var names = new List<string>() { "预测销量","预计入库","可用库存","预计缺货数量"};
return new JsonResult(new { data = result, days = date, names = names}); return new JsonResult(new { data = result, days = date, names = names});
} }
......
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