Commit 27964b16 by lizefeng

新增付款类型

parent b644c10d
......@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
{
Console.WriteLine("采购建议计算任务启动...");
// 创建采购计划
PurchaseAdviseServices.Generate();
//PurchaseAdviseServices.Generate();
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -194,7 +194,7 @@ select
{
sql = @"
select
sum(t5.forecast_turnoverday_sales) as 'forecast_turnoverday_sales', -- 供应链长度日均
sum(t5.quantity_safe_inventory) as 'quantity_safe_inventory', -- 日均加权销量
sum(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
sum(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
sum(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
......@@ -219,7 +219,7 @@ where 1=1 ";
sql = @"
select
t1.*,t2.warehouse_name,t3.sku_title_cn as 'sku_name',t4.create_time,
(t5.forecast_turnoverday_sales) as 'forecast_turnoverday_sales', -- 供应链长度日均
(t5.quantity_safe_inventory) as 'quantity_safe_inventory', -- 日均加权销量
(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
......
......@@ -169,7 +169,10 @@ namespace AutoTurnOver.Models
public string create_time_str { get { return create_time.ToString("yyyy-MM-dd"); } }
public decimal forecast_turnoverday_sales { get; set; }
/// <summary>
/// 日均加权销量
/// </summary>
public decimal quantity_safe_inventory { get; set; }
public decimal quantity_out_stock { get; set; }
......
......@@ -43,5 +43,7 @@ namespace AutoTurnOver.Models
/// 更新时间
/// </summary>
public DateTime update_time { get; set; }
public int payment_type { get; set; }
}
}
......@@ -81,7 +81,7 @@ namespace AutoTurnOver.Services
// 平均采购交期
data.delivery_days = delivery_days / purchaseList.Count;
data.payment_type = purchaseList.Any(s => s.pay_type == 1) ? 1 : 2;
......@@ -106,7 +106,7 @@ namespace AutoTurnOver.Services
var inboundList = AveragePurchase.GetInboundList(purchaseWList.Select(s => s.purchase_id), skuItem.bailun_sku);
if (inboundList != null && inboundList.Count() >= 1)
{
dataWarehouse.inbound_days = (int)inboundList.Sum(s => Math.Ceiling((s.update_time - s.arrival_time).TotalHours / 24)) / inboundList.Count();
dataWarehouse.inbound_days = (int)inboundList.Sum(s => Math.Ceiling((s.update_time - s.arrival_time).TotalHours / 24)) / inboundList.Count();
}
else
{
......
......@@ -153,7 +153,7 @@ namespace AutoTurnOver.Controllers
DataTable table = new DataTable();
string[] cols = new string[] { "初始建议数", "系统建议数", "采购数量", "是否已推送", "时间", "sku", "产品名称", "产品14日日均", "仓库编码","仓库名称",
"内部商品编码", "商品建议采购", "商品14日日均", "商品moq", "供应链日均销量", "缺货", "调拨在途", "采购在途", "库存数",
"内部商品编码", "商品建议采购", "商品14日日均", "商品moq", "日均加权销量", "缺货", "调拨在途", "采购在途", "库存数",
"采购金额", "供应链长度", "供应商名称", "采购类型"
};
foreach (var item in cols)
......@@ -179,7 +179,7 @@ namespace AutoTurnOver.Controllers
row["商品建议采购"] = itemData.goods_quantity_init_advise;
row["商品14日日均"] = itemData.goods_history_fourteenday_sales;
row["商品moq"] = itemData.goods_moq;
row["供应链日均销量"] = itemData.forecast_turnoverday_sales;
row["日均加权销量"] = itemData.quantity_safe_inventory;
row["缺货"] = itemData.quantity_out_stock;
row["调拨在途"] = itemData.quantity_transfer;
row["采购在途"] = itemData.quantity_purchase;
......
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