Commit 74cdd815 by 泽锋 李

出备货建议的时候,持久存储计算过程用到的数据

parent 7635f458
...@@ -38,6 +38,7 @@ namespace AutoGeneratePurchaseAdvise ...@@ -38,6 +38,7 @@ namespace AutoGeneratePurchaseAdvise
//purchase_advise.ReplaceLogistics(DateTime.Now, "935619301", "MMDUKFBA"); //purchase_advise.ReplaceLogistics(DateTime.Now, "935619301", "MMDUKFBA");
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"))); //PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
//report.PurchaseWeekBackUp(); //report.PurchaseWeekBackUp();
PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -510,8 +510,6 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware ...@@ -510,8 +510,6 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
} }
} }
//ImportShoujiShortageDetailed(mainID); //ImportShoujiShortageDetailed(mainID);
//备份周转数据 //备份周转数据
...@@ -533,7 +531,7 @@ set t1.`fixed_unit_price` = t3.unit_price, ...@@ -533,7 +531,7 @@ set t1.`fixed_unit_price` = t3.unit_price,
t1.`fixed_quantity_out_stock` =t2.quantity_out_stock, t1.`fixed_quantity_out_stock` =t2.quantity_out_stock,
t1.`fixed_turnover_sales`=t2.turnover_sales , t1.`fixed_turnover_sales`=t2.turnover_sales ,
t1.`fixed_turnover_date_sales`=0, t1.`fixed_turnover_date_sales`=0,
t1.`fixed_sales_explain_details` =t2.sales_explain_details, t1.`fixed_sales_explain_details` =t2.sales_details,
t1.`fixed_turnover_inbound` =t2.turnover_inbound, t1.`fixed_turnover_inbound` =t2.turnover_inbound,
t1.`fixed_quantity_inventory`=t2.quantity_inventory , t1.`fixed_quantity_inventory`=t2.quantity_inventory ,
t1.`fixed_moq`= t2.quantity_minimum_order, t1.`fixed_moq`= t2.quantity_minimum_order,
...@@ -542,6 +540,24 @@ set t1.`fixed_unit_price` = t3.unit_price, ...@@ -542,6 +540,24 @@ set t1.`fixed_unit_price` = t3.unit_price,
where t1.main_id=@advId and t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code where t1.main_id=@advId and t1.bailun_sku = t2.bailun_sku and t1.warehouse_code =t2.warehouse_code
and t1.bailun_sku =t3.bailun_sku and t1.bailun_sku =t3.bailun_sku
",new { advId }); ",new { advId });
// 周转期的预测销量需要自行计算
var datas = _connection.Query<dc_auto_purchase_advise_detailed>(" select * from dc_auto_purchase_advise_detailed where main_id=@main_id ", new { main_id = advId }, commandTimeout: 0).AsList();
if (datas != null)
{
foreach (var item in datas)
{
try
{
item.fixed_turnover_date_sales = (int)item.fixed_sales_explain_details.ToObj<List<decimal>>()[item.turnover_days + 7 - 1];
_connection.Execute("update dc_auto_purchase_advise_detailed set fixed_turnover_date_sales=@fixed_turnover_date_sales where id=@id ",new { id= item.id});
}
catch (Exception)
{
}
}
}
} }
public static void ImportDetailedTemp(int mainID, DateTime date) public static void ImportDetailedTemp(int mainID, DateTime date)
......
...@@ -211,6 +211,75 @@ namespace AutoTurnOver.Models ...@@ -211,6 +211,75 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public int? quantity_transfer_temporary_storage { get; set; } public int? quantity_transfer_temporary_storage { get; set; }
/// <summary>
/// 单价
/// </summary>
public decimal? fixed_unit_price { get; set; }
/// <summary>
/// 历史7天日均
/// </summary>
public decimal? fixed_history_sevenday_sales { get; set; }
/// <summary>
/// 历史14日均
/// </summary>
public decimal? fixed_history_fourteenday_sales { get; set; }
/// <summary>
/// 历史30日均
/// </summary>
public decimal? fixed_history_thirtyday_sales { get; set; }
/// <summary>
/// 加权日均
/// </summary>
public decimal? fixed_daily_weighted_sales { get; set; }
/// <summary>
/// 安全库存
/// </summary>
public decimal? fixed_quantity_safe_inventory { get; set; }
/// <summary>
/// 今日实际缺货
/// </summary>
public decimal? fixed_quantity_out_stock { get; set; }
/// <summary>
/// 供应链累积销量
/// </summary>
public decimal? fixed_turnover_sales { get; set; }
/// <summary>
/// 供应链到货当天的销量
/// </summary>
public decimal? fixed_turnover_date_sales { get; set; }
/// <summary>
/// 预测销量
/// </summary>
public string fixed_sales_explain_details { get; set; }
/// <summary>
/// 累积入库数量
/// </summary>
public decimal? fixed_turnover_inbound { get; set; }
/// <summary>
/// 实际库存
/// </summary>
public decimal? fixed_quantity_inventory { get; set; }
/// <summary>
/// moq
/// </summary>
public decimal? fixed_moq { get; set; }
/// <summary>
/// 多备天数
/// </summary>
public decimal? fixed_stock_up_sales { get; set; }
/// <summary>
/// 销量公式
/// </summary>
public string fixed_dc_auto_sales_forecast_title { get; set; }
} }
......
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