| | |
| | | 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(); |
| | |
| | | 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)) |