肖洋
2024-12-24 b24ef0d9a6a572529cf7e34a0fc8de4fa24bb9e7
合并
已删除2个文件
已修改8个文件
432 ■■■■■ 文件已修改
.gitignore 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/.vs/Code Management/v17/.wsuo 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/.vs/Code Management/v17/workspaceFileList.bin 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 376 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneDBName.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -1587,3 +1587,5 @@
/Code Management/.vs/Code Management/CopilotIndices/17.12.31.40377/CodeChunks.db-wal
/Code Management/.vs/Code Management/CopilotIndices/17.12.31.40377/SemanticSymbols.db-wal
/Code Management/.vs/slnx.sqlite
/Code Management/.vs/Code Management/v17/.wsuo
/Code Management/.vs/Code Management/v17/workspaceFileList.bin
Code Management/.vs/Code Management/v17/.wsuo
Binary files differ
Code Management/.vs/Code Management/v17/workspaceFileList.bin
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/AutofacModuleRegister.cs
@@ -23,8 +23,8 @@
            var basePath = AppContext.BaseDirectory;
            var cacheType = new List<Type>();
            builder.RegisterType<LogAOP>();
            cacheType.Add(typeof(LogAOP));
            //builder.RegisterType<LogAOP>();
            //cacheType.Add(typeof(LogAOP));
            builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//注册仓储
            builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//注册服务
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/ConveyorLine/CommonConveyorLine.cs
@@ -274,7 +274,7 @@
        }
        /// <summary>
        ///
        /// 检测站台是否有货
        /// </summary>
        /// <param name="deviceChildCode"></param>
        /// <returns></returns>
