Commit 9574a90f by lizefeng

采购建议改为每天9点出

parent 43e3e0e8
......@@ -24,7 +24,7 @@ namespace AutoGeneratePurchaseAdvise
{
var now = DateTime.Now;
// 判断是不是指定的时间
if (now.Hour == 8 && now.Minute == 1)
if (now.Hour == 9 && now.Minute == 1)
{
Console.WriteLine($"开始采购平均值统计任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAdviseServices.Generate();
......
......@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
{
Console.WriteLine("采购建议计算任务启动...");
// 创建采购计划
//PurchaseAdviseServices.Generate();
PurchaseAdviseServices.Generate();
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -45,7 +45,7 @@ namespace AutoTurnOver.DB
RedundancyDeduction("GZBLWH", "QYBLZZ");
// 生成采购建议 (只补缺货的不管)
_connection.Execute(@"
_connection.Execute(@"
INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_final_advise`,
`product_inner_code`,`goods_quantity_init_advise`,`goods_moq`,`good_sku_codes`,`goods_history_fourteenday_sales`,`history_fourteenday_sales`,
`quantity_actual`,`main_id`,
......@@ -103,7 +103,7 @@ select
// 凑单sku(初始建议数没有) 如果下单数只有一个,改为2 ( 只补缺货的不管 )
_connection.Execute(@" update dc_auto_purchase_advise_detailed as t1,
_connection.Execute(@" update dc_auto_purchase_advise_detailed as t1,
dc_base_sku as t2
set t1.quantity_final_advise=2
where t1.bailun_sku = t2.bailun_sku and t1.quantity_final_advise=1 and t1.quantity_init_advise<=0 and ( t2.buyer_name not in ('赵美聪','张莹霞','张莹霞1') or t1.warehouse_code!='GZBLWH' ) and t1.main_id=@main_id ", new { main_id = mainID }, commandTimeout: 0);
......
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