From 843cc2ea1b104ecdf9da61318a4136a5d4096411 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 24 四月 2026 11:07:21 +0800
Subject: [PATCH] 集成Quartz定时任务,支持NG出库自动化及WMS/WCS接口扩展
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs | 35 +++++++++++++++--------------------
1 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
index d6c8e23..96fb104 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
@@ -1,4 +1,5 @@
锘�#region MyRegion
+
#region << 鐗� 鏈� 娉� 閲� >>
/*----------------------------------------------------------------
@@ -20,19 +21,15 @@
using AutoMapper;
using HslCommunication;
-using Microsoft.AspNetCore.Server.HttpSys;
using Newtonsoft.Json;
using Quartz;
using SqlSugar;
-using System.Diagnostics.CodeAnalysis;
using System.Reflection;
-using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
-using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
using WIDESEAWCS_DTO.TaskInfo;
@@ -41,7 +38,6 @@
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
-using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
@@ -128,6 +124,7 @@
}
#region 璺敱鏂瑰紡
+
//List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
//foreach (string childDeviceCode in childDeviceCodes)
//{
@@ -144,8 +141,9 @@
// method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
// }
// }
- //}
- #endregion
+ //}
+
+ #endregion 璺敱鏂瑰紡
}
}
catch (Exception ex)
@@ -173,7 +171,6 @@
_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
WriteInfo(conveyorLine.DeviceName, log);
- //if()
var taskNew = _taskService.QueryTaskByPalletCode(command.ConveyorLineBarcode, stationInfo.Roadway);
if (taskNew == null)
@@ -193,7 +190,7 @@
}
}
}
- else //濡傛灉浠诲姟璇锋眰澶辫触
+ else //濡傛灉浠诲姟璇锋眰澶辫触
{
//濡傛灉璇锋眰浣嶇疆涓嶯G浣嶇疆涓�鑷� 鍒欏啓褰撳墠浣嶇疆璁╃嚎浣撻��鍥�
if (stationInfo.stationChildCode == stationInfo.stationNGChildCode)
@@ -216,7 +213,6 @@
var taskNew = _taskRepository.QueryFirst(x => x.Roadway == stationInfo.Roadway && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
if (taskNew == null) //涓嶅瓨鍦ㄧ┖妗嗗嚭搴撲换鍔� 鍒欒姹俉MS鍑虹┖搴�
{
- ConsoleHelper.WriteWarningLine("璇锋眰绌烘墭鐩�");
if (_taskService.RequestTask(command.ConveyorLineBarcode, stationInfo).Result.Status)
{
Dt_Task task = _taskService.QueryTaskByPalletCode(command.ConveyorLineBarcode, stationInfo.Roadway);
@@ -286,27 +282,26 @@
WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
if (!content.Status)
{
- //ConsoleHelper.WriteErrorLine($"鍒嗗鍛煎彨绌烘墭鐩樺け璐content.Message}");
return;
}
WMSTaskDTO wMSTaskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
- ConsoleHelper.WriteSuccessLine(content.Data.ToString());
List<WMSTaskDTO> wMSTaskDTOs = new List<WMSTaskDTO>() { wMSTaskDTO };
_taskService.ReceiveWMSTask(wMSTaskDTOs);
needBarcode.inLineNum += 1;
_needBarcodeRepository.UpdateData(needBarcode);
}
- else
- {
- ConsoleHelper.WriteErrorLine($"鍒嗗绌烘墭鐩樺叆鍙c�恵stationManager.stationChildCode}銆戝湪閫旀暟閲�>缂撳瓨鏁伴噺");
- }
+ //else
+ //{
+ // ConsoleHelper.WriteErrorLine($"鍒嗗绌烘墭鐩樺叆鍙c�恵stationManager.stationChildCode}銆戝湪閫旀暟閲�>缂撳瓨鏁伴噺");
+ //}
}
- else
- {
- ConsoleHelper.WriteErrorLine($"鍒嗗绌烘墭鐩樺叆鍙c�恵stationManager.stationChildCode}銆戞湁鐩�");
- }
+ //else
+ //{
+ // ConsoleHelper.WriteErrorLine($"鍒嗗绌烘墭鐩樺叆鍙c�恵stationManager.stationChildCode}銆戞湁鐩�");
+ //}
}
}
}
+
#endregion
\ No newline at end of file
--
Gitblit v1.9.3