| | |
| | | var types = station.tray_type.Split('/'); |
| | | var area = types[0] == "SmallTray" ? "11" : "10"; |
| | | //æ¾1åºåºç空æä½ |
| | | |
| | | var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable) |
| | | .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable) |
| | | .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); |
| | | var EmptyStation = GetStation.EmptyPalletStation(area); |
| | | //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable) |
| | | // .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault(); |
| | | //if (EmptyStation == null) |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable) |
| | | // .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (EmptyStation != null) |
| | | { |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | |
| | | agv_Traytype = types[0] |
| | | }; |
| | | agvtaskRepository.Add(agvtask, true); |
| | | EmptyStation.location_state = LocationStateEnum.Busy.ToString(); |
| | | stationinfoRepository.Update(EmptyStation, true); |
| | | WriteDBLog.Success("åå»ºæ´æ¢ç©ºçä»»å¡", $"ä»»å¡ç¼å·ï¼{agvtask.agv_tasknum}", "PCS"); |
| | | CreatePartQueue(agvtaskRepository, agvtask, types[1]); |
| | | } |