已添加5个文件
已修改11个文件
1152 ■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HoistEnum.cs 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs 318 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/HKTaskExtend.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs
@@ -3,8 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -12,10 +16,78 @@
{
    public class ApiInfoService : ServiceBase<Dt_ApiInfo, IRepository<Dt_ApiInfo>>, IApiInfoService
    {
        public ApiInfoService(IRepository<Dt_ApiInfo> BaseDal) : base(BaseDal)
        private readonly IInterfaceLogService _interfaceLogService;
        public ApiInfoService(IRepository<Dt_ApiInfo> BaseDal, IInterfaceLogService interfaceLogService) : base(BaseDal)
        {
            _interfaceLogService = interfaceLogService;
        }
        public IRepository<Dt_ApiInfo> Repository => BaseDal;
        /// <summary>
        /// Post接口请求
        /// </summary>
        /// <param name="apiCode">接口编号</param>
        /// <param name="requestParameters">请求内容</param>
        /// <param name="remark">备注</param>
        /// <param name="isAdd">是否添加日志</param>
        /// <returns></returns>
        public WebResponseContent PostInterfaceRequest(string apiCode, string requestParameters, string remark, bool isAdd = true)
        {
            WebResponseContent content = new WebResponseContent();
            string response = string.Empty;
            Dt_ApiInfo? apiInfo = null;
            try
            {
                apiInfo = BaseDal.QueryFirst(x => x.ApiCode == apiCode) ?? throw new Exception($"未找到{remark}接口配置信息!请检查接口配置");
                response = HttpHelper.Post(apiInfo.ApiAddress, requestParameters);
                if (apiInfo.Remark.Contains("四向车"))
                {
                    FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                    if (fOURBOTReturn == null) throw new Exception($"{apiInfo.Remark}响应内容转换实体失败!");
                    if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
                    content.Data = fOURBOTReturn;
                }
                else if (apiInfo.Remark.Contains("凯乐士"))
                {
                }
                else if (apiInfo.Remark.Contains("海康"))
                {
                }
                else if (apiInfo.Remark.Contains("WMS"))
                {
                }
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            finally
            {
                if (isAdd && !string.IsNullOrEmpty(response) && apiInfo != null)
                {
                    Dt_InterfaceLog interfaceLog = new Dt_InterfaceLog()
                    {
                        ApiCode = apiCode,
                        RequestParameters = requestParameters,
                        ApiAddress = apiInfo.ApiAddress,
                        ApiName = apiInfo.ApiName,
                        PushFrequency = 1,
                        PushState = content.Status ? 1 : 2,
                        Requestor = "WCS",
                        Recipient = apiInfo.Remark,
                        ResponseParameters = response,
                        Creater = "System",
                        Remark = content.Status ? remark : content.Message,
                    };
                    _interfaceLogService.Repository.AddData(interfaceLog);
                }
            }
            return content;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_BasicInfoService
{
    public class InterfaceLogService : ServiceBase<Dt_InterfaceLog, IRepository<Dt_InterfaceLog>>, IInterfaceLogService
    {
        public InterfaceLogService(IRepository<Dt_InterfaceLog> BaseDal) : base(BaseDal)
        {
        }
        public IRepository<Dt_InterfaceLog> Repository => BaseDal;
        /// <summary>
        /// æ·»åŠ æ—¥å¿—
        /// </summary>
        /// <param name="ApiCode">接口编号</param>
        /// <param name="ApiName">接口名称</param>
        /// <param name="ApiAddress">接口地址</param>
        /// <param name="Requestor">请求方</param>
        /// <param name="RequestParameters">请求内容</param>
        /// <param name="Recipient">接收方</param>
        /// <param name="ResponseParameters">响应内容</param>
        /// <param name="Add">是否添加</param>
        /// <returns></returns>
        public WebResponseContent AddInterfaceLog(string ApiCode, string ApiName, string ApiAddress, string Requestor, string RequestParameters, string Recipient, string ResponseParameters, bool Add)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs
@@ -60,7 +60,7 @@
                    if (rGVLocationInfo == null) break;
                    Dt_Task dt_Task = new()
                    {
                        Grade = 1,
                        Grade = 66,
                        PalletCode = locationInfo.PalletCode,
                        Roadway = locationInfo.RoadwayNo,
                        TaskState = TaskStatusEnum.RGV_NewMoveTask.ObjToInt(),
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HoistEnum.cs
@@ -85,7 +85,166 @@
        /// <summary>
        /// 4楼出库扫码完成信号
        /// </summary>
        ROutScanningCompletionSignal
        ROutScanningCompletionSignal,
        #region æå‡æœºæŠ¥è­¦ä¿¡æ¯
        /// <summary>
        /// ç”µæ»šç­’3楼报警A301
        /// </summary>
        R_ElectricDrumA301,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A302
        /// </summary>
        R_ElectricDrumA302,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A303
        /// </summary>
        R_ElectricDrumA303,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A304
        /// </summary>
        R_ElectricDrumA304,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A305
        /// </summary>
        R_ElectricDrumA305,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A306
        /// </summary>
        R_ElectricDrumA306,
        /// <summary>
        /// ç”µæ»šç­’3楼报警A307
        /// </summary>
        R_ElectricDrumA307,
        /// <summary>
        /// ç”µæ»šç­’3楼提升机1报警T001
        /// </summary>
        R_ElectricDrumT001,
        /// <summary>
        /// æå‡æœº1变频器报警
        /// </summary>
        R_InverterAlarm,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A401
        /// </summary>
        R_ElectricDrumA401,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A402
        /// </summary>
        R_ElectricDrumA402,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A403
        /// </summary>
        R_ElectricDrumA403,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A404
        /// </summary>
        R_ElectricDrumA404,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A405
        /// </summary>
        R_ElectricDrumA405,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A406
        /// </summary>
        R_ElectricDrumA406,
        /// <summary>
        /// ç”µæ»šç­’4楼报警A407
        /// </summary>
        R_ElectricDrumA407,
        /// <summary>
        /// æå‡æœº2变频器报警
        /// </summary>
        R_ElectricDrumT002,
        /// <summary>
        /// æå‡æœº1上限位报警
        /// </summary>
        R_UpperlimitAlarm1,
        /// <summary>
        /// æå‡æœº1下限位报警
        /// </summary>
        R_LowerlimitAlarm1,
        /// <summary>
        /// æå‡æœº2上限位报警
        /// </summary>
        R_UpperlimitAlarm2,
        /// <summary>
        /// æå‡æœº2下限位报警
        /// </summary>
        R_LowerlimitAlarm2,
        /// <summary>
        /// è¯»ç å™¨3楼扫码异常
        /// </summary>
        R_ScancodeError1,
        /// <summary>
        /// è¯»ç å™¨4楼扫码异常
        /// </summary>
        R_ScancodeError2,
        /// <summary>
        /// ç”µæŸœæ€¥åœ3楼
        /// </summary>
        R_EmergencSytop1,
        /// <summary>
        ///  ç”µæŸœæ€¥åœ4楼
        /// </summary>
        R_EmergencSytop2,
        /// <summary>
        ///提升机急停3楼
        /// </summary>
        R_TSJEmergencSytop1,
        /// <summary>
        /// æå‡æœºæ€¥åœ4楼
        /// </summary>
        R_TSJEmergencSytop2,
        /// <summary>
        /// ç”µæ»šç­’4楼报警T002
        /// </summary>
        R_DrumAlarmT002,
        /// <summary>
        /// å¤‡ç”¨1
        /// </summary>
        R_TSJSpare1,
        /// <summary>
        /// å¤‡ç”¨1
        /// </summary>
        R_TSJSpare2,
        #endregion
    }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
@@ -12,5 +13,15 @@
    public interface IApiInfoService : IService<Dt_ApiInfo>
    {
        public IRepository<Dt_ApiInfo> Repository { get; }
        /// <summary>
        /// Post接口请求
        /// </summary>
        /// <param name="apiCode">接口编号</param>
        /// <param name="requestParameters">请求内容</param>
        /// <param name="remark">备注</param>
        /// <param name="isAdd">是否添加日志</param>
        /// <returns></returns>
        public WebResponseContent PostInterfaceRequest(string apiCode, string requestParameters, string remark, bool isAdd = true);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_IBasicInfoService
{
    public interface IInterfaceLogService : IService<Dt_InterfaceLog>
    {
        public IRepository<Dt_InterfaceLog> Repository { get; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs
@@ -36,6 +36,12 @@
        public string ApiAddress { get; set; }
        /// <summary>
        /// æŽ¨é€æ¬¡æ•°
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "货位行")]
        public int PushFrequency { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "备注")]
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
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_InterfaceLog), "接口日志")]
    public class Dt_InterfaceLog : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// æŽ¥å£ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "接口编号")]
        public string ApiCode { get; set; }
        /// <summary>
        /// æŽ¥å£åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "接口名称")]
        public string ApiName { get; set; }
        /// <summary>
        /// æŽ¥å£åœ°å€
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "接口地址")]
        public string ApiAddress { get; set; }
        /// <summary>
        /// æŽ¨é€æ¬¡æ•°
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "推送次数")]
        public int PushFrequency { get; set; } = 0;
        /// <summary>
        /// æŽ¨é€çŠ¶æ€
        /// 0未推送
        /// 1推送成功
        /// 2推送失败
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "推送状态")]
        public int PushState { get; set; } = 0;
        /// <summary>
        /// è¯·æ±‚æ–¹
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "请求方")]
        public string Requestor { get; set; }
        /// <summary>
        /// è¯·æ±‚内容
        /// </summary>
        [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "请求内容")]
        public string RequestParameters { get; set; }
        /// <summary>
        /// æŽ¥æ”¶æ–¹
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "接收方")]
        public string Recipient { get; set; }
        /// <summary>
        /// å“åº”内容
        /// </summary>
        [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "响应内容")]
        public string ResponseParameters { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Server.Controllers.BasicInfo
{
    /// <summary>
    ///接口信息
    /// </summary>
    [Route("api/InterfaceLog")]
    [ApiController]
    public class InterfaceLogController : ApiBaseController<IInterfaceLogService, Dt_InterfaceLog>
    {
        public InterfaceLogController(IInterfaceLogService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -365,14 +365,16 @@
                    TargetAddress = taskDTO.toLocationCode,
                    Creater = "WMS",
                };
                content = SendHIKROBOTTask(dt_Task);
                if (!content.Status) throw new Exception(content.Message);
                dt_Task.Dispatchertime = DateTime.Now;
                BaseDal.AddData(dt_Task);
                return content.OK(data: new
                {
                    taskCode = taskDTO.taskCode,
                    Message = "成功"
                });
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs
@@ -106,19 +106,27 @@
                                    else
                                    {
                                        bool Work = false;
                                        if (device.IsConnected)
                                        try
                                        {
                                            int i = 0;
                                            while (!Work && i <= 3)
                                            if (device.IsConnected)
                                            {
                                                i++;
                                                Work = device.SetValue(HoistEnum.Inboundboxon, 1, task.TargetAddress);
                                                Thread.Sleep(500);
                                                int i = 0;
                                                while (!Work && i <= 3)
                                                {
                                                    i++;
                                                    Work = device.SetValue(HoistEnum.Inboundboxon, 1, task.TargetAddress);
                                                    Thread.Sleep(500);
                                                }
                                            }
                                            if (!Work)
                                            {
                                                task.ExceptionMessage = $"【{task.TargetAddress}】写入3楼入库箱放到位失败";
                                                task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.TargetAddress}";
                                            }
                                        }
                                        if (!Work)
                                        catch (Exception ex)
                                        {
                                            task.ExceptionMessage = $"【{task.TargetAddress}】写入3楼入库箱放到位失败";
                                            task.ExceptionMessage = $"【{task.TargetAddress}】写入3楼入库箱放到位失败!{ex.Message}";
                                            task.Remark = $"{device.DeviceCode}_Inboundboxon_{1}_{task.TargetAddress}";
                                        }
                                    }
@@ -317,31 +325,40 @@
                    var task = BaseDal.QueryFirst(x => x.PalletCode == Rgv.content.podID);
                    if (task == null) throw new Exception($"未找到任务,任务编号【{Rgv.content.taskID}】");
                    //移库
                    if (task.TaskType == TaskTypeEnum.CPMoveInventory.ObjToInt() && Rgv.messageType == 10 && Rgv.content.status == 4)
                    if (task.TaskType == TaskTypeEnum.CPMoveInventory.ObjToInt())
                    {
                        deviceName += "移库";
                        WMSMoveLocationFeedback wMSMoveLocationFeedback = new WMSMoveLocationFeedback()
                        if (Rgv.messageType == 72)
                        {
                            containerCode = task.PalletCode,
                            fromStationCode = task.SourceAddress,
                            toLocationCode = task.TargetAddress
                        };
                        Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSMoveLocationFeedback));
                        WMSReturn agvContent = null;
                        if (apiInfo == null) task.ExceptionMessage = "未找到移库完成反馈WMS接口配置信息!请检查接口配置";
                        else
                            task.TaskState = TaskStatusEnum.TakeFinish.ObjToInt();
                            BaseDal.UpdateData(task);
                            UpdateLocationStatus(task.SourceAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.Free);
                        }
                        if (Rgv.messageType == 10 && Rgv.content.status == 4)
                        {
                            task.TaskState = TaskStatusEnum.Finish.ObjToInt();
                            string response = HttpHelper.Post(apiInfo.ApiAddress, wMSMoveLocationFeedback.Serialize());
                            agvContent = response.DeserializeObject<WMSReturn>();
                            content.OK(data: agvContent);
                            if (agvContent.code != 200)
                            deviceName += "移库";
                            WMSMoveLocationFeedback wMSMoveLocationFeedback = new WMSMoveLocationFeedback()
                            {
                                task.ExceptionMessage = agvContent.message;
                                content.Error(agvContent.message);
                                containerCode = task.PalletCode,
                                fromStationCode = task.SourceAddress,
                                toLocationCode = task.TargetAddress
                            };
                            Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSMoveLocationFeedback));
                            WMSReturn agvContent = null;
                            if (apiInfo == null) task.ExceptionMessage = "未找到移库完成反馈WMS接口配置信息!请检查接口配置";
                            else
                            {
                                task.TaskState = TaskStatusEnum.Finish.ObjToInt();
                                string response = HttpHelper.Post(apiInfo.ApiAddress, wMSMoveLocationFeedback.Serialize());
                                agvContent = response.DeserializeObject<WMSReturn>();
                                content.OK(data: agvContent);
                                if (agvContent.code != 200)
                                {
                                    task.ExceptionMessage = agvContent.message;
                                    content.Error(agvContent.message);
                                }
                                UpdateLocationStatus(task.TargetAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.InStock);
                                BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.自动完成);
                            }
                            UpdateLocationStatus(task.TargetAddress, task.PalletCode, deviceTypeEnum, LocationStatusEnum.InStock);
                            BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.自动完成);
                        }
                    }
                    else
