| | |
| | | using Microsoft.Extensions.Logging; |
| | | using MailKit.Search; |
| | | using Microsoft.Extensions.Logging; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using System; |
| | |
| | | { |
| | | try |
| | | { |
| | | var allocorder = _allocateOrderRepository.Db.Queryable<Dt_AllocateOrder>().Includes(x => x.Details).Where(x => x.Details.Any(o => o.Id == orderDetailId)).First(); |
| | | //var allocorder = _allocateOrderDetailRepository.Db.Queryable<Dt_AllocateOrderDetail>() |
| | | // .LeftJoin<Dt_AllocateOrder>((detail, order) => detail.OrderId == order.Id) |
| | | // .Where((detail, order) => order.Id == orderDetailId) |
| | | // .Select((detail, order) => order) |
| | | // .First(); |
| | | if (allocorder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ¾ä¸å°åæ®"); |
| | | } |
| | | var outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).First(x => x.OrderNo == allocorder.OrderNo); |
| | | //var allocorder = _allocateOrderRepository.Db.Queryable<Dt_AllocateOrder>().Includes(x => x.Details).Where(x => x.Details.Any(o => o.Id == orderDetailId)).First(); |
| | | ////var allocorder = _allocateOrderDetailRepository.Db.Queryable<Dt_AllocateOrderDetail>() |
| | | //// .LeftJoin<Dt_AllocateOrder>((detail, order) => detail.OrderId == order.Id) |
| | | //// .Where((detail, order) => order.Id == orderDetailId) |
| | | //// .Select((detail, order) => order) |
| | | //// .First(); |
| | | //if (allocorder == null) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error("æ¾ä¸å°åæ®"); |
| | | //} |
| | | |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).Where(x => x.Details.Any(o => o.Id == orderDetailId)).First(); |
| | | |
| | | if (outboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ¾ä¸å°åºåºåæ®"); |
| | | } |
| | | |
| | | var orderdetail = outboundOrder.Details.Where(outItem => allocorder.Details.Any(allocItem => allocItem.MaterielCode == outItem.MaterielCode && allocItem.LineNo == outItem.lineNo |
| | | && allocItem.BarcodeQty == outItem.BarcodeQty && allocItem.WarehouseCode == outItem.WarehouseCode && allocItem.BarcodeUnit == outItem.BarcodeUnit)).First(); |
| | | if (orderdetail == null) |
| | | if (outboundOrder.Details == null || !outboundOrder.Details.Any()) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ¾ä¸å°åºåºæç»åæ®"); |
| | | } |
| | | //var orderdetail = outboundOrder.Details.Where(outItem => allocorder.Details.Any(allocItem => allocItem.MaterielCode == outItem.MaterielCode && allocItem.LineNo == outItem.lineNo |
| | | // && allocItem.BarcodeQty == outItem.BarcodeQty && allocItem.WarehouseCode == outItem.WarehouseCode && allocItem.BarcodeUnit == outItem.BarcodeUnit)).First(); |
| | | //if (orderdetail == null) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error("æ¾ä¸å°åºåºæç»åæ®"); |
| | | //} |
| | | |
| | | (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews, station); |
| | | |