| | |
| | | using static FreeSql.Internal.GlobalFilter; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | |
| | | namespace WIDESEA_WCS.JobsPart.Common.æ°æä»¶å¤¹ |
| | | namespace WIDESEA_WCS.JobsPart.Common |
| | | { |
| | | public class OutboundTask_a |
| | | { |
| | |
| | | Idt_inventoryRepository inventoryRepository = new dt_inventoryRepository(context); |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | |
| | | var mes_heads = mes_HeadRepository.Find(x => x.processCode == "28").OrderBy(x => x.expectedStartTime).ToList(); |
| | | var mes_heads = mes_HeadRepository.Find(x => x.processCode == "28").OrderByDescending(x => x.CreateTime).ToList(); |
| | | foreach (var mes_head in mes_heads) |
| | | { |
| | | #region æ ¹æ®å·¥ååè¡¨æ¥æ¾åºå |
| | |
| | | var Station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault(); |
| | | if (Station != null) |
| | | { |
| | | var stationinfos = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.quantity > 0 && x.enable && x.location_state == LocationStateEnum.Stroge.ToString()).OrderByDescending(x => x.column).ToList(); |
| | | foreach (var stationinfo in stationinfos) |
| | | var stationinfo = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.enable && x.quantity > 0).OrderByDescending(x => x.column).FirstOrDefault(); |
| | | |
| | | if (stationinfo != null) |
| | | { |
| | | if (stationinfo.location_state == LocationStateEnum.OutBusy.ToString() || stationinfo.location_state != LocationStateEnum.Stroge.ToString()) continue; |
| | | |
| | | if (string.IsNullOrEmpty(stationinfo.bindSN)) |
| | | { |
| | | stationinfo.remark = "车轮SNå·ä¿¡æ¯å¼å¸¸"; |
| | |
| | | } |
| | | |
| | | #region è´§ä½è½¦è½®å
¨é¨å
å«å¨å·¥åå
åä¸åä»»å¡ |
| | | bool OK = false; |
| | | //bool OK = false; |
| | | foreach (var SN in lists) |
| | | { |
| | | OK = mes_DetailRepository.Find(x => x.jobID == mes_head.jobID && x.SN == SN).Any(); |
| | | if (!mes_DetailRepository.Find(x => x.jobID == mes_head.jobID && x.SN.Contains(SN)).Any()) return; |
| | | |
| | | } |
| | | if (OK) |
| | | { |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | | agv_fromaddress = stationinfo.stationCode, |
| | |
| | | agvtaskRepository.Add(agvtask, true); |
| | | WriteDBLog.Success("å建åºåºä»»å¡", $"ä»»å¡ç¼å·ï¼{agvtask.agv_tasknum}", "PCS"); |
| | | continue; |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | #region è´§ä½è½¦è½®æä¸ä¸ªå
å«å¨å·¥åå
åä¸åä»»å¡ |
| | | //foreach (var SN in lists) |
| | |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | | } |