| | |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | |
| | | var Mes_Works = workinfoRepository.Find(x => x.processCode == "28").OrderBy(x => x.CreateTime).ToList(); |
| | | var Mes_Works = workinfoRepository.Find(x => x.processCode == "28").OrderByDescending(x => x.CreateTime).ToList(); |
| | | foreach (var Mes_Work in Mes_Works) |
| | | { |
| | | var inventory = inventoryRepository.Find(x => x.SN == Mes_Work.SN).FirstOrDefault(); |
| | |
| | | var Station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault();//æ¥æ¾åºåè´§ä½ |
| | | if (Station != null) |
| | | { |
| | | |
| | | #region |
| | | |
| | | dt_stationinfo stationinfo = null; |
| | | //æ¥æ¾å½åè´§ä½åè¡æ¯å¦åå¨å
¥åºä»»å¡ |
| | | if (GetStation.InBusyStation(Station.stationCode)) continue; |
| | | |
| | | #region åºåºä¸ |
| | | if (Station.area == "1") |
| | | { |
| | | //æ¥æ¾å½åè´§ä½å忝å¦åå¨å
¥åºä»»å¡ |
| | | if (stationinfoRepository.Find(x => x.column == Station.column && x.area == "1" && x.location_state == LocationStateEnum.InBusy.ToString()).Any()) continue; |
| | | |
| | | stationinfo = stationinfoRepository.Find(x => x.column == Station.column && x.enable && x.area == "1" && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.line).FirstOrDefault(); |
| | | } |
| | | #endregion |
| | | else |
| | | { |
| | | //æ¥æ¾å½åè´§ä½å忝å¦åå¨å
¥åºä»»å¡ |
| | | if (stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.location_state == LocationStateEnum.InBusy.ToString()).Any()) continue; |
| | | |
| | | stationinfo = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.column).FirstOrDefault(); |
| | | } |
| | | |
| | | stationinfo = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.column).FirstOrDefault(); |
| | | if (stationinfo != null) |
| | | { |
| | | if (agvtaskRepository.Find(x => x.agv_fromaddress == stationinfo.stationCode).Any()) continue; |
| | | |
| | | if (stationinfoRepository.Find(x => x.line == stationinfo.line && x.area == stationinfo.area && x.column > stationinfo.column && !x.enable).Any()) |
| | | continue; |
| | | if (string.IsNullOrEmpty(stationinfo.bindSN)) |
| | | { |
| | | stationinfo.remark = "车轮SNå·ä¿¡æ¯å¼å¸¸"; |
| | |
| | | var count = 0; |
| | | foreach (var SN in lists) |
| | | { |
| | | //if (!workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) return; |
| | | if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++; |
| | | if (workinfoRepository.Find(x => x.processCode == "28" && x.SN == SN).Any()) count++; |
| | | //if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++; |
| | | |
| | | } |
| | | if (count != lists.Count) continue; |
| | |
| | | //} |
| | | #endregion |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | |
| | | WriteDBLog.Error("å建åºåºä»»å¡", $"é误信æ¯ï¼{ex.Message}", "PCS"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |