| | |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | List<string> stationCodes = new List<string>() { "S01001001", "S01001002", "W01001001", "W01001002", "W01001003" }; |
| | | dt_stationinfo EmptyStation = null; |
| | | string remark = ""; |
| | | foreach (var stationCode in stationCodes) |
| | | { |
| | |
| | | } |
| | | remark = "æ¥è¯¢ç©ºæå çä½"; |
| | | #region 空æå ç |
| | | var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList(); |
| | | var EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0).FirstOrDefault(); |
| | | if (stationCode.Contains("S")) |
| | | { |
| | | var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList(); |
| | | EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0 && x.enable).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | { |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0 && x.enable).OrderByDescending(x => x.quantity).FirstOrDefault(); |
| | | if (EmptyStation != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyStation); |
| | | } |
| | | } |
| | | #endregion |
| | | remark = "æ¥æ¾åºå
空æä½"; |
| | | if (EmptyStation == null)//æ¥æ¾åºå
空æç |
| | | else |
| | | { |
| | | remark = "æ¥æ¾åºå
空æä½"; |
| | | EmptyStation = GetStation.EmptyPalletStation(area); |
| | | } |
| | | |
| | | |
| | | if (EmptyStation != null) |