分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-07-05 ddab693f389b648157c8b48c7fcbdefc92561dd2
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
60
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Core.Extensions;
using WIDESEA_WCS.Jobs;
using WIDESEA_WCS.WCSClient;
using static Dapper.SqlMapper;
 
namespace WIDESEA_WCS
{
    [DisallowConcurrentExecution]
    public class VK4Job : JobBase, IJob
    {
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                ExecuteJob(context, DoAction);
            }
            catch (Exception ex)
            {
 
            }
            return Task.CompletedTask;
        }
 
        private void DoAction(IJobExecutionContext context)
        {
            var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient;
            //自动重连
            if (!client.IsConnected)
            {
                client.Connect();
                return;
            }
            #region 信息交互
            info_interaction.wheeldata(client);
            info_interaction.scan(client);
            info_interaction.labeller(client);
            #endregion
            #region 车轮信息追溯
            Wheel_info_trace.Wheel_online(client);
            Wheel_info_trace.Wheel_machine(client);
            Wheel_info_trace.Wheel_offline(client);
            #endregion
            #region 信息采集
            WheelDBItem.VK4WheelDBItem = GetDate.GetWheelDate(client);
            VKDBItem.VK4DBItem = GetDate.GetVKDate(client);
            GantryDBItem.VK4GantryDBItem = GetDate.GetGantryDate(client);
            MachineDBItem.VK4MachineDBItem = GetDate.GetMachineDate(client);
            #endregion
        }
    }
}