From 695571c6009ecbc12e7d4a4fb147df7967a1260e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 20:21:19 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/CommonHoisterJob.cs | 58 +++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 39 insertions(+), 19 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..b9049d6 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"
@@ -4,6 +4,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
@@ -48,7 +49,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 +69,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,64 +77,83 @@
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;
task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
- _taskRepository.UpdateData(task);
-
bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, false, deviceChildCode);
+ if (isWrite)
+ {
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, currentAddress: task.CurrentAddress, nextAddress: task.NextAddress);
+ }
}
else
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴斾换鍔′俊鎭�,{deviceChildCode}");
}
}
else if (leisure && !tray && !requestIn && !inbounding && !requestOut && !outbounding)
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && _taskService.TaskOutboundTypes.Contains(x.TaskType));
+ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == deviceChildCode);
+ if (stationManger == null)
+ {
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode}");
+ break;
+ }
+ if (stationManger.StationType != StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
+ {
+ continue;
+ }
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskType != TaskTypeEnum.MesOutbound.ObjToInt() && x.Roadway== stationManger.StackerCraneCode);
if (task != null)
{
+ task.TaskState=TaskStatusEnum.HT_Executing.ObjToInt();
bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, true, deviceChildCode);
- WriteInfo(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
+ if (isWrite)
+ {
+ _taskService.UpdateTask(task, TaskStatusEnum.HT_Executing);
+ }
+ WriteError(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}");
}
}
else if (!leisure && !tray && !requestIn && !inbounding && requestOut && outbounding)
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && _taskService.TaskOutboundTypes.Contains(x.TaskType));
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.HT_Executing.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);
+ if (isWrite)
+ {
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, nextAddress: task.NextAddress);
+ }
}
else
{
- WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
+ WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}");
}
}
}
--
Gitblit v1.9.3