@@ -397,16 +414,24 @@
                            {
                                task.ExceptionMessage = Rgv.content.errorReason;
                                var Error = _taskErrorMessageService.Repository.QueryFirst(x => x.ErrorCode == Rgv.content.errorCode && x.DeviceType == (int)deviceTypeEnum);
                                if (Error != null)
                                if (task.TaskType == (int)TaskTypeEnum.CPOutbound && task.TaskState == (int)TaskStatusEnum.Execut && Rgv.content.errorCode == 1330003)//成品出库任务下发后反馈有阻碍托,修改任务状态为新建重新查询阻碍托关系
                                {
                                    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());
                                    task.TaskState = (int)TaskStatusEnum.New;
                                    BaseDal.UpdateData(task);
                                }
                                else
                                    ErrorTaskFeedback(task, true);
                                {
                                    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);
                                }
                            }
                        }
                    }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,318 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Common;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Common.LocationEnum;
using SixLabors.ImageSharp;
using Autofac.Core;
namespace WIDESEAWCS_Tasks
{
    public partial class TSJJob
    {
        /// <summary>
        /// æµ·åº·ç»§ç»­æ‰§è¡Œä»»åŠ¡
        /// </summary>
        /// <param name="device"></param>
        public void HKConexecutTask(OtherDevice device)
        {
            List<Dt_Task> Uptasks = new List<Dt_Task>();
            //查询所有任务类型为3,4楼的入库任务类型且任务状态为AGV_WaitToExecute的任务
            var taskList = _taskService.Repository.QueryData(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt());
            //任务的目标地址对于站台号;
            foreach (var task in taskList)
            {
                //先检查设备状态
                if (device.GetValue<HoistEnum, short>(HoistEnum.EquipmentStatus, "TSJ") == 2)
                {
                    if (task.ExceptionMessage == "提升机设备故障")
                    {
                        continue;
                    }
                    task.ExceptionMessage = "提升机设备故障";
                    Uptasks.Add(task);
                    continue;
                    //throw new Exception("设备故障");
                }
                if (task.TaskType == TaskTypeEnum.RK3F.ObjToInt() || task.TaskType == TaskTypeEnum.CHUKU1.ObjToInt() || task.TaskType == TaskTypeEnum.F04.ObjToInt())
                {
                    if (task.TaskType == TaskTypeEnum.RK3F.ObjToInt())
                    {
                        //判断3楼入库箱号有无
                        if (device.GetValue<HoistEnum, short>(HoistEnum.OutboundInplace, task.TargetAddress) != 2)
                        {
                            if (task.ExceptionMessage == "3楼入库箱号有货,请先处理")
                            {
                                continue;
                            }
                            task.ExceptionMessage = "3楼入库箱号有货,请先处理";
                            Uptasks.Add(task);
                            continue;
                        }
                    }
                    else
                    {
                        if (device.GetValue<HoistEnum, short>(HoistEnum.ReturnbinAvailable, task.TargetAddress) != 2)
                        {
                            if (task.ExceptionMessage != "4F提升机入口有货")
                            {
                                task.ExceptionMessage = "4F提升机入口有货";
                                Uptasks.Add(task);
                            }
                            continue;
                        }
                    }
                    //然后调用输送线接口,通知输送线有料箱需要入库,任务举行执行
                    var result = _taskService.Hikvisiontaskscontinue(task.WMSTaskNum);
                    if (result.Status == false)
                    {
                        if (task.ExceptionMessage != result.Message)
                        {
                            task.ExceptionMessage = result.Message;
                            Uptasks.Add(task);
                        }
                        continue;
                    }
                    task.TaskState = (int)TaskStatusEnum.AGV_ToExecute;
                    task.ExceptionMessage = "";
                    Uptasks.Add(task);
                    //这里任务变成了CheckPalletCodeing
                }
                else if (task.TaskType == TaskTypeEnum.CK3F.ObjToInt() || task.TaskType == TaskTypeEnum.Q1TSJ4.ObjToInt() || task.TaskType == TaskTypeEnum.F03.ObjToInt()) //出库
                {
                    ////出库料箱缓存数量(这个是库区查询的时候要查一下,返给wms)
                    //if (device.GetValue<HoistEnum, short>(HoistEnum.Outboundmaterialbox, "TSJ") == 0) throw new Exception("没有出库料箱缓存数量为空");
                    if (task.TaskType == TaskTypeEnum.CK3F.ObjToInt())
                    {
                        //读取3楼出库料箱到位
                        if (device.GetValue<HoistEnum, short>(HoistEnum.SOutboundmaterialbox, task.SourceAddress) != 1)
                        {
                            if (task.ExceptionMessage != "3楼提升机出口光电反馈无货")
                            {
                                task.ExceptionMessage = "3楼提升机出口光电反馈无货";
                                Uptasks.Add(task);
                            }
                            continue;
                        }
                    }
                    else
                    {
                        if (device.GetValue<HoistEnum, short>(HoistEnum.FOutboundmaterialbox, task.SourceAddress) != 1)
                        {
                            if (task.ExceptionMessage != "4楼提升机出口光电反馈无货")
                            {
                                task.ExceptionMessage = "4楼提升机出口光电反馈无货";
                                Uptasks.Add(task);
                            }
                            continue;
                        }
                        if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, task.SourceAddress) != 1)
                        {
                            if (task.ExceptionMessage != "4楼提升机出口扫码完成信号没有完成")
                            {
                                task.ExceptionMessage = "4楼提升机出口扫码完成信号没有完成";
                                Uptasks.Add(task);
                            }
                            continue;
                        }
                    }
                    //然后调用输送线接口,通知输送线有料箱需要入库,任务举行执行
                    var result = _taskService.Hikvisiontaskscontinue(task.WMSTaskNum);
                    if (result.Status == false)
                    {
                        if (task.ExceptionMessage != result.Message)
                        {
                            task.ExceptionMessage = result.Message;
                            Uptasks.Add(task);
                        }
                        continue;
                    }
                    task.TaskState = (int)TaskStatusEnum.AGV_ToExecute;
                    task.ExceptionMessage = "";
                    Uptasks.Add(task);
                }
            }
            if (Uptasks.Count > 0)
            {
                _taskService.UpdateData(Uptasks);
            }
        }
        /// <summary>
        /// æ‰˜ç›˜å·ç¡®è®¤ä¸­
        /// </summary>
        /// <param name="device"></param>
        public void PalletNumConfirmation(OtherDevice device)
        {
            #region æ‰˜ç›˜å·ç¡®è®¤ä¸­
            //查找三楼入库任务状态为CheckPalletCodeing的任务托盘号确认中
            var RK3FTask = _taskService.Repository.QueryFirst(x => x.TaskType == TaskTypeEnum.RK3F.ObjToInt() && x.TaskState == (int)TaskStatusEnum.CheckPalletCodeing);
            if (RK3FTask != null)
            {
                if (device.GetValue<HoistEnum, short>(HoistEnum.RInScanningCompletionSignal, RK3FTask.TargetAddress) != 1)
                {
                    RK3FTask.ExceptionMessage = "3楼扫码完成信号没有完成";
                    _taskService.UpdateData(RK3FTask);
                }
                else //完成就把任务状态改成托盘号确认完成
                {
                    //检查3楼入库箱号是多少,然后传给wms
                    var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Inboxnumber, RK3FTask.TargetAddress);
                    if (!string.IsNullOrEmpty(BinNumber))
                    {
                        BinNumber = BinNumber.TrimEnd('\0').Substring(2);
                        //根据读到的箱号进行料箱检验,检验通过就触发读码器读取,如果不通过就抛出异常
                        var Verification = _taskService.MaterialBoxInspection(RK3FTask.WMSTaskNum, BinNumber);
                        if (!Verification.Status)
                        {
                            if (RK3FTask.ExceptionMessage != Verification.Message)
                            {
                                RK3FTask.ExceptionMessage = Verification.Message;
                                _taskService.UpdateData(RK3FTask);
                            }
                        }
                        else
                        {
                            //如果质检通过就不改变RK3FTask.TargetAddress的值,
                            if (!string.IsNullOrEmpty(Verification.Message))
                            {
                                //寻找平库货位
                                var Location = _stationInfoService.Repository.QueryFirst(x => x.StationRegion == Verification.Message.ObjToInt() && x.StationStatus == (int)LocationStatusEnum.Free && x.FloorNumber == "CC" && x.IsOccupied == (int)LocationStatusEnum.Free);
                                //这里要判断
                                if (Location == null)
                                {
                                    RK3FTask.ExceptionMessage = "$未找到{Verification.Message}区域的货位{Location}";
                                }
                                RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                RK3FTask.NextAddress = Location.StationCode;
                                RK3FTask.TargetAddress = Location.StationCode;
                                _taskService.UpdateData(RK3FTask);
                            }
                            //调用海康进行执行完成接口
                            var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.NextAddress);
                            if (result.Status)
                            {
                                RK3FTask.ExceptionMessage = "";
                                RK3FTask.TaskState = (int)TaskStatusEnum.CheckPalletCodeFinish;
                                _taskService.UpdateData(RK3FTask);
                            }
                            else
                            {
                                if (RK3FTask.ExceptionMessage != result.Message)
                                {
                                    RK3FTask.ExceptionMessage = result.Message;
                                    _taskService.UpdateData(RK3FTask);
                                }
                            }
                        }
                    }
                }
            }
            #endregion
        }
        /// <summary>
        /// 4F提升机出口托盘号上报WMS
        /// </summary>
        /// <param name="device"></param>
        public void PalletReportingToWMS(OtherDevice device)
        {
            #region 4F提升机出口托盘号上报WMS
            var Address = "TSJC4F";
            if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, Address) == 1)
            {
                var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber, Address);
                if (!string.IsNullOrEmpty(BinNumber))
                {
                    BinNumber = BinNumber.TrimEnd('\0').Substring(2);
                    _taskService.InboundElevatorExit(Address, BinNumber);
                }
            }
            #endregion
        }
        /// <summary>
        /// æå‡æœºæŠ¥è­¦
        /// </summary>
        /// <param name="device"></param>
        public void TSJAlarm(OtherDevice device)
        {
            var alarmPoints = new Dictionary<HoistEnum, string>{
            { HoistEnum.EquipmentStatus, "设备状态" },
            { HoistEnum.R_ElectricDrumA301, "电动滚筒A301报警" },
            { HoistEnum.R_ElectricDrumA302, "电动滚筒A302报警" },
            { HoistEnum.R_ElectricDrumA303, "电动滚筒A303报警" },
            { HoistEnum.R_ElectricDrumA304, "电动滚筒A304报警" },
            { HoistEnum.R_ElectricDrumA305, "电动滚筒A305报警" },
            { HoistEnum.R_ElectricDrumA306, "电动滚筒A306报警" },
            { HoistEnum.R_ElectricDrumA307, "电动滚筒A307报警" },
            { HoistEnum.R_ElectricDrumT001, "电动滚筒T001报警" },
            { HoistEnum.R_InverterAlarm, "变频器报警" },
            { HoistEnum.R_ElectricDrumA401, "电动滚筒A401报警" },
            { HoistEnum.R_ElectricDrumA402, "电动滚筒A402报警" },
            { HoistEnum.R_ElectricDrumA403, "电动滚筒A403报警" },
            { HoistEnum.R_ElectricDrumA404, "电动滚筒A404报警" },
            { HoistEnum.R_ElectricDrumA405, "电动滚筒A405报警" },
            { HoistEnum.R_ElectricDrumA406, "电动滚筒A406报警" },
            { HoistEnum.R_ElectricDrumA407, "电动滚筒A407报警" },
            { HoistEnum.R_ElectricDrumT002, "提升机2变频器报警" },
            { HoistEnum.R_UpperlimitAlarm1, "上限位报警1" },
            { HoistEnum.R_LowerlimitAlarm1, "下限位报警1" },
            { HoistEnum.R_UpperlimitAlarm2, "上限位报警2" },
            { HoistEnum.R_LowerlimitAlarm2, "下限位报警2" },
            { HoistEnum.R_ScancodeError1, "读码器3楼扫码异常" },
            { HoistEnum.R_ScancodeError2, "读码器4楼扫码异常" },
            { HoistEnum.R_EmergencSytop1, "急停1" },
            { HoistEnum.R_EmergencSytop2, "急停2" },
            { HoistEnum.R_TSJEmergencSytop1, "提升机急停1" },
            { HoistEnum.R_TSJEmergencSytop2, "提升机急停2" },
            { HoistEnum.R_DrumAlarmT002, "电滚筒4楼报警T002" },
            { HoistEnum.R_TSJSpare1, "备用报警1" },
            { HoistEnum.R_TSJSpare2, "备用报警2" }
        };
            var Address = "TSJ";
            foreach (var point in alarmPoints)
            {
                    // è¯»å–PLC值(需要根据实际API调整)
                    bool isAlarming = device.GetValue<HoistEnum, bool>(point.Key,Address);
                    // æˆ–者 device.ReadBool(point.Key);
                    if (isAlarming)
                    {
                        // æœ‰æŠ¥è­¦ï¼Œå‘送给WMS
                        //SendAlarmToWMS(device, point.Key, point.Value);
                    }
            }
        }
    }
    }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs
