1
huangxiaoqiang
2026-02-25 02a4fdd78cef9c7d2a26bfb9aa187179cf0baac3
1
已修改35个文件
512 ■■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs 126 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs
@@ -39,6 +39,8 @@
        /// 设备名称
        /// </summary>
        public abstract string Name { get; }
        public abstract string IpAddress { get; }
        public abstract int Port { get; }
        /// <summary>  
        /// 获取当前通讯器是否已连接到PLC。  
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
@@ -81,6 +81,8 @@
        /// <summary>
        /// PLC名称
        /// </summary>
        public override string IpAddress => _ipAddress;
        public override int Port => _port;
        public override string Name => _name;
        public override ILogNet LogNet => _logNet;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
@@ -7,6 +7,7 @@
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.LogHelper;
namespace WIDESEAWCS_Core.Helper
{
@@ -78,11 +79,13 @@
                    }
                }
                string result = string.Empty;
                QuartzLogger.WriteLogToFile($"MOMAPI接口", $"请求地址:【{serviceAddress}】,请求时间【{DateTime.Now}】请求参数【{JsonConvert.SerializeObject(requestJson)}】{Environment.NewLine}{Environment.NewLine}");
                using (HttpContent httpContent = new StringContent(requestJson))
                {
                    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 120);
                    httpClient.Timeout = new TimeSpan(0, 0, 360);
                    if (headers != null)
                    {
@@ -91,6 +94,7 @@
                    }
                    result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync();
                }
                QuartzLogger.WriteLogToFile($"MOMAPI接口", $"请求地址:【{serviceAddress}】,返回时间【{DateTime.Now}】返回参数【{JsonConvert.SerializeObject(result)}】{Environment.NewLine}{Environment.NewLine}");
                return result;
            }
            catch (Exception e)
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
@@ -41,6 +41,9 @@
                string responseParam = string.Empty;
                try
                {
                    string? apiIgnore = AppSettings.GetValue("ApiLogIgnore")?.ToString();
                    string[] ignoreUrls = !string.IsNullOrEmpty(apiIgnore) ? apiIgnore.Split(",") : new string[] { "get" };
                    (context.RequestServices.GetService(typeof(RequestLogModel)) as RequestLogModel).RequestDate = DateTime.Now;
                    try
                    {
@@ -63,9 +66,12 @@
                    ms.Position = 0;
                    await ms.CopyToAsync(originalBody);
                    if (!(context.Request.Path.Value?.Contains("Get") ?? false))
                    if (!ignoreUrls.Any(x => context.Request.Path.Value?.ToLower().Contains(x.ToLower()) ?? false))
                    {
                        Logger.Add(requestParam, responseParam);
                }
                }
                catch (Exception ex)
                {
                    // 记录异常
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_IProcessService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_IProcessService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_IProcessService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ProcessService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ProcessService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ProcessService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs
@@ -16,13 +16,18 @@
#endregion << 版 本 注 释 >>
using Microsoft.Extensions.DependencyInjection;
using Quartz.Spi;
using Newtonsoft.Json;
using Quartz;
using Quartz.Spi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
//using static Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser;
namespace WIDESEAWCS_QuartzJob
{
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -2,12 +2,14 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO.BasicInfo;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
@@ -82,7 +84,13 @@
        {
            // 用于记录已经访问过的起点和终点组合,避免重复访问进入死循环
            HashSet<string> visitedRoutes = new HashSet<string>();
            return QueryNextRoutesInternal(startPosi, endPosi, visitedRoutes);
            var stopwatch = Stopwatch.StartNew();
            var rasult = QueryNextRoutesInternal(startPosi, endPosi, visitedRoutes);
            stopwatch.Stop();
            var elapsed = stopwatch.ElapsedMilliseconds;
            QuartzLogger.WriteLogToFile("路由查询", $"时长{elapsed},起点:{startPosi},终点{endPosi}");
            return rasult;
        }
        private List<Dt_Router> QueryNextRoutesInternal(string startPosi, string endPosi, HashSet<string> visitedRoutes)
@@ -125,10 +133,10 @@
                        }
                    }
                }
                else
                {
                    throw new Exception($"该路径未配置或配置错误,请检查设备路由信息,起点:【{startPosi}】,终点:【{endPosi}】");
                }
                //else
                //{
                //    throw new Exception($"该路径未配置或配置错误,请检查设备路由信息,起点:【{startPosi}】,终点:【{endPosi}】");
                //}
            }
            catch (Exception ex)
            {
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -13,6 +13,7 @@
using WIDESEAWCS_Core.Extensions;
using WIDESEAWCS_Core.Filter;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_Core.Middlewares;
using WIDESEAWCS_QuartzJob.QuartzExtensions;
using WIDESEAWCS_QuartzJob.Seed;
@@ -22,6 +23,40 @@
var builder = WebApplication.CreateBuilder(args);
int workerThreads = Environment.ProcessorCount * 8;
int completionThreads = Environment.ProcessorCount;
ThreadPool.SetMaxThreads(workerThreads, completionThreads);
AppDomain.CurrentDomain.FirstChanceException += (sender, e) =>
{
    bool flag = e.Exception.TargetSite?.DeclaringType?.Namespace?.StartsWith("WIDESEA") == true;
    if (e.Exception is not OperationCanceledException && flag)
    {
        string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log\\Exception");
        Exception ex = e.Exception;
        StringBuilder builder = new StringBuilder();
        builder.Append("错误信息:");
        builder.Append(ex.Message);
        builder.Append(Environment.NewLine);
        builder.Append("错误源:");
        builder.Append(ex.Source);
        builder.Append(Environment.NewLine);
        builder.Append("错误堆栈:");
        builder.Append(ex.StackTrace);
        builder.Append(Environment.NewLine);
        builder.Append("错误类型:");
        builder.Append(ex.GetType().ToString());
        builder.Append(Environment.NewLine);
        builder.Append("错误方法:");
        builder.Append(ex.TargetSite?.ToString());
        builder.Append(Environment.NewLine);
        builder.Append(Environment.NewLine);
        QuartzLogger.WriteLogToFile($"Error_全局错误", builder.ToString());
    }
};
if (!HslCommunication.Authorization.SetAuthorizationCode("95f1611d-633c-46ea-b03a-38ede1629f74"))
{
    ConsoleHelper.WriteErrorLine("授权失败!当前程序只能使用24小时!");
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -1,5 +1,5 @@
{
    "urls": "http://*:9290", //web服务端口,如果用IIS部署,把这个去掉
  "urls": "http://*:9291", //web服务端口,如果用IIS部署,把这个去掉
    "Logging": {
        "LogLevel": {
            "Default": "Information",
@@ -21,6 +21,7 @@
        // 注意,http://127.0.0.1:1818 和 http://localhost:1818 是不一样的
        "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
    },
  "ApiLogIgnore": "get,query,download,upload,template",
    "ApiName": "WIDESEA",
    "ExpMinutes": 120,
    "QuartzJobAutoStart": true,
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_SignalR")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_SignalR")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_SignalR")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -156,6 +156,11 @@
                                // 设置下一个地址为第一个子位置
                                task.NextAddress = routers.FirstOrDefault().ChildPosi;
                            }
                            else
                            {
                                QuartzLogger.WriteLogToFile("路由查找异常", $"起点:{item.SourceAddress},终点:{item.TargetAddress},任务号:{item.TaskNum}");
                                return content.Error("未找到路由配置");
                            }
                        }
                        else
                        {
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_TaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
@@ -47,6 +47,9 @@
        /// </summary>
        private void HandleNewTask(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            try
            {
            Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
            if (stationManager == null)
@@ -79,62 +82,11 @@
                    //    break;
            }
            #region
            //Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
            //if (stationManager.stationType == 8)
            //{
            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            //    if (task != null)
            //    {
            //        RequestInNextAddress(conveyorLine, command, childDeviceCode);
            //    }
            //}
            //else if (stationManager.stationType == 9)
            //{
            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            //    if (task != null)
            //    {
            //        ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
            //    }
            //}
            //else if (stationManager.stationType == 1)
            //{
            //    if (stationManager.stationArea.Contains("GW"))
            //    {
            //        var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish);
            //        if (taskGW != null)
            //        {
            //            command.ConveyorLineBarcode = taskGW.PalletCode;
            //        }
            //    }
            //    RequestWmsTask(conveyorLine, command, childDeviceCode);
            //}
            //else if (stationManager.stationType == 10)
            //{
            //    var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
            //    if (task != null)
            //    {
            //        RequestOutbound(conveyorLine, command, childDeviceCode);
            //    }
            //}
            //else if (stationManager.stationType == 11)
            //{
            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            //    if (task != null)
            //    {
            //        RequestOutNextAddress(conveyorLine, command, childDeviceCode);
            //    }
            //}
            //else if (stationManager.stationType == 12)
            //{
            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            //    if (task != null)
            //    {
            //        ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
            //    }
            //}
            #endregion
            }
            catch (Exception ex)
            {
                WriteInfo("HandleNewTask", $"【{ex.Message}】");
            }
        }
        private void ExecuteStationAction(Dt_StationManager stationManager, CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
@@ -168,7 +120,6 @@
                    AbNormalStationBZTask(conveyorLine, command, childDeviceCode);
                    break;
                case 1:
                    RequestWmsTask(conveyorLine, command, childDeviceCode, stationManager);
                    break;
            }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
@@ -28,12 +28,16 @@
using SqlSugar;
using System.ComponentModel.Design;
using System.Reflection;
using System.Reflection.Metadata;
using System.Threading;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO.MOM;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IProcessRepository;
@@ -47,6 +51,7 @@
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using static Quartz.Logging.OperationName;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
using Platform = WIDESEAWCS_Model.Models.Platform;
@@ -69,7 +74,7 @@
        private readonly IDeviceInfoRepository _deviceInfoRepository;
        private static List<string>? userTokenIds;
        private static List<int>? userIds;
        private static List<string> childCodeList = new List<string>();
        private static DateTime? lastUpdateTime;
        public CommonConveyorLine_CWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDt_needBarcodeRepository needBarcodeRepository, IDeviceInfoRepository deviceInfoRepository)
        {
@@ -94,42 +99,44 @@
                CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)context.JobDetail.JobDataMap.Get("JobParams");
                if (conveyorLine != null)
                {
                    #region 站台方式
                    //List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
                    //foreach (var station in stationManagers)
                    //{
                    //    ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationChildCode);
                    //    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
                    //    if (deviceProtocolDetails != null)
                    //    {
                    //        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
                    //        if (method != null)
                    //        {
                    //            method.Invoke(this, new object[] { conveyorLine, command, station });
                    //        }
                    //    }
                    //}
                    #endregion 站台方式
                    #region 路由方式
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    if (conveyorLine.DeviceCode == "1024")
                    {
                        childDeviceCodes.Add("4000");
                    }
                    var chunks = childDeviceCodes.Chunk(10);
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                    //if (conveyorLine.DeviceCode == "1024")
                    //{
                    //    childDeviceCodes.Add("4000");
                    //}
                        
                    //var options = new ParallelOptions
                    //{
                    //    MaxDegreeOfParallelism = 10
                    //    //MaxDegreeOfParallelism = Environment.ProcessorCount
                    //};
                    //{
                    //    SiemensS7 siemensS7 = new SiemensS7(conveyorLine.Communicator.IpAddress, conveyorLine.Communicator.Port, conveyorLine.DeviceName);
                    //    siemensS7.Connect();
                    //    tasks.Add(Task.Run(() =>
                    //    {
                    //    }));
                    //}
                    //Parallel.For(0, childDeviceCodes.Count, options, i =>
                    //Parallel.ForEach(childDeviceCodes, options, childDeviceCode =>
                    var tasks = new List<Task>();
                    foreach (var item in chunks)
                    {
                        tasks.Add(Task.Run(() =>
                        {
                            foreach (string childDeviceCode in item)
                            {
                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        if (command == null) continue;
                        //if (command.InteractiveSignal == 0 && command.HasPallet != 1) continue;
                                if (command != null)
                                {
                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
                        
                        DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
@@ -144,6 +151,9 @@
                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
                        {
                                        if (lastUpdateTime > DateTime.Now.AddMinutes(1))
                                        {
                                            lastUpdateTime = DateTime.Now;
                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                            if (platform != null)
                            {
@@ -158,15 +168,14 @@
                                }
                            }
                        }
                                    }
                        #region 调用事件总线通知前端
                        var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
                        if (tokenInfos == null || !tokenInfos.Any())
                                    if (tokenInfos != null || tokenInfos.Any())
                        {
                            continue;
                        }
                        var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
                        var userIds = tokenInfos?.Select(x => x.UserId).ToList();
@@ -177,9 +186,15 @@
                        };
                        _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
                                    }
                        #endregion 调用事件总线通知前端
                                }
                    }
                        }));
                    }
                    //Task.WaitAll(tasks.ToArray());
                    #endregion 路由方式
                }
