From cde56aae50adc11ff8db84e424d873843c566bfd Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 24 二月 2025 23:40:41 +0800 Subject: [PATCH] 优化WCS移库逻辑 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 49 ++++++++++++++++++++++++++----------------------- 1 files changed, 26 insertions(+), 23 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" index d9b7436..263ca5b 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" @@ -63,10 +63,11 @@ private readonly IInboundService _inboundService; private readonly IRecordService _recordService; private readonly IStockService _stockService; + private readonly IBasicRepository _basicRepository; public ITaskRepository Repository => BaseDal; - public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService) : base(BaseDal) + public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository) : base(BaseDal) { _mapper = mapper; _unitOfWorkManage = unitOfWorkManage; @@ -75,6 +76,7 @@ _inboundService = inboundService; _recordService = recordService; _stockService = stockService; + _basicRepository = basicRepository; } /// <summary> @@ -262,18 +264,9 @@ { 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) { @@ -287,6 +280,10 @@ default: break; } + } + else if (task.TaskType == (int)TaskTypeEnum.Relocation) + { + } } catch (Exception ex) @@ -332,12 +329,6 @@ } #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; @@ -345,14 +336,26 @@ 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(); } -- Gitblit v1.9.3