н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/LKBusiness/CabinOrderServicesLK.cs
@@ -36,6 +36,7 @@ List<Dt_MaterielInfo> materielInfos = _materielInfoService.Repository.QueryData(x => cabinOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_InventoryInfo> inventoryInfos = _inventoryInfoService.Repository.QueryData(x => cabinOrder.Warehouse_no == x.WarehouseCode && cabinOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_Inventory_Batch> inventory_Batches = _inventory_BatchServices.Repository.QueryData(x => cabinOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_MaterielInfo> MaterieInfoBusiness = new List<Dt_MaterielInfo>(); #region ççå ¥åºå if (cabinOrder.Order_type == "5") { @@ -47,6 +48,14 @@ Dt_InventoryInfo inventoryInfo = inventoryInfos.Where(x => x.MaterielCode == detail.productCode && x.BatchNo == detail.batchNo).First(); if (orderQty != inventoryInfo.SupplyQuantity) throw new Exception($"ççå ¥åºæ°éä¸ä¸è´,ä¸ä¼ æ°éã{orderQty}ã,åºåççæ°éã{inventoryInfo.SupplyQuantity}ã"); var mater = materielInfos.FirstOrDefault(x => x.MaterielCode == detail.productCode); //æ·»å ç©æä¿¡æ¯ä¸çç«åºä¸å¡åºåä¿¡æ¯ if (mater != null) { mater.Business_qty += inventoryInfo.SupplyQuantity; MaterieInfoBusiness.Add(mater); } inventoryInfo.StockQuantity += inventoryInfo.SupplyQuantity; inventoryInfo.AvailableQuantity = inventoryInfo.StockQuantity; inventoryInfo.SupplyQuantity = 0; @@ -91,6 +100,8 @@ _inventory_BatchServices.UpdateData(batchesUp); _cabinOrderDetailServices.UpdateData(cabinOrderDetailsUp); BaseDal.UpdateData(cabinOrder); //æ·»å ç©æçç«åºä¸å¡åºç¡æ°æ® _materielInfoService.UpdateData(MaterieInfoBusiness); _unitOfWorkManage.CommitTran(); } #endregion н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/LKBusiness/DeliveryOrderServicesLK.cs
@@ -28,6 +28,7 @@ List<Dt_MaterielInfo> materielInfos = _materielInfoService.Repository.QueryData(x => deliveryOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_InventoryInfo> inventoryInfos = _inventoryInfoService.Repository.QueryData(x => deliveryOrder.Warehouse_no == x.WarehouseCode && deliveryOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_Inventory_Batch> inventory_Batches = _inventory_BatchServices.Repository.QueryData(x => deliveryOrder.Details.Select(x => x.Goods_no).ToList().Contains(x.MaterielCode)); List<Dt_MaterielInfo> MaterieInfoBusiness =new List<Dt_MaterielInfo>(); #region çäºåºåºå if (deliveryOrder.Out_type == "6") { @@ -41,6 +42,13 @@ Dt_InventoryInfo inventoryInfo = inventoryInfos.Where(x => x.MaterielCode == detail.productCode && x.BatchNo == detail.batchNo).First(); if (orderQty != Math.Abs(inventoryInfo.SupplyQuantity)) throw new Exception($"çäºåºåºæ°éä¸ä¸è´,ä¸ä¼ æ°éã{orderQty}ã,åºåçäºæ°éã{Math.Abs(inventoryInfo.SupplyQuantity)}ã"); //æ·»å ç©æä¿¡æ¯ä¸çç«åºä¸å¡åºåä¿¡æ¯ var mater = materielInfos.FirstOrDefault(x => x.MaterielCode == detail.productCode); if (mater != null) { mater.Business_qty += inventoryInfo.SupplyQuantity; MaterieInfoBusiness.Add(mater); } inventoryInfo.StockQuantity += inventoryInfo.SupplyQuantity; inventoryInfo.AvailableQuantity = inventoryInfo.StockQuantity; inventoryInfo.SupplyQuantity = 0; @@ -85,6 +93,8 @@ _inventory_BatchServices.UpdateData(batchesUp); _deliveryOrderDetailServices.UpdateData(cabinOrderDetailsUp); BaseDal.UpdateData(deliveryOrder); //æ·»å ç©æä¿¡æ¯ä¸çç«åºä¸å¡åºåä¿¡æ¯ _materielInfoService.UpdateData(MaterieInfoBusiness); _unitOfWorkManage.CommitTran(); } catch (Exception ex)