From 429bb4abbaea6fd6be33dcf62735d4ada5070b63 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期日, 19 五月 2024 17:51:03 +0800 Subject: [PATCH] 优化逻辑提高AGV任务效率 --- 代码管理/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs | 17 ++++++----------- 1 files changed, 6 insertions(+), 11 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..b40fa60 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}鏈壘鍒板簱瀛樹俊鎭紒"); @@ -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