@@ -30,7 +30,7 @@
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class TSJJob : JobBase, IJob
    public partial class TSJJob : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly IStationMangerService _stationMangerService;
@@ -49,226 +49,11 @@
            if (flag && value != null)
            {
                OtherDevice device = (OtherDevice)value;
                //Example
                //device.GetValue  è¯»å–
                //device.SetValue  å†™å…¥
                // _taskService.Repository ä»“储层,进行数据库访问
                try
                {
                    List<Dt_Task> Uptasks = new List<Dt_Task>();
                    //查询所有任务类型为3,4楼的入库任务类型且任务状态为AGV_WaitToExecute的任务
                    var taskList = _taskService.Repository.QueryData(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt());
                    //任务的目标地址对于站台号;
                    foreach (var task in taskList)
                    {
                        //先检查设备状态
                        if (device.GetValue<HoistEnum, short>(HoistEnum.EquipmentStatus, "TSJ") == 2)
                        {
                            if (task.ExceptionMessage == "提升机设备故障")
                            {
                                continue;
                            }
                            task.ExceptionMessage = "提升机设备故障";
                            Uptasks.Add(task);
                            continue;
                            //throw new Exception("设备故障");
                        }
                        if (task.TaskType == TaskTypeEnum.RK3F.ObjToInt() || task.TaskType == TaskTypeEnum.CHUKU1.ObjToInt() || task.TaskType == TaskTypeEnum.F04.ObjToInt())
                        {
                            if (task.TaskType == TaskTypeEnum.RK3F.ObjToInt())
                            {
                                //判断3楼入库箱号有无
                                if (device.GetValue<HoistEnum, short>(HoistEnum.OutboundInplace, task.TargetAddress) != 2)
                                {
                                    if (task.ExceptionMessage == "3楼入库箱号有货,请先处理")
                                    {
                                        continue;
                                    }
                                    task.ExceptionMessage = "3楼入库箱号有货,请先处理";
                                    Uptasks.Add(task);
                                    continue;
                                }
                            }
                            else
                            {
                                if (device.GetValue<HoistEnum, short>(HoistEnum.ReturnbinAvailable, task.TargetAddress) != 2)
                                {
                                    if (task.ExceptionMessage != "4F提升机入口有货")
                                    {
                                        task.ExceptionMessage = "4F提升机入口有货";
                                        Uptasks.Add(task);
                                    }
                                    continue;
                                }
                            }
                HKConexecutTask(device);
                PalletNumConfirmation(device);
                            //然后调用输送线接口,通知输送线有料箱需要入库,任务举行执行
                            var result = _taskService.Hikvisiontaskscontinue(task.WMSTaskNum);
                            if (result.Status == false)
                            {
                                if (task.ExceptionMessage != result.Message)
                                {
                                    task.ExceptionMessage = result.Message;
                                    Uptasks.Add(task);
                                }
                                continue;
                            }
                            task.TaskState = (int)TaskStatusEnum.AGV_ToExecute;
                            task.ExceptionMessage = "";
                            Uptasks.Add(task);
                            //这里任务变成了CheckPalletCodeing
                        }
                        else if (task.TaskType == TaskTypeEnum.CK3F.ObjToInt() || task.TaskType == TaskTypeEnum.Q1TSJ4.ObjToInt() || task.TaskType == TaskTypeEnum.F03.ObjToInt()) //出库
                        {
                            ////出库料箱缓存数量(这个是库区查询的时候要查一下,返给wms)
                            //if (device.GetValue<HoistEnum, short>(HoistEnum.Outboundmaterialbox, "TSJ") == 0) throw new Exception("没有出库料箱缓存数量为空");
                            if (task.TaskType == TaskTypeEnum.CK3F.ObjToInt())
                            {
                                //读取3楼出库料箱到位
                                if (device.GetValue<HoistEnum, short>(HoistEnum.SOutboundmaterialbox, task.SourceAddress) != 1)
                                {
                                    if (task.ExceptionMessage != "3楼提升机出口光电反馈无货")
                                    {
                                        task.ExceptionMessage = "3楼提升机出口光电反馈无货";
                                        Uptasks.Add(task);
                                    }
                                    continue;
                                }
                            }
                            else
                            {
                                if (device.GetValue<HoistEnum, short>(HoistEnum.FOutboundmaterialbox, task.SourceAddress) != 1)
                                {
                                    if (task.ExceptionMessage != "4楼提升机出口光电反馈无货")
                                    {
                                        task.ExceptionMessage = "4楼提升机出口光电反馈无货";
                                        Uptasks.Add(task);
                                    }
                                    continue;
                                }
                                if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, task.SourceAddress) != 1)
                                {
                                    if (task.ExceptionMessage != "4楼提升机出口扫码完成信号没有完成")
                                    {
                                        task.ExceptionMessage = "4楼提升机出口扫码完成信号没有完成";
                                        Uptasks.Add(task);
                                    }
                                    continue;
                                }
                            }
                            //然后调用输送线接口,通知输送线有料箱需要入库,任务举行执行
                            var result = _taskService.Hikvisiontaskscontinue(task.WMSTaskNum);
                            if (result.Status == false)
                            {
                                if (task.ExceptionMessage != result.Message)
                                {
                                    task.ExceptionMessage = result.Message;
                                    Uptasks.Add(task);
                                }
                                continue;
                            }
                            task.TaskState = (int)TaskStatusEnum.AGV_ToExecute;
                            task.ExceptionMessage = "";
                            Uptasks.Add(task);
                        }
                    }
                    if (Uptasks.Count > 0)
                    {
                        _taskService.UpdateData(Uptasks);
                    }
                    #region æ‰˜ç›˜å·ç¡®è®¤ä¸­
                    //查找三楼入库任务状态为CheckPalletCodeing的任务托盘号确认中
                    var RK3FTask = _taskService.Repository.QueryFirst(x => x.TaskType == TaskTypeEnum.RK3F.ObjToInt() && x.TaskState == (int)TaskStatusEnum.CheckPalletCodeing);
                    if (RK3FTask != null)
                    {
                        if (device.GetValue<HoistEnum, short>(HoistEnum.RInScanningCompletionSignal, RK3FTask.TargetAddress) != 1)
                        {
                            RK3FTask.ExceptionMessage = "3楼扫码完成信号没有完成";
                            _taskService.UpdateData(RK3FTask);
                        }
                        else //完成就把任务状态改成托盘号确认完成
                        {
                            //检查3楼入库箱号是多少,然后传给wms
                            var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Inboxnumber, RK3FTask.TargetAddress);
                            if (!string.IsNullOrEmpty(BinNumber))
                            {
                                BinNumber = BinNumber.TrimEnd('\0').Substring(2);
                                //根据读到的箱号进行料箱检验,检验通过就触发读码器读取,如果不通过就抛出异常
                                var Verification = _taskService.MaterialBoxInspection(RK3FTask.WMSTaskNum, BinNumber);
                                if (!Verification.Status)
                                {
                                    if (RK3FTask.ExceptionMessage != Verification.Message)
                                    {
                                        RK3FTask.ExceptionMessage = Verification.Message;
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                }
                                else
                                {
                                    //如果质检通过就不改变RK3FTask.TargetAddress的值,
                                    if (!string.IsNullOrEmpty(Verification.Message))
                                    {
                                        //寻找平库货位
                                        var Location = _stationInfoService.Repository.QueryFirst(x=>x.StationRegion==Verification.Message.ObjToInt()&&x.StationStatus==(int)LocationStatusEnum.Free&&x.FloorNumber=="CC"&&x.IsOccupied==(int)LocationStatusEnum.Free);
                                        //这里要判断
                                        if (Location==null)
                                        {
                                            RK3FTask.ExceptionMessage = "$未找到{Verification.Message}区域的货位{Location}";
                                        }
                                        RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                        RK3FTask.NextAddress = Location.StationCode;
                                        RK3FTask.TargetAddress = Location.StationCode;
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                        //调用海康进行执行完成接口
                                        var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.NextAddress);
                                    if (result.Status)
                                    {
                                        RK3FTask.ExceptionMessage = "";
                                        RK3FTask.TaskState = (int)TaskStatusEnum.CheckPalletCodeFinish;
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                    else
                                    {
                                        if (RK3FTask.ExceptionMessage != result.Message)
                                        {
                                            RK3FTask.ExceptionMessage = result.Message;
                                            _taskService.UpdateData(RK3FTask);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    #endregion
                    #region 4F提升机出口托盘号上报WMS
                    var Address = "TSJC4F";
                    if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, Address) == 1)
                    {
                        var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber, Address);
                        if (!string.IsNullOrEmpty(BinNumber))
                        {
                            BinNumber = BinNumber.TrimEnd('\0').Substring(2);
                            _taskService.InboundElevatorExit(Address, BinNumber);
                        }
                    }
                    #endregion
                    //WriteInfo(device.DeviceName, "infoLog");
                    //WriteDebug(device.DeviceName, "debugLog");
                }
                catch (Exception ex)
                {
                    WriteError(device.DeviceName, "错误", ex);
                }
                PalletReportingToWMS(device);
            }
            else
            {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/HKTaskExtend.cs
@@ -71,6 +71,7 @@
                                if (content.Status)
                                {
                                    item.TaskState = (int)TaskStatusEnum.Execut;
                                    _taskService.UpdateData(item);
                                }
                            }
                            else
@@ -85,11 +86,13 @@
                                    {
                                        // åŽŸä»»åŠ¡çŠ¶æ€æ”¹ä¸ºç­‰å¾…ç©ºè½¦
                                        item.TaskState = (int)TaskStatusEnum.WaitingHkAGVMovePosition;
                                        _taskService.UpdateData(item);
                                    }
                                }
                                else
                                {
                                    item.ExceptionMessage = "未找到可用AGV小车";
                                    _taskService.UpdateData(item);
                                }
                            }
                        }
