From 208a9afadac81484fa150c0a236618facab93c52 Mon Sep 17 00:00:00 2001 From: duyongjia <adu_555@163.com> Date: 星期一, 02 十二月 2024 11:17:39 +0800 Subject: [PATCH] 最新修改上传 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 63 +++++++++++++++++--- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/DoubleStackerCraneJob.cs | 90 ++++++++++++++++++------------ 代码管理/WCS/WIDESEAWCS_Client/src/api/http.js | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs | 4 代码管理/WCS/WIDESEAWCS_Client/src/assets/imgs/wcs_x.png | 0 代码管理/WCS/WIDESEAWCS_Client/src/views/Index.vue | 2 代码管理/WCS/WIDESEAWCS_Client/src/views/Login.vue | 2 7 files changed, 111 insertions(+), 52 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/api/http.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/api/http.js" index 901521e..48c649a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/api/http.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/api/http.js" @@ -12,7 +12,7 @@ let loadingInstance; let loadingStatus = false; if (process.env.NODE_ENV == 'development') { - axios.defaults.baseURL = 'http://10.0.250.15:9291/'; + axios.defaults.baseURL = 'http://127.0.0.1:9291/'; } else if (process.env.NODE_ENV == 'debug') { axios.defaults.baseURL = 'http://10.0.250.15:9291/'; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/assets/imgs/wcs_x.png" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/assets/imgs/wcs_x.png" new file mode 100644 index 0000000..df6e40c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/assets/imgs/wcs_x.png" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Index.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Index.vue" index e59ef4f..fa2bff7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Index.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Index.vue" @@ -120,7 +120,7 @@ import VolMenu from "@/components/basic/VolElementMenu.vue"; import Message from "./index/Message.vue"; import MessageConfig from "./index/MessageConfig.js"; -var imgUrl = require("@/assets/imgs/wms_x.png"); +var imgUrl = require("@/assets/imgs/wcs_x.png"); var $this; var $interval; var $indexDate; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Login.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Login.vue" index c61c0e8..c79f997 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Login.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/Login.vue" @@ -1,6 +1,6 @@ <template> <div class="login-container"> - <div class="project-name">WIDESEA_WMS</div> + <div class="project-name">WCS</div> <div class="login-form"> <div class="form-user" @keypress="loginPress"> <div class="login-text"> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" index a61f151..05589ac 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" @@ -66,7 +66,7 @@ /// </summary> /// <param name="key"></param> /// <returns></returns> - [Route("CancelTask")] + [HttpPost,Route("CancelTask")] public WebResponseContent CancelTask(int taskNum) { return Service.CancelTask(taskNum); @@ -78,7 +78,7 @@ /// </summary> /// <param name="taskNum"></param> /// <returns></returns> - [HttpPost, HttpGet, Route("ForceCompleteTask")] + [HttpPost, Route("ForceCompleteTask")] public WebResponseContent ForceCompleteTask (int taskNum) { return Service.ForceCompleteTask(taskNum); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" index 427ab45..0b7f0c0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" @@ -8,7 +8,9 @@ using System.Linq; using System.Reflection.Metadata; using System.Text; +using System.Threading; using System.Threading.Tasks; +using WIDESEAWCS_Common.LocationEnum; using WIDESEAWCS_Common.ServiceLog; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Communicator; @@ -51,18 +53,19 @@ public Task Execute(IJobExecutionContext context) { - WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "寮�濮嬫椂闂�" + DateTime.Now); - WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", $"澶у爢鍨涙満浠诲姟鎵ц涓�..."); - //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); - CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane; + //WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "寮�濮嬫椂闂�" + DateTime.Now); + Console.WriteLine("褰撳墠绾跨▼鏁�"+ThreadPool.ThreadCount); + //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane; try { if (commonStackerCrane != null) { - if (!commonStackerCrane.IsEventSubscribed) - { - commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 - } + WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", $"澶у爢鍨涙満浠诲姟鎵ц涓�..."); + //if (!commonStackerCrane.IsEventSubscribed) + //{ + // commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 + //} if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) { @@ -73,6 +76,7 @@ Dt_Task? task = GetTask(commonStackerCrane); if (task != null) { + WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", $"澶у爢鍨涙満浠诲姟鍙穥task.TaskNum}"); StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); if (stackerCraneTaskCommand != null) @@ -95,8 +99,12 @@ //绌鸿溅鍑哄簱鍛戒护鍙戦�佹垚鍔熷悗锛屽洖浼� status=1锛� if (task.TaskType == (int)TaskOutboundTypeEnum.OutPick) { + Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); + srcLocation.LocationStatus = (int)LocationStatusEnum.Free; + _locationInfoRepository.UpdateData(srcLocation); MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 1 }; MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); + WriteDebug(nameof(CommonStackerCraneJob), $"鍫嗗灈鏈哄洖浼燬tatus:1,鐢ㄤ簬鐢熸垚鍑哄簱浠诲姟,浠诲姟鍙穥task.TaskNum}"); } } else @@ -109,6 +117,10 @@ } } } + else + { + WriteDebug(nameof(DoubleStackerCraneJob), "鏈煡璇㈠埌褰撳墠鍙互鎵ц涓婃枡浠诲姟鐨勫ぇ鍫嗗灈鏈猴紒"); + } } catch (Exception ex) { @@ -116,14 +128,37 @@ } - //鏌ヨ鎻愬崌鏈�/缁勭珛鏈轰俊鍙� + //Task.Run(delegate //{ try { if (commonStackerCrane != null) { + //璇诲彇澶у爢鍨涙満浠诲姟鍙峰拰浠诲姟瀹屾垚纭鐘舵�侊紙鍥犱负灏佽鐨勪簨浠剁粡甯镐笉瑙﹀彂锛屾墍浠ュ姞涓洿鎺ヨ鐨勯�昏緫锛屼互鍏嶅嚭鐜板爢鍨涙満涓�鐩存帴澶勪簬绛夊緟wcs纭锛� + byte IsOver = commonStackerCrane.Communicator.Read<byte>("DB106.22"); + int tasknum = commonStackerCrane.Communicator.Read<int>("DB106.18"); + //WriteDebug(nameof(CommonStackerCraneJob), $"璇诲彇澶у爢鍨涙満SC01浠诲姟瀹屾垚淇″彿鍊�:{IsOver} 浠诲姟鍙凤細{tasknum}"); + if (IsOver == 6) + { + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + _taskService.StackCraneTaskCompleted(tasknum); + Console.Out.WriteLine("TaskCompleted" + tasknum); + bool issuccess = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + if (issuccess) + { + WriteDebug(nameof(CommonStackerCraneJob), $"澶у爢鍨涙満SC01浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5鎴愬姛{tasknum}"); + } + else + { + WriteDebug(nameof(CommonStackerCraneJob), $"澶у爢鍨涙満SC01浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5澶辫触{tasknum}"); + } + } + } + + //鎻愬崌鏈轰氦浜� Dt_Task? task1001 = _taskService.QueryStackerCraneTaskByAGVRequest("SC01"); if (task1001 != null) { @@ -293,13 +328,15 @@ } + + } } catch (Exception ex) { WriteError(nameof(CommonStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex); } - WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now); + // WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now); //}); return Task.CompletedTask; } @@ -318,7 +355,11 @@ { Console.Out.WriteLine("TaskCompleted" + e.TaskNum); _taskService.StackCraneTaskCompleted(e.TaskNum); - commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + bool issuccess=commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + if (issuccess) + { + WriteDebug(nameof(CommonStackerCraneJob), $"浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5鎴愬姛{e.TaskNum}"); + } } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/DoubleStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/DoubleStackerCraneJob.cs" index b5d847a..a1cedbf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/DoubleStackerCraneJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/DoubleStackerCraneJob.cs" @@ -52,10 +52,9 @@ public Task Execute(IJobExecutionContext context) { - WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", "寮�濮嬫椂闂�" + DateTime.Now); + //WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", "寮�濮嬫椂闂�" + DateTime.Now); CommonStackerCrane? stackerCraneOne = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC02") as CommonStackerCrane; CommonStackerCrane? stackerCraneTwo = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC03") as CommonStackerCrane; - WriteDebug(nameof(DoubleStackerCraneJob), $"灏忓爢鍨涙満浠诲姟鎵ц涓�..."); try { @@ -63,11 +62,11 @@ Dt_Task? task = GetTask(); if (task != null) - { - WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", $"灏忓爢鍨涙満浠诲姟鍙穥task.TaskNum}"); + { CommonStackerCrane? StackerCrane = GetStrackerCrane(task, stackerCraneOne, stackerCraneTwo); if (StackerCrane != null) { + WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", $"灏忓爢鍨涙満浠诲姟鍙穥task.TaskNum}"); StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); if (stackerCraneTaskCommand != null) { @@ -96,55 +95,74 @@ } catch (Exception ex) { - WriteError(nameof(CommonStackerCraneJob), "灏忓爢鍨涙満鎵ц浠诲姟寮傚父锛�", ex); + WriteError(nameof(DoubleStackerCraneJob), "灏忓爢鍨涙満鎵ц浠诲姟寮傚父锛�", ex); } //璇诲彇鍫嗗灈鏈轰换鍔″彿鍜屼换鍔″畬鎴愮‘璁ょ姸鎬� //Task.Run(delegate //{ - - try + + try + { + if (stackerCraneOne != null)//SC02 { - if (stackerCraneOne != null) - { - byte IsFinish = stackerCraneOne.Communicator.Read<byte>("DB106.22"); - int tasknum = stackerCraneOne.Communicator.Read<int>("DB106.18"); - if (IsFinish == 6) - { - if (stackerCraneOne.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) - { - //鏆傛椂 鍏堝啓5:瀹屾垚纭 淇″彿 - _taskService.StackCraneTaskCompleted(tasknum); - stackerCraneOne.SetValue(StackerCraneDBName.WorkType, 5); - - } - } - } - - if (stackerCraneTwo != null) + byte IsOver = stackerCraneOne.Communicator.Read<byte>("DB106.22"); + int tasknum = stackerCraneOne.Communicator.Read<int>("DB106.18"); + // WriteDebug(nameof(DoubleStackerCraneJob), $"璇诲彇灏忓爢鍨涙満SC02浠诲姟瀹屾垚淇″彿鍊�:{IsOver}浠诲姟鍙凤細{tasknum}"); + if (IsOver == 6) { - //璇诲彇鍫嗗灈鏈轰换鍔″彿鍜屼换鍔″畬鎴愮‘璁ょ姸鎬� - byte IsFinish = stackerCraneTwo.Communicator.Read<byte>("DB106.22"); - int tasknum = stackerCraneTwo.Communicator.Read<int>("DB106.18"); - if (IsFinish == 6) + if (stackerCraneOne.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) { - if (stackerCraneTwo.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + _taskService.StackCraneTaskCompleted(tasknum); + Console.Out.WriteLine("TaskCompleted" + tasknum); + bool issuccess = stackerCraneOne.SetValue(StackerCraneDBName.WorkType, 5); + if (issuccess) { - _taskService.StackCraneTaskCompleted(tasknum); - stackerCraneTwo.SetValue(StackerCraneDBName.WorkType, 5); + WriteDebug(nameof(DoubleStackerCraneJob), $"灏忓爢鍨涙満SC02浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5鎴愬姛{tasknum}"); + } + else + { + WriteDebug(nameof(DoubleStackerCraneJob), $"灏忓爢鍨涙満SC02浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5澶辫触{tasknum}"); + } + + } + } + } + + if (stackerCraneTwo != null)//SC03 + { + //璇诲彇鍫嗗灈鏈轰换鍔″彿鍜屼换鍔″畬鎴愮‘璁ょ姸鎬� + byte IsOver = stackerCraneTwo.Communicator.Read<byte>("DB106.22"); + int tasknum = stackerCraneTwo.Communicator.Read<int>("DB106.18"); + // WriteDebug(nameof(DoubleStackerCraneJob), $"璇诲彇灏忓爢鍨涙満SC03浠诲姟瀹屾垚淇″彿鍊�:{IsOver}浠诲姟鍙凤細{tasknum}"); + if (IsOver == 6) + { + if (stackerCraneTwo.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + _taskService.StackCraneTaskCompleted(tasknum); + Console.Out.WriteLine("TaskCompleted" + tasknum); + bool issuccess = stackerCraneTwo.SetValue(StackerCraneDBName.WorkType, 5); + if (issuccess) + { + WriteDebug(nameof(DoubleStackerCraneJob), $"灏忓爢鍨涙満SC03浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5鎴愬姛{tasknum}"); + } + else + { + WriteDebug(nameof(DoubleStackerCraneJob), $"灏忓爢鍨涙満SC03浠诲姟鍙峰啓鍏ヤ换鍔″畬鎴愮‘璁ゅ��5澶辫触{tasknum}"); } } } } - catch (Exception ex) - { - WriteError(nameof(DoubleStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex); - } + } + catch (Exception ex) + { + WriteError(nameof(DoubleStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex); + } //}); - WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now); + //WriteDebug("灏忓爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now); return Task.CompletedTask; } -- Gitblit v1.9.3