lss
2025-05-16 790eb4d466531a0a727fbc617eb6447167c1da54
HH.WCS.Mobox3/HH.WCS.Mobox3.Emerson/wms/WMSHelper.cs
File was renamed from HH.WCS.Mobox3/HH.WCS.Mobox3.EmersonWCS/wms/WMSHelper.cs
@@ -1,7 +1,7 @@
using HH.WCS.EmersonWcs.api;
using HH.WCS.EmersonWcs.LISTA.models;
using HH.WCS.EmersonWcs.models.other;
using HH.WCS.EmersonWcs.util;
using HH.WCS.Emerson.api;
using HH.WCS.Emerson.LISTA.models;
using HH.WCS.Emerson.models.other;
using HH.WCS.Emerson.util;
using Newtonsoft.Json;
using Opc.Ua;
using System;
@@ -13,9 +13,9 @@
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using static HH.WCS.EmersonWcs.api.ApiModel;
using static HH.WCS.Emerson.api.ApiModel;
namespace HH.WCS.EmersonWcs.wms
namespace HH.WCS.Emerson.wms
{
    /// <summary>
    /// wms管到作业
@@ -614,7 +614,8 @@
            var distribution = db.Queryable<TN_Distribution_CNTR>().Where(a => a.N_B_STATE == 1).ToList();
            if (distribution.Count > 0)
            {
                try
                {
                foreach (var item in distribution)
                {
                    LogHelper.Info($"托盘{item.S_CNTR_CODE}开始出库");
@@ -645,10 +646,15 @@
                                endloc = LocationHelper.GetLoc(item.S_EXIT_LOC_CODE);
                            }
                            if (endloc == null && endloc.N_LOCK_STATE == 0 && endloc.N_CURRENT_NUM == 0)
                                if (endloc == null)
                            {
                                LogHelper.Info($"终点货位:{item.S_EXIT_LOC_CODE}不可用");
                                    return;
                                }
                                if (endloc.N_LOCK_STATE != 0 || endloc.N_CURRENT_NUM != 0)
                                {
                                    LogHelper.Info($"终点货位:{item.S_EXIT_LOC_CODE}不可用");
                                    return;
                            }
                        }
                    }
@@ -690,9 +696,7 @@
                            var distributions = db.Queryable<TN_Distribution_CNTR>().Where(a => a.N_B_STATE == 1 && a.S_BS_NO == item.S_BS_NO).ToList();
                            if (distributions.Count > 0)
                            {
                                LogHelper.Info($"托盘{item.S_CNTR_CODE}创建任务完成,出库单{item.S_BS_NO}存在未完成的出库任务,不允许修改出库单状态");
                            }
                            else
                            {
@@ -715,6 +719,13 @@
                        Console.WriteLine("起点终点货位为空,请检查日志");
                    }
                }
                }
                catch (Exception ex)
                {
                    LogHelper.Info($"CreateOutTask Error :{ex}");
                    throw;
                }
            }