| | |
| | | { |
| | | Dt_OutboundOrder dt_OutboundOrder = _outboundService.OutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.First().OrderId).First(); |
| | | (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = new(); |
| | | if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS")) |
| | | if (dt_OutboundOrder.OutWareHouse.Contains("BC")) |
| | | { |
| | | result = _outboundService.OutboundOrderDetailService.DWANDYSAssignStockOutbound(outboundOrderDetails); |
| | | |
| | | result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails); |
| | | } |
| | | else |
| | | { |
| | | result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails); |
| | | result = _outboundService.OutboundOrderDetailService.DWANDYSAssignStockOutbound(outboundOrderDetails); |
| | | } |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | |
| | | { |
| | | x.OrderNo = outboundOrder.OrderNo; |
| | | }); |
| | | if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS")) |
| | | if (dt_OutboundOrder.OutWareHouse.Contains("BC")) |
| | | { |
| | | result.Item2.ForEach(x => |
| | | { |
| | | x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | result.Item2.ForEach(x => |
| | | { |
| | | if (x.LockQuantity == x.OrderQuantity) |
| | | { |
| | | x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | result.Item2.ForEach(x => |
| | | { |
| | | x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 立库出库指令上传,出库任务下发 |
| | | /// 出库单据下发 |
| | | /// </summary> |
| | | /// <param name="orderAddDTO"></param> |
| | | /// <returns></returns> |
| | |
| | | BatchNo = details.BatchNo, |
| | | MaterielCode = details.MaterielCode, |
| | | MaterielName = details.MaterielName, |
| | | MaterielType = details.MaterielType, |
| | | MaterieSpec = details.MaterieSpec, |
| | | OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(), |
| | | OrderQuantity = details.OrderQuantity, |
| | |
| | | foreach (int key in keys) |
| | | { |
| | | |
| | | (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys); |
| | | (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(keys); |
| | | if (result.Item2 != null && result.Item2.Count > 0) |
| | | { |
| | | stockInfos.AddRange(result.Item2); |
| | |
| | | } |
| | | if (result.Item4 != null && result.Item4.Count > 0) |
| | | { |
| | | outStockLockInfos.AddRange(result.Item4); |
| | | outStockLockInfos.AddRange(result.Item4); |
| | | } |
| | | if (result.Item5 != null && result.Item5.Count > 0) |
| | | { |
| | | if(result.Item5.Any(x => x.RoadwayNo.Contains("DW")) || result.Item5.Any(x => x.RoadwayNo.Contains("YS"))) |
| | | if (result.Item5.Any(x => x.RoadwayNo.Contains("DW")) || result.Item5.Any(x => x.RoadwayNo.Contains("YS"))) |
| | | { |
| | | locationInfos.AddRange(result.Item5.DistinctBy(x => x.LocationCode)); |
| | | |
| | |
| | | { |
| | | tasks.AddRange(result.Item1); |
| | | } |
| | | if(locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS")) |
| | | if (locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS")) |
| | | { |
| | | break; |
| | | } |
| | |
| | | BaseDal.AddData(tasks); |
| | | _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | if (tasks.FirstOrDefault().PalletCode.Contains("BC")) |
| | | { |
| | | PushTasksToWCS(tasks); |
| | | } |
| | | else |
| | | { |
| | | PushTasksWCS(tasks); |
| | | } |
| | | |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |