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_GW/GWTask/RequestInbound.cs | 18
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs | 5
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 2
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/SchedulerCenterServer.cs | 470 +++++++++++++++
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs | 43 +
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs | 5
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs | 1
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 7
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs | 1
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db | 0
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs | 2
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ISchedulerCenter.cs | 71 ++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ResponseContent.cs | 45 +
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs | 20
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs | 5
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobFactory.cs | 51 +
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs | 8
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs | 5
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 6
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal | 0
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm | 0
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs | 12
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs | 2
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TasksQz.cs | 80 ++
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 124 +++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer.csproj | 1
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db | 0
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs | 18
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs | 11
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 288 ++++++---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs | 14
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Cache/obj/Debug/net6.0/WIDESEA_Cache.AssemblyInfo.cs | 2
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TaskInfoDto.cs | 38 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs | 18
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/NGTask/OutNGTask.cs | 168 +++++
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs | 2
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal | 0
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs | 2
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/QuartzJobMildd.cs | 59 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj | 1
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 61 +
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal | 0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/WIDESEA_Tasks.csproj | 8
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs | 2
/dev/null | 23
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobSetup.cs | 38 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/obj/WIDESEA_Tasks.csproj.nuget.g.targets | 7
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs | 5
Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm | 0
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs | 2
60 files changed, 1,502 insertions(+), 259 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
index 03cb5fa..97f5e50 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
index 92dbe81..f24f0d3 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
index 486f065..ea4e572 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
index c7a6242..7374c80 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
index 7b97e6d..ffa8eb7 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
index 685d45f..17a2539 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
index 41a4da7..dc0a7d4 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -49,6 +49,11 @@
public string TargetAddress { get; set; }
/// <summary>
+ /// 涓嬩竴浣嶇疆
+ /// </summary>
+ public string NextAddress { get; set; }
+
+ /// <summary>
/// 浼樺厛绾�
/// </summary>
public int Grade { get; set; }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
index 332402f..3250b5b 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_IProcessService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_IProcessService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
index 58b7bb3..ddac36f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -72,6 +72,13 @@
WebResponseContent ReceiveByWMSGWTask([NotNull] WMSTaskDTO taskDTO);
/// <summary>
+ /// 鎺ユ敹WMSNg鍑哄簱浠诲姟
+ /// </summary>
+ /// <param name="taskDTO"></param>
+ /// <returns></returns>
+ WebResponseContent ReceiveByWMSNGTask([NotNull] WMSTaskDTO taskDTO);
+
+ /// <summary>
/// 鏍规嵁鎵樼洏鍙枫�佽捣濮嬪湴鍧�鍚慦MS璇锋眰浠诲姟
/// </summary>
/// <param name="palletCode">鎵樼洏鍙�</param>
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
index 0b5cc99..664d50c 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
index f250dbf..ecfe81b 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
index cabcb05..928851d 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
+++ b/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+02a4fdd78cef9c7d2a26bfb9aa187179cf0baac3")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ProcessService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ProcessService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
index 313f1b6..faa25c7 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -94,7 +94,7 @@
{
}
- return Json(vueDictionaryDTOs);
+ return Json(vueDictionaryDTOs.GroupBy(x => x.DicNo).Select(g => g.First()).ToList());
}
private VueDictionaryDTO? GetVueDictionary(string key)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
index d2293fa..5bf80bc 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -36,6 +36,11 @@
{
return Service.ReceiveByWMSGWTask(taskDTOs);
}
+ [HttpPost, Route("ReceiveByWMSNGTask"), AllowAnonymous]
+ public WebResponseContent ReceiveByWMSNGTask([FromBody] WMSTaskDTO taskDTOs)
+ {
+ return Service.ReceiveByWMSNGTask(taskDTOs);
+ }
[HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
index 2f2bba0..72c53a5 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_SignalR")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_SignalR")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
index e403edf..06c9db3 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -252,7 +252,7 @@
// 鍙戣捣璇锋眰鑾峰彇鍏ュ簱浠诲姟
content = await RequestInTask(palletCode, stationManager);
- ConsoleHelper.WriteErrorLine($"{stationManager.stationChildCode}绔欏彴璇锋眰鍝嶅簲淇℃伅:{content.ToJsonString()}");
+ //ConsoleHelper.WriteErrorLine($"{stationManager.stationChildCode}绔欏彴璇锋眰鍝嶅簲淇℃伅:{content.ToJsonString()}");
if (!content.Status)
{
@@ -260,7 +260,7 @@
}
var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
- ConsoleHelper.WriteSuccessLine(content.Data.ToString());
+ //ConsoleHelper.WriteSuccessLine(content.Data.ToString());
return ReceiveByWMSTask(task);
}
catch (Exception ex)
@@ -559,6 +559,7 @@
task.NextAddress = "002-000-002";
task.SourceAddress = taskDTO.SourceAddress;
task.TargetAddress = taskDTO.TargetAddress;
+
}
BaseDal.AddData(task);
@@ -573,6 +574,44 @@
return content;
}
+ public WebResponseContent ReceiveByWMSNGTask([NotNull] WMSTaskDTO taskDTO)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var task = BaseDal.QueryFirst(x => x.TaskNum == taskDTO.TaskNum || x.PalletCode == taskDTO.PalletCode);
+ if (task != null)
+ {
+ var taskHty = task.Adapt<Dt_Task_Hty>();
+ _taskHtyRepository.AddData(taskHty);
+ BaseDal.DeleteData(task);
+ }
+
+ Dt_Task taskNew = _mapper.Map<Dt_Task>(taskDTO);
+ taskNew.Creater = "WMS";
+
+ if (taskNew.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+ {
+ taskNew.TaskState = (int)TaskOutStatusEnum.OutNew;
+ taskNew.CurrentAddress = taskDTO.SourceAddress;
+ taskNew.NextAddress = taskDTO.NextAddress;
+ taskNew.SourceAddress = taskDTO.SourceAddress;
+ taskNew.TargetAddress = taskDTO.TargetAddress;
+
+ }
+ BaseDal.AddData(taskNew);
+
+ _taskExecuteDetailService.AddTaskExecuteDetail(taskNew.WMSId, "鎺ユ敹WMS浠诲姟");
+
+ content = WebResponseContent.Instance.OK("鎴愬姛");
+ }
+ catch (Exception ex)
+ {
+ content = WebResponseContent.Instance.Error($"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}");
+ }
+ return content;
+ }
+
/// <summary>
/// 鎺ユ敹WMS浠诲姟淇℃伅
/// </summary>
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 0bb0701..02c4864 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -778,7 +778,7 @@
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
{
- if (!task.Roadway.Contains("GW") && task.TaskType != (int)TaskOutboundTypeEnum.InToOut)
+ if (!task.Roadway.Contains("GW") && task.TaskType != (int)TaskOutboundTypeEnum.InToOut && task.TaskType != (int)TaskOutboundTypeEnum.OutNG)
{
var routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
if (!routers.Any()) return WebResponseContent.Instance.Error($"鏈壘鍒拌澶囪矾鐢变俊鎭�");
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
index c6f15db..097f693 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
index b4c6f25..c941b9d 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
+++ b/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+29aa484d06b2d4839536034bb1033d0e60334ec2")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
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 72ec354..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
@@ -171,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)
@@ -214,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);
@@ -284,26 +282,24 @@
WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
if (!content.Status)
{
- ConsoleHelper.WriteErrorLine($"{stationManager.stationChildCode}鍒嗗鍛煎彨绌烘墭鐩樺け璐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}銆戞湁鐩�");
+ //}
}
}
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
index 2d4d0fc..33a03e9 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
@@ -189,8 +189,6 @@
_taskService.Delete(taskExecuting);
}
- ConsoleHelper.WriteErrorLine($"褰撳墠鎵樼洏瀛樺湪浠诲姟锛氥�恵command.ConveyorLineBarcode}銆�");
-
WriteInfo(conveyorLine.DeviceName, $"褰撳墠鎵樼洏瀛樺湪浠诲姟{command.ConveyorLineBarcode}");
}
@@ -260,16 +258,6 @@
var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
if (task != null)
{
- 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($"鎵樼洏鍙凤細銆恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
- return;
- }
- }
-
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
@@ -283,7 +271,7 @@
}
else
{
- if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" && content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃")
+ if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" && content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃" && !content.Message.Contains("瀛樺湪浠诲姟") && !content.Message.Contains("瀛樺湪搴撳瓨涓嶅厑璁稿叆搴�"))
{
WriteInfo(conveyorLine.DeviceName, content.Message);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode);
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
index 314b55b..3240c59 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
@@ -239,16 +239,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);
@@ -645,8 +635,6 @@
var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
-
- ConsoleHelper.WriteSuccessLine($"鏃堕棿锛氥�恵DateTime.Now}銆戣姹俉MS鍑哄簱浠诲姟杩斿洖缁撴灉锛氥�恵content.Serialize()}銆�");
// 妫�鏌ョ姸鎬佸苟杩斿洖
if (!content.Status)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index 92786b6..c111eac 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -135,7 +135,7 @@
if (command == null) continue;
//if (command.InteractiveSignal == 0 && command.HasPallet != 1) continue;
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());
if (deviceProtocolDetails != null)
{
@@ -231,10 +231,10 @@
{
if (childDeviceCode == "1039")
{
- var GWTask = _taskRepository.QueryData(x => (x.Roadway.Contains("GWSC2")|| x.Roadway.Contains("GWSC3")) && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
+ var GWTask = _taskRepository.QueryData(x => (x.Roadway.Contains("GWSC2") || x.Roadway.Contains("GWSC3")) && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
if ((GWTask.Where(x => x.Roadway.Contains("GWSC2")).ToList().Count >= 2 && task.Roadway.Contains("GWSC2")) || (GWTask.Where(x => x.Roadway.Contains("GWSC3")).ToList().Count >= 2 && task.Roadway.Contains("GWSC3")))
{
- ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓﹞(task.Roadway.Contains("GWSC3")?"涓�":"浜�")}宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
+ //ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓﹞(task.Roadway.Contains("GWSC3") ? "涓�" : "浜�")}宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
return;
}
}
@@ -582,7 +582,7 @@
var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
if (content.Status)
{
- Console.WriteLine($"{taskDTO.TaskType}鍛煎彨鎴愬姛");
+ //Console.WriteLine($"{taskDTO.TaskType}鍛煎彨鎴愬姛");
}
return content;
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
index 0b9a5f2..5cb2e55 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -254,7 +254,7 @@
_taskService.Delete(taskExecuting);
}
- ConsoleHelper.WriteErrorLine($"褰撳墠鎵樼洏瀛樺湪浠诲姟锛氥�恵command.ConveyorLineBarcode}銆�");
+ //ConsoleHelper.WriteErrorLine($"褰撳墠鎵樼洏瀛樺湪浠诲姟锛氥�恵command.ConveyorLineBarcode}銆�");
WriteInfo(conveyorLine.DeviceName, $"褰撳墠鎵樼洏瀛樺湪浠诲姟{command.ConveyorLineBarcode}");
}
@@ -323,10 +323,16 @@
{
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"))
+ //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($"鎵樼洏鍙凤細銆恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
+ // return;
+ //}
+ var GWTask = _taskRepository.QueryData(x => (x.Roadway.Contains("GWSC2") || x.Roadway.Contains("GWSC3")) && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
+ if ((GWTask.Where(x => x.Roadway.Contains("GWSC2")).ToList().Count >= 2 && task.Roadway.Contains("GWSC2")) || (GWTask.Where(x => x.Roadway.Contains("GWSC3")).ToList().Count >= 2 && task.Roadway.Contains("GWSC3")))
{
- ConsoleHelper.WriteErrorLine($"鎵樼洏鍙凤細銆恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
+ //ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓﹞(task.Roadway.Contains("GWSC3") ? "涓�" : "浜�")}宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
return;
}
}
@@ -345,15 +351,13 @@
}
else
{
- if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" && content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃" && !content.Message.Contains("瀛樺湪浠诲姟"))
+ if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" && content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃" && !content.Message.Contains("瀛樺湪浠诲姟") && !content.Message.Contains("瀛樺湪搴撳瓨涓嶅厑璁稿叆搴�"))
{
WriteInfo(conveyorLine.DeviceName, content.Message);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
- ConsoleHelper.WriteErrorLine($"銆恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戣姹傜偣浣嶏細銆恵childDeviceCode}銆戝紓甯镐俊鎭�恵content.Message}銆�");
WriteInfo(conveyorLine.DeviceName, $"銆恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戣姹傜偣浣嶏細銆恵childDeviceCode}銆戝紓甯镐俊鎭�恵content.Message}銆�");
}
- ConsoleHelper.WriteErrorLine($"銆恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戣姹傜偣浣嶏細銆恵childDeviceCode}銆戝紓甯镐俊鎭�恵content.Message}銆�");
}
}
catch (Exception ex)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 4109752..e250ca5 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -1,4 +1,5 @@
-锘縰sing Mapster;
+锘縰sing Autofac.Core;
+using Mapster;
using Newtonsoft.Json;
using Quartz;
using System.Diagnostics.CodeAnalysis;
@@ -60,7 +61,6 @@
{
try
{
-
CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
if (commonStackerCrane != null)
{
@@ -81,35 +81,30 @@
StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
if (stackerCraneTaskCommand != null)
{
- var taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.TaskNum);
- //var taskBarCode = commonStackerCrane.GetValue<StackerCraneDBName, string>(StackerCraneDBName.Barcode);
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浠诲姟鍙凤細銆恵taskNum}銆戜换鍔′换鍔″彿锛氥�恵task.TaskNum}銆�", ConsoleColor.DarkBlue);
- if (taskNum == 0)
+ bool IsInStock = commonStackerCrane.Communicator.Read<bool>("DB14.4.3");
+ if (!IsInStock)
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戜换鍔″彿涓恒�恵0}銆�,浠诲姟鍙蜂笉涓�鑷村彲浠ヤ笅鍙戜换鍔�", ConsoleColor.DarkBlue);
-
- Thread.Sleep(1000);
- bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
- if (sendFlag)
+ var taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.TaskNum);
+ ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浠诲姟鍙凤細銆恵taskNum}銆戜换鍔′换鍔″彿锛氥�恵task.TaskNum}銆�", ConsoleColor.DarkBlue);
+ if (taskNum == 0)
{
- 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);
+ Thread.Sleep(1000);
+ bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
+ if (sendFlag)
+ {
+ commonStackerCrane.LastTaskType = task.TaskType;
+ _taskService.UpdateTaskStatusToNext(task.TaskNum);
+ }
+ }
+ else
+ {
+ ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戜换鍔″彿涓嶄负銆恵0}銆�,涓嶅彲浠ヤ笅鍙戜换鍔�", ConsoleColor.DarkBlue);
}
}
else
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戜换鍔″彿涓嶄负銆恵0}銆�,涓嶅彲浠ヤ笅鍙戜换鍔�", ConsoleColor.DarkBlue);
+ ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戞湁璐т俊鎭笉涓恒�恵0}銆�,涓嶅彲浠ヤ笅鍙戜换鍔�", ConsoleColor.DarkBlue);
+ WriteInfo("鍫嗗灈鏈烘湁璐т俊鍙�", $"銆恵commonStackerCrane.DeviceName}銆戞湁璐т俊鎭笉涓恒�恵IsInStock}銆�,涓嶅彲浠ヤ笅鍙戜换鍔�");
}
}
}
@@ -162,8 +157,6 @@
{
if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浣滀笟鐘舵�侊細銆恵(int)commonStackerCrane.StackerCraneWorkStatusValue}銆戞椂闂淬�恵DateTime.Now}銆�", ConsoleColor.Magenta);
-
string str = $"銆恵commonStackerCrane.DeviceName}銆戜换鍔″畬鎴�,浠诲姟鍙凤細銆恵e.TaskNum}銆戞椂闂淬�恵DateTime.Now}銆�";
WriteInfo(commonStackerCrane.DeviceName, str);
ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue);
@@ -171,9 +164,9 @@
if (task == null) commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
- if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType==(int)TaskOutboundTypeEnum.InToOut)
+ if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
{
- var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017"||x.stationPLC=="1024") && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
+ var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017" || x.stationPLC == "1024") && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
if (device != null)
@@ -189,6 +182,48 @@
{
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 (task.TaskType == (int)TaskOutboundTypeEnum.OutNG)
+ {
+ Dt_StationManager stationinfo = null;
+ if (commonStackerCrane.DeviceCode.Contains("CW"))
+ stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017" || x.stationPLC == "1024") && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
+ else
+ stationinfo = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && x.stationChildCode == task.TargetAddress);
+
+ 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.ConveyorLineBarcode, task.PalletCode, stationinfo.stationChildCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+ }
+ else if (device.DeviceCode == "1015" || device.DeviceCode == "2025")
+ {
+ CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1815), stationinfo.stationChildCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, 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.ConveyorLineBarcode, task.PalletCode, stationinfo.stationChildCode);
Thread.Sleep(100);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
}
@@ -219,19 +254,23 @@
}
var content = _taskService.StackCraneTaskCompleted(e.TaskNum);
+
if (commonStackerCrane.DeviceCode.Contains("CH") && task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
{
task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
_taskService.UpdateData(newTask);
}
+
if ((task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && (task.TargetAddress == "002-021-001" || task.TargetAddress == "001-021-001"))|| task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
{
var TASKHTY = task.Adapt<Dt_Task_Hty>();
_taskRepository.DeleteData(task);
_htyRepository.AddData(TASKHTY);
}
+
var isWorkType = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+
str = $"{commonStackerCrane.DeviceName}銆慦MS|WCS浠诲姟瀹屾垚锛氥�恵content.Status}銆�,鍫嗗灈鏈哄畬鎴愪俊鍙峰啓鍏ワ細銆恵isWorkType}銆�,浠诲姟鍙凤細銆恵e.TaskNum}銆戞椂闂淬�恵DateTime.Now}銆�";
WriteInfo(commonStackerCrane.DeviceName, str);
ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue);
@@ -315,98 +354,155 @@
/// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns>
private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
{
- Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
- if (task.Roadway.Contains("GW") || task.Roadway.Contains("CW"))
+ if (task.TaskType == (int)TaskOutboundTypeEnum.OutNG)
{
- if (router != null)
+ if (task.Roadway.Contains("CW"))
{
- IDevice? device = null;
- if (task.Roadway.Contains("CW"))
+ var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017" || x.stationPLC == "1024") && x.stationType == 10 && x.Roadway == task.Roadway);
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
+ if (device != null)
{
- device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
- if (device != null)
+ if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
{
- if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
+ CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
+
+ if (conveyorLine.IsOccupied(task.TargetAddress))//鍑哄簱绔欏彴鏈鍗犵敤
{
- CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
- if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+ return task;
+ }
+
+ }
+ else
+ {
+ CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
+
+ if (conveyorLine.IsOccupied(task.TargetAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+ {
+ return task;
+ }
+ }
+ }
+ else
+ {
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.NextAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
+ }
+ }
+ else
+ {
+ var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && x.stationChildCode == task.TargetAddress);
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
+ if (device != null)
+ {
+ CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
+ if (conveyorLine.IsOccupied(task.TargetAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+ {
+ return task;
+ }
+ }
+ else
+ {
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.NextAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
+ }
+ }
+ }
+ else
+ {
+ Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
+ if (task.Roadway.Contains("GW") || task.Roadway.Contains("CW"))
+ {
+ if (router != null)
+ {
+ IDevice? device = null;
+ if (task.Roadway.Contains("CW"))
+ {
+ 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
+ {
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.NextAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
+ }
+ }
+ }
+ else
+ {
+ IDevice? device = null;
+ if (task.Roadway.Contains("GW"))
+ {
+ string targetDeviceCode = task.Roadway == "GWSC3" ? "2025" : "1015";
+ device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == targetDeviceCode);
+
+ if (device != null)
+ {
+ CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
+ if (conveyorLine.IsOccupied(task.TargetAddress))//鍑哄簱绔欏彴鏈鍗犵敤
{
return task;
}
}
else
{
- CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
- if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.TargetAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
+ }
+ }
+ //_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.TargetAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
+ }
+ }
+ else
+ {
+ if ((task.NextAddress == ("002-021-001") || task.NextAddress == ("001-021-001")) && task.Roadway.Contains("JZ"))
+ {
+ return task;
+ }
+ else
+ {
+ //Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
+ if (router != null)
+ {
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
+ if (device != null)
+ {
+ CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
+ if (conveyorLine.IsOccupiedx(router.ChildPosi))//鍑哄簱绔欏彴鏈鍗犵敤
{
return task;
}
}
- }
- else
- {
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.NextAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
- }
- }
- }
- else
- {
- IDevice? device = null;
- if (task.Roadway.Contains("GW"))
- {
- string targetDeviceCode = task.Roadway == "GWSC3" ? "2025" : "1015";
- device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == targetDeviceCode);
-
- if (device != null)
- {
- CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
- if (conveyorLine.IsOccupied(task.TargetAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+ else
{
- return task;
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵router.ChildPosiDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
}
}
else
{
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵task.TargetAddress}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
}
- }
- //_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.TargetAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
- }
- }
- else
- {
- if ((task.NextAddress == ("002-021-001") || task.NextAddress == ("001-021-001")) && task.Roadway.Contains("JZ"))
- {
- return task;
- }
- else
- {
- //Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
- if (router != null)
- {
- IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
- if (device != null)
- {
- CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
- if (conveyorLine.IsOccupiedx(router.ChildPosi))//鍑哄簱绔欏彴鏈鍗犵敤
- {
- return task;
- }
- }
- else
- {
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵router.ChildPosiDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
- }
- }
- else
- {
- _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
}
}
}
return null;
}
-
+
/// <summary>
/// 鏌ユ壘鍏朵粬鍑哄簱浠诲姟鐨勮緟鍔╂柟娉曪紙鎺掗櫎鎸囧畾浠诲姟ID鐨勪换鍔★級
/// </summary>
@@ -523,7 +619,7 @@
}
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- if (task.Roadway.Contains("GW")|| task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
+ if (task.Roadway.Contains("GW")|| task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm || task.TaskType == (int)TaskOutboundTypeEnum.OutNG)
{
string[] endCodes = task.NextAddress.Split("-");
stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
index a7ed647..689126f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
@@ -82,27 +82,14 @@
if (stackerCraneTaskCommand != null)
{
var taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.TaskNum);
- //var taskBarCode = commonStackerCrane.GetValue<StackerCraneDBName, string>(StackerCraneDBName.Barcode);
ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浠诲姟鍙凤細銆恵taskNum}銆戜换鍔′换鍔″彿锛氥�恵task.TaskNum}銆�", ConsoleColor.DarkBlue);
if (taskNum == 0)
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戜换鍔″彿涓恒�恵0}銆�,浠诲姟鍙蜂笉涓�鑷村彲浠ヤ笅鍙戜换鍔�", ConsoleColor.DarkBlue);
-
Thread.Sleep(1000);
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);
commonStackerCrane.LastTaskType = task.TaskType;
-
_taskService.UpdateTaskStatusToNext(task.TaskNum);
}
@@ -162,8 +149,6 @@
{
if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浣滀笟鐘舵�侊細銆恵(int)commonStackerCrane.StackerCraneWorkStatusValue}銆戞椂闂淬�恵DateTime.Now}銆�", ConsoleColor.Magenta);
-
string str = $"銆恵commonStackerCrane.DeviceName}銆戜换鍔″畬鎴�,浠诲姟鍙凤細銆恵e.TaskNum}銆戞椂闂淬�恵DateTime.Now}銆�";
WriteInfo(commonStackerCrane.DeviceName, str);
ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue);
@@ -185,9 +170,6 @@
}
WriteInfo(commonStackerCrane.DeviceName, $"銆愭墜鍔ㄥ嚭搴撹褰曘�戜换鍔″彿銆恵e.TaskNum}銆戞墭鐩樺彿銆恵task.PalletCode}銆�");
}
-
-
-
if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
index e38f9fa..2d0a34d 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -83,15 +83,6 @@
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);
commonStackerCrane.LastTaskType = task.TaskType;
_taskService.UpdateTaskStatusToNext(task.TaskNum);
}
@@ -151,8 +142,6 @@
{
if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
{
- ConsoleHelper.WriteColorLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満浣滀笟鐘舵�侊細銆恵(int)commonStackerCrane.StackerCraneWorkStatusValue}銆戞椂闂淬�恵DateTime.Now}銆�", ConsoleColor.Magenta);
-
string str = $"銆恵commonStackerCrane.DeviceName}銆戜换鍔″畬鎴�,浠诲姟鍙凤細銆恵e.TaskNum}銆戞椂闂淬�恵DateTime.Now}銆�";
WriteInfo(commonStackerCrane.DeviceName, str);
ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue);
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
index 75ea823..85d7d5c 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
index f2f7973..300099e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
index bb51e43..34b0d6c 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
index 995c485..3ac8839 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
index 66eeed8..7d372b9 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
index ce72ce3..ab43d8f 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Cache/obj/Debug/net6.0/WIDESEA_Cache.AssemblyInfo.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Cache/obj/Debug/net6.0/WIDESEA_Cache.AssemblyInfo.cs
index 2daf93e..11a2437 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Cache/obj/Debug/net6.0/WIDESEA_Cache.AssemblyInfo.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Cache/obj/Debug/net6.0/WIDESEA_Cache.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEA_Cache")]
[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+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_Cache")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_Cache")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs
index 7b95dee..6cc73e2 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs
@@ -143,6 +143,11 @@
public const string ReceiveTask = "ReceiveTask";
/// <summary>
+ /// 璇锋眰WCS浠诲姟涓嬪彂NG鍑哄簱浠诲姟
+ /// </summary>
+ public const string ReceiveByWMSNGTask = "ReceiveByWMSNGTask";
+
+ /// <summary>
/// 璇锋眰WCS浠诲姟
/// </summary>
public const string GetStation = "GetStation";
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
index 8a4b227..3e67081 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
@@ -587,5 +587,6 @@
鑷姩鎭㈠ = 4,
浜哄伐瀹屾垚 = 5,
鑷姩瀹屾垚 = 6,
+ NG浠诲姟鍒犻櫎 = 7,
}
}
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs
deleted file mode 100644
index 1851aa6..0000000
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-锘縰sing Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace WIDESEA_Core.Extensions
-{
-
- /// <summary>
- /// 浠诲姟璋冨害 鍚姩鏈嶅姟
- /// </summary>
- public static class JobSetup
- {
- public static void AddJobSetup(this IServiceCollection services)
- {
- if (services == null) throw new ArgumentNullException(nameof(services));
-
- }
- }
-}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ISchedulerCenter.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ISchedulerCenter.cs
new file mode 100644
index 0000000..5d250f6
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ISchedulerCenter.cs
@@ -0,0 +1,71 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA.QuartzJob
+{
+ public interface ISchedulerCenter
+ {
+ /// <summary>
+ /// 寮�鍚换鍔¤皟搴�
+ /// </summary>
+ /// <returns></returns>
+ Task<ResponseContent> StartScheduleAsync();
+ /// <summary>
+ /// 鍋滄浠诲姟璋冨害
+ /// </summary>
+ /// <returns></returns>
+ Task<ResponseContent> StopScheduleAsync();
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<ResponseContent> AddScheduleJobAsync(TasksQz sysSchedule);
+ /// <summary>
+ /// 鍋滄涓�涓换鍔�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<ResponseContent> StopScheduleJobAsync(TasksQz sysSchedule);
+ /// <summary>
+ /// 妫�娴嬩换鍔℃槸鍚﹀瓨鍦�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<bool> IsExistScheduleJobAsync(TasksQz sysSchedule);
+ /// <summary>
+ /// 鏆傚仠鎸囧畾鐨勮鍒掍换鍔�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<ResponseContent> PauseJob(TasksQz sysSchedule);
+ /// <summary>
+ /// 鎭㈠涓�涓换鍔�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<ResponseContent> ResumeJob(TasksQz sysSchedule);
+
+ /// <summary>
+ /// 鑾峰彇浠诲姟瑙﹀彂鍣ㄧ姸鎬�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ Task<List<TaskInfoDto>> GetTaskStaus(TasksQz sysSchedule);
+ /// <summary>
+ /// 鑾峰彇瑙﹀彂鍣ㄦ爣璇�
+ /// </summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ string GetTriggerState(string key);
+
+ /// <summary>
+ /// 绔嬪嵆鎵ц 涓�涓换鍔�
+ /// </summary>
+ /// <param name="tasksQz"></param>
+ /// <returns></returns>
+ Task<ResponseContent> ExecuteJobAsync(TasksQz tasksQz);
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobFactory.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobFactory.cs
new file mode 100644
index 0000000..1fe8170
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobFactory.cs
@@ -0,0 +1,51 @@
+锘縰sing Microsoft.Extensions.DependencyInjection;
+using Quartz;
+using Quartz.Spi;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WIDESEA.QuartzJob
+{
+ public class JobFactory : IJobFactory
+ {
+ /// <summary>
+ /// 娉ㄥ叆鍙嶅皠鑾峰彇渚濊禆瀵硅薄
+ /// </summary>
+ private readonly IServiceProvider _serviceProvider;
+ public JobFactory(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = serviceProvider;
+ }
+ /// <summary>
+ /// 瀹炵幇鎺ュ彛Job
+ /// </summary>
+ /// <param name="bundle"></param>
+ /// <param name="scheduler"></param>
+ /// <returns></returns>
+ public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
+ {
+ try
+ {
+ var serviceScope = _serviceProvider.CreateScope();
+ var job = serviceScope.ServiceProvider.GetService(bundle.JobDetail.JobType) as IJob;
+ return job;
+
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ public void ReturnJob(IJob job)
+ {
+ var disposable = job as IDisposable;
+ if (disposable != null)
+ {
+ disposable.Dispose();
+ }
+
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobSetup.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobSetup.cs
new file mode 100644
index 0000000..b2c3131
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/JobSetup.cs
@@ -0,0 +1,38 @@
+锘縰sing Microsoft.Extensions.DependencyInjection;
+using Quartz;
+using Quartz.Spi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+
+namespace WIDESEA.QuartzJob
+{
+ /// <summary>
+ /// 浠诲姟璋冨害 鍚姩鏈嶅姟
+ /// </summary>
+ public static class JobSetup
+ {
+ public static void AddJobSetup(this IServiceCollection services)
+ {
+ if (services == null) throw new ArgumentNullException(nameof(services));
+
+ services.AddSingleton<IJobFactory, JobFactory>();
+ services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
+
+ var baseType = typeof(IJob);
+ var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
+ var referencedAssemblies = System.IO.Directory.GetFiles(path, "WIDESEA_Tasks.dll").Select(Assembly.LoadFrom).ToArray();
+ var types = referencedAssemblies
+ .SelectMany(a => a.DefinedTypes)
+ .Select(type => type.AsType())
+ .Where(x => x != baseType && baseType.IsAssignableFrom(x)).ToArray();
+ var implementTypes = types.Where(x => x.IsClass).ToArray();
+ foreach (var implementType in implementTypes)
+ {
+ services.AddTransient(implementType);
+ }
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ResponseContent.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ResponseContent.cs
new file mode 100644
index 0000000..3029388
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/ResponseContent.cs
@@ -0,0 +1,45 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WIDESEA.QuartzJob
+{
+ public class ResponseContent
+ {
+ public ResponseContent()
+ {
+ }
+ public ResponseContent(bool status)
+ {
+ Status = status;
+ }
+ public bool Status { get; set; }
+ public string Code { get; set; }
+ public string Message { get; set; }
+ public object Data { get; set; }
+
+ public ResponseContent OK()
+ {
+ Status = true;
+ return this;
+ }
+
+ public static ResponseContent Instance
+ {
+ get { return new ResponseContent(); }
+ }
+ public ResponseContent OK(string message = null, object data = null)
+ {
+ Status = true;
+ Message = message;
+ Data = data;
+ return this;
+ }
+ public ResponseContent Error(string message = null)
+ {
+ Status = false;
+ Message = message;
+ return this;
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/SchedulerCenterServer.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/SchedulerCenterServer.cs
new file mode 100644
index 0000000..733cd88
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/SchedulerCenterServer.cs
@@ -0,0 +1,470 @@
+锘縰sing Quartz;
+using Quartz.Impl;
+using Quartz.Impl.Triggers;
+using Quartz.Spi;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Helper;
+
+namespace WIDESEA.QuartzJob
+{
+ public class SchedulerCenterServer : ISchedulerCenter
+ {
+ private Task<IScheduler> _scheduler;
+ private readonly IJobFactory _iocjobFactory;
+ public SchedulerCenterServer(IJobFactory jobFactory)
+ {
+ _iocjobFactory = jobFactory;
+ _scheduler = GetSchedulerAsync();
+ }
+ private Task<IScheduler> GetSchedulerAsync()
+ {
+ if (_scheduler != null)
+ return _scheduler;
+ else
+ {
+ // 浠嶧actory涓幏鍙朣cheduler瀹炰緥
+ NameValueCollection collection = new NameValueCollection
+ {
+ { "quartz.serializer.type", "binary" },
+ };
+ StdSchedulerFactory factory = new StdSchedulerFactory(collection);
+ return _scheduler = factory.GetScheduler();
+ }
+ }
+
+ /// <summary>
+ /// 寮�鍚换鍔¤皟搴�
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ResponseContent> StartScheduleAsync()
+ {
+ var result = new ResponseContent();
+ try
+ {
+ _scheduler.Result.JobFactory = _iocjobFactory;
+ if (!_scheduler.Result.IsStarted)
+ {
+ //绛夊緟浠诲姟杩愯瀹屾垚
+ await _scheduler.Result.Start();
+
+ ConsoleHelper.WriteSuccessLine("浠诲姟璋冨害寮�鍚紒");
+ result = ResponseContent.Instance.OK($"浠诲姟璋冨害寮�鍚垚鍔�");
+ return result;
+ }
+ else
+ {
+ result = ResponseContent.Instance.OK($"浠诲姟璋冨害宸茬粡寮�鍚�");
+ return result;
+ }
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ /// <summary>
+ /// 鍋滄浠诲姟璋冨害
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ResponseContent> StopScheduleAsync()
+ {
+ var result = new ResponseContent();
+ try
+ {
+ if (!_scheduler.Result.IsShutdown)
+ {
+ //绛夊緟浠诲姟杩愯瀹屾垚
+ await _scheduler.Result.Shutdown();
+ //await Console.Out.WriteLineAsync("浠诲姟璋冨害鍋滄锛�");
+ result = ResponseContent.Instance.OK($"浠诲姟璋冨害鍋滄鎴愬姛");
+ return result;
+ }
+ else
+ {
+ result = ResponseContent.Instance.OK($"浠诲姟璋冨害宸茬粡鍋滄");
+ return result;
+ }
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ /// <summary>
+ /// 娣诲姞涓�涓鍒掍换鍔★紙鏄犲皠绋嬪簭闆嗘寚瀹欼Job瀹炵幇绫伙級
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="tasksQz"></param>
+ /// <returns></returns>
+ public async Task<ResponseContent> AddScheduleJobAsync(TasksQz tasksQz)
+ {
+ var result = new ResponseContent();
+
+ if (tasksQz != null)
+ {
+ try
+ {
+ JobKey jobKey = new JobKey(tasksQz.Id.ToString(), tasksQz.JobGroup);
+ if (await _scheduler.Result.CheckExists(jobKey))
+ {
+ result = ResponseContent.Instance.OK($"璇ヤ换鍔¤鍒掑凡缁忓湪鎵ц:銆恵tasksQz.Name}銆�,璇峰嬁閲嶅鍚姩锛�");
+ return result;
+ }
+ #region 璁剧疆寮�濮嬫椂闂村拰缁撴潫鏃堕棿
+
+ if (tasksQz.BeginTime == null)
+ {
+ tasksQz.BeginTime = DateTime.Now;
+ }
+ DateTimeOffset starRunTime = DateBuilder.NextGivenSecondDate(tasksQz.BeginTime, 1);//璁剧疆寮�濮嬫椂闂�
+ if (tasksQz.EndTime == null)
+ {
+ tasksQz.EndTime = DateTime.MaxValue.AddDays(-1);
+ }
+ DateTimeOffset endRunTime = DateBuilder.NextGivenSecondDate(tasksQz.EndTime, 1);//璁剧疆鏆傚仠鏃堕棿
+
+ #endregion
+
+ #region 閫氳繃鍙嶅皠鑾峰彇绋嬪簭闆嗙被鍨嬪拰绫�
+
+ Assembly assembly = Assembly.Load(new AssemblyName(tasksQz.AssemblyName));
+ Type jobType = assembly.GetType(tasksQz.AssemblyName + "." + tasksQz.ClassName);
+
+ #endregion
+ //鍒ゆ柇浠诲姟璋冨害鏄惁寮�鍚�
+ //if (!_scheduler.Result.IsStarted)
+ //{
+ // await StartScheduleAsync();
+ //}
+
+ //浼犲叆鍙嶅皠鍑烘潵鐨勬墽琛岀▼搴忛泦
+ IJobDetail job = new JobDetailImpl(tasksQz.Id.ToString(), tasksQz.JobGroup, jobType);
+ job.JobDataMap.Add("JobParam", tasksQz.JobParams);
+ ITrigger trigger;
+
+ #region 娉涘瀷浼犻��
+ //IJobDetail job = JobBuilder.Create<T>()
+ // .WithIdentity(sysSchedule.Name, sysSchedule.JobGroup)
+ // .Build();
+ #endregion
+
+ if (tasksQz.Cron != null && CronExpression.IsValidExpression(tasksQz.Cron) && tasksQz.TriggerType > 0)
+ {
+ trigger = CreateCronTrigger(tasksQz);
+
+ ((CronTriggerImpl)trigger).MisfireInstruction = MisfireInstruction.CronTrigger.DoNothing;
+ }
+ else
+ {
+ trigger = CreateSimpleTrigger(tasksQz);
+ }
+
+ // 鍛婅瘔Quartz浣跨敤鎴戜滑鐨勮Е鍙戝櫒鏉ュ畨鎺掍綔涓�
+ await _scheduler.Result.ScheduleJob(job, trigger);
+ //await Task.Delay(TimeSpan.FromSeconds(120));
+ //await Console.Out.WriteLineAsync("鍏抽棴浜嗚皟搴﹀櫒锛�");
+ //await _scheduler.Result.Shutdown();
+ result = ResponseContent.Instance.OK($"銆恵tasksQz.Name}銆戞垚鍔�");
+ return result;
+ }
+ catch (Exception ex)
+ {
+ result = ResponseContent.Instance.Error($"浠诲姟璁″垝寮傚父:銆恵ex.Message}銆�");
+ return result;
+ }
+ }
+ else
+ {
+ result = ResponseContent.Instance.Error($"浠诲姟璁″垝涓嶅瓨鍦�:銆恵tasksQz?.Name}銆�");
+ return result;
+ }
+ }
+
+ /// <summary>
+ /// 浠诲姟鏄惁瀛樺湪?
+ /// </summary>
+ /// <returns></returns>
+ public async Task<bool> IsExistScheduleJobAsync(TasksQz sysSchedule)
+ {
+ JobKey jobKey = new JobKey(sysSchedule.Id.ToString(), sysSchedule.JobGroup);
+ if (await _scheduler.Result.CheckExists(jobKey))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ /// <summary>
+ /// 鏆傚仠涓�涓寚瀹氱殑璁″垝浠诲姟
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ResponseContent> StopScheduleJobAsync(TasksQz sysSchedule)
+ {
+ var result = new ResponseContent();
+ try
+ {
+ JobKey jobKey = new JobKey(sysSchedule.Id.ToString(), sysSchedule.JobGroup);
+ if (!await _scheduler.Result.CheckExists(jobKey))
+ {
+ result = ResponseContent.Instance.Error($"鏈壘鍒拌鏆傚仠鐨勪换鍔�:銆恵sysSchedule.Name}銆�");
+ return result;
+ }
+ else
+ {
+ await _scheduler.Result.DeleteJob(jobKey);
+ result = ResponseContent.Instance.OK($"銆恵sysSchedule.Name}銆戞垚鍔�");
+ return result;
+ }
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ /// <summary>
+ /// 鎭㈠鎸囧畾鐨勮鍒掍换鍔�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ public async Task<ResponseContent> ResumeJob(TasksQz sysSchedule)
+ {
+ var result = new ResponseContent();
+ try
+ {
+ JobKey jobKey = new JobKey(sysSchedule.Id.ToString(), sysSchedule.JobGroup);
+ if (!await _scheduler.Result.CheckExists(jobKey))
+ {
+ result = ResponseContent.Instance.Error($"鏈壘鍒拌鎭㈠鐨勪换鍔�:銆恵sysSchedule.Name}銆�");
+ return result;
+ }
+ await _scheduler.Result.ResumeJob(jobKey);
+ result = ResponseContent.Instance.OK($"銆恵sysSchedule.Name}銆戞垚鍔�");
+ return result;
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+ /// <summary>
+ /// 鏆傚仠鎸囧畾鐨勮鍒掍换鍔�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <returns></returns>
+ public async Task<ResponseContent> PauseJob(TasksQz sysSchedule)
+ {
+ var result = new ResponseContent();
+ try
+ {
+ JobKey jobKey = new JobKey(sysSchedule.Id.ToString(), sysSchedule.JobGroup);
+ if (!await _scheduler.Result.CheckExists(jobKey))
+ {
+ result = ResponseContent.Instance.Error($"鏈壘鍒拌鏆傚仠鐨勪换鍔�:銆恵sysSchedule.Name}銆�");
+ return result;
+ }
+ await _scheduler.Result.PauseJob(jobKey);
+ result = ResponseContent.Instance.Error($"銆恵sysSchedule.Name}銆戞垚鍔�");
+ return result;
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+ #region 鐘舵�佺姸鎬佸府鍔╂柟娉�
+ public async Task<List<TaskInfoDto>> GetTaskStaus(TasksQz sysSchedule)
+ {
+
+ var ls = new List<TaskInfoDto>();
+ var noTask = new List<TaskInfoDto>{ new TaskInfoDto {
+ jobId = sysSchedule.Id.ToString(),
+ jobGroup = sysSchedule.JobGroup,
+ triggerId = "",
+ triggerGroup = "",
+ triggerStatus = "涓嶅瓨鍦�"
+ } };
+ JobKey jobKey = new JobKey(sysSchedule.Id.ToString(), sysSchedule.JobGroup);
+ IJobDetail job = await _scheduler.Result.GetJobDetail(jobKey);
+ if (job == null)
+ {
+ return noTask;
+ }
+ //info.Append(string.Format("浠诲姟ID:{0}\r\n浠诲姟鍚嶇О:{1}\r\n", job.Key.Name, job.Description));
+ var triggers = await _scheduler.Result.GetTriggersOfJob(jobKey);
+ if (triggers == null || triggers.Count == 0)
+ {
+ return noTask;
+ }
+ foreach (var trigger in triggers)
+ {
+ var triggerStaus = await _scheduler.Result.GetTriggerState(trigger.Key);
+ string state = GetTriggerState(triggerStaus.ToString());
+ ls.Add(new TaskInfoDto
+ {
+ jobId = job.Key.Name,
+ jobGroup = job.Key.Group,
+ triggerId = trigger.Key.Name,
+ triggerGroup = trigger.Key.Group,
+ triggerStatus = state
+ });
+ //info.Append(string.Format("瑙﹀彂鍣↖D:{0}\r\n瑙﹀彂鍣ㄥ悕绉�:{1}\r\n鐘舵��:{2}\r\n", item.Key.Name, item.Description, state));
+
+ }
+ return ls;
+ }
+ public string GetTriggerState(string key)
+ {
+ string state = null;
+ if (key != null)
+ key = key.ToUpper();
+ switch (key)
+ {
+ case "1":
+ state = "鏆傚仠";
+ break;
+ case "2":
+ state = "瀹屾垚";
+ break;
+ case "3":
+ state = "鍑洪敊";
+ break;
+ case "4":
+ state = "闃诲";
+ break;
+ case "0":
+ state = "姝e父";
+ break;
+ case "-1":
+ state = "涓嶅瓨鍦�";
+ break;
+ case "BLOCKED":
+ state = "闃诲";
+ break;
+ case "COMPLETE":
+ state = "瀹屾垚";
+ break;
+ case "ERROR":
+ state = "鍑洪敊";
+ break;
+ case "NONE":
+ state = "涓嶅瓨鍦�";
+ break;
+ case "NORMAL":
+ state = "姝e父";
+ break;
+ case "PAUSED":
+ state = "鏆傚仠";
+ break;
+ }
+ return state;
+ }
+ #endregion
+ #region 鍒涘缓瑙﹀彂鍣ㄥ府鍔╂柟娉�
+
+ /// <summary>
+ /// 鍒涘缓SimpleTrigger瑙﹀彂鍣紙绠�鍗曡Е鍙戝櫒锛�
+ /// </summary>
+ /// <param name="sysSchedule"></param>
+ /// <param name="starRunTime"></param>
+ /// <param name="endRunTime"></param>
+ /// <returns></returns>
+ private ITrigger CreateSimpleTrigger(TasksQz sysSchedule)
+ {
+ if (sysSchedule.CycleRunTimes > 0)
+ {
+ ITrigger trigger = TriggerBuilder.Create()
+ .WithIdentity(sysSchedule.Id.ToString(), sysSchedule.JobGroup)
+ .StartAt(sysSchedule.BeginTime.Value)
+ .WithSimpleSchedule(x => x
+ .WithIntervalInSeconds(sysSchedule.IntervalSecond)
+ .WithRepeatCount(sysSchedule.CycleRunTimes - 1))
+ .EndAt(sysSchedule.EndTime.Value)
+ .Build();
+ return trigger;
+ }
+ else
+ {
+ ITrigger trigger = TriggerBuilder.Create()
+ .WithIdentity(sysSchedule.Id.ToString(), sysSchedule.JobGroup)
+ .StartAt(sysSchedule.BeginTime.Value)
+ .WithSimpleSchedule(x => x
+ .WithIntervalInSeconds(sysSchedule.IntervalSecond)
+ .RepeatForever()
+ )
+ .EndAt(sysSchedule.EndTime.Value)
+ .Build();
+ return trigger;
+ }
+ // 瑙﹀彂浣滀笟绔嬪嵆杩愯锛岀劧鍚庢瘡10绉掗噸澶嶄竴娆★紝鏃犻檺寰幆
+
+ }
+ /// <summary>
+ /// 鍒涘缓绫诲瀷Cron鐨勮Е鍙戝櫒
+ /// </summary>
+ /// <param name="m"></param>
+ /// <returns></returns>
+ private ITrigger CreateCronTrigger(TasksQz sysSchedule)
+ {
+ // 浣滀笟瑙﹀彂鍣�
+ return TriggerBuilder.Create()
+ .WithIdentity(sysSchedule.Id.ToString(), sysSchedule.JobGroup)
+ .StartAt(sysSchedule.BeginTime.Value)//寮�濮嬫椂闂�
+ .EndAt(sysSchedule.EndTime.Value)//缁撴潫鏁版嵁
+ .WithCronSchedule(sysSchedule.Cron)//鎸囧畾cron琛ㄨ揪寮�
+ .ForJob(sysSchedule.Id.ToString(), sysSchedule.JobGroup)//浣滀笟鍚嶇О
+ .Build();
+ }
+ #endregion
+
+
+ /// <summary>
+ /// 绔嬪嵆鎵ц 涓�涓换鍔�
+ /// </summary>
+ /// <param name="tasksQz"></param>
+ /// <returns></returns>
+ public async Task<ResponseContent> ExecuteJobAsync(TasksQz tasksQz)
+ {
+ var result = new ResponseContent();
+ try
+ {
+ JobKey jobKey = new JobKey(tasksQz.Id.ToString(), tasksQz.JobGroup);
+
+ //鍒ゆ柇浠诲姟鏄惁瀛樺湪锛屽瓨鍦ㄥ垯 瑙﹀彂涓�娆★紝涓嶅瓨鍦ㄥ垯鍏堟坊鍔犱竴涓换鍔★紝瑙﹀彂浠ュ悗鍐� 鍋滄浠诲姟
+ if (!await _scheduler.Result.CheckExists(jobKey))
+ {
+ //涓嶅瓨鍦� 鍒� 娣诲姞涓�涓鍒掍换鍔�
+ await AddScheduleJobAsync(tasksQz);
+
+ //瑙﹀彂鎵ц涓�娆�
+ await _scheduler.Result.TriggerJob(jobKey);
+
+ //鍋滄浠诲姟
+ await StopScheduleJobAsync(tasksQz);
+
+ result = ResponseContent.Instance.OK($"绔嬪嵆鎵ц璁″垝浠诲姟:銆恵tasksQz.Name}銆戞垚鍔�");
+ }
+ else
+ {
+ await _scheduler.Result.TriggerJob(jobKey);
+ result = ResponseContent.Instance.OK($"绔嬪嵆鎵ц璁″垝浠诲姟:銆恵tasksQz.Name}銆戞垚鍔�");
+ }
+ }
+ catch (Exception ex)
+ {
+ result = ResponseContent.Instance.Error($"绔嬪嵆鎵ц璁″垝浠诲姟澶辫触:銆恵ex.Message}銆�");
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TaskInfoDto.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TaskInfoDto.cs
new file mode 100644
index 0000000..69f43b2
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TaskInfoDto.cs
@@ -0,0 +1,38 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WIDESEA.QuartzJob
+{
+ public class TaskInfoDto
+ {
+ /// <summary>
+ /// 浠诲姟ID
+ /// </summary>
+ public string jobId { get; set; }
+ /// <summary>
+ /// 浠诲姟鍚嶇О
+ /// </summary>
+ public string jobName { get; set; }
+ /// <summary>
+ /// 浠诲姟鍒嗙粍
+ /// </summary>
+ public string jobGroup { get; set; }
+ /// <summary>
+ /// 瑙﹀彂鍣↖D
+ /// </summary>
+ public string triggerId { get; set; }
+ /// <summary>
+ /// 瑙﹀彂鍣ㄥ悕绉�
+ /// </summary>
+ public string triggerName { get; set; }
+ /// <summary>
+ /// 瑙﹀彂鍣ㄥ垎缁�
+ /// </summary>
+ public string triggerGroup { get; set; }
+ /// <summary>
+ /// 瑙﹀彂鍣ㄧ姸鎬�
+ /// </summary>
+ public string triggerStatus { get; set; }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TasksQz.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TasksQz.cs
new file mode 100644
index 0000000..66377cc
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/QuartzJob/TasksQz.cs
@@ -0,0 +1,80 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WIDESEA.QuartzJob
+{
+ /// <summary>
+ /// 浠诲姟璁″垝琛�
+ /// </summary>
+ public class TasksQz
+ {
+ /// <summary>
+ /// 浠诲姟鍚嶇О
+ /// </summary>
+ public string Name { get; set; }
+ /// <summary>
+ /// 浠诲姟鍒嗙粍
+ /// </summary>
+ public string JobGroup { get; set; }
+ /// <summary>
+ /// 浠诲姟杩愯鏃堕棿琛ㄨ揪寮�
+ /// </summary>
+ public string Cron { get; set; }
+ /// <summary>
+ /// 浠诲姟鎵�鍦―LL瀵瑰簲鐨勭▼搴忛泦鍚嶇О
+ /// </summary>
+ public string AssemblyName { get; set; }
+ /// <summary>
+ /// 浠诲姟鎵�鍦ㄧ被
+ /// </summary>
+ public string ClassName { get; set; }
+ /// <summary>
+ /// 浠诲姟鎻忚堪
+ /// </summary>
+ public string Remark { get; set; }
+ /// <summary>
+ /// 鎵ц娆℃暟
+ /// </summary>
+ public int RunTimes { get; set; }
+ /// <summary>
+ /// 寮�濮嬫椂闂�
+ /// </summary>
+ public DateTime? BeginTime { get; set; }
+ /// <summary>
+ /// 缁撴潫鏃堕棿
+ /// </summary>
+ public DateTime? EndTime { get; set; }
+ /// <summary>
+ /// 瑙﹀彂鍣ㄧ被鍨嬶紙0銆乻imple 1銆乧ron锛�
+ /// </summary>
+ public int TriggerType { get; set; }
+ /// <summary>
+ /// 鎵ц闂撮殧鏃堕棿, 绉掍负鍗曚綅
+ /// </summary>
+ public int IntervalSecond { get; set; }
+ /// <summary>
+ /// 寰幆鎵ц娆℃暟
+ /// </summary>
+ public int CycleRunTimes { get; set; }
+ /// <summary>
+ /// 鏄惁鍚姩
+ /// </summary>
+ public bool IsStart { get; set; } = true;
+ /// <summary>
+ /// 鎵ц浼犲弬
+ /// </summary>
+ public string JobParams { get; set; }
+
+ public bool? IsDeleted { get; set; }
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ /// </summary>
+ public DateTime CreateTime { get; set; } = DateTime.Now;
+ /// <summary>
+ /// 浠诲姟鍐呭瓨涓殑鐘舵��
+ /// </summary>
+ public List<TaskInfoDto> Triggers { get; set; }
+ public int Id { get; set; }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj
index ebc0ae3..0fefed8 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj
@@ -25,6 +25,7 @@
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OfficeOpenXml.Core.ExcelPackage" Version="1.0.0" />
+ <PackageReference Include="Quartz" Version="3.18.0" />
<PackageReference Include="SkiaSharp" Version="2.88.8" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.152" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.0" />
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs
index 7e5705a..d5a081e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs
@@ -50,6 +50,11 @@
public string TargetAddress { get; set; }
/// <summary>
+ /// 涓嬩竴浣嶇疆
+ /// </summary>
+ public string NextAddress { get; set; }
+
+ /// <summary>
/// 浼樺厛绾�
/// </summary>
public int Grade { get; set; }
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
index 4c80318..60534dd 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEA_IStoragIntegrationRepository")]
[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+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_IStoragIntegrationRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_IStoragIntegrationRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
index b8209d6..e3dbb66 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
@@ -278,4 +278,6 @@
WebResponseContent GetLocationStatus();
Task<string> GetRoadWayAsync(List<string> process);
+
+ Task<string> GetGWRoadWayAsync(List<string> process);
}
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
index f77ec6a..e288425 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEA_StoragIntegrationRepository")]
[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+990afb24199ef1f7a4648728ac28ed74394e459c")]
[assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_StoragIntegrationRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_StoragIntegrationRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
index 34e555d..86fe1e6 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
@@ -37,7 +37,7 @@
ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository,
IStockInfoDetailRepository stockInfoDetailRepository,
IMapper mapper,
- IDt_TaskService taskService,
+ IDt_TaskService taskService,
IDt_AreaInfoRepository AreaInfoRepository,
ISys_ConfigService configService) : base(BaseDal)
{
@@ -52,7 +52,7 @@
_mapper = mapper;
_taskService = taskService;
_AreaInfoRepository = AreaInfoRepository;
- _configService= configService;
+ _configService = configService;
}
/// <summary>
@@ -130,7 +130,7 @@
public WebResponseContent HandOutTask(int locationID)
{
LogFactory.GetLog("鎵嬪姩鍑哄簱浠诲姟").InfoFormat(true, "鎵嬪姩鍑哄簱浠诲姟", JsonConvert.SerializeObject(locationID), App.User.UserName);
- WebResponseContent content=new WebResponseContent();
+ WebResponseContent content = new WebResponseContent();
try
{
Dt_AreaInfo areaInfo = _AreaInfoRepository.QueryFirst(x => x.AreaCode == "CWSC1");
@@ -240,9 +240,9 @@
return content.Error("鏈壘鍒拌揣浣嶄俊鎭�!");
}
DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationId == location.Id);
- if(stock == null)
+ if (stock == null)
{
- location.LocationStatus= (int)LocationEnum.Free;
+ location.LocationStatus = (int)LocationEnum.Free;
BaseDal.UpdateData(location);
}
else
@@ -259,7 +259,7 @@
AddStockInfoDetailHty(details);
}
await AddStockInfoHtyAsync(stockInfo_Hty);
-
+
location.LocationStatus = (int)LocationEnum.Free;
BaseDal.UpdateData(location);
@@ -337,7 +337,7 @@
int enable = Convert.ToBoolean(saveModel.Extra) ? 0 : 4;
for (int i = 0; i < saveModel.DelKeys.Count; i++)
{
- DtLocationInfo location = BaseDal.QueryData(x => x.Id == int.Parse(saveModel.DelKeys[i].ToString())).FirstOrDefault();
+ DtLocationInfo location = BaseDal.QueryFirst(x => x.Id == int.Parse(saveModel.DelKeys[i].ToString()));
location.LocationStatus = enable;
locations.Add(location);
}
@@ -530,12 +530,12 @@
{
var isStockAdd = SqlSugarHelper.DbWMS.Insertable(details).ExecuteCommand();
- if (isStockAdd==0)
+ if (isStockAdd == 0)
{
throw new Exception("搴撳瓨鏄庣粏鍘嗗彶淇℃伅娣诲姞澶辫触");
}
}
-
+
#endregion
#endregion 鍐呴儴鏂规硶
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 8350e38..19b4a94 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -160,6 +160,45 @@
}
}
+ public async Task<WebResponseContent> CompleteNgTaskAsync(Dt_Task task)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var boxing = await _boxingInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode);
+ if (boxing != null)
+ {
+ await _boxingInfoRepository.Db.DeleteNav<DtBoxingInfo>(x => x.Id == boxing.Id)
+ .Include(x => x.BoxingInfoDetails)
+ .ExecuteCommandAsync();
+ }
+ var loc = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress && x.RoadwayNo == task.Roadway);
+ var taskHty = task.Adapt<Dt_Task_Hty>();
+ taskHty.FinishTime = DateTime.Now;
+ taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
+ taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
+ int lastStatus = loc.LocationStatus;
+ loc.LocationStatus = (int)LocationEnum.Free;
+ task.TaskState = (int)TaskOutStatusEnum.OutFinish;
+ // 浜嬪姟澶勭悊
+ await _unitOfWorkManage.UseTranAsync(async () =>
+ {
+ await UpdateLocationAsync(loc);
+
+ await DeleteTaskAsync(task.TaskId);
+ await AddTaskHtyAsync(taskHty);
+ });
+
+ _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(loc, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum);
+ return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark);
+ }
+ catch (Exception err)
+ {
+ LogFactory.GetLog("浠诲姟瀹屾垚").Error(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{err.Message}");
+ return content.Error(err.Message);
+ }
+ }
+
private AgingOutputDto MapToAgingOutputDto(DtStockInfo stock, ResponseEqptRunDto? info = null)
{
// TODO Value鍊兼牴鎹甅OM涓嬪彂鐨勯潤缃椂闂村埌褰撳墠鏃堕棿鐨勫垎閽熸暟
@@ -407,7 +446,15 @@
return content.OK("鍏ュ簱浠诲姟瀹屾垚鎴愬姛");
}
// 鏍规嵁鏄惁鏈夌粍鐩樹俊鎭垱寤哄簱瀛樺疄渚嬫ā鍨�
- DtStockInfo stock = boxing == null ? CreateEmptyPalletStock(task, locationInf) : CreateFullPalletStock(task, locationInf, boxing);
+ DtStockInfo stock = null;
+ if (boxing == null && task.TaskType == (int)TaskInboundTypeEnum.InTray)
+ {
+ stock = CreateEmptyPalletStock(task, locationInf);
+ }
+ else
+ {
+ stock = CreateFullPalletStock(task, locationInf, boxing);
+ }
// 鎵ц鏁版嵁搴撲簨鍔�
bool isResult = await ExecuteTransaction(stock, taskHty, locationInf, task.TaskId, boxing);
@@ -638,11 +685,20 @@
case (int)TaskOutboundTypeEnum.OutTray:
case (int)TaskOutboundTypeEnum.Outbound:
- case (int)TaskOutboundTypeEnum.OutNG:
LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
return await CompleteStackTaskAsync(task, stock);
+ case (int)TaskOutboundTypeEnum.OutNG:
+ LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
+ if(task.Roadway.Contains("FR"))
+ {
+ return await CompleteStackTaskAsync(task, stock);
+ }
+ else
+ {
+ return await CompleteNgTaskAsync(task);
+ }
case (int)TaskOutboundTypeEnum.OutFireAlarm:
LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鐏浠诲姟", "");
@@ -671,7 +727,7 @@
{
return CreateAndReturnWMSTaskDTO(task);
}
- if(task != null && (task.TaskState != (int)TaskInStatusEnum.InNew || task.TaskState != (int)TaskOutStatusEnum.OutNew))
+ if (task != null && (task.TaskState != (int)TaskInStatusEnum.InNew || task.TaskState != (int)TaskOutStatusEnum.OutNew))
{
return content.Error($"鎵樼洏{input.PalletCode}瀛樺湪浠诲姟");
}
@@ -737,6 +793,14 @@
ConsoleHelper.WriteErrorLine($"鑾峰彇鐢佃姱鐘舵�佸け璐�:{result.MOMMessage}");
if (result.SerialNos.Count <= 0)
{
+ var config = _configService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStacker, SysConfigConst.InboundIsEmpty);
+ var strings = config.ConfigValue.Split(',').ToList();
+ if (strings.Contains(input.Position))
+ {
+ // todo閫佽嚦NG鍙�
+ ConsoleHelper.WriteErrorLine($"褰撳墠浣嶇疆銆恵input.Position}銆戜笉鑳藉叆绌烘墭鐩�");
+ return content.Error($"褰撳墠浣嶇疆銆恵input.Position}銆戜笉鑳藉叆绌烘墭鐩�");
+ }
// 绌烘墭鐩樺叆搴撻�昏緫
var staion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == input.Position && x.stationType == 1 && x.remark == "IN");
if (staion != null)
@@ -759,8 +823,8 @@
if (strings.Contains(input.Position))
{
// todo閫佽嚦NG鍙�
- ConsoleHelper.WriteErrorLine($"褰撳墠浣嶇疆涓嶈兘鍏ョ┖鎵樼洏");
- return content.Error("褰撳墠浣嶇疆涓嶈兘鍏ョ┖鎵樼洏");
+ ConsoleHelper.WriteErrorLine($"褰撳墠浣嶇疆銆恵input.Position}銆戜笉鑳藉叆绌烘墭鐩�");
+ return content.Error($"褰撳墠浣嶇疆銆恵input.Position}銆戜笉鑳藉叆绌烘墭鐩�");
}
else
return await RequestTrayInTaskAsync(input);
@@ -2210,13 +2274,19 @@
{
WebResponseContent content = new WebResponseContent();
- // 鑾峰彇鐩爣鍦板潃
- //string ToAddress = await GetRoadWayAsync(process);
string ToAddress = string.Empty;
- if (flag < 2)
+ if (input.Position == "1039")
+ {
+ ToAddress = await GetGWRoadWayAsync(process);
+ }
+ else if (flag < 2)
+ {
ToAddress = await GetRoadWayAsync(process);
+ }
else
+ {
ToAddress = process[0];
+ }
if (string.IsNullOrEmpty(ToAddress))
{
return content.Error("鏃犳硶鑾峰彇鐩爣鍦板潃");
@@ -2249,10 +2319,6 @@
{
task.TaskId = taskId;
isResult = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(input.PalletCode, input.Position, ToAddress, TaskInStatusEnum.InNew.GetIntegralRuleTypeEnumDesc()));
-
- //var location = _locationRepository.QueryFirst(x => x.RoadwayNo == task.Roadway && x.LocationCode == task.TargetAddress);
- //location.LocationStatus = (int)LocationEnum.Lock;
- //var isLocation = _locationRepository.UpdateData(location);
if (isResult)
{
@@ -2356,6 +2422,40 @@
return minRoadwayNo;
}
+
+ private static readonly object _lock = new object();
+ private static int _currentIndex = -1; // 璁板綍涓婁竴娆″垎閰嶇殑宸烽亾绱㈠紩
+ public async Task<string> GetGWRoadWayAsync(List<string> process)
+ {
+ var deviceCode = await SqlSugarHelper.DbWCS.Queryable<Dt_DeviceInfo>()
+ .Where(x => x.DeviceStatus == 1.ToString() && process.Contains(x.DeviceCode))
+ .Select(x => x.DeviceCode).ToListAsync();
+
+ var availableRoadways = _locationRepository.QueryData(x => deviceCode.Contains(x.RoadwayNo) && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable)
+ .GroupBy(x => x.RoadwayNo)
+ .Select(g => new
+ {
+ RoadwayNo = g.Key,
+ Count = g.Count(),
+ TargetCount = BaseDal.QueryData(t => t.TargetAddress == g.Key).Count()
+ })
+ .Where(x => x.Count - x.TargetCount > 0 && x.TargetCount < 2)
+ .OrderByDescending(x => x.Count)
+ .ToList();
+
+ if (!availableRoadways.Any())
+ {
+ return null; // 鎴栨姏鍑哄紓甯�
+ }
+
+ // 杞鍒嗛厤
+ lock (_lock)
+ {
+ _currentIndex = (_currentIndex + 1) % availableRoadways.Count;
+ return availableRoadways[_currentIndex].RoadwayNo;
+ }
+ }
+
/// <summary>
/// 鏍规嵁鍖哄煙鑾峰彇宸烽亾鎴栫珯鍙�
/// </summary>
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/NGTask/OutNGTask.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/NGTask/OutNGTask.cs
new file mode 100644
index 0000000..1b84fb1
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/NGTask/OutNGTask.cs
@@ -0,0 +1,168 @@
+锘縰sing AutoMapper;
+using Masuit.Tools;
+using Newtonsoft.Json;
+using Quartz;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.Const;
+using WIDESEA_Core.Enums;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO.WMS;
+using WIDESEA_IServices;
+using WIDESEA_IStorageTaskRepository;
+using WIDESEA_IStorageTaskServices;
+using WIDESEA_Model.Models;
+using WIDESEA_StorageTaskRepository;
+using WIDESEAWCS_BasicInfoRepository;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEA_Tasks
+{
+ public class OutNGTask : IJob
+ {
+ private readonly IDt_TaskRepository _taskRepository;
+ private readonly IDt_StationManagerRepository _stationManagerRepository;
+ private readonly ISys_ConfigService _configService;
+ private readonly IDt_TaskService _taskService;
+ private readonly IDt_Task_HtyRepository _task_HtyRepository;
+ private readonly IMapper _mapper;
+ public OutNGTask(IDt_TaskRepository taskRepository, IDt_StationManagerRepository stationManagerRepository, ISys_ConfigService configService, IDt_TaskService taskService, IDt_Task_HtyRepository task_HtyRepository, IMapper mapper)
+ {
+ _taskRepository = taskRepository;
+ _stationManagerRepository = stationManagerRepository;
+ _configService = configService;
+ _taskService = taskService;
+ _task_HtyRepository = task_HtyRepository;
+ _mapper = mapper;
+ }
+
+ public Task Execute(IJobExecutionContext context)
+ {
+ try
+ {
+ var task = _taskRepository.QueryFirst(x => x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState == (int)TaskInStatusEnum.SC_InExecuting && x.ErrorMessage != null && (x.Roadway.Contains("GW") || x.Roadway.Contains("CW")));
+
+ if (task != null)
+ {
+ Dt_StationManager stationManager = null;
+ string position = null;
+ if (task.Roadway.Contains("CW"))
+ {
+ stationManager = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017" || x.stationPLC == "1024") && x.stationType == 10 && x.Roadway == task.Roadway);
+ position = task.Roadway switch
+ {
+ var s when s.StartsWith("CWSC") =>
+ int.TryParse(s.Substring(4), out var num)
+ ? num switch
+ {
+ >= 1 and <= 9 => "001-035-001",
+ >= 11 and <= 17 => "001-036-001"
+
+ }
+ : throw new Exception("鏈壘鍒拌宸烽亾淇℃伅"),
+ _ => throw new Exception("鏈壘鍒拌宸烽亾淇℃伅")
+ };
+ }
+ else
+ {
+ stationManager = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && (x.stationPLC == "1015" || x.stationPLC == "2025") && x.remark == task.Roadway);
+ position = "002-000-002";
+ }
+
+ var taskNew = CreateTask(task, stationManager, position);
+ WMSTaskDTO taskDTO = CreateTaskDTO(taskNew);
+
+ var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+ var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
+ var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveByWMSNGTask)?.ConfigValue;
+ if (wmsBase == null || ipAddress == null)
+ {
+ throw new InvalidOperationException("WMS IP 鏈厤缃�");
+ }
+ var wmsIpAddress = wmsBase + ipAddress;
+
+ var result = HttpHelper.PostAsync(wmsIpAddress, taskDTO.ToJsonString()).Result;
+ var content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+ if (content.Status)
+ {
+ var taskHtyNG = CreateHistoricalTask(task);
+ _task_HtyRepository.AddData(taskHtyNG);
+ _taskRepository.DeleteData(task);
+ _taskRepository.AddData(taskNew);
+ }
+ return Task.CompletedTask;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ ConsoleHelper.WriteWarningLine($"鎵ц NG 浠诲姟鍑哄簱鏃跺彂鐢熷紓甯�: {ex.Message}{ex.StackTrace}");
+ }
+ return Task.CompletedTask;
+ }
+ private Dt_Task CreateTask(Dt_Task task,Dt_StationManager stationManager,string position)
+ {
+ return new Dt_Task
+ {
+ Grade = 1,
+ Roadway = task.Roadway,
+ TargetAddress = stationManager.stationChildCode,
+ Dispatchertime = DateTime.Now,
+ MaterialNo = "",
+ NextAddress = position,
+ OrderNo = null,
+ PalletCode = task.PalletCode,
+ SourceAddress = task.TargetAddress,
+ CurrentAddress = task.TargetAddress,
+ TaskState = (int)TaskOutStatusEnum.OutNew,
+ TaskType = (int)TaskOutboundTypeEnum.OutNG,
+ TaskNum = _taskRepository.GetTaskNo().Result,
+ Creater = "System",
+ CreateDate = DateTime.Now,
+ TaskId = 0,
+ ProductionLine = task.ProductionLine,
+ ProcessCode = task.ProcessCode,
+ ErrorMessage = task.ErrorMessage,
+ };
+ }
+ private WMSTaskDTO CreateTaskDTO(Dt_Task task)
+ {
+ return new WMSTaskDTO
+ {
+ TaskNum = task.TaskNum.Value,
+ Grade = 1,
+ PalletCode = task.PalletCode,
+ RoadWay = task.Roadway,
+ SourceAddress = task.SourceAddress,
+ TargetAddress = task.TargetAddress,
+ NextAddress = task.NextAddress,
+ TaskState = task.TaskState.Value,
+ Id = 0,
+ TaskType = task.TaskType,
+ ProductionLine = task.ProductionLine,
+ };
+ }
+ private Dt_Task_Hty CreateHistoricalTask(Dt_Task task, bool isHand = false)
+ {
+ // 鏇存柊浠诲姟鐘舵��
+ task.TaskState = task.TaskType > 199 ? (int)TaskInStatusEnum.InFinish : (int)TaskOutStatusEnum.OutFinish;
+ task.CurrentAddress = task.NextAddress;
+
+ // 鍒涘缓鍘嗗彶浠诲姟
+ var taskHty = _mapper.Map<Dt_Task_Hty>(task);
+ taskHty.FinishTime = DateTime.Now;
+ taskHty.TaskId = 0;
+ taskHty.OperateType = (int)OperateTypeEnum.NG浠诲姟鍒犻櫎;
+ taskHty.SourceId = task.TaskId;
+ if (isHand)
+ {
+ taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
+ }
+ return taskHty;
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/QuartzJobMildd.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/QuartzJobMildd.cs
new file mode 100644
index 0000000..0dd21db
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/QuartzJobMildd.cs
@@ -0,0 +1,59 @@
+锘�
+using Microsoft.AspNetCore.Builder;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WIDESEA.QuartzJob;
+using WIDESEA_Core;
+using WIDESEA_Core.Helper;
+
+namespace WIDESEA_Tasks
+{
+ /// <summary>
+ /// Quartz 鍚姩鏈嶅姟
+ /// </summary>
+ public static class QuartzJobMiddleWare
+ {
+ public static void UseQuartzJobMildd(this IApplicationBuilder app)
+ {
+ if (app == null) throw new ArgumentNullException(nameof(app));
+ var schedulerCenter = app.ApplicationServices.GetService(typeof(ISchedulerCenter)) as ISchedulerCenter;
+ try
+ {
+ var allQzServices = new List<TasksQz>()
+ {
+ new TasksQz()
+ {
+ Id = 1,
+ AssemblyName = "WIDESEA_Tasks",
+ ClassName = "OutNGTask",
+ CreateTime = DateTime.Now,
+ IntervalSecond = Convert.ToInt32( AppSettings.app("IntervalSecond")),
+ IsDeleted = false,
+ IsStart = false,
+ JobGroup = "WIDESEA_Tasks",
+ Name = "OutNGTask",
+ TriggerType = 0
+ },
+ };
+ foreach (var item in allQzServices)
+ {
+ var ResuleModel = schedulerCenter.AddScheduleJobAsync(item).Result;
+ if (ResuleModel.Status)
+ {
+ ConsoleHelper.WriteSuccessLine($"{item.ClassName}鍚姩鎴愬姛");
+ }
+ else
+ {
+ Console.Out.WriteLine($"QuartzNetJob{item.Name}鍚姩澶辫触锛侀敊璇俊鎭細{ResuleModel.Message}");
+ }
+ }
+ schedulerCenter.StartScheduleAsync();
+ }
+ catch (Exception e)
+ {
+ throw;
+ }
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/WIDESEA_Tasks.csproj b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/WIDESEA_Tasks.csproj
index 132c02c..458a4dc 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/WIDESEA_Tasks.csproj
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/WIDESEA_Tasks.csproj
@@ -6,4 +6,12 @@
<Nullable>enable</Nullable>
</PropertyGroup>
+ <ItemGroup>
+ <PackageReference Include="Quartz" Version="3.18.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\WIDESEA_StorageTaskServices\WIDESEA_StorageTaskServices.csproj" />
+ </ItemGroup>
+
</Project>
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/obj/WIDESEA_Tasks.csproj.nuget.g.targets b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/obj/WIDESEA_Tasks.csproj.nuget.g.targets
index 3dc06ef..6d30475 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/obj/WIDESEA_Tasks.csproj.nuget.g.targets
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Tasks/obj/WIDESEA_Tasks.csproj.nuget.g.targets
@@ -1,2 +1,7 @@
锘�<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
\ No newline at end of file
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+ <Import Project="$(NuGetPackageRoot)system.text.json\8.0.0\buildTransitive\net6.0\System.Text.Json.targets" Condition="Exists('$(NuGetPackageRoot)system.text.json\8.0.0\buildTransitive\net6.0\System.Text.Json.targets')" />
+ <Import Project="$(NuGetPackageRoot)sqlitepclraw.lib.e_sqlite3\2.1.6\buildTransitive\net6.0\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('$(NuGetPackageRoot)sqlitepclraw.lib.e_sqlite3\2.1.6\buildTransitive\net6.0\SQLitePCLRaw.lib.e_sqlite3.targets')" />
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
index 769e109..d9b1457 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
@@ -284,4 +284,9 @@
{
return await Service.GetRoadWayAsync(process);
}
+ [HttpPost, AllowAnonymous, Route("GetGWRoadWayAsync")]
+ public async Task<string> GetGWRoadWayAsync(List<string> process)
+ {
+ return await Service.GetGWRoadWayAsync(process);
+ }
}
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
index 4bcf385..37283df 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -1,32 +1,35 @@
-using WIDESEA_Core.Helper;
-using WIDESEA_Core.Extensions;
-using WIDESEA_Core.Middlewares;
-using System.Reflection;
-using WIDESEA_Core.Filter;
+using Autofac;
+using Autofac.Core;
+using Autofac.Extensions.DependencyInjection;
+using Microsoft.AspNetCore.Mvc.Controllers;
+using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.OpenApi.Models;
+using NewLife.Windows;
+using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
-using Newtonsoft.Json;
-using System.Text;
-using Microsoft.AspNetCore.Mvc.Controllers;
-using Microsoft.Extensions.DependencyInjection.Extensions;
-using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
-using WIDESEA_Core;
-using WIDESEA_Core.BaseServices;
-using Autofac.Extensions.DependencyInjection;
-using Autofac;
-using WIDESEA_WMSServer.Filter;
-using WIDESEA_Core.Authorization;
-using WIDESEA_Core.Core;
-using Swashbuckle.AspNetCore.SwaggerGen;
-using Microsoft.OpenApi.Models;
-using WIDESEA_StorageTaskServices;
-using Autofac.Core;
-using WIDESEA_Cache;
+using Quartz.Spi;
using SimpleRedis;
-using WIDESEA_DTO.WMS;
-using static NewLife.Remoting.ApiHttpClient;
-using NewLife.Windows;
+using Swashbuckle.AspNetCore.SwaggerGen;
+using System.Reflection;
+using System.Text;
+using WIDESEA.QuartzJob;
+using WIDESEA_Cache;
+using WIDESEA_Core;
+using WIDESEA_Core.Authorization;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Core;
using WIDESEA_Core.Enums;
+using WIDESEA_Core.Extensions;
+using WIDESEA_Core.Filter;
+using WIDESEA_Core.Helper;
+using WIDESEA_Core.Middlewares;
+using WIDESEA_DTO.WMS;
+using WIDESEA_StorageTaskServices;
+using WIDESEA_Tasks;
+using WIDESEA_WMSServer.Filter;
+using static NewLife.Remoting.ApiHttpClient;
var builder = WebApplication.CreateBuilder(args);
@@ -119,6 +122,13 @@
builder.Services.AddHostedService<MyBackgroundService>();
+
+//builder.Services.AddSingleton<IJobFactory, JobFactory>();
+//builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
+
+//builder.Services.AddTransient<OutNGTask>();//Job使用瞬时依赖注入
+
+
//缓存设置配置转实体
builder.Services.AddConfigurableOptions<CacheSettingsOptions>();
//禁止在主机启动时通过 App.GetOptions<TOptions> 获取选项,如需获取配置选项理应通过 App.GetConfig<TOptions>("配置节点", true)。
@@ -154,6 +164,7 @@
WIDESEA_Core.Helper.ConsoleHelper.WriteSuccessLine("Redis 服务已成功注册");
}
}
+app.UseQuartzJobMildd();
// 3、配置中间件
app.UseMiniProfiler();//性能分析器
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer.csproj b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer.csproj
index 66cde40..fab0da3 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer.csproj
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer.csproj
@@ -41,5 +41,6 @@
<ProjectReference Include="..\WIDESEA_StorageOutOrderServices\WIDESEA_StorageOutOrderServices.csproj" />
<ProjectReference Include="..\WIDESEA_StorageTaskServices\WIDESEA_StorageTaskServices.csproj" />
<ProjectReference Include="..\WIDESEA_StoragIntegrationServices\WIDESEA_StoragIntegrationServices.csproj" />
+ <ProjectReference Include="..\WIDESEA_Tasks\WIDESEA_Tasks.csproj" />
</ItemGroup>
</Project>
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
index 11e32e0..5aaeac7 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -10,8 +10,8 @@
"MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
//杩炴帴瀛楃涓�
//"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
- "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB_BBMain;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.20.253;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+ "ConnectionStringWCS": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
//璺ㄥ煙
"Cors": {
"PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
@@ -34,6 +34,8 @@
"ClearRedis": true
}
},
+ //Job鎵ц闂撮殧鏃堕棿锛屽崟浣嶄负绉�
+ "IntervalSecond": 10,
// 鍏佽鍑哄簱鐨勭紪鐮�
"OutBoundMateriel": [
//{
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs
index cb2caeb..8feb85a 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs
@@ -43,6 +43,7 @@
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEA_StorageTaskServices")]
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEA_StoragIntegrationRepository")]
[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEA_StoragIntegrationServices")]
+[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("WIDESEA_Tasks")]
// 鐢� MSBuild WriteCodeFragment 绫荤敓鎴愩��
--
Gitblit v1.9.3