| | |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == WMStask.TaskNum && x.TaskType == WMStask.TaskType); |
| | | if (task == null) return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | if (task.TaskType == (int)TaskTypeEnum.Inbound) |
| | | if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.InboundGroup) |
| | | { |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | |
| | | } |
| | | if (Sourcelocation != null) |
| | | { |
| | | Sourcelocation.CurrentQty--; |
| | | if (task.TaskType == TaskOutboundTypeEnum.Outbound.ObjToInt()) Sourcelocation.CurrentQty--; |
| | | if (Sourcelocation.CurrentQty == 0) |
| | | { |
| | | Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | |
| | | if (Sourcelocation.Row == 1 && Sourcelocation.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == 2 && x.Column == Sourcelocation.Column && x.Layer == Sourcelocation.Layer); |
| | | if (locationInfo.CurrentQty == 0 && locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | if (locationInfo.CurrentQty == 0 /*&& locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()*/) |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | locationInfo.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | Dt_OutStockLockInfo? outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | int overCount = 0; |
| | | if (outStockLockInfo != null) |
| | | { |
| | | Dt_OutboundOrder outboundOrder = null; |
| | | int overCount = 0; |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfo.OrderDetailId); |
| | | if (outboundOrderDetail != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | outStockLockInfo.Status = OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | } |
| | | Db.Ado.BeginTran(); |
| | | if (outboundOrder != null && outboundOrder.Details.Count == overCount) |
| | | { |
| | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | Db.Ado.CommitTran(); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | if (stockInfo.StockStatus != StockStatusEmun.å
¥åºä¸.ObjToInt()) throw new Exception($"æç[{task.PalletCode}],该ç»çç¶æä¸å¯å
¥åº"); |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.StockId == stockInfo.Id); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) |
| | | { |
| | | stockInfo.SerialNumber = locationInfo.CurrentQty; |
| | | stockInfo.InDate = DateTime.Now; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | stockInfoDetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = string.Empty; |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | Db.Ado.CommitTran(); |
| | | return content; |
| | | } |
| | | #region å
¥åºå |
| | | Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(stockInfoDetail.OrderNo); |
| | | if (inboundOrder == null || inboundOrder.Details == null) throw new Exception($"æªæ¾å°æç[{task.PalletCode}]çå
¥åºåæç»ä¿¡æ¯"); |