From 733e63cb362f17aea4a1020654fa348a0d0c1f06 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 24 二月 2025 00:08:59 +0800
Subject: [PATCH] 优化入库逻辑,优化直接出库逻辑,优化移库任务逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
index b05ad95..eb9f455 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
@@ -54,11 +54,13 @@
                 ShuttleCar shuttleCar = (ShuttleCar)context.JobDetail.JobDataMap.Get("JobParams");
                 if (shuttleCar != null)
                 {
+                    shuttleCar.Communicator.IsReadAfterWrite = false;
                     ShuttleCarTaskCommandR command = ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar, shuttleCar.DeviceCode);//璇诲彇绌挎杞︿俊鎭�
                     if (command != null && command.JoinStatus == 1)
                     {
                         #region 绌挎杞︿换鍔″畬鎴�
-                        if (command.TaskTypeComplete > (short)ShuttleCarTaskComplete.Standby)
+                        var complete = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.TaskComplete);
+                        if (complete && command.TaskTypeComplete > (short)ShuttleCarTaskComplete.Standby && command.Status == command.TaskTypeComplete)
                         {
                             var Status = _taskService.ShuttleCarTaskCompleted(command.number, command.TaskTypeComplete).Status;
                             shuttleCar.SetValue(ShuttleCarDBName.ConfirmComplete, Status, shuttleCar.DeviceCode);
@@ -66,11 +68,11 @@
                         #endregion
 
                         #region 鍒涘缓绉昏溅鍏呯數浠诲姟
-                        if (command.Err_Status == (short)ShuttleCarErr.LowBattery || command.ElectricQuantity == (short)ShuttleCarErr.LowBattery)
+                        if (command.Err_Status == (short)ShuttleCarErr.LowBattery || command.ElectricQuantity <= (short)ShuttleCarErr.LowBattery)
                         {
                             //鐢熸垚鍫嗗灈鏈虹Щ杞︿换鍔�&绌挎杞﹀厖鐢典换鍔�
-                            var ShuttleCar = QueryCode(shuttleCar.DeviceCode);//鍏呯數缁堢偣寰呯‘璁わ紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
-                            _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "", ShuttleCar.ShuttleCarCode, ShuttleCarTaskType.Charging.ToString());
+                            var ShuttleCar = QueryCode(shuttleCar.DeviceCode);
+                            _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "002-002-001", ShuttleCar.ShuttleCarCode, ShuttleCarTaskType.Charging.ToString());
                         }
                         #endregion
 
@@ -78,8 +80,8 @@
                         GetSC_CarFinish();
                         #endregion
 
-                        #region 鑾峰彇绉昏溅浠诲姟
-                        Get_CarTask(shuttleCar,command);
+                        #region 鑾峰彇绉昏溅/鍑哄叆搴撲换鍔�
+                        Get_CarTask(shuttleCar, command);
                         #endregion
 
                     }

--
Gitblit v1.9.3