dengjunjie
2026-02-26 f1d8d7b04a81619cb29457fa88538bbaf37d8c20
优化WCS跟四向车接口
已添加6个文件
已修改13个文件
740 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/StationMangerService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationTypeEnum.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/RGV/FOURBOT/FOURBOTNewMovePodTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/RGV/FOURBOT/FOURBOTReturn.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IRGVLocationInfoService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IStationMangerService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RGVTaskMethods.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/HKTaskExtend.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs
@@ -1,10 +1,13 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -15,7 +18,19 @@
        public RGVLocationInfoService(IRepository<Dt_RGVLocationInfo> BaseDal) : base(BaseDal)
        {
        }
        private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>()
        {
            { nameof(Dt_RGVLocationInfo.Depth), OrderByType.Desc },
            { nameof(Dt_RGVLocationInfo.Layer), OrderByType.Asc },
            //{ nameof(Dt_RGVLocationInfo.Column), OrderByType.Asc },
            { nameof(Dt_RGVLocationInfo.Row), OrderByType.Asc },
        };
        public IRepository<Dt_RGVLocationInfo> Repository => BaseDal;
        public Dt_RGVLocationInfo GetFreeLocationInfo(string AreaCode)
        {
            Dt_RGVLocationInfo? rGVLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy);
            return rGVLocationInfo;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/StationMangerService.cs
