wangxinhui
2024-11-06 8f392cc88b0768b74efca3b68785cf5aa1c38e70
wcs-server-hbf/WIDESEA_WCS/SchedulerExecute/Equipment/F_TBSB_DownTask.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Common.LoctionEnum;
using WIDESEA_Common.Tools;
@@ -27,7 +28,8 @@
        {
            if (Interlocked.Exchange(ref _readFTBSignalsoZ_Down, 1) == 0)
            {
                Task.Run(() =>
                {
                try
                {
                    VOLContext Context = new VOLContext();
@@ -58,7 +60,9 @@
                        //Convert.ToBoolean(plc.ReadValue("R_Feedingrequest".ToString(), SB_Up_Location));
                        if (GYR_RFX)
                        {
                                #region 记录下料请求信号
                                WriteLog.GetLog().Write($"{plc.PLCName}下料请求:{GYR_RFX}---{DateTime.Now}", $"负极涂布下料请求");
                                #endregion
                            //找到路由规则(以设备为起点的路由规则)
                            List<base_routing_table> Routing_Table = routingRepository.Find(d => d.route_began == SB_Up_Location);
                            base_ware_location location_TB = new base_ware_location();
@@ -131,8 +135,6 @@
                                    if (x == 1)
                                    {
                                        agvRepository.Add(agvtask, true);
                                        WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"生成任务:{agvtask.agv_tasknum},终点货位【{location_TB.upper_code}】状态:托盘光电检测:{location_TB.tpgd},状态:{location_TB.location_state},更新时间:{location_TB.wireless_time}", $"【{TBSB}】下料任务生成");
                                        WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"----------------任务生成成功  {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】下料任务生成");
                                        return content.OK();
                                   
                                    }
@@ -151,15 +153,15 @@
                }
                catch (Exception ex)
                {
                    //////WriteLog.Info($"任务生成").Write($"结束时间:   {DateTime.Now}  异常信息:{ex.Message} -------------- {Environment.NewLine}", $"任务生成");
                    throw;
                        WriteLog.GetLog().Write($"负极涂布下料:{DateTime.Now} --------------{ex}", $"负极涂布下料调度");
                }
                finally
                {
                    Interlocked.Exchange(ref _readFTBSignalsoZ_Down, 0);
                }
                });
            }
        }