已添加5个文件
已修改8个文件
477 ■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSUpOrDownContainerDTO.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskErrorMessageService.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_TaskErrorMessage.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskErrorMessageController.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskErrorMessageService.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs
@@ -98,19 +98,19 @@
                    List<Dt_RGVLocationInfo> dt_RGVLocationInfos = BaseDal.QueryData(x => x.RoadwayNo == items.Key);//查找当前巷道号货位
                    if (item.LocationType == 1)
                    {
                        rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).FirstOrDefault();//判断浅深度货位是否有货
                        rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus != LocationStatusEnum.Free.ObjToInt()).FirstOrDefault();//判断浅深度货位是否有货
                        if (rGVLocationInfo != null) break;
                        return item;
                    }
                    else
                    {
                        rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).OrderByDescending(x => x.Depth).FirstOrDefault();//判断浅深度货位是否有货
                        rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth < item.Depth && x.LocationStatus != LocationStatusEnum.Free.ObjToInt()).OrderByDescending(x => x.Depth).FirstOrDefault();//判断浅深度货位是否有货
                        if (rGVLocationInfo != null)
                        {
                            rGVLocationInfo = dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).OrderBy(x => x.Depth).FirstOrDefault();
                            if (rGVLocationInfo != null)
                            {
                                if (dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()).Any()) rGVLocationInfo = null;
                                if (dt_RGVLocationInfos.Where(x => x.Depth > rGVLocationInfo.Depth && x.LocationStatus != LocationStatusEnum.Free.ObjToInt()).Any()) rGVLocationInfo = null;
                                else return rGVLocationInfo;
                            }
                        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSUpOrDownContainerDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.WMS
{
    public class WMSUpOrDownContainerDTO
    {
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        public string locationCode { get; set; }
        /// <summary>
        /// æ–™ç®±æ¡ç 
        /// </summary>
        public string containerCode { get; set; }
        /// <summary>
        /// æµå‘
        /// 1上架2下架
        /// </summary>
        public int direction { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskErrorMessageService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_ITaskInfoService
{
    public interface ITaskErrorMessageService : IService<Dt_TaskErrorMessage>
    {
        /// <summary>
        /// ä»“储层(数据库访问)
        /// </summary>
        IRepository<Dt_TaskErrorMessage> Repository { get; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -75,14 +75,14 @@
        /// </summary>
        /// <param name="wMSCancelTask">取消任务实体类</param>
        /// <returns></returns>
         WebResponseContent CancelWMSTask(WMSCancelTask wMSCancelTask);
        WebResponseContent CancelWMSTask(WMSCancelTask wMSCancelTask);
        /// <summary>
        /// ä¿®æ”¹ä»»åŠ¡ä¼˜å…ˆçº§
        /// </summary>
        /// <param name="updateTaskPriority"></param>
        /// <returns></returns>
         WebResponseContent UpdateWMSTaskPriority(WMSUpdateTaskPriority updateTaskPriority);
        WebResponseContent UpdateWMSTaskPriority(WMSUpdateTaskPriority updateTaskPriority);
        /// <summary>
        /// æ ¹æ®æ‰˜ç›˜å·ã€èµ·å§‹åœ°å€å‘WMS请求任务
@@ -210,7 +210,7 @@
        /// <param name="taskNum">任务号</param>
        /// <returns>返回处理结果</returns>
        WebResponseContent TaskStatusRecovery(int taskNum);
        WebResponseContent ErrorTaskFeedback(Dt_Task dt_Task, bool Del);
        WebResponseContent ErrorTaskFeedback(Dt_Task dt_Task, bool Del = false, string ErrorCode = "");
        /// <summary>
        /// å›žæ»šä»»åŠ¡çŠ¶æ€
        /// </summary>
@@ -233,7 +233,7 @@
        /// <param name="deviceTypeEnum"></param>
        /// <param name="locationStatusEnum"></param>
        /// <returns></returns>
        WebResponseContent UpdateLocationStatus(string locationCode,string palletCode, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum);
        WebResponseContent UpdateLocationStatus(string locationCode, string palletCode, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum);
        WebResponseContent ModifyWMSLayoutZone(WMSUpdateLocationArea wMSUpdateLocationArea);
@@ -268,7 +268,7 @@
        /// <param name="taskCode">任务号</param>
        /// <param name="containerCode">容器编码</param>
        /// <returns></returns>
        public WebResponseContent MaterialBoxInspection(string taskCode ,string containerCode);
        public WebResponseContent MaterialBoxInspection(string taskCode, string containerCode);
        /// <summary>
        /// 4F提升机出口托盘号上报WMS
@@ -311,7 +311,12 @@
        /// </summary>
        /// <param name="TaskCode">任务号</param>
        /// <returns></returns>
        WebResponseContent Hikvisiontaskscontinue(string TaskCode, string Address=null);
        WebResponseContent Hikvisiontaskscontinue(string TaskCode, string Address = null);
        /// <summary>
        /// å¹³åº“货位上下架容器
        /// </summary>
        /// <param name="wMSUpOrDown"></param>
        /// <returns></returns>
        WebResponseContent UpOrDownContainer(WMSUpOrDownContainerDTO wMSUpOrDown);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_TaskErrorMessage.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,55 @@
using Magicodes.ExporterAndImporter.Core;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.DB.Models;
namespace WIDESEAWCS_Model.Models
{
    [SugarTable(nameof(Dt_TaskErrorMessage), "任务异常信息")]
    public class Dt_TaskErrorMessage : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [ImporterHeader(Name = "主键")]
        [ExporterHeader(DisplayName = "主键")]
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int TaskId { get; set; }
        /// <summary>
        /// é”™è¯¯ä»£ç 
        /// </summary>
        [ImporterHeader(Name = "错误代码")]
        [ExporterHeader(DisplayName = "错误代码")]
        [SugarColumn(IsNullable = false, ColumnDescription = "错误代码")]
        public int ErrorCode { get; set; }
        /// <summary>
        /// å¼‚常信息英文
        /// </summary>
        [ImporterHeader(Name = "异常信息英文")]
        [ExporterHeader(DisplayName = "异常信息英文")]
        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "异常信息英文")]
        public string ErrorMessage { get; set; }
        /// <summary>
        /// å¼‚常信息
        /// </summary>
        [ImporterHeader(Name = "异常信息")]
        [ExporterHeader(DisplayName = "异常信息")]
        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "异常信息")]
        public string ExceptionMessage { get; set; }
        /// <summary>
        /// è®¾å¤‡ç±»åž‹ï¼Œ0凯乐士,1海康,2四向车
        /// </summary>
        [ImporterHeader(Name = "设备类型")]
        [ExporterHeader(DisplayName = "设备类型")]
        [SugarColumn(IsNullable = false, ColumnDescription = "设备类型")]
        public int DeviceType { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskErrorMessageController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_WCSServer.Controllers.Task
{
    [Route("api/TaskErrorMessage")]
    [ApiController]
    public class TaskErrorMessageController : ApiBaseController<ITaskErrorMessageService, Dt_TaskErrorMessage>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public TaskErrorMessageController(ITaskErrorMessageService service, IHttpContextAccessor httpContextAccessor) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs
@@ -47,6 +47,18 @@
        }
        /// <summary>
        /// å¹³åº“货位上下架容器
        /// </summary>
        /// <param name="taskDTOs"></param>
        /// <returns></returns>
        [HttpPost, Route("UpOrDownContainer"), AllowAnonymous]
        public WMSReturn UpOrDownContainer([FromBody] WMSUpOrDownContainerDTO wMSUpOrDown)
        {
            WebResponseContent content = _taskService.UpOrDownContainer(wMSUpOrDown);
            return WMSReturnMethod.ReturnWMS(content);
        }
        /// <summary>
        /// å–消任务
        /// </summary>
        /// <param name="wMSCancelTask"></param>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -212,8 +212,14 @@
                Dt_StationManger? stationInfo = null;
                Dt_Task dt_Task = null;
                //入库 åˆ°ä¸€æ¥¼ä¸‰ä¸ªç«™å°çš„位置
                if (taskType == (int)TaskTypeEnum.Q3RK)
                if (taskType == (int)TaskTypeEnum.Q3RK)//6-1楼
                {
                    var  ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点站台【{taskDTO.toLocationCode}】!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode ) ?? throw new Exception($"未找到{taskDTO.fromLocationCode}起点货位");
                    if (StationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{StationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    if (StationInfo.StationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前状态不可以出库");
                    if (StationInfo.FloorNumber != "FF") throw new Exception($"【{taskDTO.fromLocationCode}】的楼层和任务类型楼层不匹配");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -231,10 +237,15 @@
                    };
                }
                //出库
                if (taskType == (int)TaskTypeEnum.Q3CK)
                if (taskType == (int)TaskTypeEnum.Q3CK)//1-6楼
                {
                    //stationInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    //if (stationInfo.IsOccupied != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未{taskDTO.toLocationCode}终点货位");
                    if (StationInfo.StationStatus != (int)LocationStatusEnum.Free) throw new Exception($"终点库位【{taskDTO.toLocationCode}】当前状态不可以放货");
                    if (StationInfo.FloorNumber != "FF") throw new Exception($"终点库位【{taskDTO.toLocationCode}】的楼层与任务类型楼层不匹配");
                    var ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点站台【{taskDTO.fromLocationCode}】!");
                    if (ionInfo.Remark != taskDTO.containerCode) throw new Exception($"起点站台【{taskDTO.fromLocationCode}】绑定料箱号【{ionInfo.Remark}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -285,21 +296,15 @@
            Dt_StationInfo? stationInfo = null;
            try
            {
                //#region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
                //if (taskType!= (int)TaskTypeEnum.CK3F)
                //{
                //    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                //    if (stationInfo.StationName != LocationStatusEnum.InStock.ToString()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                //    if (stationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{stationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                //}
                //else
                //{
                //    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                //    if (stationInfo.StationName != LocationStatusEnum.InStock.ToString()) throw new Exception($"起点库位【{taskDTO.toLocationCode}】当前库位状态不可出库!");
                //}
                //#endregion
                #region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
               var reslut= ValidateLocationForTask(taskType,taskDTO);
                if (!reslut.Status)
                {
                    throw new Exception(reslut.Message);
                }
                #endregion
                Dt_Task dt_Task = new Dt_Task()
                 Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
@@ -337,6 +342,13 @@
            try
            {
                var stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (stationInfo.StationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不是有货!");
                if (stationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"当前库位【{taskDTO.fromLocationCode}】绑定料箱号【{stationInfo.PalletCode}】与任务的料箱号【{taskDTO.containerCode}】不匹配");
                var stationInfo2 = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                if (stationInfo2.StationStatus != (int)LocationStatusEnum.Free) throw new Exception($"终点库位【{taskDTO.toLocationCode}】当前库位状态不是空闲!");
                var dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskErrorMessageService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoService
{
    public class TaskErrorMessageService : ServiceBase<Dt_TaskErrorMessage, IRepository<Dt_TaskErrorMessage>>, ITaskErrorMessageService
    {
        public TaskErrorMessageService(IRepository<Dt_TaskErrorMessage> BaseDal) : base(BaseDal)
        {
        }
        public IRepository<Dt_TaskErrorMessage> Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs
@@ -8,6 +8,7 @@
using System.Reflection.Metadata;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.LocationEnum;
@@ -176,7 +177,7 @@
                                    BaseDal.UpdateData(task);
                                }
                                // //四楼出提升机 å…¥åº“ ä¹‹å‰æ˜¯AGV_ToExecute  //要写成取货完成状态TakeFinish
                                else if ((task.TaskType == TaskTypeEnum.Q1TSJ4.ObjToInt() || task.TaskType == TaskTypeEnum.F03.ObjToInt()) && task.TaskState == (int)TaskStatusEnum.AGV_ToExecute)
                                else if ((task.TaskType == TaskTypeEnum.Q1TSJ4.ObjToInt() || task.TaskType == TaskTypeEnum.F03.ObjToInt()) && task.TaskState == (int)TaskStatusEnum.TakeFinish)
                                {
                                    var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
                                    if (device == null) task.ExceptionMessage = "未找到提升机信息";
@@ -283,7 +284,7 @@
                        case "intolift": //进入电梯
                            {
                                //六楼到一楼的入库任务
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01)
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01 || task.TaskType == (int)TaskTypeEnum.Q3CK)
                                {
                                    task.TaskState = TaskStatusEnum.Hkintolift.ObjToInt();
                                    BaseDal.UpdateData(task);
@@ -292,7 +293,7 @@
                            break;
                        case "leavelift": //离开电梯
                            {
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01)
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01|| task.TaskType == (int)TaskTypeEnum.Q3CK)
                                {
                                    task.TaskState = TaskStatusEnum.HKleavelift.ObjToInt();
                                    BaseDal.UpdateData(task);
@@ -391,6 +392,21 @@
                                    TaskCompleted(task, deviceTypeEnum);
                                }
                            }
                            if (Rgv.content.status == 5)
                            {
                                task.ExceptionMessage = Rgv.content.errorReason;
                                var Error = _taskErrorMessageService.Repository.QueryFirst(x => x.ErrorCode == Rgv.content.errorCode && x.DeviceType == (int)deviceTypeEnum);
                                if (Error != null)
                                {
                                    task.ExceptionMessage = Error.ExceptionMessage;
                                    MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
                                    if (matches.Count > 0)
                                        task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
                                    ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
                                }
                                else
                                    ErrorTaskFeedback(task, true);
                            }
                        }
                    }
                }
@@ -405,6 +421,30 @@
                _trackloginfoService.AddTrackLog(TaskDTO, content, $"{deviceName}任务状态反馈", "", "");
            }
            return content;
        }
        #endregion
        #region å¼‚常信息转换
        /// <summary>
        /// å¼‚常信息()内容转换
        /// </summary>
        /// <param name="source"></param>
        /// <param name="targetTemplate"></param>
        /// <returns></returns>
        public string ReplacePlaceholders(string source, string targetTemplate)
        {
            // æå–源字符串中的所有括号值
            var values = Regex.Matches(source, @"\(([^)]+)\)")
                              .Cast<Match>()
                              .Select(m => m.Groups[1].Value)
                              .ToList();
            // æ›¿æ¢ç›®æ ‡æ¨¡æ¿ä¸­çš„æ‰€æœ‰ (%v)
            int idx = 0;
            string result = Regex.Replace(targetTemplate, @"\(\%v\)", _ =>
                idx < values.Count ? values[idx++] : "");
            return result;
        }
        #endregion
@@ -597,38 +637,22 @@
                        dt_RGVLocationInfo.LocationStatus = locationStatusEnum.ObjToInt();
                        _rGVLocationInfoService.Repository.UpdateData(dt_RGVLocationInfo);
                    }
                }
                else//平库库位
                {
                }
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion
        #region æ›´æ–°ä¸€æ¥¼ç«™å°çŠ¶æ€
        public WebResponseContent UpdateStandStatus(Dt_Task task, string stationCode, LocationStatusEnum locationStatusEnum)
        {
            try
            {
                Dt_StationManger? stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == task.TargetAddress);
                //stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                if (stationManger != null)
                {
                    if (locationStatusEnum == LocationStatusEnum.Free) //如果起点完成就给货位赋值托盘号
                    Dt_StationManger stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == locationCode);
                    if (stationManger != null)
                    {
                        stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                        if (locationStatusEnum == LocationStatusEnum.Free) //如果起点完成就给货位赋值托盘号
                        {
                            stationManger.Remark = "";
                            stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
                        }
                        else
                        {
                            stationManger.Remark = palletCode;
                            stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                        }
                        _stationMangerService.UpdateData(stationManger);
                    }
                    else
                    {
                        stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
                    }
                    _stationMangerService.UpdateData(stationManger);
                }
                return WebResponseContent.Instance.OK();
            }
@@ -640,7 +664,7 @@
        #endregion
        #region ä¸ŠæŠ¥WMS
        public WebResponseContent TaskFeedback(Dt_Task dt_Task, int Status, bool Del = true)
        public WebResponseContent TaskFeedback(Dt_Task dt_Task, int Status, bool Del = false)
        {
            WebResponseContent content = new WebResponseContent();
            WMSInOutBoundCompleteFeedback boundCompleteFeedback = new WMSInOutBoundCompleteFeedback();
@@ -683,7 +707,7 @@
        }
        #endregion
        #region å¤±è´¥ä»»åŠ¡ä¸ŠæŠ¥WMS并删除任务
        public WebResponseContent ErrorTaskFeedback(Dt_Task dt_Task, bool Del)
        public WebResponseContent ErrorTaskFeedback(Dt_Task dt_Task, bool Del = false, string ErrorCode = "")
        {
            WebResponseContent content = new WebResponseContent();
            WMSInOutBoundCompleteFeedback boundCompleteFeedback = new WMSInOutBoundCompleteFeedback();
@@ -699,7 +723,7 @@
                    boundCompleteFeedback.fromStationCode = dt_Task.SourceAddress;
                    boundCompleteFeedback.toLocationCode = dt_Task.TargetAddress;
                    boundCompleteFeedback.status = 3;
                    boundCompleteFeedback.custStatus = "";
                    boundCompleteFeedback.custStatus = ErrorCode;
                    boundCompleteFeedback.memo = dt_Task.ExceptionMessage;
                    string response = HttpHelper.Post(apiInfo.ApiAddress, boundCompleteFeedback.Serialize());
                    agvContent = response.DeserializeObject<WMSReturn>();
@@ -720,15 +744,12 @@
            finally
            {
                _trackloginfoService.AddTrackLog(boundCompleteFeedback, content, "出入库任务状态反馈WMS", "", "");
                if (agvContent != null && agvContent.code == 200 && Del) BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.自动删除);
                if (agvContent != null && agvContent.code == 200 && Del)
                    BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.自动删除);
                else BaseDal.UpdateData(dt_Task);
            }
            return content;
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -57,6 +57,7 @@
        private readonly IApiInfoService _apiInfoService;
        private readonly IStationMangerService _stationMangerService;
        private readonly IStationInfoService _stationInfo;
        private readonly ITaskErrorMessageService _taskErrorMessageService;
        private readonly IMapper _mapper;
        private Dictionary<string, OrderByType> _taskOrderBy = new()
@@ -76,7 +77,7 @@
        /// </summary>
        public IRepository<Dt_Task> Repository => BaseDal;
        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService, IStationInfoService stationInfo) : base(BaseDal)
        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService, IStationInfoService stationInfo, ITaskErrorMessageService taskErrorMessageService) : base(BaseDal)
        {
            _routerService = routerService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -89,6 +90,7 @@
            _trackloginfoService = trackloginfoService;
            _stationMangerService = stationMangerService;
            _stationInfo = stationInfo;
            _taskErrorMessageService = taskErrorMessageService;
        }
        public WebResponseContent ReceiveWMSTask([NotNull] List<WMSTasksDTO> taskDTOs)
        {
@@ -189,9 +191,9 @@
                                content = HKF01Transport(task, item.taskType);
                                break;
                            case (int)TaskTypeEnum.F04:
                            case (int)TaskTypeEnum.F03:
                            case (int)TaskTypeEnum.F02:
                            case (int)TaskTypeEnum.RK3F:
                            case (int)TaskTypeEnum.F02:
                            case (int)TaskTypeEnum.F03:
                            case (int)TaskTypeEnum.CK3F:
                                content = CJCarryTaske(task, item.taskType);
                                objects.Add(content.Data);
@@ -1237,11 +1239,11 @@
        public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode)
        {
            WebResponseContent content = new WebResponseContent();
            inboundElevatorExitDTO inboundElevator=new inboundElevatorExitDTO();
            inboundElevatorExitDTO inboundElevator = new inboundElevatorExitDTO();
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(inboundElevatorExitDTO)) ?? throw new Exception("未找到4F提升机出口托盘号上报WMS接口配置信息!请检查接口配置");
                inboundElevator.containerCode= containerCode;
                inboundElevator.containerCode = containerCode;
                inboundElevator.toLocationCode = LocationCode;
                string response = HttpHelper.Post(apiInfo.ApiAddress, inboundElevator.Serialize());
                content.OK(data: response);
