| | |
| | | Console.WriteLine(jsondata); |
| | | var result = JsonConvert.DeserializeObject<List<pullLockInfo>>(jsondata.ToString()); |
| | | |
| | | var lockInfo = _MESLockInfoRepository.QueryData().OrderByDescending(x => x.sequenceNo).FirstOrDefault(); |
| | | int serial = 1; |
| | | if (lockInfo != null) |
| | | { |
| | | serial = lockInfo.sequenceNo + 1; |
| | | } |
| | | |
| | | foreach (var item in result) |
| | | { |
| | | var assemblyOrderInfo = _assemblyOrderInfoRepository.QueryFirst(x => x.workOrderNo == item.workOrderNo && x.orderType == item.workOrderType); |
| | |
| | | } |
| | | else |
| | | { |
| | | OutStock = _VVStockInfoRepository.QueryData(x => x.pbMaterial == item.pbMaterial && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0 && x.workOrderType == item.workOrderType && x.CarType == (int)BodyType.PaintedBody).OrderBy(x => x.biwInPassTime).First(); |
| | | OutStock = _VVStockInfoRepository.QueryData(x => x.pbMaterial == item.pbMaterial && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0 && x.workOrderType == item.workOrderType && x.CarType == (int)BodyType.PaintedBody && x.RoadwayNo != lockInfo.TCLine).OrderBy(x => x.biwInPassTime).FirstOrDefault(); |
| | | |
| | | if (null == OutStock) |
| | | { |
| | | OutStock = _VVStockInfoRepository.QueryData(x => x.pbMaterial == item.pbMaterial && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0 && x.workOrderType == item.workOrderType && x.CarType == (int)BodyType.PaintedBody).OrderBy(x => x.biwInPassTime).FirstOrDefault(); |
| | | } |
| | | //var stockList = _VVStockInfoRepository.QueryData(x => x.pbMaterial == item.pbMaterial && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0 && x.workOrderType == item.workOrderType && x.CarType == (int)BodyType.PaintedBody).ToList(); |
| | | |
| | | //if (stockList.Any()) |
| | | //{ |
| | | // var maxStock = stockList.GroupBy(x => x.RoadwayNo).OrderByDescending(x => x.Count()); |
| | | // OutStock = stockList.Where(x => x.RoadwayNo == maxStock.FirstOrDefault().Key).FirstOrDefault(); |
| | | //} |
| | | } |
| | | if (OutStock == null) |
| | | { |
| | |
| | | |
| | | var carBody = _carBodyRepository.QueryFirst(x => x.PVI == OutStock.PVI); |
| | | |
| | | var lockInfo = _MESLockInfoRepository.QueryData().OrderByDescending(x => x.sequenceNo).FirstOrDefault(); |
| | | int serial = 1; |
| | | if (lockInfo != null) |
| | | { |
| | | serial = lockInfo.sequenceNo + 1; |
| | | } |
| | | //var lockInfo = _MESLockInfoRepository.QueryData().OrderByDescending(x => x.sequenceNo).FirstOrDefault(); |
| | | //int serial = 1; |
| | | //if (lockInfo != null) |
| | | //{ |
| | | // serial = lockInfo.sequenceNo + 1; |
| | | //} |
| | | |
| | | Dt_MESLockInfo mESLockInfo = new Dt_MESLockInfo |
| | | { |