bklLiudl
2025-04-28 9b3567a5a2f1a81bec684e8aecda3a1146906cca
Admin.NET/WCS.Application/Util/FourWayCarUtil.cs
@@ -7,6 +7,7 @@
using System.Text;
using System.Threading.Tasks;
using WCS.Application.Entity;
using static Elastic.Clients.Elasticsearch.JoinField;
namespace WCS.Application.Util;
@@ -257,7 +258,21 @@
                        //}
                        if (currentModel.Make != locationModel.Make)
                        {
                            neighbor.IsSendPlc = true;
                            //if (current.X != neighbor.X)
                            //{
                            //    current.IsSendPlc = true;
                            //}
                            if (current.Y > neighbor.Y)
                            {
                                current.IsSendPlc = true;
                            }
                            else if (current.Y < neighbor.Y)
                            {
                                neighbor.IsSendPlc = true;
                            }
                            //current.IsSendPlc = true;
                        }
                                                
@@ -439,6 +454,28 @@
    }
    /// <summary>
    /// 获取总任务表下发ID主键
    /// </summary>
    /// <returns></returns>
    public static int GetTaskId()
    {
        var list = _db.Queryable<WcsTask>().ToList();
        var maxNo = list.Max(m => m.TaskId);
        if (maxNo != null && maxNo > 0)
        {
            if (maxNo++ > 99999999)
            {
                return 1;
            }
            return (int)maxNo++;
        }
        return 1;
    }
    /// <summary>
    /// 计算曼哈顿距离
    /// </summary>
    /// <param name="start">起始位置</param>