From f3493a6f6f9958cea100ad596fa84239a6e2e962 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 18 六月 2024 16:58:53 +0800
Subject: [PATCH] 获取老PCS下VK、桁架机械手、机床、状态信息

---
 代码管理/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs"
index dfc9c30..65dd109 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs"
@@ -42,6 +42,8 @@
                 if (station2 == null) return content.Error("璇疯緭鍏ユ纭殑璧风偣鍦板潃锛�");
                 if (!station1.tray_type.Contains("Small") && station2.area != "4")
                     throw new Exception($"澶ф墭鐩樺彧鑳藉瓨鏀惧湪搴撳尯4锛�");
+                if (station1.tray_type.Contains("Small") && station2.area != "3" && station2.area != "2")
+                    throw new Exception($"灏忔墭鐩樺彧鑳藉瓨鏀惧湪搴撳尯2/搴撳尯3锛�");
                 if (agvtaskRepository.Find(x => x.agv_fromaddress.Contains(from_address) || x.agv_toaddress.Contains(from_address)).Any())
                     throw new Exception($"璧风偣{from_address}宸插瓨鍦ㄤ换鍔★紒");
                 if (agvtaskRepository.Find(x => x.agv_fromaddress.Contains(to_address) || x.agv_toaddress.Contains(to_address)).Any())
@@ -52,17 +54,9 @@
                     throw new Exception($"缁堢偣{to_address}涓嶆槸绌鸿揣浣嶏紒");
                 if (string.IsNullOrEmpty(station1.stationType))
                     throw new Exception($"璧风偣{from_address}鏈粦瀹氱墿鏂欑被鍨嬶紒");
-                
-                if (station2.area == "1")
-                {
-                    if (stationinfoRepository.Find(x => x.area == station2.area && x.column == station2.column && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
-                        throw new Exception($"缁堢偣{to_address}鍚屽垪瀛樺湪涓庤捣鐐圭墿鏂欑被鍨嬩笉鍖归厤锛�");
-                }
-                else
-                {
-                    if (stationinfoRepository.Find(x => x.area == station2.area && x.line == station2.line && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
-                        throw new Exception($"缁堢偣{to_address}鍚岃瀛樺湪涓庤捣鐐圭墿鏂欑被鍨嬩笉鍖归厤锛�");
-                }
+
+                if (stationinfoRepository.Find(x => x.area == station2.area && x.line == station2.line && x.enable && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
+                    throw new Exception($"缁堢偣{to_address}鍚岃瀛樺湪涓庤捣鐐圭墿鏂欑被鍨嬩笉鍖归厤锛�");
                 var inventory = inventoryRepository.Find(x => x.stationCode == station1.stationCode).FirstOrDefault();
                 if (inventory == null) throw new Exception($"璧风偣{from_address}鏈壘鍒板簱瀛樹俊鎭紒");
 
@@ -71,7 +65,7 @@
                     agv_fromaddress = station1.stationCode,
                     agv_id = Guid.NewGuid(),
                     agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
-                    agv_grade = 1,
+                    agv_grade = 0,
                     agv_createtime = DateTime.Now,
                     agv_taskstate = "Create",
                     agv_materielid = station1.stationType,
@@ -92,6 +86,7 @@
                 station2.location_state = LocationStateEnum.InBusy.ToString();
                 station2.heatNumber = station1.heatNumber;
                 station2.Number = station1.Number;
+                station2.billetID = station1.billetID;
                 station2.stationType = station1.stationType;
                 stationinfoRepository.Update(station2, true);
                 content.OK();

--
Gitblit v1.9.3