From 981a80940e47409300c09847684ca530f75b4a5f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 10 一月 2025 23:56:33 +0800
Subject: [PATCH] 优化WCS辅料出库逻辑
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/CommonHoisterJob.cs | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs"
index 62c0a55..d94d4dd 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs"
@@ -48,7 +48,7 @@
List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == hoister.DeviceCode);
if (stationMangers == null || stationMangers.Count == 0)
{
- WriteInfo(hoister.DeviceName, "鏈壘鍒板搴旂珯鍙颁俊鎭�");
+ WriteError(hoister.DeviceName, "鏈壘鍒板搴旂珯鍙颁俊鎭�");
return Task.CompletedTask;
}
@@ -68,7 +68,7 @@
if (task != null)
{
bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, true, deviceChildCode);
- WriteInfo(hoister.DeviceName, $"璇锋眰鍏ュ簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ WriteError(hoister.DeviceName, $"璇锋眰鍏ュ簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
}
}
else if (!leisure && tray && requestIn && inbounding && !requestOut && !outbounding)
@@ -76,19 +76,19 @@
Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && x.SourceAddress == deviceChildCode && _taskService.TaskInboundTypes.Contains(x.TaskType));
if (task != null)
{
- Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationDeviceCode == deviceChildCode);
+ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == deviceChildCode);
if (stationManger == null)
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
break;
}
string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode);
if (string.IsNullOrEmpty(locationCode))
{
- WriteInfo(hoister.DeviceName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ WriteError(hoister.DeviceName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
break;
}
-
+ task.CurrentAddress = stationManger.StackerCraneStationCode;
task.TargetAddress = locationCode;
task.NextAddress = locationCode;
task.DeviceCode = stationManger.StackerCraneCode;
@@ -99,7 +99,7 @@
}
else
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴斾换鍔′俊鎭�,{deviceChildCode}");
}
}
else if (leisure && !tray && !requestIn && !inbounding && !requestOut && !outbounding)
@@ -108,7 +108,7 @@
if (task != null)
{
bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, true, deviceChildCode);
- WriteInfo(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ WriteError(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
}
}
else if (!leisure && !tray && !requestIn && !inbounding && requestOut && outbounding)
@@ -116,24 +116,24 @@
Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && _taskService.TaskOutboundTypes.Contains(x.TaskType));
if (task != null)
{
- Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationDeviceCode == deviceChildCode);
+ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == deviceChildCode);
if (stationManger == null)
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
break;
}
task.TargetAddress = deviceChildCode;
- task.NextAddress = deviceChildCode;
+ task.NextAddress = stationManger.StackerCraneStationCode; ;
task.DeviceCode = stationManger.StackerCraneCode;
task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
_taskRepository.UpdateData(task);
- bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, false, deviceChildCode);
+ bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, false, deviceChildCode);
}
else
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
}
}
}
--
Gitblit v1.9.3