@@ -209,7 +224,6 @@
                var log = $"时间:【{DateTime.Now}】【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】任务号:【{command.ConveyorLineTaskNum}】设备编码:【{childDeviceCode}】";
                ConsoleHelper.WriteSuccessLine(log);
                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                WriteInfo(conveyorLine.DeviceName, log);
                if (childDeviceCode == "4000")
@@ -225,15 +239,15 @@
                }
                else
                {
                    if (childDeviceCode == "1039")
                    {
                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
                        {
                            ConsoleHelper.WriteErrorLine($"时间:【{DateTime.Now}】托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发");
                            return;
                        }
                    }
                    //if (childDeviceCode == "1039")
                    //{
                    //    var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
                    //    if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
                    //    {
                    //        ConsoleHelper.WriteErrorLine($"时间:【{DateTime.Now}】托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发");
                    //        return;
                    //    }
                    //}
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
@@ -282,15 +296,6 @@
                    }
                }
            }
            //else
            //{
            //    //当前地址请求 寻找当前地址的托盘号 任务号的任务,如存在任务则重新再次写入新目标地址
            //    Dt_Task currentTask = _taskService.QueryExecutingCurrentConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
            //    if (currentTask != null)
            //    {
            //        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(currentTask.TargetAddress), childDeviceCode);
            //    }
            //}
        }
        /// <summary>
