chengsc
2025-06-11 413194b8c6a71fea8cb7a567800b11703c6c7d5a
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;
using static SKIT.FlurlHttpClient.Wechat.Api.Models.CustomServiceKfSessionGetWaitCaseResponse.Types;
namespace WCS.Application.Util;
@@ -25,6 +26,10 @@
    /// <returns></returns>
    public static List<CarModel> GetCarPathUp(List<CarModel> list, int moveType)
    {
        if (list == null)
        {
            return null;
        }
        for (int i = 0; i < list.Count; i++)
        {
            if (i >= 0 && i < list.Count - 1)
@@ -423,7 +428,6 @@
    }
    /// <summary>
    /// 获取小车路径
    /// </summary>
@@ -491,7 +495,7 @@
                if (current.Equals(end))
                {
                    Log.Error(ReconstructPath(cameFrom, current).ToString());
                    Log.Error("小车路径分配:" +ReconstructPath(cameFrom, current).ToString());
                    return ReconstructPath(cameFrom, current);
                }
@@ -611,6 +615,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>