@@ -306,6 +306,31 @@
            return false;
        }
        /// <summary>
        /// 检测站台是否有货
        /// </summary>
        /// <param name="deviceChildCode"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public bool IsOccupiedx(string deviceChildCode)
        {
            if (Communicator.IsConnected)
            {
                var device = _deviceProDTOs.Where(x => x.DeviceChildCode == deviceChildCode && x.DeviceProParamName == "InteractiveSignal").FirstOrDefault();
                object readStatus = Communicator.ReadAsObj(device.DeviceProAddress, device.DeviceDataType);
                //todo 协议明细信息未获取到时抛出异常
                if (readStatus.ToString() != "2")
                {
                    return true;
                }
                return false;
            }
            //todo 通讯未连接时抛出异常
            return false;
        }
        public void Dispose()
        {
            _heartStatr = false;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -12,9 +12,9 @@
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
  "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=True",
  //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=True",
  //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -157,23 +157,38 @@
        private Task ProcessDeviceAsync(CommonConveyorLine conveyorLine, string childDeviceCode)
        {
            // 读取任务命令和设备命令
            ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
            ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand");
            if (command != null && commandWrite != null)
            try
            {
                #region 调用事件总线通知前端
                // 获取缓存中的用户信息
                if (userTokenIds == null && userIds == null)
                // 读取任务命令和设备命令
                ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
                ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand");
                if (command != null && commandWrite != null)
                {
                    var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
                    if (tokenInfos != null && tokenInfos.Any())
                    {
                        userTokenIds = tokenInfos.Select(x => x.Token_ID).ToList();
                        userIds = tokenInfos.Select(x => x.UserId).ToList();
                    #region 调用事件总线通知前端
                    // 获取缓存中的用户信息
                    if (userTokenIds == null && userIds == null)
                    {
                        var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
                        if (tokenInfos != null && tokenInfos.Any())
                        {
                            userTokenIds = tokenInfos.Select(x => x.Token_ID).ToList();
                            userIds = tokenInfos.Select(x => x.UserId).ToList();
                            // 构造通知数据
                            object obj = new
                            {
                                command,
                                commandWrite
                            };
                            // 发送通知
                            _noticeService.LineData(userIds.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj });
                        }
                    }
                    else
                    {
                        // 构造通知数据
                        object obj = new
                        {
@@ -183,75 +198,68 @@
                        // 发送通知
                        _noticeService.LineData(userIds.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj });
                    }
                }
                else
                {
                    // 构造通知数据
                    object obj = new
                    #endregion 调用事件总线通知前端
                    // 将交互信号转换为布尔数组
                    var writeInteractiveSignal = commandWrite.WriteInteractiveSignal;
                    var structs = BitConverter.GetBytes(writeInteractiveSignal).Reverse().ToArray().ToBoolArray();
                    // 获取设备协议详情
                    List<DeviceProtocolDetailDTO>? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.Where(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)).ToList();
                    if (deviceProtocolDetails != null)
                    {
                        command,
                        commandWrite
                    };
                    // 发送通知
                    _noticeService.LineData(userIds.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj });
                }
                #endregion 调用事件总线通知前端
                // 将交互信号转换为布尔数组
                var writeInteractiveSignal = commandWrite.WriteInteractiveSignal;
                var structs = BitConverter.GetBytes(writeInteractiveSignal).Reverse().ToArray().ToBoolArray();
                // 获取设备协议详情
                List<DeviceProtocolDetailDTO>? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.Where(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)).ToList();
                if (deviceProtocolDetails != null)
                {
                    foreach (var item in deviceProtocolDetails)
                    {
                        int itemValue = item.ProtocalDetailValue.ObjToInt();
                        if (structs[itemValue] == true)
                        foreach (var item in deviceProtocolDetails)
                        {
                            // 获取处理方法
                            MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType);
                            if (method != null)
                            int itemValue = item.ProtocalDetailValue.ObjToInt();
                            if (structs[itemValue] == true)
                            {
                                command.InteractiveSignal = writeInteractiveSignal;
                                // 调用处理方法
                                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, itemValue });
                                // 获取处理方法
                                MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType);
                                if (method != null)
                                {
                                    command.InteractiveSignal = writeInteractiveSignal;
                                    // 调用处理方法
                                    method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, itemValue });
                                }
                            }
                            else
                            {
                                // 发送完成信号
                                ConveyorLineSendFinish(conveyorLine, childDeviceCode, itemValue, false);
                            }
                        }
                        else
                        {
                            // 发送完成信号
                            ConveyorLineSendFinish(conveyorLine, childDeviceCode, itemValue, false);
                        }
                    }
                }
                // 查询平台信息
                Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                if (platform != null && !string.IsNullOrEmpty(platform.Location))
                {
                    var strings = platform.Location.Split(',').ToList();
                    foreach (var ite in strings)
                    // 查询平台信息
                    Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                    if (platform != null && !string.IsNullOrEmpty(platform.Location))
                    {
                        // 读取任务命令
                        ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite);
                        if (command1.InteractiveSignal != 2)
                        var strings = platform.Location.Split(',').ToList();
                        foreach (var ite in strings)
                        {
                            command.InteractiveSignal = writeInteractiveSignal;
                            int count = strings.Count;
                            // 获取处理方法
                            MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                            if (method != null)
                            // 读取任务命令
                            ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite);
                            if (command1.InteractiveSignal != 2)
                            {
                                command.InteractiveSignal = commandWrite.WriteInteractiveSignal;
                                // 调用处理方法
                                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                            };
                                command.InteractiveSignal = writeInteractiveSignal;
                                int count = strings.Count;
                                // 获取处理方法
                                MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                if (method != null)
                                {
                                    command.InteractiveSignal = commandWrite.WriteInteractiveSignal;
                                    // 调用处理方法
                                    method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                };
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return Task.CompletedTask;
@@ -370,37 +378,45 @@
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成");
            var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
            try
            {
                if (command.Barcode == task.PalletCode && childDeviceCode == task.NextAddress)
                ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成");
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
                {
                    //conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, "1000", childDeviceCode);
                    ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成,下一目标地址【等待分配货位,并写入1000】");
                    ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
                    if (command.Barcode == task.PalletCode && childDeviceCode == task.NextAddress)
                    {
                        int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
                        //conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, "1000", childDeviceCode);
                        var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.SourceAddress);
                        task.CurrentAddress = station.stationLocation;
                        task.NextAddress = station.stationNGLocation;
                        task.TargetAddress = task.NextAddress;
                        task.TaskState = nextStatus;
                        task.ModifyDate = DateTime.Now;
                        task.Modifier = "System";
                        _taskRepository.UpdateData(task);
                    }
                    else
                    {
                        WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                        Console.Out.WriteLine(content.ToJsonString());
                        ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成,下一目标地址【等待分配货位,并写入1000】");
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
                        {
                            int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
                            var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.SourceAddress);
                            task.CurrentAddress = station.stationLocation;
                            task.NextAddress = station.stationNGLocation;
                            task.TargetAddress = task.NextAddress;
                            task.TaskState = nextStatus;
                            task.ModifyDate = DateTime.Now;
                            task.Modifier = "System";
                            _taskRepository.UpdateData(task);
                        }
                        else
                        {
                            WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                            Console.Out.WriteLine(content.ToJsonString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
@@ -417,41 +433,49 @@
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void RequestOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            // 查询输送线任务,根据输送线设备和子设备代码获取任务信息
            var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
            // 输出成功信息,包括输送线名称、任务号、托盘条码和子设备代码,以及任务信息
            ConsoleHelper.WriteSuccessLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,task{task.ToJsonString()}");
            // 如果任务不为空,则执行以下操作
            if (task != null)
            try
            {
                // 获取任务的下一目标地址
                var next = task.NextAddress;
                // 将任务命令映射到当前任务
                var taskCommand = MapTaskCommand(task, command);
                // 查询输送线任务,根据输送线设备和子设备代码获取任务信息
                var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
                // 恢复任务的下一目标地址
                task.NextAddress = next;
                // 输出成功信息,包括输送线名称、任务号、托盘条码和子设备代码,以及任务信息
                ConsoleHelper.WriteSuccessLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,task{task.ToJsonString()}");
                // 输出成功信息,包括输送线名称、任务号、托盘条码、子设备代码和下一目标地址
                ConsoleHelper.WriteSuccessLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,下一目标地址【{taskCommand.TargetAddress}】");
                // 向输送线发送命令
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                // 完成输送线发送任务,并更新任务状态
                ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                // 更新任务状态到下一个状态
                _taskService.UpdateTaskStatusToNext(task);
                // 如果任务的目标地址是"1020-1",则再次更新任务状态到下一个状态
                if (task.TargetAddress == "1020-1")
                // 如果任务不为空,则执行以下操作
                if (task != null)
                {
                    // 获取任务的下一目标地址
                    var next = task.NextAddress;
                    // 将任务命令映射到当前任务
                    var taskCommand = MapTaskCommand(task, command);
                    // 恢复任务的下一目标地址
                    task.NextAddress = next;
                    // 输出成功信息,包括输送线名称、任务号、托盘条码、子设备代码和下一目标地址
                    ConsoleHelper.WriteSuccessLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,下一目标地址【{taskCommand.TargetAddress}】");
                    // 向输送线发送命令
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    // 完成输送线发送任务,并更新任务状态
                    ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    // 更新任务状态到下一个状态
                    _taskService.UpdateTaskStatusToNext(task);
                    // 如果任务的目标地址是"1020-1",则再次更新任务状态到下一个状态
                    if (task.TargetAddress == "1020-1")
                    {
                        _taskService.UpdateTaskStatusToNext(task);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
@@ -511,64 +535,72 @@
        /// <param name="childDeviceCode">子设备编号</param>
        public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            // 打印成功信息,表示托盘已到达指定输送线并完成出库
            ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成");
            // 查询正在执行的输送线任务
            var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            // 如果任务存在
            if (task != null)
            try
            {
                // 如果任务中的托盘条码与命令中的托盘条码一致
                if (command.Barcode == task.PalletCode)
                // 打印成功信息,表示托盘已到达指定输送线并完成出库
                ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成");
                // 查询正在执行的输送线任务
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                // 如果任务存在
                if (task != null)
                {
                    // 创建一个空的WebResponseContent对象
                    WebResponseContent content = new WebResponseContent();
                    // 保存任务的下一目标地址
                    var next = task.NextAddress;
                    // 将任务映射为命令
                    var taskCommand = MapTaskCommand(task, command);
                    // 恢复任务的下一目标地址
                    task.NextAddress = next;
                    // 如果任务的托盘条码与命令中的托盘条码不一致或者任务备注为"NG"
                    if (task.PalletCode != command.Barcode || task.Remark == "NG")
                    // 如果任务中的托盘条码与命令中的托盘条码一致
                    if (command.Barcode == task.PalletCode)
                    {
                        // 查询目标地址的容量
                        var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
                        // 设置命令的目标地址为NG地址
                        taskCommand.TargetAddress = NGAddress;
                        // 创建一个空的WebResponseContent对象
                        WebResponseContent content = new WebResponseContent();
                        // 保存任务的下一目标地址
                        var next = task.NextAddress;
                        // 将任务映射为命令
                        var taskCommand = MapTaskCommand(task, command);
                        // 恢复任务的下一目标地址
                        task.NextAddress = next;
                        // 如果任务的托盘条码与命令中的托盘条码不一致或者任务备注为"NG"
                        if (task.PalletCode != command.Barcode || task.Remark == "NG")
                        {
                            // 查询目标地址的容量
                            var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
                            // 设置命令的目标地址为NG地址
                            taskCommand.TargetAddress = NGAddress;
                        }
                        else
                        {
                            // 设置命令的目标地址为1000
                            taskCommand.TargetAddress = 1000;
                        }
                        // 打印成功信息,表示托盘已到达指定输送线并完成出库,下一目标地址已确定
                        ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成,下一目标地址【{taskCommand.TargetAddress}】");
                        // 发送命令到输送线
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        // 完成输送线发送
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        // 更新任务状态到下一个状态
                        content = _taskService.UpdateTaskStatusToNext(task);
                    }
                    else
                    {
                        // 设置命令的目标地址为1000
                        taskCommand.TargetAddress = 1000;
                        // 查询目标地址的容量
                        var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
                        // 打印成功信息,表示托盘已到达指定输送线并完成出库,下一目标地址已确定
                        ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成,下一目标地址【{NGAddress}】");
                        // 设置输送线的目标地址为NG地址
                        conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, NGAddress, childDeviceCode);
                        // 完成输送线发送
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        // 更新任务状态到下一个状态
                        _taskService.UpdateTaskStatusToNext(task);
                    }
                }
            }
            catch (Exception ex)
            {
                    // 打印成功信息,表示托盘已到达指定输送线并完成出库,下一目标地址已确定
                    ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成,下一目标地址【{taskCommand.TargetAddress}】");
                    // 发送命令到输送线
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    // 完成输送线发送
                    ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    // 更新任务状态到下一个状态
                    content = _taskService.UpdateTaskStatusToNext(task);
                }
                else
                {
                    // 查询目标地址的容量
                    var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
                    // 打印成功信息,表示托盘已到达指定输送线并完成出库,下一目标地址已确定
                    ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成,下一目标地址【{NGAddress}】");
                    // 设置输送线的目标地址为NG地址
                    conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, NGAddress, childDeviceCode);
                    // 完成输送线发送
                    ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    // 更新任务状态到下一个状态
                    _taskService.UpdateTaskStatusToNext(task);
                }
            }
        }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -81,6 +81,7 @@
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.SetValue(StackerCraneDBName.StartCommand, 1);
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
@@ -294,7 +295,7 @@
                    if (device != null)
                    {
                        CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
                        //if (conveyorLine.IsOccupied(router.ChildPosi))//出库站台未被占用
                        if (conveyorLine.IsOccupiedx(router.ChildPosi))//出库站台未被占用
                        {
                            return task;
                        }
@@ -357,7 +358,7 @@
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 0;
            stackerCraneTaskCommand.StartCommand = 1;
            //stackerCraneTaskCommand.StartCommand = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                if (task.SourceAddress == "1359-4" && task.Roadway.Contains("JZ"))
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneDBName.cs
@@ -70,5 +70,15 @@
        /// 托盘号
        /// </summary>
        Barcode,
        /// <summary>
        /// 启动命令
        /// </summary>
        StartCommand,
        /// <summary>
        /// 消防命令
        /// </summary>
        FireCommand,
    }
}
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -11,8 +11,8 @@
let loadingInstance
let loadingStatus = false
if (process.env.NODE_ENV == 'development') {
  // axios.defaults.baseURL = 'http://localhost:5000/';
  axios.defaults.baseURL = 'http://192.168.5.251:5000/';
  axios.defaults.baseURL = 'http://localhost:5000/';
  // axios.defaults.baseURL = 'http://192.168.5.251:5000/';
}
else if (process.env.NODE_ENV == 'debug') {
  axios.defaults.baseURL = 'http://127.0.0.1:9991/';