@@ -412,12 +417,9 @@
                // 拼接完整的MOM接口地址(基础IP + 接口路径)
                var MOMIpAddress = wmsBase + ipAddress;
                // 5. 调用MOM接口(POST异步请求,同步等待结果)
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.Serialize()}】");
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                // 记录接口调用日志(请求参数、返回参数),便于问题排查
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.Serialize()}】");
                WriteInfo("入站校验", "");
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验返回参数【{result}】");
                // 6. 解析MOM接口返回结果为实体对象
@@ -519,6 +521,10 @@
                    content = _taskService.UpdateTaskStatusToNext(task);
                }
                var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationArea == "Call" && x.stationType == 12);
                if (station == null)
                {
                    return;
                }
                CommonConveyorLine_BZ? commonConveyorBZ=Storage.Devices.FirstOrDefault(x=>x.DeviceCode==station.stationPLC) as CommonConveyorLine_BZ;
                if (commonConveyorBZ != null)
                {
@@ -636,11 +642,8 @@
                
                List<string> strings = platform.Location.Split(',').ToList();
                WriteInfo("调度执行时间记录", "【调取WMS出库接口开始时间:】" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
                WriteInfo("调度执行时间记录", "【调取WMS出库接口结束时间:】" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                WriteInfo("OCV请求返回参数", $"时间:【{DateTime.Now}】请求点位【{childDeviceCode}】返回参数【{JsonConvert.SerializeObject(result)}】");
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
@@ -662,6 +665,7 @@
        public WebResponseContent CreateAndSendTask(WMSTaskDTO taskDTO)
        {
            var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
            if (content.Status)
            {
                Console.WriteLine($"{taskDTO.TaskType}呼叫成功");
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
@@ -94,29 +94,13 @@
                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)context.JobDetail.JobDataMap.Get("JobParams");
                if (conveyorLine != null)
                {
                    #region 站台方式
                    //List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
                    //foreach (var station in stationManagers)
                    //{
                    //    ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationChildCode);
                    //    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
                    //    if (deviceProtocolDetails != null)
                    //    {
                    //        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
                    //        if (method != null)
                    //        {
                    //            method.Invoke(this, new object[] { conveyorLine, command, station });
                    //        }
                    //    }
                    //}
                    #endregion 站台方式
                    #region 路由方式
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    if (conveyorLine.DeviceCode == "1024")
                    {
                        childDeviceCodes.Add("4000");
                    }
                    
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
@@ -137,22 +121,22 @@
                            }
                        }
                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
                        {
                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                            if (platform != null)
                            {
                                if (command.HasPallet != 1)
                                {
                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                    if (method != null)
                                    {
                                        int count = 1;
                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                    }
                                }
                            }
                        }
                        //if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
                        //{
                        //    Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                        //    if (platform != null)
                        //    {
                        //        if (command.HasPallet != 1)
                        //        {
                        //            MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                        //            if (method != null)
                        //            {
                        //                int count = 1;
                        //                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                        //            }
                        //        }
                        //    }
                        //}
                        #region 调用事件总线通知前端
@@ -205,7 +189,6 @@
                var log = $"时间:【{DateTime.Now}】【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】任务号:【{command.ConveyorLineTaskNum}】设备编码:【{childDeviceCode}】";
                ConsoleHelper.WriteSuccessLine(log);
                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                WriteInfo(conveyorLine.DeviceName, log);
                if (task == null)
@@ -214,16 +197,6 @@
                }
                else
                {
                    if (childDeviceCode == "1039")
                    {
                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
                        {
                            ConsoleHelper.WriteErrorLine($"时间:【{DateTime.Now}】托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发");
                            return;
                        }
                    }
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
@@ -261,7 +234,6 @@
                if (newTask != null)
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    if (sendFlag)
@@ -271,15 +243,6 @@
                    }
                }
            }
            //else
            //{
            //    //当前地址请求 寻找当前地址的托盘号 任务号的任务,如存在任务则重新再次写入新目标地址
            //    Dt_Task currentTask = _taskService.QueryExecutingCurrentConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
            //    if (currentTask != null)
            //    {
            //        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(currentTask.TargetAddress), childDeviceCode);
            //    }
            //}
        }
        /// <summary>
