From 551cabeb6da6eac58b8ee280101f708e06b42316 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 02 一月 2025 09:43:16 +0800 Subject: [PATCH] PDA --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 38 ++++++++++++++++++-------------------- 1 files changed, 18 insertions(+), 20 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" index 9a267e2..8700f6f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" @@ -163,7 +163,7 @@ LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); - + stockInfo.LocationCode = locationInfo.LocationCode; Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); @@ -176,7 +176,7 @@ } List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); - + foreach (var item in stockInfo.Details) { Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == item.InboundOrderRowNo); @@ -213,13 +213,13 @@ { inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt(); } - if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status) + if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status)//todo 淇敼澶勭悊 { return WebResponseContent.Instance.Error($"鍏ュ簱鍚屾Erp澶辫触"); } } //娴嬭瘯鏋跺叆搴撳簱瀛樼姸鎬� - if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) + if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt()) { stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚鏈缓鍑哄簱鍗�.ObjToInt(); } @@ -239,8 +239,11 @@ _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundCompleted); _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum); - _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetails); - _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); + if (inboundOrder != null) + { + _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetails); + _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); + } _unitOfWorkManage.CommitTran(); return WebResponseContent.Instance.OK(); } @@ -287,13 +290,13 @@ } else { - for (int i = 0; i < outStockLockInfos.Count; i++) + foreach (var item in outStockLockInfos) { - Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId); + Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == item.OrderDetailId); if (outboundOrderDetail != null) { - outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity; - if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity) + outboundOrderDetail.OverOutQuantity = item.AssignQuantity; + if (outboundOrderDetail.OverOutQuantity == outboundOrderDetail.OrderQuantity) { outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); } @@ -301,16 +304,8 @@ } } } + - if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) - { - //鎺ㄩ�佸嚭搴撳畬鎴� - WebResponseContent webResponse = _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id, stockInfo); - if (!webResponse.Status) - { - return webResponse; - } - } _unitOfWorkManage.BeginTran(); if (outboundOrderDetails.Count > 0) { @@ -327,7 +322,10 @@ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); _unitOfWorkManage.CommitTran(); - + if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) + { + _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id, outStockLockInfos); + } return WebResponseContent.Instance.OK(); } catch (Exception ex) -- Gitblit v1.9.3