From 3571d8b2231e06e46774af86be502014d6974e1d Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 07 四月 2026 16:16:53 +0800
Subject: [PATCH] 优化ERP接收单据逻辑,一期领料变更逻辑修改

---
 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPC.cs |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPC.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPC.cs"
index 2c5a958..049f254 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPC.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPC.cs"
@@ -65,6 +65,7 @@
             try
             {
                 bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
+                bool isUpdate = false;
                 if (flag && value != null)
                 {
                     OtherDevice device = (OtherDevice)value;
@@ -96,18 +97,25 @@
                                     Thread.Sleep(1000);
                                 }
                             }
-                            if (conveyorLineInfoRead != null && conveyorLineInfoRead.StatusPV == 2 && conveyorLineInfoRead.Command == 10)
+                            if (conveyorLineInfoRead != null && conveyorLineInfoRead.StatusPV == 2 && conveyorLineInfoRead.Command == 10 && item.IsOccupied == 1)
                             {
                                 item.IsOccupied = 0;
+                                isUpdate = true;
+                                WriteInfo("鐮佸灈宸ヤ綅鐘舵�佹洿鏂�",$"{item.StationCode}{DateTime.Now}鏇存柊宸ヤ綅鐘舵��:{conveyorLineInfoRead.Command}");
                             }
-                            else
+                            else if ((conveyorLineInfoRead == null ||(conveyorLineInfoRead != null && conveyorLineInfoRead.Command != 10 && item.IsOccupied == 0)))
                             {
                                 item.IsOccupied = 1;
+                                isUpdate = true;
+                                WriteInfo("鐮佸灈宸ヤ綅鐘舵�佹洿鏂�", $"{item.StationCode}{DateTime.Now}鏇存柊宸ヤ綅鐘舵�佷笉鍙敤");
                             }
                         }
 
                     }
-                    _stationMangerRepository.UpdateData(stationMangers);
+                    if (isUpdate)
+                    {
+                        _stationMangerRepository.UpdateData(stationMangers);
+                    }
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3