@@ -1278,6 +1280,7 @@
                string dataJson = wMSReturn.result.ToString();
                Exists? exists = JsonConvert.DeserializeObject<Exists>(dataJson);
                if (exists == null) throw new Exception($"WMS返回结果的result转换失败");
                if (exists.taskExists) return WebResponseContent.Instance.OK();
                return WebResponseContent.Instance.OK(exists.errorAreaCode);
            }
            catch (Exception ex)
@@ -1299,6 +1302,41 @@
            throw new NotImplementedException();
        }
        /// <summary>
        /// å¹³åº“货位上下架容器
        /// </summary>
        /// <param name="wMSUpOrDown"></param>
        /// <returns></returns>
        public WebResponseContent UpOrDownContainer(WMSUpOrDownContainerDTO wMSUpOrDown)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StationInfo stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == wMSUpOrDown.locationCode) ?? throw new Exception($"未找到货位【{wMSUpOrDown.locationCode}】信息");
                if (wMSUpOrDown.direction == 1)
                {
                    stationInfo.StationStatus = LocationStatusEnum.InStock.ObjToInt();
                    stationInfo.PalletCode = wMSUpOrDown.containerCode;
                }
                else
                {
                    stationInfo.StationStatus = LocationStatusEnum.Free.ObjToInt();
                    stationInfo.PalletCode = "";
                }
                _stationInfo.UpdateData(stationInfo);
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(wMSUpOrDown, content, "平库货位上下架容器", "", "");
            }
            return content;
        }
        /// <summary>
        /// å®¹å™¨æµåŠ¨è¯·æ±‚
        /// </summary>
        /// <param name="wMSContainerFlow"></param>
