| | |
| | | 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()) |
| | |
| | | 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}æªæ¾å°åºåä¿¡æ¯ï¼"); |
| | | |
| | |
| | | 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(); |