@@ -97,6 +100,7 @@
                    else
                    {
                        item.ExceptionMessage = "获取AGV小车信息失败";
                        _taskService.UpdateData(item);
                    }
                }
                else if (item.TaskType == (int)TaskTypeEnum.F01)
@@ -111,7 +115,7 @@
                        {
                            // ä»Žä»»åŠ¡çš„èµ·å§‹åœ°å€ä¸­æå–éœ€è¦çš„æ¥¼å±‚ä»£ç 
                            string requiredMapCode = GetMapCodeFromAddress(item.SourceAddress);
                            if (string.IsNullOrEmpty(requiredMapCode))
                            if (requiredMapCode==null)
                            {
                                item.ExceptionMessage = $"无法从目标地址 {item.SourceAddress} ä¸­è¯†åˆ«æ¥¼å±‚信息";
                                _taskService.UpdateData(item);
@@ -128,6 +132,7 @@
                                if (content.Status)
                                {
                                    item.TaskState = (int)TaskStatusEnum.Execut;
                                    _taskService.UpdateData(item);
                                }
                            }
                            else
@@ -141,17 +146,18 @@
                                    if (callCarResult.Status)
                                    {
                                        item.TaskState = (int)TaskStatusEnum.WaitingHkAGVMovePosition;
                                        _taskService.UpdateData(item);
                                    }
                                }
                                else
                                {
                                    item.ExceptionMessage = "未找到可用AGV小车";
                                    _taskService.UpdateData(item);
                                }
                            }
                        }
                    }
                }
                _taskService.UpdateData(item);
            }
        }
