From 595770fb0359d0425a103fb6e2106cecffe2c90b Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 30 十二月 2024 11:32:45 +0800 Subject: [PATCH] PDA添加组盘入库WMS系统,不上传上游系统 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 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..056a1bc 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(); } @@ -301,7 +304,7 @@ } } } - + if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) { //鎺ㄩ�佸嚭搴撳畬鎴� -- Gitblit v1.9.3