@@ -365,9 +328,9 @@
                };
                var MOMIpAddress = wmsBase + ipAddress;
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验请求参数【{trayCells.Serialize()}】");
                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                WriteInfo("入站校验", "");
                WriteInfo("入站校验", $"【{childDeviceCode}】入站校验返回参数【{result}】");
                ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
@@ -377,7 +340,6 @@
                    if (newTask != null)
                    {
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                        if (sendFlag)
@@ -391,7 +353,6 @@
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    if (sendFlag)
@@ -414,9 +375,7 @@
            var log = $"时间:【{DateTime.Now}】【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】任务号:【{command.ConveyorLineTaskNum}】设备编码:【{childDeviceCode}】";
            ConsoleHelper.WriteSuccessLine(log);
            //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
            WriteInfo(conveyorLine.DeviceName, log);
            var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
            if (task != null)
@@ -445,7 +404,6 @@
                    }
                }
                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                if (sendFlag)
                {
@@ -571,11 +529,8 @@
                
                List<string> strings = platform.Location.Split(',').ToList();
                WriteInfo("调度执行时间记录", "【调取WMS出库接口开始时间:】" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
                WriteInfo("调度执行时间记录", "【调取WMS出库接口结束时间:】" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                WriteInfo("OCV请求返回参数", $"时间:【{DateTime.Now}】请求点位【{childDeviceCode}】返回参数【{JsonConvert.SerializeObject(result)}】");
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -178,16 +178,23 @@
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                        if (device != null)
                        {
                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
                            {
                                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
                                Thread.Sleep(100);
                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
                            }
                            else
                            {
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
                            Thread.Sleep(100);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
                        }
                        }
                        WriteInfo(commonStackerCrane.DeviceName, $"【手动出库记录】任务号【{e.TaskNum}】托盘号【{task.PalletCode}】");
                    }
                    if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
@@ -281,7 +288,7 @@
                    _noticeService.Logs(userTokenIds, new { commonStackerCrane.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                    WriteInfo(commonStackerCrane.DeviceName, log);
                    task = FindAnotherOutboundTask(commonStackerCrane.DeviceCode, task.TaskId);
                    task = FindAnotherOutboundTask(commonStackerCrane.DeviceCode, task);
                    if (task == null)
                    {
@@ -319,10 +326,21 @@
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
                        if (device != null)
                        {
                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
                            {
                                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
                                if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用
                                {
                                    return task;
                                }
                            }
                            else
                            {
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用
                            {
                                return task;
                                }
                            }
                        }
                        else
@@ -395,11 +413,11 @@
        /// <param name="deviceCode">设备代码</param>
        /// <param name="excludedTaskId">要排除的任务ID</param>
        /// <returns></returns>
        private Dt_Task? FindAnotherOutboundTask(string deviceCode, int excludedTaskId)
        private Dt_Task? FindAnotherOutboundTask(string deviceCode, Dt_Task task)
        {
            // 先获取所有符合条件(排除指定任务ID)的出库任务列表
            var allOutboundTasks = _taskService.QueryAllOutboundTasks(deviceCode);
            var availableTasks = allOutboundTasks?.Where(t => excludedTaskId != t.TaskId && t.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup).ToList();
            var availableTasks = allOutboundTasks?.Where(t => t.TargetAddress != task.TargetAddress && t.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup).ToList();
            if (availableTasks == null || availableTasks.Count == 0)
            {
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
@@ -319,6 +319,8 @@
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
                        if (device != null)
                        {
                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
                            {
                            CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
                            if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用
                            {
@@ -327,6 +329,15 @@
                        }
                        else
                        {
                                CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                                if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用
                                {
                                    return task;
                                }
                            }
                        }
                        else
                        {
                            _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{task.NextAddress}】对应的通讯对象,无法判断出库站台是否被占用");
                        }
                    }
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,4 +1,5 @@
using Mapster;
using AngleSharp.Io;
using Mapster;
using Masuit.Tools;
using SixLabors.Fonts.Tables.AdvancedTypographic;
using SqlSugar;
@@ -10,6 +11,7 @@
using WIDESEA_DTO.WMS;
using WIDESEA_IServices;
using WIDESEA_IStoragIntegrationServices;
using WIDESEA_Model.Models;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_QuartzJob.Models;
@@ -1028,6 +1030,8 @@
                stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
                await _locationRepository.UpdateDataAsync(stockInfo.LocationInfo);
            }
            if (position == "1670")
                LogFactory.GetLog($"OCV{position}请求{productionLine}任务").Info(true, $"返回参数{JsonConvert.SerializeObject(taskDTO)}");
            // 返回成功响应
            return content.OK(data: taskDTO);
@@ -1066,16 +1070,28 @@
            var result = new DtStockInfo();
            result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
            var stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                            .Includes(x => x.LocationInfo)
                            .Includes(x => x.StockInfoDetails)
                            //.Includes(x => x.StockInfoDetails)
                            .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull)
                            .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
                            .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo))
                            .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable)
                            .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                            //.WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                            .OrderBy(x => x.OutboundTime)
                            .FirstAsync();
                            .ToListAsync();
            foreach (var stock in stockInfoList)
            {
                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
                    .Where(d => d.StockId == stock.Id && materielCodes.Contains(d.MaterielCode))
                    .AnyAsync();
                if (hasMatchingDetail)
                {
                    result = stock;
                    break;
                }
            }
            if (result.IsNullOrEmpty())
                ConsoleHelper.WriteErrorLine($"{area.AreaName}-{productionLine}查询实盘库存信息失败:未找到符合条件的数据");
@@ -1123,21 +1139,43 @@
                .Where(x => x.DeviceCode.Contains("CWSC"))
                .ToList().Select(x => x.DeviceCode).ToList();
            //var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
            //    .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件
            //    .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
            //    .Includes(x => x.LocationInfo)
            //    .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
            //    .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 过滤条件
            //    .Includes(x => x.StockInfoDetails)
            //    .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
            //    .OrderBy(x => x.OutboundTime) // 排序
            //    .FirstAsync(); // 获取第一个元素
            DtStockInfo stockInfo = null;
            var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件
                .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
                .Includes(x => x.LocationInfo)
                .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
                .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 过滤条件
                .Includes(x => x.StockInfoDetails)
                .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                .OrderBy(x => x.OutboundTime) // 排序
                .FirstAsync(); // 获取第一个元素
                .ToListAsync();
            if (result.IsNullOrEmpty())
            foreach (var stock in result)
            {
                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
                    .Where(d => d.StockId == stock.Id && materielCodes.Contains(d.MaterielCode))
                    .AnyAsync();
                if (hasMatchingDetail)
                {
                    stockInfo = stock;
                    break;
                }
            }
            if (stockInfo.IsNullOrEmpty())
                ConsoleHelper.WriteErrorLine($"{JsonConvert.SerializeObject(areaCodes)}-{productionLine}查询常温实盘库存信息失败:未找到符合条件的数据");
            return result;
            return stockInfo;
        }
        catch (Exception ex)
        {
@@ -1166,21 +1204,36 @@
                .Where(x => stackers.Contains(x.DeviceCode))
                .ToList().Select(x => x.DeviceCode).ToList();
            DtStockInfo stockInfo = null;
            var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                .Where(x => x.ProductionLine == station.productLine)
                .Where(x => x.AreaCode == areaCode && x.IsFull == false)
                .Includes(x => x.StockInfoDetails)
                .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "空托盘"))
                //.Includes(x => x.StockInfoDetails)
                //.Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "空托盘"))
                .Includes(x => x.LocationInfo)
                .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
                .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 过滤条件
                .OrderBy(x => x.CreateDate) // 排序
                .FirstAsync(); // 转换为列表
                .ToListAsync();
            foreach (var stock in result)
            {
                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
                    .Where(d => d.StockId == stock.Id && d.MaterielCode == "空托盘")
                    .AnyAsync();
                if (hasMatchingDetail)
                {
                    stockInfo = stock;
                    break;
                }
            }
            if (result.IsNullOrEmpty())
                ConsoleHelper.WriteErrorLine($"{area}-{station.productLine}查询空盘库存信息失败:未找到符合条件的数据");
            return result;
            return stockInfo;
        }
        catch (Exception ex)
        {
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs
@@ -21,7 +21,7 @@
                {
                    if (firstDirectoryInfos[i].Name != "Info")
                    {
                        FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles();
                        FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles().OrderByDescending(x => x.CreationTime).ToArray();
                        List<object> values = new List<object>();
                        for (int j = 0; j < nextFileInfos.Length; j++)
                        {
@@ -48,10 +48,10 @@
            {
                List<FileInfo> files = new List<FileInfo>();
                DirectoryInfo folder = new DirectoryInfo(AppContext.BaseDirectory + "\\Logs\\");
                DirectoryInfo[] firstDirectoryInfos = folder.GetDirectories();
                DirectoryInfo[] firstDirectoryInfos = folder.GetDirectories().OrderByDescending(x => x.CreationTime).ToArray();
                for (int i = 0; i < firstDirectoryInfos.Length; i++)
                {
                    FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles();
                    FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles().OrderByDescending(x => x.CreationTime).ToArray();
                    files.AddRange(nextFileInfos);
                }
                if (files.Count > 0)