@@ -1306,6 +1344,7 @@
        /// <exception cref="NotImplementedException"></exception>
        public WebResponseContent ContainerRequest(WMSContainerFlow wMSContainerFlow)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StationManger stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == wMSContainerFlow.slotCode) ?? throw new Exception($"未找到站台【{wMSContainerFlow.slotCode}】信息");
@@ -1313,20 +1352,26 @@
                if (wMSContainerFlow.direction == "200")
                {
                    stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
                    stationManger.Remark = "";
                    FOURBOToccupyStation fOURBOToccupyStation = new FOURBOToccupyStation()
                    {
                        stationCode = wMSContainerFlow.slotCode,
                    };
                    string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOToccupyStation.Serialize());
                    FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                    content.OK(data: fOURBOTReturn);
                    if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
                    _stationMangerService.UpdateData(stationManger);
                }
                return WebResponseContent.Instance.OK();
                return content.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
                return content.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(wMSContainerFlow, content, "容器流动请求", "", "");
            }
        }
        /// <summary>
@@ -1379,11 +1424,21 @@
                //task.TaskState = (int)TaskStatusEnum.Execut;
                //BaseDal.UpdateData(task);
                #endregion
                #region ä¸Šæž¶ä¸­éœ€è¦å°†ç«™å°çŠ¶æ€æ”¹ä¸ºå ç”¨ ç»‘定容器编码
                stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                stationManger.Remark = iQC.ContainerCode;
                _stationMangerService.UpdateData(stationManger);
                #endregion
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(iQC, content, "IQC质检结果反馈", "", "");
            }
        }
