wangxinhui
2024-11-06 8f392cc88b0768b74efca3b68785cf5aa1c38e70
wcs-server-hbf/WIDESEA_WCS/SchedulerExecute/Equipment/F_GFSB_UPTask.cs
@@ -4,10 +4,12 @@
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;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Services.IRepositories;
using WIDESEA_Services.Repositories;
@@ -27,7 +29,8 @@
        {
            if (Interlocked.Exchange(ref _readGFBUPSignalsoF, 1) == 0)
            {
                Task.Run(() =>
                {
                try
                {
                    VOLContext Context = new VOLContext();
@@ -54,6 +57,9 @@
                            var SBtask = agvRepository.FindFirst(f => f.agv_toaddress == plc.EquipType);
                            //有结束本次循环
                            if (SBtask != null) { continue; }
                                #region 记录上料请求信号
                                WriteLog.GetLog().Write($"{plc.PLCName}上料请求:{GYR_RFX.Content}---{DateTime.Now}", $"负极棍分上料请求");
                                #endregion
                            List<base_routing_table> Routing_Table = routingRepository.Find(d => d.route_end == plc.EquipType);
                            List<base_ware_location> loctionList = new List<base_ware_location>();
                            foreach (var item in Routing_Table)
@@ -102,8 +108,6 @@
                                if (a==1)
                                {
                                    agvRepository.Add(agvtask, true);
                                    WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"生成任务:{agvtask.agv_tasknum},起点货位【{Location.upper_code}】状态:托盘光电检测:{Location.tpgd},状态:{Location.location_state},更新时间:{Location.wireless_time}", $"【{TBSB}】上料任务生成");
                                    WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"----------------任务生成成功  {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】上料任务生成");
                                }
                               
                            }
@@ -115,13 +119,14 @@
                }
                catch (Exception ex)
                {
                    throw;
                        WriteLog.GetLog().Write($"负极棍分上料:{DateTime.Now} --------------{ex}", $"负极棍分上料调度");
                }
                finally
                {
                    Interlocked.Exchange(ref _readGFBUPSignalsoF, 0);
                }
                });
            }
        }