1
huangxiaoqiang
2025-03-27 2cc749ec598c39f9172f9b989979f6218ec256b1
1
已删除1个文件
已修改9个文件
393 ■■■■ 文件已修改
.gitignore 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/Log_PLCReadWrite/分容11线入库输送线/Logs_20250320231918.txt 283 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -55169,3 +55169,7 @@
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/publish/runtimes/linux-arm/native/libSystem.IO.Ports.Native.so
/项目资料/项目图纸/前段线体点位图/08三楼输送布局点位图1107.dwl2
*.txt
/项目资料/项目图纸/前段线体点位图/08三楼输送布局点位图1107.dwg.bak
/项目资料/项目图纸/前段线体点位图/08三楼输送布局点位图1107.DWG.lck
*.lck
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/Log_PLCReadWrite/分容11线入库输送线/Logs_20250320231918.txt
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -11,7 +11,8 @@
  "ConnectionStringsEncryption": false,
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  "ConnectionString": "Data Source=192.168.90.253;Initial Catalog=WIDESEA_WCSDB3F;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.65.253;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/Log_PLCReadWrite/·ÖÈÝ11ÏßÈë¿âÊäËÍÏß/Logs_20250320231918.txt
ÎļþÒÑɾ³ý
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -281,7 +281,8 @@
                                    command.InteractiveSignal = commandWrite.WriteInteractiveSignal;
                                    // è°ƒç”¨å¤„理方法
                                    method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                };
                                }
                                ;
                            }
                        }
                    }
@@ -296,6 +297,7 @@
            }
            return Task.CompletedTask;
        }
        #region å…¥åº“
        /// <summary>
@@ -383,16 +385,18 @@
                    IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == platform.PLCCode);
                    if (device != null)
                    {
                        int x = 3;
                        CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
                        foreach (var item in Location)
                        {
                            x--;
                            ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item);
                            if (command1.InteractiveSignal != 2)
                            {
                                var tasks = _taskRepository.QueryData(x => (x.TaskType == (int)TaskInboundTypeEnum.InTray || x.TaskType == (int)TaskOutboundTypeEnum.OutTray) && x.TargetAddress == childDeviceCode);
                                // å¦‚果已有任务数量小于指定索引
                                if (tasks.Count < Location.Count)
                                if (tasks.Count < Location.Count && tasks.Count < x)
                                {
                                    return childDeviceCode;
                                }
@@ -439,12 +443,11 @@
            _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
            WriteInfo(conveyorLine.DeviceName, log);
            if (childDeviceCode == "1279")
            {
                var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationPLC == conveyorLine.DeviceCode);
                CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue, stationManager);
            }
            //if (childDeviceCode == "1279")
            //{
            //    var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationPLC == conveyorLine.DeviceCode);
            //    CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue, stationManager);
            //}
            
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null)
@@ -744,8 +747,8 @@
        #endregion å‡ºåº“
        #region è¾“送线交互完成
        /// <summary>
        /// è¾“送线交互完成
        /// </summary>
@@ -776,8 +779,8 @@
                conveyorLine.Communicator.Write(DeviceProAddress, value);
            }
        }
        #endregion
        #endregion
        #region æ£€æµ‹ç©ºç›˜å®žç›˜ä»»åŠ¡
@@ -961,8 +964,8 @@
        #endregion è®¾å¤‡NG口入库
        #region è¾“出日志
        public async Task LogAndWarn(string deviceName, string log, string color = "red")
        {
            ConsoleHelper.WriteWarningLine(log);
@@ -972,13 +975,11 @@
        #endregion
        private (ConveyorLineTaskCommand, ConveyorLineTaskCommandWrite) ReadCommands(Dt_StationManager station, CommonConveyorLine conveyorLine)
        {
            ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode);
            ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(station.stationChildCode, "DeviceCommand");
            return (command, commandWrite);
        }
    }
}
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -173,7 +173,7 @@
                        RoadWay = childDeviceCode,
                        SourceAddress = childDeviceCode,
                        TargetAddress = isTrue,
                        TaskState = (int)TaskOutStatusEnum.OutNew,
                        TaskState = (int)TaskOutStatusEnum.SC_OutFinish,
                        Id = 0,
                        TaskType = (int)TaskOutboundTypeEnum.TrayInToOut,
                        ProductionLine = result.ProductionLine,
@@ -414,7 +414,12 @@
        /// <exception cref="InvalidOperationException"></exception>
        private async Task JZRequestInBound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue, Dt_StationManager stationManager)
        {
            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
            ResultTrayCellsStatus resultTrayCellsStatus = GetResultTrayCellsStatus(command, stationManager);
            //todo判断是否为空框
            var serialNosError = resultTrayCellsStatus.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
            if (serialNosError.Count > 0)
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -120,18 +120,6 @@
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                        //ConveyorLineTaskCommand_After command = null;
                        //if (childDeviceCode == "2236")
                        //{
                        //    var stationPLC = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && x.stationChildCode == childDeviceCode).stationPLC;
                        //    IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationPLC);
                        //    CommonConveyorLine_After conveyorLine1 = (CommonConveyorLine_After)device;
                        //    command = conveyorLine1.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        //}
                        //else
                        //{
                        //    command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        //}
                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        if (command == null) continue;
                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
@@ -146,7 +134,7 @@
                            }
                        }
                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
                        if (childDeviceCode == "3464" || childDeviceCode == "3460" || childDeviceCode == "3456" )
                        {
                            Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                            if (platform != null)
@@ -404,7 +392,7 @@
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationLocation);
                }
                if ((stationManager.stationPLC == "1018" && stationManager.stationArea == "Cache") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray)  //更新在途数据
                if ((stationManager.stationPLC == "1007" && stationManager.stationArea == "Cache") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray)  //更新在途数据
                {
                    dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == stationManager.productLine && x.toArea == stationManager.stationChildCode);
