Commit 3cc8bb95 by lizefeng

新增采购在途,调拨在途、昨日销量、预测明日销量、预测7天日均销量、预测14天日均

parent 7a1e410e
......@@ -23,11 +23,13 @@ namespace AutoTurnOver.DB
/// <param name="order">排序类型</param>
/// <param name="sort">排序字段</param>
/// <returns></returns>
public static List<Models.dc_auto_turnover> List(Condition_AutoTurnOver m,int offset, int limit, ref int total,string order="",string sort= "")
public static List<Models.dc_auto_turnover_Extend> List(Condition_AutoTurnOver m,int offset, int limit, ref int total,string order="",string sort= "")
{
try
{
var sql = "select dat.* from dc_auto_turnover dat where 1=1 ";
var sql = @"select dat.*,t2.oneday_sales,t2.forecast_oneday_sales as 'forecast_oneday_sales2' from dc_auto_turnover as dat
left join dc_sales_volume as t2 on t2.bailun_sku=dat.bailun_sku and dat.warehouse_code = t2.warehouse_code
where 1=1 ";
if (!string.IsNullOrEmpty(m.bailun_sku))
{
......@@ -51,7 +53,7 @@ namespace AutoTurnOver.DB
if (string.IsNullOrWhiteSpace(sort)) sort = "quantity_init_advise";
if (!string.IsNullOrEmpty(sort))
{
sql += " order by dat." + sort;
sql += " order by " + sort;
if (!string.IsNullOrEmpty(order))
{
......@@ -64,13 +66,13 @@ namespace AutoTurnOver.DB
}
var obj = _connection.Query<Models.dc_auto_turnover>(sql+ " limit " + offset + "," + limit);
var obj = _connection.Query<Models.dc_auto_turnover_Extend>(sql+ " limit " + offset + "," + limit);
return obj.AsList();
}
catch (Exception ex)
{
return new List<Models.dc_auto_turnover>();
return new List<Models.dc_auto_turnover_Extend>();
}
}
......
......@@ -131,6 +131,16 @@ namespace AutoTurnOver.Models
/// 质检入库时长
/// </summary>
public int inspection_delivery { get; set; }
/// <summary>
/// 未来7天日均
/// </summary>
public int forecast_sevenday_sales { get; set; }
/// <summary>
/// 未来14天日均
/// </summary>
public int forecast_fourteenday_sales { get; set; }
}
......@@ -156,4 +166,17 @@ namespace AutoTurnOver.Models
/// </summary>
public int? redundancy { get; set; }
}
public class dc_auto_turnover_Extend : dc_auto_turnover
{
/// <summary>
///昨日销量
/// </summary>
public int oneday_sales { get; set; }
/// <summary>
/// 预测明日销量
/// </summary>
public int forecast_oneday_sales2 { get; set; }
}
}
......@@ -19,7 +19,7 @@ namespace AutoTurnOver.Services
/// <param name = "order" > 排序类型 </ param >
/// <param name="sort">排序字段</param>
/// <returns></returns>
public List<dc_auto_turnover> List(Condition_AutoTurnOver m,int offset, int limit, ref int total,string order="",string sort="")
public List<dc_auto_turnover_Extend> List(Condition_AutoTurnOver m,int offset, int limit, ref int total,string order="",string sort="")
{
return DB.dc_auto_turnover.List(m,offset, limit, ref total,order,sort);
}
......
......@@ -55,6 +55,10 @@ namespace AutoTurnOver.Controllers
p.transfer_delivery,
p.quantity_purchase,
p.quantity_transfer,
p.forecast_fourteenday_sales,
p.forecast_sevenday_sales,
p.oneday_sales,
p.forecast_oneday_sales2
});
......
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