From 516e36a4748cc5863bc1f0e00fef32062dcf7cde Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期四, 26 十二月 2024 21:56:24 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 43 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 38 insertions(+), 5 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index ed090e0..35f3322 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -87,7 +87,23 @@
}
+ public WebResponseContent TaskCompleted(int taskNum)
+ {
+ try
+ {
+ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+ if (task != null)
+ {
+ }
+
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
/// <summary>
/// 鎺ユ敹WMS浠诲姟淇℃伅
@@ -112,23 +128,40 @@
task.Creater = "WMS";
task.TaskState = (int)TaskStatusEnum.New;
task.CurrentAddress = item.SourceAddress;
- task.NextAddress = item.TargetAddress;
List<Dt_WarehouseDevice> wades = warehouseDevices.Where(x => x.WarehouseId == item.WarehouseId).ToList();
+
+ Dt_Router? router = new Dt_Router();
if (string.IsNullOrEmpty(item.AGVArea))
{
Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StackerCraneCode == item.RoadWay);
-
- //stationManger.AGVStationCode
- //stationManger.StackerCraneCode
- //stationManger.StationDeviceCode
+ if (stationManger == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
+ }
List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (stationManger.StationDeviceCode == x.StartPosi || stationManger.StackerCraneCode == x.StartPosi));
+ if (routers.FirstOrDefault() == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ }
+ router = routers.FirstOrDefault();
+ if (routers.Count == 1)
+ {
+ task.NextAddress = router?.NextPosi ?? "";
+ }
}
else
{
List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
+ if (routers.FirstOrDefault() == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ }
+ router = routers.FirstOrDefault();
+
+ task.NextAddress = router?.NextPosi ?? "";
}
tasks.Add(task);
--
Gitblit v1.9.3