wangxinhui
2024-11-06 8f392cc88b0768b74efca3b68785cf5aa1c38e70
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WIDESEA_Common.Tools;
 
namespace WIDESEA_WCS
{
    /// <summary>
    /// 正极
    /// </summary>
    [DisallowConcurrentExecution]
    public class JobZ_0925 : IJob
    {
        private static int lockObj1 = 0;
        public Task Execute(IJobExecutionContext context)
        {
            if (lockObj1 == 0)
            {
                try
                {
                    lockObj1 = 1;
                    Task task = Task.Run(() =>
                    {
                        while (true)
                        {
                            try
                            {
                                WriteLog.GetLog().Write($"开始时间正极:{DateTime.Now} --------------", $"正极调度");
                                StackerExecutor.Z_BCK_Task();//正极箔材库
 
                                StackerExecutor.Z_GFSB_DownTask();//正极辊分下料任务
                                StackerExecutor.Z_GFSB_UpTask(); //正极辊分上料任务
 
                                StackerExecutor.Z_TBSB_DownTask();//正极涂布下料
                                StackerExecutor.Z_TBSB_UpTask();//正极涂布上料任务
 
                                StackerExecutor.Z_TSJ_DownTask();//正极提升机下料
                                WriteLog.GetLog().Write($"结束时间正极:{DateTime.Now} --------------", $"正极调度");
                            }
                            catch { }
 
                            Thread.Sleep(200);
                        }
                    });
                }
                catch (Exception ex)
                {
                    lockObj1 = 0;
                    throw new Exception(ex.Message);
                }
            }
            return Task.CompletedTask;
        }
    }
}