From d41acebbd89f171b0eeb205fca4f68043ca85f95 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期三, 03 十二月 2025 19:47:24 +0800
Subject: [PATCH] 选配与暂存
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 82 ++++++++++++++++++++++++----------------
1 files changed, 49 insertions(+), 33 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index c1e3af2..d6fa948 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -24,6 +24,7 @@
using Newtonsoft.Json;
using Quartz;
using SqlSugar;
+using System.Net;
using System.Reflection;
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoRepository;
@@ -43,6 +44,7 @@
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
using WIDESEAWCS_Tasks.ConveyorLineJob;
+using WIDESEAWCS_Tasks.StackerCraneJob;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_Tasks
@@ -295,9 +297,15 @@
conveyorLine.SetValue(ConveyorLineDBName.WheelsDiameter, task.wheels_gkcc, stationInfo.stationChildCode);
conveyorLine.SetValue(ConveyorLineDBName.WheelsLX, task.WheelsLX, stationInfo.stationChildCode);
- conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
-
- _taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode);
+ Dt_Task dt_Task = _taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode);
+ if (dt_Task != null)
+ {
+ conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
+ }
+ else
+ {
+ conveyorLine.SetValue(ConveyorLineDBName.ResponState, 3, stationInfo.stationChildCode);
+ }
}
}
@@ -341,44 +349,52 @@
var task = _taskService.QueryExecutingTaskByBarcode(command.Number, stationInfo.stationChildCode);
if (task != null)
{
- //鏍规嵁杞﹁酱缂撳瓨浣嶇疆 鍐欏叆瀵瑰簲鐩爣鍦板潃
- if (task.TargetAddress == stationInfo.stationChildCode)
+ if (task.TargetAddress == "2032" || task.TargetAddress == "2042")
{
- //WebResponseContent content = _taskService.RequestWheelsFlow(task.task_CZInfo).Result;
- WebResponseContent content = _taskService.RequestWheelsFlow(task.PalletCode).Result;
- if (content.Status)
- {
- string taraddress = content.Data.ToString(); // "2032";SourceAddress
- bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
-
- bool k2= conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddress, stationInfo.stationChildCode);
- bool k3= conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
- WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
+ bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
- Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屽弽棣堣嚦杈撻�佺嚎淇℃伅====璧峰鍦板潃锛歿k1},鐩爣鍦板潃鈥渰k2},鍙嶉淇″彿锛歿k3},浠诲姟淇敼鐘舵�侊細{k4.Status}锛�)");
- }
- else
- {
- conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode);
-
- Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屽悜WMS鐢宠鍘诲悜澶辫触锛屽師鍥狅細{content.Message},鍐欏叆鐢宠瘔淇℃晠闅滐細2");
- }
- }
- else
- {
- bool k1= conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode);
bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
- Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屽弽棣堣嚦杈撻�佺嚎淇℃伅====璧峰鍦板潃锛歿k1},鐩爣鍦板潃鈥渰k2},鍙嶉淇″彿锛歿k3},浠诲姟淇敼鐘舵�侊細{k4.Status}锛�)");
+ Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屽弽棣堣嚦杈撻�佺嚎淇℃伅====璧峰鍦板潃锛歿k1},鐩爣鍦板潃鈥渰k2},鍙嶉淇″彿锛歿k3},浠诲姟淇敼鐘舵�侊細{k4.Status},,鍐欏叆鍘诲悜锛歿task.TargetAddress}锛�)");
+
}
+ else
+ {
+ if (task.Towhereabouts == "2032" || task.Towhereabouts == "2042")
+ {
+ bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
+
+ bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.Towhereabouts, stationInfo.stationChildCode);
+ bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
+ WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task);
+
+ Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屽弽棣堣嚦杈撻�佺嚎淇℃伅====璧峰鍦板潃锛歿k1},鐩爣鍦板潃鈥渰k2},鍙嶉淇″彿锛歿k3},浠诲姟淇敼鐘舵�侊細{k4.Status},,鍐欏叆鍘诲悜锛歿task.Towhereabouts}锛�)");
+ }
+ }
+
}
else
{
- conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode);
- Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屾湭鎵惧埌浠诲姟锛岀敵璇蜂笅涓�鍦板潃涓猴細{stationInfo.stationChildCode},鍐欏叆鐢宠瘔淇℃晠闅滐細2");
+
+ string taraddresspos = _taskService.RequestWheletHty(command.Number);
+ if (taraddresspos != null)
+ {
+
+ bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode);
+
+ bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddresspos, stationInfo.stationChildCode);
+ bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
+
+ Console.Out.WriteLine($"鍘嗗彶鏌ヨ淇℃伅锛�,鐢宠鏉$爜锛歿command.Number}锛屽弽棣堣嚦杈撻�佺嚎淇℃伅====璧峰鍦板潃锛歿k1},鐩爣鍦板潃鈥渰k2},鍙嶉淇″彿锛歿k3},鍐欏叆鐩爣鍦板潃涓猴細{taraddresspos})");
+ }
+ else
+ {
+ conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode);
+ Console.Out.WriteLine($"璇诲彇鍒拌緭閫佺嚎鐢宠,鐢宠鏉$爜锛歿command.Number}锛屾湭鎵惧埌浠诲姟锛岀敵璇蜂笅涓�鍦板潃涓猴細{stationInfo.stationChildCode},鍐欏叆鐢宠瘔淇℃晠闅滐細2");
+ }
}
}
@@ -396,7 +412,7 @@
if (content.Status)
{
conveyorLine.SetValue(ConveyorLineDBName.Number, content.Data.ToString(), stationInfo.stationChildCode);
- conveyorLine.SetValue(ConveyorLineDBName.CarType,"001", stationInfo.stationChildCode);
+ conveyorLine.SetValue(ConveyorLineDBName.CarType, "001", stationInfo.stationChildCode);
conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode);
}
else
@@ -440,10 +456,10 @@
{
DeviceProDTO? deviceProDTOt = conveyorLine.DeviceProDTOs.Find(x => x.DeviceChildCode == "3022" && x.DeviceProParamName == "Number");
string Number = conveyorLine.Communicator.Read<string>(deviceProDTOt.DeviceProAddress);
- if (Number != "" && Number!=null)
+ if (Number != "" && Number != null)
{
//璋冨彇wms鎺ュ彛鐢宠agv浠诲姟
- WebResponseContent content = _taskService.GetAGVTaskdistribution(stationInfo.stationLocation);
+ WebResponseContent content = _taskService.GetAGVTaskdistribution(stationInfo.stationLocation, Number);
}
}
--
Gitblit v1.9.3