物料信息程序启动后就拉取
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NLog.Web;
|
||||
@@ -7,6 +9,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto.Erp;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
|
||||
namespace WMS.Web.Api
|
||||
{
|
||||
@@ -14,7 +18,25 @@ namespace WMS.Web.Api
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
var host= CreateHostBuilder(args).Build();
|
||||
//to do you want
|
||||
Task.Run(() =>
|
||||
{
|
||||
//<2F>첽-ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var sercice = scope.ServiceProvider.GetRequiredService<IErpService>();
|
||||
sercice.BillQueryForMaterial().GetAwaiter().GetResult();
|
||||
|
||||
var cache = scope.ServiceProvider.GetRequiredService<IMemoryCache>();
|
||||
var cache_key = "erp_materials_list";
|
||||
var materials = cache.Get<List<ErpMaterialDto>>(cache_key);
|
||||
Console.WriteLine("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺" + materials.Count);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
host.Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
|
||||
Reference in New Issue
Block a user