@@ -3,8 +3,10 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -17,5 +19,10 @@
        }
        public IRepository<Dt_StationManger> Repository => BaseDal;
        public Dt_StationManger GetInStationInfo(string fromLocationCode)
        {
            return BaseDal.QueryFirst(x => x.StationCode == fromLocationCode && x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt());
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationTypeEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common
{
    public enum StationTypeEnum
    {
        /// <summary>
        /// å…¥åº“站台
        /// </summary>
        StationType_OnlyInbound = 1,
        /// <summary>
        /// å‡ºåº“站台
        /// </summary>
        StationType_OnlyOutbound = 2,
        /// <summary>
        /// å‡ºå…¥åº“站台
        /// </summary>
        StationType_InboundAndOutbound = 3,
        /// <summary>
        /// å‡ºå…¥åº“口
        /// </summary>
        StationType_InStartAndOutEnd = 33,
        /// <summary>
        /// æˆå“è‡ªåŠ¨å–ç«™å°
        /// </summary>
        StationType_ProductBackTake = 95,
        /// <summary>
        /// æˆå“è‡ªåŠ¨è¡¥æ¡†
        /// </summary>
        StationType_ProductBack = 98,
        /// <summary>
        /// ç ç›˜æœºç«™å°
        /// </summary>
        StationType_PakcPallet = 99,
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs
@@ -15,14 +15,14 @@
        /// </summary>
        [Description("新建任务")]
        New,
        ///// <summary>
        ///// å¾…执行
        ///// </summary>
        /// <summary>
        /// å¾…执行
        /// </summary>
        [Description("待执行")]
        Execut,
        ///// <summary>
        ///// å–货中
        ///// </summary>
        /// <summary>
        /// å–货中
        /// </summary>
        [Description("取货中")]
        Takeing,
        /// <summary>
@@ -47,6 +47,16 @@
        [Description("外形检测中")]
        CheckShapeing,
        /// <summary>
        /// å¤–形检测成功
        /// </summary>
        [Description("外形检测成功")]
        CheckShapeingOk,
        /// <summary>
        /// å¤–形检测失败
        /// </summary>
        [Description("外形检测失败")]
        CheckShapeingNG,
        /// <summary>
        /// æ‰˜ç›˜å·ç¡®è®¤ä¸­
        /// </summary>
        [Description("托盘号确认中")]
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/RGV/FOURBOT/FOURBOTNewMovePodTask.cs
@@ -15,7 +15,7 @@
        /// <summary>
        /// ä¼˜å…ˆçº§
        /// </summary>
        public int priority { get; set; } = 3;
        public int priority { get; set; }
        /// <summary>
        /// æ¬è¿ç±»åž‹
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/RGV/FOURBOT/FOURBOTReturn.cs
@@ -29,7 +29,7 @@
        /// <summary>
        /// å“åº”数据
        /// </summary>
        public object data { get; set; }
        public FOURBOTnewMovePodTaskResponseData data { get; set; }
    }
    /// <summary>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IRGVLocationInfoService.cs
@@ -12,5 +12,12 @@
    public interface IRGVLocationInfoService : IService<Dt_RGVLocationInfo>
    {
       public IRepository<Dt_RGVLocationInfo> Repository { get; }
        /// <summary>
        /// èŽ·å–å¯ç”¨ç©ºè´§ä½
        /// </summary>
        /// <param name="AreaCode"></param>
        /// <param name="containerType"></param>
        /// <returns></returns>
        Dt_RGVLocationInfo GetFreeLocationInfo(string AreaCode);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IStationMangerService.cs
@@ -12,5 +12,11 @@
    public interface IStationMangerService : IService<Dt_StationManger>
    {
        public IRepository<Dt_StationManger> Repository { get; }
        /// <summary>
        /// èŽ·å–å…¥åº“ç«™å°
        /// </summary>
        /// <param name="fromLocationCode"></param>
        /// <returns></returns>
        Dt_StationManger GetInStationInfo(string fromLocationCode);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs
@@ -69,7 +69,7 @@
        [SugarColumn(IsNullable = false, ColumnDescription = "站台是否可用")]
        public int IsOccupied { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// å¤‡æ³¨(外形检测点ID)
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "备注")]
        public string Remark { get; set; }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs
@@ -134,12 +134,12 @@
        public int Grade { get; set; }
        /// <summary>
        /// WMS任务主键
        /// å››å‘车任务ID
        /// </summary>
        [ImporterHeader(Name = "WMS任务主键")]
        [ExporterHeader(DisplayName = "WMS任务主键")]
        [SugarColumn(IsNullable = true, ColumnDescription = "WMS任务主键")]
        public int WMSId { get; set; }
        [ImporterHeader(Name = "四向车任务ID")]
        [ExporterHeader(DisplayName = "四向车任务ID")]
        [SugarColumn(IsNullable = true, ColumnDescription = "四向车任务ID")]
        public int RGVTaskId { get; set; }
        /// <summary>
        /// ä»»åŠ¡ä¸‹å‘æ—¶é—´
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskService
    {
        #region æµ·åº·AGV任务创建
        /// <summary>
        /// åˆ›å»ºæµ·åº·AGV入库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateHKNewInTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();//这里我不知道是什么类型
                //获取货位信息
                Dt_HKLocationInfo? kLSLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
                if (kLSLocationInfo == null) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = kLSLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = kLSLocationInfo.LocationCode,
                    TargetAddress = kLSLocationInfo.LocationCode,
                    Creater = "WMS",
                };
                kLSLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _hKLocationInfoService.Repository.UpdateData(kLSLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }
        /// <summary>
        /// åˆ›å»ºæµ·åº·AGV出库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateHKNewOutTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode);
                if (hKLocationInfo == null) throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = hKLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = taskDTO.toLocationCode,
                    TargetAddress = taskDTO.toLocationCode,
                    Creater = "WMS",
                };
                hKLocationInfo.LocationStatus = LocationStatusEnum.OutLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _hKLocationInfoService.Repository.UpdateData(hKLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -74,7 +74,7 @@
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = kLSLocationInfo.RoadwayNo,
@@ -100,161 +100,6 @@
            }
        }
        #endregion
        #region RGV任务创建
        /// <summary>
        /// åˆ›å»ºå››å‘车入库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateRGVNewInTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                List<Dt_RGVLocationInfo>? rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt());
                if (rGVLocationInfos.Count < 1) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                var rGVLocationInfo = rGVLocationInfos.OrderBy(x => x.Depth).First();
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = rGVLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = rGVLocationInfo.LocationCode,//找入库站台对应的外形检测编号
                    TargetAddress = rGVLocationInfo.LocationCode,
                    Creater = "WMS",
                };
                rGVLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _rGVLocationInfoService.Repository.UpdateData(rGVLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// åˆ›å»ºå››å‘车出库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateRGVNewOutTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                Db.Ado.BeginTran();
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        #endregion
        #region æµ·åº·AGV任务创建
        /// <summary>
        /// åˆ›å»ºæµ·åº·AGV入库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateHKNewInTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();//这里我不知道是什么类型
                //获取货位信息
                Dt_HKLocationInfo? kLSLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
                if (kLSLocationInfo == null) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = kLSLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = kLSLocationInfo.LocationCode,
                    TargetAddress = kLSLocationInfo.LocationCode,
                    Creater = "WMS",
                };
                kLSLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _hKLocationInfoService.Repository.UpdateData(kLSLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }
        /// <summary>
        /// åˆ›å»ºæµ·åº·AGV出库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateHKNewOutTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode);
                if (hKLocationInfo == null) throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = hKLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = taskDTO.toLocationCode,
                    TargetAddress = taskDTO.toLocationCode,
                    Creater = "WMS",
                };
                hKLocationInfo.LocationStatus = LocationStatusEnum.OutLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _hKLocationInfoService.Repository.UpdateData(hKLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                throw new Exception(ex.Message);
            }
        }
        #endregion
        #region 5 è·¨æ¥¼å±‚运输任务创建
        public WebResponseContent CarryTask(TaskDTO taskDTO, int taskType)
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RGVTaskMethods.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskService
    {
        #region RGV任务创建
        /// <summary>
        /// åˆ›å»ºå››å‘车入库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateRGVNewInTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                //List<Dt_RGVLocationInfo>? rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt());
                //if (rGVLocationInfos.Count < 1) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                //var rGVLocationInfo = rGVLocationInfos.OrderBy(x => x.Depth).First();
                //var rGVLocationInfo = _rGVLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                Dt_StationManger stationManger = _stationMangerService.GetInStationInfo(taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点位置【{taskDTO.fromLocationCode}】站台信息!");
                //if (stationManger.IsOccupied == 1) throw new Exception($"起点位置【{taskDTO.fromLocationCode}】站台被占用,请释放!");
                Dt_Task dt_Task = new()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = taskDTO.toAreaCode,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = stationManger.Remark,//找入库站台对应的外形检测编号
                    TargetAddress = "",
                    //Remark = taskDTO.toAreaCode,
                    Creater = "WMS",
                };
                //rGVLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                //Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                //_rGVLocationInfoService.Repository.UpdateData(rGVLocationInfo);
                //Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// åˆ›å»ºå››å‘车出库任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent CreateRGVNewOutTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                Db.Ado.BeginTran();
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -46,6 +46,7 @@
        private readonly IRGVLocationInfoService _rGVLocationInfoService;
        private readonly IRepository<Dt_TaskExecuteDetail> _taskExecuteDetailRepository;
        private readonly IApiInfoService _apiInfoService;
        private readonly IStationMangerService _stationMangerService;
        private readonly IMapper _mapper;
        private Dictionary<string, OrderByType> _taskOrderBy = new()
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/HKTaskExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Tasks
{
    public partial class TaskJob
    {
        #region ä¸‹å‘海康AGV任务
        public void SendHIKROBOTTask(List<Dt_Task> tasks)
        {
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Tasks
{
    public partial class TaskJob
    {
        #region ä¸‹å‘凯乐士AGV任务
        public void SendGALAXISTask(List<Dt_Task> tasks)
        {
            GALAXISTaskInfo gALAXISTaskInfo = new();
            try
            {
                gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss");
                gALAXISTaskInfo.msgTime = DateTime.Now.ToString();
                gALAXISTaskInfo.tasks = new List<GALAXISTask>();
                foreach (var task in tasks)
                {
                    GALAXISTask gALAXISTask = new GALAXISTask()
                    {
                        taskId = task.WMSTaskNum,
                        taskType = task.TaskType == (int)TaskTypeEnum.MLInbound ? 0 : 1,
                        barCode = task.PalletCode,
                        endNode = task.TargetAddress,
                        startNode = task.SourceAddress,
                        priorityCode = task.Grade
                    };
                    gALAXISTaskInfo.tasks.Add(gALAXISTask);
                }
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("未找到凯乐士AGV任务下发接口配置信息!请检查接口配置");
                string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
                GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                if (agvContent.success)
                {
                    if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo);
                    tasks.ForEach(task =>
                    {
                        task.TaskState = (int)TaskStatusEnum.Execut;
                    });
                    _taskService.UpdateData(tasks);
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
            }
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Tasks
{
    public partial class TaskJob
    {
        #region ä¸‹å‘四向车任务
        public void SendRGVTask(List<Dt_Task> tasks)
        {
            FOURBOTnewMovePodTask fOURBOTnewMovePodTask = new();
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(FOURBOTnewMovePodTask)) ?? throw new Exception("未找到四向车任务下发接口配置信息!请检查接口配置");
                #region å…¥åº“
                var intasks = tasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPInbound).ToList();
                foreach (var item in intasks)
                {
                    fOURBOTnewMovePodTask.priority = item.Grade;
                    fOURBOTnewMovePodTask.podID = item.PalletCode;
                    fOURBOTnewMovePodTask.destination = item.NextAddress;
                    fOURBOTnewMovePodTask.desExt = new
                    {
                        unload = 0//是否放下容器,0否1是
                    };
                    fOURBOTnewMovePodTask.desType = 2;
                    string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                    FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                    if (fOURBOTReturn.returnCode == 0)
                    {
                        item.RGVTaskId = fOURBOTReturn.data.taskID;
                        item.TaskState = (int)TaskStatusEnum.Execut;
                    }
                }
                _taskService.UpdateData(intasks);
                #endregion
                #region å‡ºåº“
                var outtasks = tasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPOutbound).ToList();
                foreach (var item in outtasks)
                {
                    ///判断是否需要移库
                }
                #endregion
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
            }
        }
        #endregion
        /// <summary>
        /// ä¸‹å‘外形检测成功任务
        /// </summary>
        /// <param name="tasks"></param>
        public void SendCheckShapeingOkTask(List<Dt_Task> tasks)
        {
            FOURBOTnewMovePodTask fOURBOTnewMovePodTask = new();
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(FOURBOTnewMovePodTask)) ?? throw new Exception("未找到四向车任务下发接口配置信息!请检查接口配置");
                List<Dt_RGVLocationInfo> rGVLocationInfos = new List<Dt_RGVLocationInfo>();
                foreach (var item in tasks)
                {
                    #region èŽ·å–è´§ä½
                    var rGVLocationInfo = _rGVLocationInfoService.GetFreeLocationInfo(item.Roadway);
                    if (rGVLocationInfo == null)
                    {
                        item.ExceptionMessage = $"未找到终点库区【{item.Roadway}】可用空货位!";
                    }
                    #endregion
                    else
                    {
                        item.CurrentAddress = item.NextAddress;
                        item.NextAddress = rGVLocationInfo.LocationCode;
                        fOURBOTnewMovePodTask.priority = item.Grade;
                        fOURBOTnewMovePodTask.podID = item.PalletCode;
                        fOURBOTnewMovePodTask.destination = item.NextAddress;
                        fOURBOTnewMovePodTask.desExt = new
                        {
                            unload = 1//是否放下容器,0否1是
                        };
                        fOURBOTnewMovePodTask.desType = 2;
                        string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                        FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                        if (fOURBOTReturn.returnCode == 0)
                        {
                            item.RGVTaskId = fOURBOTReturn.data.taskID;
                            item.TaskState = (int)TaskStatusEnum.Puting;
                            rGVLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                            rGVLocationInfos.Add(rGVLocationInfo);
                        }
                    }
                }
                _taskService.Db.Ado.BeginTran();
                _taskService.UpdateData(tasks);
                _rGVLocationInfoService.UpdateData(rGVLocationInfos);
                _taskService.Db.Ado.CommitTran();
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs
@@ -29,6 +29,16 @@
                    var Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.MLInbound || x.TaskType == (int)TaskTypeEnum.MLOutbound).ToList();
                    if (Tasks.Count > 0) SendGALAXISTask(Tasks);
                    #endregion
                    #region æŸ¥æ‰¾RGV任务
                    Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.CPInbound || x.TaskType == (int)TaskTypeEnum.CPOutbound).ToList();
                    if (Tasks.Count > 0) SendRGVTask(Tasks);
                    #endregion
                    #region æŸ¥æ‰¾æµ·åº·AGV任务
                    Tasks = newTasks.Where(x => x.TaskType == (int)TaskTypeEnum.Carry || x.TaskType == (int)TaskTypeEnum.CJCarry || x.TaskType == (int)TaskTypeEnum.CJInbound || x.TaskType == (int)TaskTypeEnum.CJOutbound).ToList();
                    if (Tasks.Count > 0) SendHIKROBOTTask(Tasks);
                    #endregion
                }
            }
            catch (Exception ex)
