wangxinhui
昨天 a8756c3526832332db4ef5685348d9b188c2bf2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;
        }
    }
}