| | |
| | | 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 (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | | //task.TaskState = nextStatus; |
| | | task.TaskState = TaskInStatusEnum.InFinish.ObjToInt(); |
| | | content = UpdateTaskStatusInFinish(task); |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.Outbound) |
| | | else if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>(); |
| | | //if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | |
| | | case (int)TaskOutStatusEnum.SC_OutFinish://æ´æ°è´§ä½åºåä¿¡æ¯ |
| | | UpdateTaskStatusSC_OutFinish(task); |
| | | break; |
| | | //case (int)TaskOutStatusEnum.Line_OutFinish: |
| | | |
| | | //break; |
| | | case (int)TaskOutStatusEnum.AGV_OutFinish: |
| | | { |
| | | task.CurrentAddress = WMStask.CurrentAddress; |
| | | task.TargetAddress = WMStask.TargetAddress; |
| | | task.NextAddress = string.Empty; |
| | | UpdateData(task); |
| | | } |
| | | break; |
| | | case (int)TaskOutStatusEnum.OutFinish: |
| | | UpdateTaskStatusOutFinish(task); |
| | | break; |
| | |
| | | } |
| | | if (Sourcelocation != null) |
| | | { |
| | | if (task.TaskType == TaskOutboundTypeEnum.Outbound.ObjToInt()) Sourcelocation.CurrentQty--; |
| | | if (Sourcelocation.CurrentQty == 0) |
| | | /*if (task.TaskType == TaskOutboundTypeEnum.Outbound.ObjToInt())*/ |
| | | Sourcelocation.CurrentQty--; |
| | | if (Sourcelocation.CurrentQty <= 0 && Sourcelocation.Row != 2) |
| | | { |
| | | Sourcelocation.CurrentQty = 0; |
| | | Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | Sourcelocation.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); |
| | | } |
| | |
| | | _outboundService.OutboundOrderDetailService.Repository.DeleteAndMoveIntoHty(outboundOrder.Details, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | if (outStockLockInfo != null) _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | Db.Ado.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | |
| | | if (stockInfo.StockStatus != StockStatusEmun.å
¥åºä¸.ObjToInt()) throw new Exception($"æç[{task.PalletCode}],该ç»çç¶æä¸å¯å
¥åº"); |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.StockId == stockInfo.Id); |
| | | |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.LocationCodesGetStockInfos(new List<string> { stockInfo.LocationCode }).Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt()).ToList(); |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) |
| | | { |
| | | stockInfo.SerialNumber = locationInfo.CurrentQty; |
| | | stockInfo.SerialNumber = stockInfos.Count + 1; |
| | | stockInfo.InDate = DateTime.Now; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | stockInfoDetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | |
| | | } |
| | | #region å
¥åºå |
| | | Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(stockInfoDetail.OrderNo); |
| | | if (inboundOrder == null || inboundOrder.Details == null) throw new Exception($"æªæ¾å°æç[{task.PalletCode}]çå
¥åºåæç»ä¿¡æ¯"); |
| | | if (inboundOrder == null || inboundOrder.Details.Count < 1) throw new Exception($"æªæ¾å°æç[{task.PalletCode}]çå
¥åºåæç»ä¿¡æ¯"); |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfoDetail.BatchNo && x.MaterielCode == stockInfoDetail.MaterielCode); |
| | | inboundOrderDetail.OverInQuantity++; |
| | | //inboundOrderDetail.OverInQuantity++; |
| | | inboundOrderDetail.OrderDetailStatus = inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity ? OrderDetailStatusEnum.Over.ObjToInt() : OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | | |
| | | if (inboundOrder.Details.FirstOrDefault(x => x.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()) == null) |
| | |
| | | inboundOrder.OrderStatus = InboundStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | } |
| | | #endregion |
| | | |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.Repository.LocationCodesGetStockInfos(new List<string> { stockInfo.LocationCode }).Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt()).ToList(); |
| | | stockInfo.SerialNumber = stockInfos.Count + 1; |
| | | stockInfo.InDate = DateTime.Now; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | |
| | | } |
| | | else |
| | | { |
| | | List<Dt_InboundOrderDetail> orderDetails = inboundOrder.Details; |
| | | inboundOrder.Details = null; |
| | | _inboundService.InbounOrderService.Repository.DeleteAndMoveIntoHty(inboundOrder, OperateType.èªå¨å®æ); |
| | | _inboundService.InboundOrderDetailService.Repository.DeleteAndMoveIntoHty(inboundOrder.Details, OperateType.èªå¨å®æ); |
| | | _inboundService.InboundOrderDetailService.Repository.DeleteAndMoveIntoHty(orderDetails, OperateType.èªå¨å®æ); |
| | | } |
| | | #endregion |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |