dengjunjie
2024-12-30 595770fb0359d0425a103fb6e2106cecffe2c90b
´úÂë¹ÜÀí/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())
                {
                    //推送出库完成