| | |
| | | Dt_Task task = new() |
| | | { |
| | | OrderNo = stockInfoDetail.OrderNo, |
| | | CurrentAddress = "0", |
| | | CurrentAddress = locationInfo.LocationCode, |
| | | Grade = 0, |
| | | Creater = "WMS", |
| | | PalletCode = stockInfo.PalletCode, |
| | | NextAddress = "", |
| | | NextAddress = roadwayInfo.OutSCStationCode, |
| | | Roadway = locationInfo.RoadwayNo, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | TargetAddress = roadwayInfo.OutStationCode, |
| | | SourceAddress = locationInfo.LocationCode, |
| | | TargetAddress = "", |
| | | TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | Depth = locationInfo.Depth, |
| | | WarehouseId=stockInfo.WarehouseId, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) |
| | | }; |
| | | tasks.Add(task); |
| | |
| | | } |
| | | |
| | | } |
| | | BaseDal.AddData(tasks); |
| | | return tasks; |
| | | } |
| | | |
| | |
| | | OrderQuantity = details.OrderQuantity, |
| | | OrderId = oldOuboundOrder.Id, |
| | | Creater = "WMS", |
| | | CreateDate= DateTime.Now, |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | //_outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | |
| | | inboundOrder.OrderStatus = InboundStatusEnum.未开始.ObjToInt(); |
| | | inboundOrder.Creater = "WMS"; |
| | | inboundOrder.CreateDate = DateTime.Now; |
| | | _unitOfWorkManage.BeginTran(); |
| | | bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | |
| | | Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO1.OrderNo).Includes(x => x.Details).First(); |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.OrderId == oldOutboundOrder.Id); |
| | | List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>(); |
| | |
| | | LinId = outboundOrderDetail.LinId, |
| | | PalletCode = outboundOrderDetail.LPNNo, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | |
| | | stockSelectViews.Add(stockSelectViewDTO); |
| | | GenerateOutboundTasks(oldOutboundOrder.Id, stockSelectViews); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | |
| | |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | BaseDal.AddData(tasks); |
| | | //判断移库 |
| | | //content = RelocationTasks(tasks.OrderBy(x => x.Depth).ToList()); |
| | | //if (content.Status) |
| | |
| | | { |
| | | content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | if (content.Status) |
| | | { |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | | if (!content.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content; |
| | | } |
| | | return content; |
| | | } |
| | | else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0) |
| | | { |
| | |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | //将任务推送到WCS |
| | | PushTasksToWCS(tasks); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | PalletCode = dt_StockInfo.PalletCode, |
| | | Roadway = locationInfos.RoadwayNo, |
| | | TaskType = TaskTypeEnum.RelocationIn.ObjToInt(), |
| | | //TaskType = TaskTypeEnum.RelocationIn.ObjToInt(), |
| | | TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | SourceAddress = locationInfos.LocationCode, |
| | | TargetAddress = newLocation.LocationCode, |
| | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task != null) |
| | | { |
| | | if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound) |
| | | if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.EmptyProductBack) |
| | | { |
| | | //处理出库的逻辑 |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | |
| | | return content = WebResponseContent.Instance.Error($"出库任务取消成功"); |
| | | |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.PalletInbound) |
| | | else if (task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.Inbound) |
| | | { |
| | | //处理出库的逻辑 |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |