From 96e6dc957aee5d20218ac8127a28db6a7e6ba6de Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 10 一月 2025 10:00:52 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/GroundStationJob_CSJ.cs |   36 ++++++++----------------------------
 1 files changed, 8 insertions(+), 28 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 adaece9..d2ae90d 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"
@@ -43,7 +43,7 @@
             {
                 if (device == null)
                 {
-                    WriteInfo(nameof(GroundStationJob_CSJ), "璋冨害閿欒,璁惧瀵硅薄浼犲�间负null");
+                    WriteError(nameof(GroundStationJob_CSJ), "璋冨害閿欒,璁惧瀵硅薄浼犲�间负null");
                     return Task.CompletedTask;
                 }
                 List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
@@ -64,12 +64,7 @@
                             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;
-                                int oldStatus = task.TaskState;
-                                task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
-                                task.NextAddress = item.StationCode;
-                                _taskRepository.UpdateData(task);
-                                _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}");
+                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode);
                             }
                         }
                         if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
@@ -82,22 +77,16 @@
                                 Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);
                                 if (stationManger == null)
                                 {
-                                    WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+                                    WriteError(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}");
+                                    WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
                                     continue;
                                 }
-                                task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
-                                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}");
+                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode);
                             }
                         }
                     }
@@ -117,25 +106,16 @@
                             Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);
                             if (stationManger == null)
                             {
-                                WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+                                WriteError(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}");
+                                WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
                                 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}");
+                            _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode);
                         }
                     }
                     catch (Exception ex)

--
Gitblit v1.9.3