@@ -46,68 +56,13 @@
        {
            try
            {
                var Tasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == (int)TaskStatusEnum.CheckShapeingOk).ToList();
                SendCheckShapeingOkTask(Tasks);
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
            }
        }
        #endregion
        #region ä¸‹å‘凯乐士AGV任务
        public void SendGALAXISTask(List<Dt_Task> tasks)
        {
            GALAXISTaskInfo gALAXISTaskInfo = new GALAXISTaskInfo();
            try
            {
                gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss");
                gALAXISTaskInfo.msgTime = DateTime.Now.ToString();
                gALAXISTaskInfo.tasks = new List<GALAXISTask>();
                foreach (var task in tasks)
                {
                    GALAXISTask gALAXISTask = new GALAXISTask()
                    {
                        taskId = task.WMSTaskNum,
                        taskType = task.TaskType == (int)TaskTypeEnum.MLInbound ? 0 : 1,
                        barCode = task.PalletCode,
                        endNode = task.TargetAddress,
                        startNode = task.SourceAddress,
                        priorityCode = task.Grade
                    };
                    gALAXISTaskInfo.tasks.Add(gALAXISTask);
                }
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("未找到凯乐士AGV任务下发接口配置信息!请检查接口配置");
                string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
                GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                if (agvContent.success)
                {
                    if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo);
                    tasks.ForEach(task =>
                    {
                        task.TaskState = (int)TaskStatusEnum.Execut;
                    });
                    _taskService.UpdateData(tasks);
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
            }
        }
        #endregion
        #region ä¸‹å‘四向车任务
        public void SendRGVTask(List<Dt_Task> tasks)
        {
        }
        #endregion
        #region ä¸‹å‘海康AGV任务
        public void SendHIKROBOTTask(List<Dt_Task> tasks)
        {
        }
        #endregion
    }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs
@@ -28,10 +28,12 @@
    {
        private readonly ITaskService _taskService;
        private readonly IApiInfoService _apiInfoService;
        public TaskJob(ITaskService taskService, IApiInfoService apiInfoService)
        private readonly IRGVLocationInfoService _rGVLocationInfoService;
        public TaskJob(ITaskService taskService, IApiInfoService apiInfoService, IRGVLocationInfoService rGVLocationInfoService)
        {
            _taskService = taskService;//注入
            _apiInfoService = apiInfoService;
            _rGVLocationInfoService = rGVLocationInfoService;
        }
        public Task Execute(IJobExecutionContext context)