using Newtonsoft.Json;
|
using Quartz;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEAWCS_Core.Helper;
|
using WIDESEAWCS_Core;
|
using WIDESEAWCS_QuartzJob;
|
|
namespace WIDESEAWCS_Tasks
|
{
|
[DisallowConcurrentExecution]
|
public partial class UpdateExpirationlabelJob : JobBase, IJob
|
{
|
|
public Task Execute(IJobExecutionContext context)
|
{
|
Thread.Sleep(4320000);
|
try
|
{
|
string address = AppSettings.Get("WMSApiAddress");
|
if (string.IsNullOrEmpty(address)) throw new Exception("未找到WMSApi地址");
|
string responseStr = HttpHelper.Get($"{address}/api/StockInfo/UpdateExpirationlabel");
|
|
WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
|
if (responseContent.Status)
|
{
|
return Task.CompletedTask;
|
}
|
}
|
catch (Exception ex)
|
{
|
Console.Out.WriteLine(nameof(UpdateExpirationlabelJob) + ":" + ex.Message);
|
}
|
return Task.CompletedTask;
|
}
|
}
|
}
|