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
using Quartz;
using System;
using System.Threading;
using System.Threading.Tasks;
using WIDESEA_WCS.Jobs;
using WIDESEA_WCS.SchedulerExecute.AGV;
 
namespace WIDESEA_WCS
{
    [DisallowConcurrentExecution]
    /// <summary>
    /// 负极设备与AGV交互
    /// </summary>
    public class AgvAndEquiWorkFJJob : JobBase, IJob
    {
        private static int lockObj1 = 0;
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
 
                var executeLog = ExecuteJob(context, () => Run(context));
            }
            catch (Exception)
            {
 
            }
            return Task.FromResult(string.Empty);
        }
        public string Run(IJobExecutionContext context)
        {
            if (lockObj1 == 0)
            {
                try
                {
                    lockObj1 = 1;
                    AGVSchedulerExecute.AgvAndEquiWorkFJ();//负极设备与AGV交互
                }
                catch (Exception ex)
                {
                    lockObj1 = 0;
                    throw new Exception(ex.Message);
                }
            }
 
            return string.Empty;
        }
    }
}