@@ -1395,6 +1450,7 @@
        /// <exception cref="NotImplementedException"></exception>
        public WebResponseContent multiSetNodeStatus(FOURBOTStorageStatusNotify fOURBOTStorageStatusNotify)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                var Agvlocation = _rGVLocationInfoService.Repository.QueryData(x => fOURBOTStorageStatusNotify.storageCode.Contains(x.LocationCode));
@@ -1403,12 +1459,16 @@
                    item.EnableStatus = (int)(fOURBOTStorageStatusNotify.disable == 0 ? EnableStatusEnum.Normal : EnableStatusEnum.Disable);
                }
                _rGVLocationInfoService.UpdateData(Agvlocation);
                return WebResponseContent.Instance.OK();
                return content.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(fOURBOTStorageStatusNotify, content, "批量更新储位状态", "", "");
            }
        }
@@ -1438,6 +1498,71 @@
            }
        }
        /// <summary>
        /// æ ¡éªŒä»»åŠ¡ç›¸å…³çš„åº“ä½çŠ¶æ€å’Œç»‘å®šå…³ç³»
        /// </summary>
        /// <param name="taskType">任务类型</param>
        /// <param name="taskDTO">任务DTO</param>
        /// <returns>返回起点库位和终点库位信息</returns>
        /// <exception cref="Exception">校验失败时抛出异常</exception>
        private WebResponseContent ValidateLocationForTask(int taskType, TaskDTO taskDTO)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                #region
                // å…¥åº“类任务(需要校验终点库位)
                if (taskType == (int)TaskTypeEnum.CK3F || taskType == (int)TaskTypeEnum.F03)
                {
                    var toStation = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode)
                          ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                    if (toStation.StationStatus != (int)LocationStatusEnum.Free)
                        throw new Exception($"终点库位【{taskDTO.toLocationCode}】库位状态不可入库!");
                }
                // å‡ºåº“类任务(需要校验起点库位)
                else if (taskType == (int)TaskTypeEnum.RK3F || taskType == (int)TaskTypeEnum.F04)
                {
                    var fromStation = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode)
                        ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    if (fromStation.StationStatus != (int)LocationStatusEnum.InStock)
                        throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    if (fromStation.PalletCode != taskDTO.containerCode)
                        throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{fromStation.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                }
                // ç§»åº“类任务(需要同时校验起点和终点)
                else if (taskType == (int)TaskTypeEnum.F02)
                {
                    // æ ¡éªŒç»ˆç‚¹åº“位
                    var toStation = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode)
                        ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                    if (toStation.StationStatus != (int)LocationStatusEnum.Free)
                        throw new Exception($"终点库位【{taskDTO.toLocationCode}】库位状态不可入库!");
                    // æ ¡éªŒèµ·ç‚¹åº“位
                    var fromStation = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode)
                        ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    if (fromStation.StationStatus != (int)LocationStatusEnum.InStock)
                        throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    if (fromStation.PalletCode != taskDTO.containerCode)
                        throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{fromStation.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                }
                #endregion
                return content.OK();
            }
            catch (Exception ex)
            {
                return content.Error(ex.Message);
            }
        }
    }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs
@@ -207,6 +207,7 @@
                                }
                                else
                                {
                                    RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                    if (!string.IsNullOrEmpty(Verification.Message)) RK3FTask.TargetAddress = Verification.Message;
                                    //如果料箱检验成功就写入读码器的值
                                    var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.TargetAddress);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs
@@ -183,9 +183,9 @@
                };
                requestData = request;  // ä¿å­˜è¯·æ±‚数据用于日志
                //content.candidatePodIDs = tasks.Select(x => x.PalletCode).ToList();
                string response = HttpHelper.Post("http://127.0.0.1:4523/m2/6165241-5857331-default/440906899?apifoxApiId=440906899", request.Serialize());
                //string response = HttpHelper.Post("http://127.0.0.1:4523/m2/6165241-5857331-default/440906899?apifoxApiId=440906899", request.Serialize());
                //string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                content.OK(data: fOURBOTReturn);
                if (fOURBOTReturn.returnCode == 0)