Commit 5548ddae by 泽锋 李

新增一个下午15点的采购建议

parent 9d86e1e4
......@@ -70,11 +70,12 @@ namespace AutoGeneratePurchaseAdvise
if (now.Hour == 9 && now.Minute == 1)
{
Console.WriteLine($"开始 推送采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAdviseServices.Generate();
PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
Console.WriteLine($"结束 推送采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
if (now.Hour == 10 && now.Minute == 01)
{
Console.WriteLine($"开始推送 jit精油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......@@ -97,6 +98,14 @@ namespace AutoGeneratePurchaseAdvise
}
// 判断是不是指定的时间
if (now.Hour == 15 && now.Minute == 1)
{
Console.WriteLine($"开始 推送采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 12:00:00")));
Console.WriteLine($"结束 推送采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
......
......@@ -40,7 +40,7 @@ namespace AutoTurnOver.DB
/// 导入明细数据
/// </summary>
/// <param name="mainID"></param>
public static void ImportDetailed(int mainID)
public static void ImportDetailed(int mainID,DateTime date)
{
RedundancyDeduction("QYBLZZ", "GZBLWH");
......@@ -106,7 +106,8 @@ select
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join view_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
where t6.`status`=2 and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 ) and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
where t1.gmt_modified>=@btime
and t6.`status`=2 and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 ) and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
and (
( ( t6.buyer_name not in ('赵美聪','张莹霞','张莹霞1','冯兆欣') or t1.warehouse_code not in ('GZBLWH','GZBLYS') ) and t1.warehouse_code!='BLGZ03' )
or
......@@ -115,7 +116,7 @@ select
) as t1 where t1.quantity_final_advise>0
)
", new { main_id = mainID }, commandTimeout: 0);
", new { main_id = mainID, btime = date }, commandTimeout: 0);
// 凑单sku(初始建议数没有) 如果下单数只有一个,改为2 ( 只补缺货的不管 )
......
......@@ -17,7 +17,7 @@ namespace AutoTurnOver.Services
/// <summary>
/// 创建采购计划
/// </summary>
public static void Generate()
public static void Generate(DateTime date)
{
try
{
......@@ -25,7 +25,7 @@ namespace AutoTurnOver.Services
var mainID = purchase_advise.Add(new dc_auto_purchase_advise { create_time = DateTime.Now, no = purchase_advise.GenerateOrderNo() ,buy_sys_plan_no = "Generate" });
if (mainID == null) throw new Exception("创建采购建议失败");
purchase_advise.ImportDetailed(mainID.Value);
purchase_advise.ImportDetailed(mainID.Value,date);
}
catch (Exception ex)
{
......
......@@ -14,8 +14,6 @@ namespace ResetOutofstock
{
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