YieldSegmentedPathCache.cs 1.22 KB
namespace Rcs.Application.Services.PathFind.Models;

/// <summary>
/// 让行分段路径缓存。
/// 使用 VdaPath 前缀保存,但通过非 GUID Key 形态与主任务缓存隔离。
/// </summary>
public class YieldSegmentedPathCache
{
    public string YieldOrderId { get; set; } = string.Empty;

    public Guid RobotId { get; set; }

    public Guid MapId { get; set; }

    public string MapCode { get; set; } = string.Empty;

    public string TargetNodeCode { get; set; } = string.Empty;

    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 当前路口段索引(第一层)。
    /// </summary>
    public int CurrentJunctionIndex { get; set; }

    /// <summary>
    /// 当前资源段索引(第二层)。
    /// </summary>
    public int CurrentResourceIndex { get; set; }

    /// <summary>
    /// 让行订单更新序号(VDA5050 OrderUpdateId)。
    /// </summary>
    public int OrderUpdateId { get; set; }

    /// <summary>
    /// 缓存版本号(用于并发更新 CAS)。
    /// </summary>
    public long PlanVersion { get; set; } = 1;

    /// <summary>
    /// 两层切割路径。
    /// </summary>
    public List<VdaJunctionSegmentCache> JunctionSegments { get; set; } = new();
}