| | |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Jobs; |
| | | using WIDESEA_WCS.JobsPart.Common; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | using WIDESEA_WMS.IRepositories; |
| | |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == stationCode).ToList(); |
| | | var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读åæçä¿¡å·:1:æ,2æ |
| | | var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//读åè´§ç©ä¿¡å·:1:æ,2æ |
| | | var station = stationinfoRepository.Find(x => x.stationCode == stationCode).FirstOrDefault(); |
| | | var station = stationinfoRepository.Find(x => x.stationCode == stationCode && x.enable).FirstOrDefault(); |
| | | if (station == null) continue; |
| | | if (PalletSignal == 1 && MaterialSignal == 2 && (station.stationCode.Contains("S0100100") ? station.tray_status == "EmptyTray" : true)) |
| | | { |
| | | var area = station.tray_type == "SmallTray" ? "11" : "10"; |
| | |
| | | continue; |
| | | |
| | | } |
| | | var EmptyStation = GetStation.EmptyPalletStation(area); |
| | | |
| | | #region æ¥æ¾åºåºä¸ç©ºæçç©ºè´§ä½ |
| | | var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) |
| | | .OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æ¥æ¾æ²¡æä»»å¡ç空æçè´§ä½ |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) |
| | | //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æ¥æ¾æ²¡æä»»å¡ç空æçè´§ä½ |
| | | |
| | | if (EmptyStation != null) |
| | | { |
| | | if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) |
| | | { |
| | | EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æé¤å½ååå¨ä»»å¡çè´§ä½ |
| | | } |
| | | if (EmptyStation != null && EmptyStation.line == 2)//妿任å¡åå¨ç¬¬äºè¡,ææ¥ç¬¬ä¸è¡æ¯å¦æè´§ |
| | | { |
| | | if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; |
| | | } |
| | | } |
| | | // if (EmptyStation != null) |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æé¤å½ååå¨ä»»å¡çè´§ä½ |
| | | // } |
| | | // if (EmptyStation != null && EmptyStation.line == 2)//妿任å¡åå¨ç¬¬äºè¡,ææ¥ç¬¬ä¸è¡æ¯å¦æè´§ |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; |
| | | // } |
| | | // } |
| | | |
| | | // if (EmptyStation == null) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æåä¸ä¸ªè´§ä½æä»»å¡åä¸è½çæå
¥åºä»»å¡ |
| | | // if (EmptyStation != null) continue; |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æ¾æå¤é¢æ²¡å 满5个çè´§ä½ |
| | | // if (EmptyStation == null) |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | // } |
| | | |
| | | #endregion |
| | | |
| | | if (EmptyStation == null) |
| | | { |
| | | EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æåä¸ä¸ªè´§ä½æä»»å¡åä¸è½çæå
¥åºä»»å¡ |
| | | if (EmptyStation != null) continue; |
| | | EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æ¾æå¤é¢æ²¡å 满5个çè´§ä½ |
| | | if (EmptyStation == null) |
| | | EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | } |
| | | |
| | | if (EmptyStation != null) |
| | | { |