Commit a95711e4 by 泽锋 李

采购建议导出,新增7,14,30日日均

parent 4aac8fb4
......@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
static async Task Main(string[] args)
{
Console.WriteLine("采购建议计算任务启动...");
//PurchaseAdviseServices.Generate();
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -844,6 +844,11 @@ t3.suppliers_link,
(t3.unit_price * (case when t1.quantity_actual>0 then t1.quantity_actual else t1.quantity_final_advise end ) ) as 'quantity_final_advise_price', -- 采购金额
t3.suppliers_name,
(case when t2_s.hq_type='fba仓' then t2_s.bailun_account else t2_s.warehouse_name end) as 'source_warehouse_code_name',
t5.history_sevenday_sales as 't_history_sevenday_sales',
t5.history_fourteenday_sales as 't_history_fourteenday_sales',
t5.history_thirtyday_sales as 't_history_thirtyday_sales',
(t1.history_fourteenday_sales - t5.forecast_fourteenday_sales) as 'sudden_increase' -- 突增关注
from dc_auto_purchase_advise_detailed as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
......
......@@ -143,12 +143,9 @@ namespace AutoTurnOver.Models
/// 商品的最近14日日均销量
/// </summary>
public decimal goods_history_fourteenday_sales { get; set; }
/// <summary>
/// 产品的最近14日日均
/// </summary>
public decimal history_fourteenday_sales { get; set; }
public int suppliers_id { get; set; }
public string push_user_name { get; set; }
......@@ -199,6 +196,20 @@ namespace AutoTurnOver.Models
public class dc_auto_purchase_advise_detailed_dto : dc_auto_purchase_advise_detailed
{
/// <summary>
/// 过去7日销量(日均)
/// </summary>
public decimal t_history_sevenday_sales { get; set; }
/// <summary>
/// 过去14日销量(日均)
/// </summary>
public decimal t_history_fourteenday_sales { get; set; }
/// <summary>
/// 过去30天日均销量
/// </summary>
public decimal t_history_thirtyday_sales { get; set; }
public string source_warehouse_code_name { get; set; }
public string source_warehouse_code_name_str
{
......
......@@ -177,7 +177,7 @@ namespace AutoTurnOver.Controllers
DataTable table = new DataTable();
string[] cols = new string[] { "初始建议数", "系统建议数", "采购数量", "是否已推送","jit备货类型", "时间", "sku", "产品名称", "产品14日日均", "仓库编码","仓库名称","源仓库",
"内部商品编码", "商品建议采购", "商品14日日均", "商品moq", "日均加权销量","安全库存", "缺货","实时缺货", "调拨在途", "采购在途", "库存数",
"采购金额", "供应链长度", "供应商名称", "采购类型","采购员","突增关注","待发货百伦单号"
"采购金额", "供应链长度", "供应商名称", "采购类型","采购员","突增关注","待发货百伦单号","7日日均","14日日均","30日日均"
};
foreach (var item in cols)
{
......@@ -187,6 +187,9 @@ namespace AutoTurnOver.Controllers
foreach (var itemData in list)
{
DataRow row = table.NewRow();
row["7日日均"] = itemData.t_history_sevenday_sales;
row["14日日均"] = itemData.t_history_fourteenday_sales;
row["30日日均"] = itemData.t_history_thirtyday_sales;
row["源仓库"] = itemData.source_warehouse_code_name_str;
row["初始建议数"] = itemData.quantity_init_advise;
row["系统建议数"] = itemData.quantity_final_advise;
......
......@@ -12,8 +12,6 @@ namespace ResetOutofstock
static async Task Main(string[] args)
{
Console.WriteLine("刷新缺货数据任务启动...");
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<ResetOutofstockBackgrounService>();
......
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