@@ -467,6 +455,7 @@
        {
            try
            {
                WriteInfo("出库", $"【{JsonConvert.SerializeObject(platform)}】");
                TaskOutboundTypeEnum taskOutboundTypeEnum;
                if (platform.PlatformType.Contains("OutTray"))
                    taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray;
@@ -515,7 +504,7 @@
                    return;
                taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
                WriteInfo("出库", $"【{JsonConvert.SerializeObject(taskDTO)}】");
                #endregion è°ƒç”¨WMS获取出库任务
                CreateAndSendTask(taskDTO);
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -1,9 +1,7 @@
using Mapster;
using Masuit.Tools;
using Newtonsoft.Json;
using Quartz;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
@@ -92,15 +90,15 @@
                                        bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                        if (sendFlag)
                                        {
                                            StringBuilder builder = new StringBuilder();
                                            builder.AppendLine();
                                            builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】");
                                            builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】");
                                            builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】");
                                            builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】");
                                            builder.AppendLine($"时间:【{DateTime.Now}】");
                                            builder.AppendLine();
                                            ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
                                            //StringBuilder builder = new StringBuilder();
                                            //builder.AppendLine();
                                            //builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】");
                                            //builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】");
                                            //builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】");
                                            //builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】");
                                            //builder.AppendLine($"时间:【{DateTime.Now}】");
                                            //builder.AppendLine();
                                            //ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
                                            commonStackerCrane.LastTaskType = task.TaskType;
                                            _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                        }
@@ -192,7 +190,7 @@
                    }
                    var content = _taskService.StackCraneTaskCompleted(e.TaskNum);
                    if (commonStackerCrane.DeviceCode.Contains("CH") && task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
                    if ((commonStackerCrane.DeviceCode.Contains("CH") || commonStackerCrane.DeviceCode.Contains("JZ")) && task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
                    {
                        task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
                        Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
@@ -430,7 +428,7 @@
            {
                var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue;
                var valueList = value.Split(',').ToList();
                if ((valueList.Contains(task.SourceAddress)) && task.Roadway.Contains("CH") || task.Roadway.Contains("JZ"))
                if ((valueList.Contains(task.SourceAddress)) && (task.Roadway.Contains("CH") || task.Roadway.Contains("JZ")))
                {
                    string[] souredCodes = task.CurrentAddress.Split("-");
                    if (souredCodes.Length == 3)
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -73,15 +73,15 @@
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        StringBuilder builder = new StringBuilder();
                                        builder.AppendLine();
                                        builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】");
                                        builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】");
                                        builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】");
                                        builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】");
                                        builder.AppendLine($"时间:【{DateTime.Now}】");
                                        builder.AppendLine();
                                        ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
                                        //StringBuilder builder = new StringBuilder();
                                        //builder.AppendLine();
                                        //builder.AppendLine($"【{commonStackerCrane.DeviceName}】堆垛机状态:【{commonStackerCrane.StackerCraneStatusDes}】,时间:【{DateTime.Now}】");
                                        //builder.AppendLine($"【{commonStackerCrane.DeviceName}】手自动状态:【{commonStackerCrane.StackerCraneAutoStatusDes}】,时间:【{DateTime.Now}】");
                                        //builder.AppendLine($"【{commonStackerCrane.DeviceName}】作业状态:【{commonStackerCrane.StackerCraneWorkStatusDes}】,时间:【{DateTime.Now}】");
                                        //builder.AppendLine($"【{commonStackerCrane.DeviceName}】下发任务成功,【{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}】");
                                        //builder.AppendLine($"时间:【{DateTime.Now}】");
                                        //builder.AppendLine();
                                        //ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -871,6 +871,8 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            // è®°å½•异常信息并抛出
            LogFactory.GetLog($"{position}请求{productionLine}任务").Info(true, $"{position}-{tag}-{areaCode}-{JsonConvert.SerializeObject(areaCodes)}-{productionLine}");
            // æ ¹æ®æ‰˜ç›˜ç±»åž‹æŸ¥è¯¢åº“存信息
            DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
                ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -9,8 +9,10 @@
  "urls": "http://*:5000",
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionStringWCS": "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=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionStringWCS": "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=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=192.168.65.253;Initial Catalog=WIDESEA_WMSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionStringWCS": "Data Source=192.168.65.253;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称