| | |
| | | { |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | | task.TaskState = nextStatus; |
| | | switch (nextStatus) |
| | | { |
| | | case (int)TaskInStatusEnum.SC_InFinish: |
| | | content = UpdateTaskStatusInFinish(task); |
| | | break; |
| | | case (int)TaskInStatusEnum.Car_InFinish: |
| | | content = InboundTaskCompleted(task); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | //task.TaskState = nextStatus; |
| | | task.TaskState = TaskInStatusEnum.InFinish.ObjToInt(); |
| | | content = UpdateTaskStatusInFinish(task); |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.Outbound) |
| | | { |
| | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.Relocation) |
| | | { |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 夿æ¯å¦ä¸ºå åæºåæ¾è´§ä½ |
| | | if (task.IsPickPlace) |
| | | { |
| | | |
| | | } |
| | | #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; |
| | |
| | | stockInfoDetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = locationInfo.MaxQty - locationInfo.CurrentQty == 0 ? LocationStatusEnum.Fullload.ObjToInt() : LocationStatusEnum.InStock.ObjToInt(); |
| | | |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = string.Empty; |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.UpdateData(task); |
| | | #region ä»»å¡åå
¥åºå |
| | | //BaseDal.UpdateData(task); |
| | | BaseDal.DeleteAndMoveIntoHty(task, OperateType.èªå¨å®æ); |
| | | if (inboundOrder.OrderStatus != InboundStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | _inboundService.InbounOrderService.Repository.UpdateData(inboundOrder); |
| | | _inboundService.InboundOrderDetailService.Repository.UpdateData(inboundOrderDetail); |
| | | } |
| | | else |
| | | { |
| | | _inboundService.InbounOrderService.Repository.DeleteAndMoveIntoHty(inboundOrder, OperateType.èªå¨å®æ); |
| | | _inboundService.InboundOrderDetailService.Repository.DeleteAndMoveIntoHty(inboundOrder.Details, OperateType.èªå¨å®æ); |
| | | } |
| | | #endregion |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | _inboundService.InbounOrderService.Repository.UpdateData(inboundOrder); |
| | | _inboundService.InboundOrderDetailService.Repository.UpdateData(inboundOrderDetail); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | Db.Ado.CommitTran(); |
| | | } |