@@ -263,20 +269,16 @@
        private string GetMapCodeFromAddress(string address)
        {
            if (string.IsNullOrEmpty(address))
            {
                return null;
            }
            // åœ°å€æ ¼å¼ç¤ºä¾‹ ï¼šAA å¯¹åº” 0339050AA0309145
            // keys æ˜¯ AA、BB、CC、DD、EE、FF,vule是对应的点位信息
            foreach (var floorCode in FloorMapping.FloorMap.Keys)
            else
            {
                if (address.Contains(floorCode))
                {
                    return floorCode;//返回的就是AA、BB、CC、DD、EE、FF中的一个,代表对应的楼层
                }
                var reslut = _stationInfoService.Repository.QueryFirst(x => x.StationCode == address);
                return reslut.FloorNumber;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs
@@ -161,15 +161,11 @@
        /// <param name="tasks"></param>
        public void IsMoveTask(List<Dt_Task> tasks)
        {
            object requestData = null;  // æ·»åŠ å˜é‡è®°å½•è¯·æ±‚æ•°æ®
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GetBlockPodContentDto)) ?? throw new Exception("未找到批量获取阻碍托盘关系接口配置信息!请检查接口配置");
                List<Dt_Task> dt_Tasks = new List<Dt_Task>();
                var PalletCodes = tasks.Select(x => x.PalletCode).ToList();
                //GetBlockPodContentDto content = new GetBlockPodContentDto();
                var request = new GetBlockPodContentListDto
                {
                    content = new List<GetBlockPodContentDto>
@@ -181,21 +177,49 @@
                        }
                    }
                };
                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(apiInfo.ApiAddress, request.Serialize());
                FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                content.OK(data: fOURBOTReturn);
                content = _apiInfoService.PostInterfaceRequest(nameof(GetBlockPodContentDto), request.Serialize(), "批量获取阻碍托盘关系");
                if (!content.Status)
                {
                    foreach (var item in tasks)
                    {
                        item.ExceptionMessage = content.Message;
                    }
                    _taskService.UpdateData(tasks);
                    return;
                }
                FOURBOTReturn fOURBOTReturn = content.Data as FOURBOTReturn;
                if (fOURBOTReturn.returnCode == 0)
                {
                    //ReturnBlockPodResultDto getBlockPod = fOURBOTReturn.data as ReturnBlockPodResultDto ?? throw new Exception("未获取到阻碍托盘关系数据");
                    var dataJson = fOURBOTReturn.data.ToString();
                    if (string.IsNullOrEmpty(dataJson))
                    {
                        foreach (var item in tasks)
                        {
                            item.ExceptionMessage = "获取阻碍托盘关系失败!";
                        }
                        _taskService.UpdateData(tasks);
                        return;
                    }
                    ReturnBlockPodResultDto? getBlockPod = JsonConvert.DeserializeObject<ReturnBlockPodResultDto>(dataJson);
                    if (getBlockPod == null)
                    {
                        foreach (var item in tasks)
                        {
                            item.ExceptionMessage = "阻碍托盘关系数据转换实体失败!";
                        }
                        _taskService.UpdateData(tasks);
                        return;
                    }
                    if (getBlockPod.Result.Count == 0)
                    {
                        throw new Exception("未获取到阻碍托盘关系数据");
                        foreach (var item in tasks)
                        {
                            item.ExceptionMessage = "未获取到阻碍托盘关系数据!";
                        }
                        _taskService.UpdateData(tasks);
                        return;
                    }
                    foreach (var Result in getBlockPod.Result)
                    {
@@ -234,7 +258,7 @@
            }
            finally
            {
                _trackloginfoService.AddTrackLog(requestData, content, "处理出库任务是否需要移库", "", "");
                //_trackloginfoService.AddTrackLog(requestData, content, "处理出库任务是否需要移库", "", "");
            }
        }
        #endregion
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskJob.cs
@@ -13,6 +13,7 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core.BaseRepository;
@@ -38,8 +39,9 @@
        private readonly ITrackloginfoService _trackloginfoService;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IAGVCartInfoService _agvcartInfoService;
        private readonly IStationInfoService _stationInfoService;
        public TaskJob(ITaskService taskService, IApiInfoService apiInfoService, IRGVLocationInfoService rGVLocationInfoService, IStationMangerService stationMangerService, ITrackloginfoService trackloginfoService, IUnitOfWorkManage unitOfWorkManage, IAGVCartInfoService agvcartInfoService)
        public TaskJob(ITaskService taskService, IApiInfoService apiInfoService, IRGVLocationInfoService rGVLocationInfoService, IStationMangerService stationMangerService, ITrackloginfoService trackloginfoService, IUnitOfWorkManage unitOfWorkManage, IAGVCartInfoService agvcartInfoService, IStationInfoService stationInfoService)
        {
            _taskService = taskService;//注入
            _apiInfoService = apiInfoService;
@@ -48,6 +50,7 @@
            _trackloginfoService = trackloginfoService;
            _unitOfWorkManage = unitOfWorkManage;
            _agvcartInfoService = agvcartInfoService;
            _stationInfoService = stationInfoService;
        }
        public Task Execute(IJobExecutionContext context)