From 0e24030858b439e0c437a017fdaabecd75af0e92 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 10 一月 2025 11:05:09 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/GroundStationJob_CSJ.cs | 33 ++++++++++++++++++++++++++-------
1 files changed, 26 insertions(+), 7 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
index 80a52fe..adaece9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
@@ -61,7 +61,7 @@
if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.NextAddress));
+ Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress));
if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish)
{
string oldAddress = task.NextAddress;
@@ -74,13 +74,28 @@
}
if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.TargetAddress == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.NextAddress));
- if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish)
+ Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt()) && (x.SourceAddress == item.StationCode || x.CurrentAddress == item.AGVStationCode || x.CurrentAddress == item.StationCode));
+ if (task != null)
{
string oldAddress = task.NextAddress;
int oldStatus = task.TaskState;
+ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);
+ if (stationManger == null)
+ {
+ WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+ continue;
+ }
+ string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode);
+ if (string.IsNullOrEmpty(locationCode))
+ {
+ WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+ continue;
+ }
task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
- task.NextAddress = item.StationCode;
+ task.CurrentAddress = stationManger.StackerCraneStationCode;
+ task.TargetAddress = locationCode;
+ task.NextAddress = locationCode;
+ task.DeviceCode = stationManger.StackerCraneCode;
_taskRepository.UpdateData(task);
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}");
}
@@ -103,23 +118,27 @@
if (stationManger == null)
{
WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
- break;
+ continue;
}
string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode);
if (string.IsNullOrEmpty(locationCode))
{
WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
- break;
+ continue;
}
+ string oldAddress = task.NextAddress;
+ int oldStatus = task.TaskState;
task.CurrentAddress = stationManger.StackerCraneStationCode;
task.TargetAddress = locationCode;
task.NextAddress = locationCode;
task.DeviceCode = stationManger.StackerCraneCode;
task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
_taskRepository.UpdateData(task);
+
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}");
}
}
- catch(Exception ex)
+ catch (Exception ex)
{
}
--
Gitblit v1.9.3